Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
@Deprecated | 0 |
import org.apache.sshd.common.util.AbstractLoggingBean;
public class AgentServer extends AbstractLoggingBean implements Closeable {
@SuppressWarnings("synthetic-access")
log.error("Failed to run session", e);
@SuppressWarnings("synthetic-access")
log.error("Failed to process", e);
@SuppressWarnings("synthetic-access") | 0 |
if (!SVG_NAMESPACE_URI.equals(refElement.getNamespaceURI()))
return null; // Not an SVG element.
if (refElement.getLocalName().equals(SVG_GLYPH_TAG)) {
if (refElement.getLocalName().equals(SVG_ALT_GLYPH_DEF_TAG)) {
Element agc = (Element)altGlyphChild;
if (SVG_NAMESPACE_URI.equals(agc.getNamespaceURI()) &&
SVG_GLYPH_REF_TAG.equals(agc.getLocalName())) {
if ((refGlyphElement == null) ||
(!SVG_NAMESPACE_URI.equals(refGlyphElement.getNamespaceURI())) ||
(!SVG_GLYPH_TAG.equals(refGlyphElement.getLocalName()))) | 0 |
import java.net.MalformedURLException;
import java.net.URL;
import org.apache.batik.bridge.BridgeException;
// <!> TO BE FIXED WHEN WE DO ERROR HANDLING PROPERLY
// initialize the SVG document with the appropriate context
// build the GVT tree
GVTBuilder builder = new GVTBuilder();
GraphicsNodeRenderContext rc = getRenderContext();
BridgeContext ctx = new BridgeContext(userAgent, rc);
GraphicsNode gvtRoot;
try {
gvtRoot = builder.build(ctx, svgDoc);
} catch (BridgeException ex) {
throw new TranscoderException(ex);
}
// get the 'width' and 'height' attributes of the SVG document
float docWidth = (float)ctx.getDocumentSize().getWidth();
float docHeight = (float)ctx.getDocumentSize().getHeight();
ctx = null;
builder = null;
// compute the image's width and height according the hints
// compute the preserveAspectRatio matrix
AffineTransform Px;
String ref = null;
try {
ref = new URL(uri).getRef();
} catch (MalformedURLException ex) {
// nothing to do, catched previously
}
try {
Px = ViewBox.getViewTransform(ref, root, width, height);
} catch (BridgeException ex) {
throw new TranscoderException(ex);
}
// take the AOI into account if any
Mx.scale(sx, sy);
} else {
this.root = gvtRoot;
return (String)PrintTranscoder.this.hints.get(KEY_USER_STYLESHEET_URI);
if (PrintTranscoder.this.hints.containsKey(KEY_XML_PARSER_CLASSNAME)) {
return (String)PrintTranscoder.this.hints.get(KEY_XML_PARSER_CLASSNAME);
} else {
return XMLResourceDescriptor.getXMLParserClassName();
} | 0 |
* Copyright (c) 2001-2004 The Apache Software Foundation. All rights
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their name without prior
* @version $Id: StringEncoderComparator.java,v 1.11 2004/01/02 07:01:47 ggregory Exp $ | 0 |
CloudObject encoding = translateCoder(coder, translator);
CloudObject encoding = translateCoder(valueCoder, translator);
translateCoder(transform.getRestrictionCoder(), context));
private static CloudObject translateCoder(Coder<?> coder, TranslationContext context) {
return CloudObjects.asCloudObject(coder, context.isFnApi() ? context.getSdkComponents() : null);
} | 0 |
import org.apache.beam.sdk.transforms.Reshuffle;
.apply("Calculate hashcode", Combine.globally(new HashingFn()))
.apply(Reshuffle.<String>viaRandomKey()); | 0 |
import java.util.HashMap;
import java.util.Map;
public class TestHostMappingProvider implements HostMappingProvider {
private static Map<String, String> HOST_MAPPING = new HashMap<String, String>();
static {
HOST_MAPPING.put("domU-12-31-39-0E-34-E1.compute-1.internal", "ec2-50-17-129-192.compute-1.amazonaws.com");
HOST_MAPPING.put("ip-10-190-186-15.ec2.internal", "ec2-23-21-8-226.compute-1.amazonaws.com");
HOST_MAPPING.put("domU-12-31-39-14-EE-B3.compute-1.internal", "ec2-23-23-71-42.compute-1.amazonaws.com");
HOST_MAPPING.put("ip-10-110-157-51.ec2.internal", "ec2-107-22-121-67.compute-1.amazonaws.com");
}
@Override
public Map<String, String> getHostMap() {
return HOST_MAPPING;
}
} | 0 |
/**
* Returns the timeout in milliseconds used when retrieving a
* {@link org.apache.http.conn.ManagedClientConnection} from the
* {@link org.apache.http.conn.ClientConnectionManager}.
*
* @return timeout in milliseconds.
*/
public static long getTimeout(final HttpParams params) {
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
return params.getLongParameter(TIMEOUT, 0);
}
/**
* Sets the timeout in milliseconds used when retrieving a
* {@link org.apache.http.conn.ManagedClientConnection} from the
* {@link org.apache.http.conn.ClientConnectionManager}.
*
* @param timeout the timeout in milliseconds
*/
public static void setTimeout(final HttpParams params, long timeout) {
if (params == null) {
throw new IllegalArgumentException("HTTP parameters may not be null");
}
params.setLongParameter(TIMEOUT, timeout);
}
| 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
| 0 |
* or {@link javax.xml.dsig.XMLStructure} | 0 |
package org.apache.commons.vfs2.impl;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.commons.vfs2.FileUtil; | 1 |
import org.apache.batik.css.engine.value.ValueManager;
* @author <a href="mailto:deweese@apache.org">l449433</a> | 1 |
Long maxFileSize = AccumuloConfiguration.getMemoryInBytes(tableConfiguration.get(Property.TABLE_MINC_MAX_MERGE_FILE_SIZE));
datafileManager = new DatafileManager(this, datafiles, maxFileSize); | 0 |
* call compaction with iterators and/or a compaction strategy, then one will fail. | 0 |
Job[] jobs = new Job[connNo * reqNo];
jobs[i] = new Job();
Queue<Job> queue = new ConcurrentLinkedQueue<Job>();
Job testjob = jobs[i];
HttpRequestExecutionHandler requestExecutionHandler = new RequestExecutionHandler() {
protected HttpRequest generateRequest(Job testjob) {
executeStandardTest(new RequestHandler(), requestExecutionHandler);
HttpRequestExecutionHandler requestExecutionHandler = new RequestExecutionHandler() {
protected HttpRequest generateRequest(Job testjob) {
executeStandardTest(new RequestHandler(), requestExecutionHandler);
HttpRequestExecutionHandler requestExecutionHandler = new RequestExecutionHandler() {
protected HttpRequest generateRequest(Job testjob) {
executeStandardTest(new RequestHandler(), requestExecutionHandler);
HttpRequestExecutionHandler requestExecutionHandler = new RequestExecutionHandler() {
protected HttpRequest generateRequest(Job testjob) {
executeStandardTest(new RequestHandler(), requestExecutionHandler);
HttpRequestExecutionHandler requestExecutionHandler = new RequestExecutionHandler() {
protected HttpRequest generateRequest(Job testjob) {
executeStandardTest(new RequestHandler(), requestExecutionHandler); | 0 |
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at | 0 |
import com.thinkaurelius.titan.core.TitanGraph;
import org.apache.hadoop.metadata.repository.graph.GraphProvider;
import org.testng.Assert;
private GraphProvider<TitanGraph> graphProvider;
Assert.assertNotNull(graphProvider);
Assert.assertNotNull(graphProvider.get()); | 0 |
*
* @version $Id: OS2FTPEntryParser.java,v 1.11 2004/04/21 23:30:33 scohen Exp $
"(\\s+|[0-9]+)\\s*"
+ "(\\s+|[A-Z]+)\\s*"
+ "(DIR|\\s+)\\s*"
+ "((?:0[1-9])|(?:1[0-2]))-"
+ "((?:0[1-9])|(?:[1-2]\\d)|(?:3[0-1]))-"
+ "(\\d\\d)\\s*"
+ "(?:([0-1]\\d)|(?:2[0-3])):"
+ "([0-5]\\d)\\s*"
*
* Thrown if the regular expression is unparseable. Should not be seen
* under normal conditions. It it is seen, this is a sign that
public OS2FTPEntryParser()
if (year > 2080) | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum { | 0 |
* @version CVS $Id: JspGenerator.java,v 1.7 2003/09/05 07:04:35 cziegeler Exp $
public class JspGenerator extends ServletGenerator { | 0 |
@Category(ValidatesRunner.class) | 0 |
this.ioThreadCount = Args.positive(ioThreadCount, "ioThreadCount");
this.ioThreadCount = Runtime.getRuntime().availableProcessors(); | 0 |
import java.net.InetAddress;
import java.net.UnknownHostException;
String advertiseHost = hostname;
if (advertiseHost.equals("0.0.0.0")) {
try {
advertiseHost = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
log.error("Unable to get hostname", e);
}
}
log.debug("Using {} to advertise monitor location in ZooKeeper", advertiseHost);
try {
String monitorAddress = HostAndPort.fromParts(advertiseHost, server.getPort()).toString();
log.info("Set monitor address in zookeeper to {}", monitorAddress);
if (null != advertiseHost) {
LogService.startLogListener(Monitor.getContext().getConfiguration(), instance.getInstanceID(), advertiseHost); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/expression/jexl/JexlExpression.java,v 1.13 2002/11/27 13:07:27 jstrachan Exp $
* $Revision: 1.13 $
* $Date: 2002/11/27 13:07:27 $
* $Id: JexlExpression.java,v 1.13 2002/11/27 13:07:27 jstrachan Exp $
* @version $Revision: 1.13 $
return "${" + expression.getExpression() + "}"; | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
} | 0 |
@Test
public void test286() {
String s286 = "var x = 0; for(x : 1..2){}; return x";
JexlEngine jexl = new JexlBuilder().strict(true).create();
Assert.assertEquals(2, jexl.createScript(s286).execute(null));
} | 0 |
PCollection<List<Integer>> quantiles = input.apply(ApproximateQuantiles.globally(5));
PCollection<KV<String, List<Integer>>> quantiles =
input.apply(ApproximateQuantiles.perKey(2));
PCollection<KV<String, List<Integer>>> quantiles =
input.apply(ApproximateQuantiles.perKey(2, new DescendingIntComparator()));
ApproximateQuantilesCombineFn.create(5), all, Arrays.asList(0, 25, 50, 75, 100));
testCombineFn(ApproximateQuantilesCombineFn.create(5), all, Arrays.asList(1, 2, 3, 3, 3));
testCombineFn(ApproximateQuantilesCombineFn.create(5), all, Arrays.asList(0, 5, 6, 6, 6));
testCombineFn(ApproximateQuantilesCombineFn.create(5), all, Arrays.asList(1, 1, 2, 4, 1000));
ApproximateQuantilesCombineFn.create(3), inputs, Arrays.asList("aa", "b", "zz")); | 0 |
/*
* Copyright 2006-2009 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/ | 0 |
* Creates a Jettison JSONObject from this Element.
* @param propertyKeys The property keys at the root of the element to serialize.
* If null, then all keys are serialized.
String getIdForDisplay(); | 1 |
queryThreadPool =
new SimpleThreadPool(numQueryThreads, "batch scanner " + batchReaderInstance + "-"); | 0 |
cvsmap = new HashMap<>();
return new ArrayList<>(cvsmap.values()); | 0 |
package org.apache.felix.sigil.eclipse.runtime.config;
public interface OSGiLaunchConfigurationConstants
{
String FORM_FILE_LOCATION = "org.apache.felix.sigil.form.location";
String AUTOMATIC_ADD = "org.apache.felix.sigil.automatic.add";
} | 0 |
import java.util.EnumSet;
import java.util.Set;
Set<RepositoryVersionState> allowed = EnumSet.of(RepositoryVersionState.INSTALLED,
RepositoryVersionState.NOT_REQUIRED);
if (request.isRevert()) {
allowed.add(RepositoryVersionState.CURRENT);
}
&& allowed.contains(hve.getState())) { | 0 |
/*
* $HeadURL$
* $Revision$
* $Date$
*
* ====================================================================
*
* Copyright 1999-2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.http;
import java.util.Iterator;
import org.apache.http.params.HttpParams;
/**
* <p>
* </p>
* @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
*
* @version $Revision$
*
* @since 4.0
*/
public interface HttpMutableMessage extends HttpMessage {
void addHeader(Header header);
void setHeader(Header header);
void removeHeader(Header header);
Iterator headerIterator();
HttpParams getParams();
} | 0 |
client = new RestClusterClient<>(configuration, "RemoteStreamEnvironment"); | 0 |
* @version $Revision$ $Date$ | 0 |
* Interface of Samza operator for BEAM. This interface demultiplexes messages from BEAM so that
* elements and side inputs can be handled separately in Samza. Watermark propagation can be
* overridden so we can hold watermarks for side inputs. The output values and watermark will be
* collected via {@link OpEmitter}.
* <p>While an emitter is supplied to this function it is not usable except in the methods {@link
* #processElement(WindowedValue, OpEmitter)}, {@link #processWatermark(Instant, OpEmitter)}, and
default void open(
Config config,
TaskContext taskContext,
TimerRegistry<TimerKey<K>> timerRegistry,
OpEmitter<OutT> emitter) {}
default void processSideInput(
String id, WindowedValue<? extends Iterable<?>> elements, OpEmitter<OutT> emitter) { | 1 |
import static org.junit.Assert.*;
| 0 |
{ "jar", "bundle" } );
if ( !supportedProjectTypes.contains( artifact.getType() ) ) | 0 |
* @version $Id$ | 0 |
public static void deleteRecursive(File file) {
if (file != null) {
if (file.isDirectory()) {
File[] children = file.listFiles();
if (children != null) {
for (File child : children) {
deleteRecursive(child);
}
}
}
file.delete();
}
}
| 0 |
Map<String,String> config = parseConfig(Property.TABLE_CONSTRAINT_PREFIX + "1=org.apache.accumulo.examples.simple.constraints.NumericValueConstraint",
Property.TABLE_CONSTRAINT_PREFIX + "2=org.apache.accumulo.examples.simple.constraints.AlphaNumKeyConstraint");
if (!cvs.constrainClass.equals("org.apache.accumulo.examples.simple.constraints.NumericValueConstraint")) {
expected.put("org.apache.accumulo.examples.simple.constraints.NumericValueConstraint", numericErrors);
expected.put("org.apache.accumulo.examples.simple.constraints.AlphaNumKeyConstraint", 1); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/TransformerUtils.java,v 1.2 2003/08/31 13:07:26 scolebourne Exp $
* @version $Revision: 1.2 $ $Date: 2003/08/31 13:07:26 $
throw new IllegalArgumentException("The object and transformer map must not be null"); | 0 |
return op.equals(">>>") ? IUSHR : ISHR;
return op.equals(">>>") ? LUSHR : LSHR;
return (size == 2) ? POP2 : POP;
return (size == 2) ? DUP2 : DUP;
return (size == 2) ? DUP2_X2 : DUP_X2;
return (size == 2) ? DUP2_X1 : DUP_X1;
return new NEWARRAY(t.getType()); | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.cauldron.sigil.model.repository;
import java.util.List;
import java.util.Map;
import org.cauldron.sigil.internal.model.repository.RepositoryType;
import org.eclipse.core.runtime.CoreException;
public interface IRepositoryConfiguration {
List<IRepositoryModel> loadRepositories();
IRepositoryModel findRepository(String id);
void saveRepositories(List<IRepositoryModel> repositories) throws CoreException;
List<RepositoryType> loadRepositoryTypes();
IRepositoryModel newRepositoryElement(IRepositoryType type);
IRepositorySet getDefaultRepositorySet();
void setDefaultRepositorySet(IRepositorySet defaultSet);
IRepositorySet getRepositorySet(String name);
Map<String, IRepositorySet> loadRepositorySets();
void saveRepositorySets(Map<String, IRepositorySet> sets);
} | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.sshd.sftp.subsystem;
import org.apache.sshd.server.SshFile;
import java.util.Iterator;
import java.util.List;
public class DirectoryHandle extends BaseHandle implements Iterator<SshFile> {
boolean done;
// the directory should be read once at "open directory"
List<SshFile> fileList = null;
int fileIndex;
public DirectoryHandle(String id, SshFile file) {
super(id, file);
fileList = file.listSshFiles();
fileIndex = 0;
}
public boolean isDone() {
return done;
}
public void setDone(boolean done) {
this.done = done;
}
public boolean hasNext() {
return fileIndex < fileList.size();
}
public SshFile next() {
SshFile f = fileList.get(fileIndex);
fileIndex++;
return f;
}
public void remove() {
throw new UnsupportedOperationException();
}
public void clearFileList() {
// allow the garbage collector to do the job
fileList = null;
}
} | 0 |
List<Node> children = new ArrayList<>();
List<String> children = new ArrayList<>(node.children.size());
assertEquals(new HashSet<>(children), new HashSet<>(Arrays.asList("b", "c")));
assertEquals(new HashSet<>(children), new HashSet<>(Arrays.asList("b"))); | 0 |
long zxid = hdr.getZxid();
while (!zks.outstandingChanges.isEmpty()
&& zks.outstandingChanges.get(0).zxid <= zxid) {
ChangeRecord cr = zks.outstandingChanges.remove(0);
if (cr.zxid < zxid) {
LOG.warn("Zxid outstanding " + cr.zxid
+ " is less than current " + zxid);
}
if (zks.outstandingChangesForPath.get(cr.path) == cr) {
zks.outstandingChangesForPath.remove(cr.path);
}
}
| 0 |
import java.util.Collections;
import java.util.Map;
import org.apache.ambari.server.audit.event.AuditEvent; | 0 |
* Adds URI query parameters. The parameter name / values are expected to be unescaped
* and may contain non ASCII characters.
* <p/>
* Please note query parameters and custom query component are mutually exclusive. This method
* will remove custom query if present.
*
* @since 4.3
*/
public URIBuilder addParameters(final List <NameValuePair> nvps) {
if (this.queryParams == null) {
this.queryParams = new ArrayList<NameValuePair>();
}
this.queryParams.addAll(nvps);
this.encodedQuery = null;
this.encodedSchemeSpecificPart = null;
this.query = null;
return this;
}
/** | 0 |
* @return the string from the node | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//fileupload/src/java/org/apache/commons/fileupload/FileUpload.java,v 1.15 2002/12/25 04:05:07 martinc Exp $
* $Revision: 1.15 $
* $Date: 2002/12/25 04:05:07 $
* @version $Id: FileUpload.java,v 1.15 2002/12/25 04:05:07 martinc Exp $
OutputStream os = item.getOutputStream();
OutputStream os = item.getOutputStream();
OutputStream os = item.getOutputStream(); | 0 |
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
systemProperty("dm.log").value( "true" ), | 0 |
import java.util.Map;
@Override
public Map<String, Object> getValuesMap() throws MetadataException {
throw new MetadataException("Get/Set not supported on an Id object");
}
| 0 |
Collections.unmodifiableList(new ArrayList<>(other));
Collections.unmodifiableList(new ArrayList<>(other));
List<XMLStructure> other = new ArrayList<>(); | 0 |
@FunctionalInterface | 0 |
import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
Class<? extends K> clazz = AccumuloVFSClassLoader.loadClass(className, c); | 1 |
import org.apache.atlas.impala.model.LineageVertex;
import org.apache.atlas.impala.model.LineageVertexMetadata;
import org.apache.commons.lang.StringUtils;
public String getQualifiedNameForColumn(LineageVertex vertex) {
// get database name and table name
LineageVertexMetadata metadata = vertex.getMetadata();
if (metadata == null) {
return getQualifiedNameForColumn(vertex.getVertexId());
}
String fullTableName = metadata.getTableName();
if (StringUtils.isEmpty(fullTableName)) {
throw new IllegalArgumentException("fullTableName in column metadata is null");
}
int sepPos = fullTableName.lastIndexOf(QNAME_SEP_ENTITY_NAME);
if (!isSeparatorIndexValid(sepPos)) {
throw new IllegalArgumentException(fullTableName + "in column metadata does not contain database name");
}
// get pure column name
String columnName = vertex.getVertexId();
if (StringUtils.isEmpty(columnName)) {
throw new IllegalArgumentException("column name in vertexId is null");
}
int sepPosLast = columnName.lastIndexOf(QNAME_SEP_ENTITY_NAME);
if (isSeparatorIndexValid(sepPosLast)) {
columnName = columnName.substring(sepPosLast+1);
}
return getQualifiedNameForColumn(
fullTableName.substring(0, sepPos),
fullTableName.substring(sepPos+1),
columnName);
}
| 0 |
package org.apache.beam.sdk.coders;
import org.apache.beam.sdk.testing.CoderProperties;
import org.apache.beam.sdk.util.CoderUtils;
* {@link org.apache.beam.sdk.coders.PrintBase64Encodings}. | 0 |
/**
public void init(final FrameworkListener... listeners) throws BundleException
{
// add framework listeners
if ( listeners != null )
{
for(final FrameworkListener fl : listeners)
{
addFrameworkListener(this, fl);
}
}
// call init
try
{
this.init();
}
// remove framework listeners
finally
{
if ( listeners != null )
{
for(final FrameworkListener fl : listeners)
{
removeFrameworkListener(this, fl);
}
}
}
} | 0 |
import org.apache.felix.dm.annotation.api.dependency.ServiceDependency; | 0 |
import org.apache.beam.sdk.util.state.CombiningState;
final StateTag<K, CombiningState<InputT, AccumT, OutputT>> bufferTag; | 0 |
* @param <K> the type of keys maintained by the returned map
* @param <V> the type of mapped values | 0 |
List<SortRequestProperty> getProperties();
List<String> getPropertyIds();
enum Order { | 0 |
fileScanner.clear();
| 0 |
final Context itsContext = (Context)this.itsContainer.getBeanFactory().getBean(AvalonUtils.CONTEXT_ROLE);
this.itsManager = (ServiceManager) this.itsContainer.getBeanFactory().getBean(AvalonUtils.SERVICE_MANAGER_ROLE); | 0 |
import static org.junit.Assert.assertEquals;
@Test
public void testStructuralValueReturnTheSameValue() {
ReadableDuration expected = Duration.millis(3_000);
Object actual = TEST_CODER.structuralValue(expected);
assertEquals(expected, actual);
} | 0 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.cli2.bug;
import java.util.Iterator;
import junit.framework.TestCase;
import org.apache.commons.cli2.Option;
import org.apache.commons.cli2.builder.PatternBuilder;
import org.apache.commons.cli2.option.GroupImpl;
public class Bug27575Test extends TestCase {
public void testRequiredOptions(){
PatternBuilder builder = new PatternBuilder();
builder.withPattern("hc!<");
Option option = builder.create();
assertTrue(option instanceof GroupImpl);
GroupImpl group = (GroupImpl)option;
Iterator i = group.getOptions().iterator();
assertEquals("[-h]",i.next().toString());
assertEquals("-c <arg>",i.next().toString());
assertFalse(i.hasNext());
}
} | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ | 0 |
package org.apache.felix.scr.annotations; | 0 |
private static final String CURRENT_COUNTER_PROPERTY = "currentCounter";
public static final String STATUS_NOT_STARTED = "NOT_STARTED";
public static final String STATUS_IN_PROGRESS = "IN_PROGRESS";
public void update(Graph graph, Long counter, boolean stageEnd) {
migrationStatus.property(CURRENT_COUNTER_PROPERTY, counter);
if(stageEnd) {
migrationStatus.property(CURRENT_INDEX_PROPERTY, counter);
}
update(graph, counter, true);
v.property(CURRENT_COUNTER_PROPERTY, longValue);
setValues(ms, fetchUsingTypeName(graph.traversal()));
if(LOG.isDebugEnabled()) {
LOG.error("get: failed!", ex);
}
private static void setValues(MigrationStatus ms, Vertex vertex) {
ms.setStartTime((Date) vertex.property(START_TIME_PROPERTY).value());
ms.setEndTime((Date) vertex.property(END_TIME_PROPERTY).value());
ms.setCurrentIndex((Long) vertex.property(CURRENT_INDEX_PROPERTY).value());
ms.setCurrentCounter((Long) vertex.property(CURRENT_COUNTER_PROPERTY).value());
ms.setOperationStatus((String) vertex.property(OPERATION_STATUS_PROPERTY).value());
ms.setTotalCount((Long) vertex.property(TOTAL_COUNT_PROPERTY).value());
} | 0 |
HttpGet httpget = new HttpGet("https://httpbin.org/get"); | 0 |
new Object[] { new Integer(lu.getLexicalUnitType()),
getPropertyName() });
new Object[] { value, getPropertyName() }); | 0 |
import org.apache.beam.sdk.extensions.euphoria.core.client.util.PCollectionLists;
import org.apache.beam.sdk.values.PCollection;
import org.apache.beam.sdk.values.PCollectionList;
* @see OfBuilder#of(PCollection)
public static <InputT> ByBuilder<InputT> of(PCollection<InputT> input) {
<InputT> ByBuilder<InputT> of(PCollection<InputT> input);
private PCollection<InputT> input;
public <T> ByBuilder<T> of(PCollection<T> input) {
public PCollection<InputT> output(OutputHint... outputHints) {
return OperatorTransform.apply(filter, PCollectionList.of(input));
public PCollection<InputT> expand(PCollectionList<InputT> inputs) {
.of(PCollectionLists.getOnlyElement(inputs)) | 0 |
// do not report instances for views that are not loaded.
if (viewDefinition.isLoaded()){
if (viewName == null || viewName.equals(viewDefinition.getCommonName())) {
for (ViewInstanceEntity viewInstanceDefinition : viewRegistry.getInstanceDefinitions(viewDefinition)) {
if (instanceName == null || instanceName.equals(viewInstanceDefinition.getName())) {
if (viewVersion == null || viewVersion.equals(viewDefinition.getVersion())) {
if (includeInstance(viewInstanceDefinition, true)) {
Resource resource = toResource(viewInstanceDefinition, requestedIds);
resources.add(resource);
}
ViewEntity viewEntity = instanceEntity.getViewEntity();
String viewName = viewEntity.getCommonName();
String version = viewEntity.getVersion();
ViewEntity view = viewRegistry.getDefinition(viewName, version);
if ( view == null ) {
throw new IllegalStateException("The view " + viewName + " is not registered.");
}
// the view must be in the LOADED state to create an instance
if (!view.isLoaded()) {
throw new IllegalStateException("The view " + viewName + " is not loaded.");
}
// the view must be in the LOADED state to delete an instance
if (viewEntity.isLoaded()) {
for (ViewInstanceEntity viewInstanceEntity : viewRegistry.getInstanceDefinitions(viewEntity)){
Resource resource = toResource(viewInstanceEntity, requestedIds);
if (predicate == null || predicate.evaluate(resource)) {
if (includeInstance(viewInstanceEntity, false)) {
viewInstanceEntities.add(viewInstanceEntity);
} | 0 |
out.writeObject(decorated());
setCollection((Collection<E>) in.readObject()); // (1) | 0 |
import org.apache.commons.jexl3.parser.ASTUnaryPlusNode;
protected Object visit(ASTUnaryPlusNode node, Object data) {
return prefixChild(node, "+", data);
}
@Override | 0 |
import org.apache.accumulo.core.security.CredentialHelper;
import org.apache.accumulo.core.security.thrift.Credential;
import org.apache.accumulo.core.security.thrift.tokens.PasswordToken;
Credential credentials = getCredentials();
public Credential getCredentials() {
return CredentialHelper.createSquelchError(username, new PasswordToken().setPassword(password.getBytes()), this.getInstance().getInstanceID()); | 1 |
import org.apache.accumulo.core.client.AccumuloClient;
AccumuloClient c = getAccumuloClient();
try (Scanner scanner = getAccumuloClient().createScanner(table, Authorizations.EMPTY)) { | 0 |
*
* http://www.apache.org/licenses/LICENSE-2.0
*
/**
* Deserializer for ImmutableList used by AbstractNotificationConsumer.GSON.
*/
public static class ImmutableListDeserializer implements JsonDeserializer<ImmutableList<?>> {
public static final Type LIST_TYPE = new TypeToken<List<?>>() {
}.getType();
JsonDeserializationContext context) {
/**
* Deserializer for ImmutableMap used by AbstractNotificationConsumer.GSON.
*/
public static final Type MAP_TYPE = new TypeToken<Map<?, ?>>() {
}.getType();
JsonDeserializationContext context) {
/**
* Deserializer for EntityNotification used by AbstractNotificationConsumer.GSON.
*/
public static final class EntityNotificationDeserializer implements JsonDeserializer<EntityNotification> {
final JsonDeserializationContext context) {
/**
* Serde for Struct used by AbstractNotificationConsumer.GSON.
*/
public static final class StructDeserializer implements JsonDeserializer<IStruct>, JsonSerializer<IStruct> {
final JsonDeserializationContext context) {
/**
* Serde for Referenceable used by AbstractNotificationConsumer.GSON.
*/
public static final class ReferenceableSerializerDeserializer implements JsonDeserializer<IStruct>,
final JsonDeserializationContext context) {
/**
* Serde for JSONArray used by AbstractNotificationConsumer.GSON.
*/
public static final class JSONArraySerializerDeserializer implements JsonDeserializer<JSONArray>,
final JsonDeserializationContext context) { | 0 |
prov.put("instance.name","FooProvider1");
prov2.put("instance.name","FooProvider2");
i3.put("instance.name","Object");
i4.put("instance.name","Ref");
i5.put("instance.name","Both"); | 0 |
import org.apache.beam.vendor.guava.v20_0.com.google.common.base.MoreObjects;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Iterables; | 0 |
.addState(
State.CONSTRUCTED,
State.PREPARED, State.STOPPED)
.addState(
State.PREPARED,
State.READY, State.STOPPED)
.addState(
State.READY,
State.STOPPED)
.addState(
State.STOPPED,
// Allow cycles in STOPPED to prevent throwing and avoid the need for call-site checking.
State.STOPPED)
private void checkState(State state) throws StorageException {
try {
stateMachine.checkState(state);
} catch (IllegalStateException e) {
throw new TransientStorageException("Storage is not " + state, e);
checkState(State.CONSTRUCTED);
checkState(State.PREPARED);
checkState(State.READY);
checkState(State.READY);
checkState(State.READY); | 0 |
package org.apache.accumulo.core.util.shell.commands;
import java.security.SecureRandom;
import java.util.Random;
import org.apache.accumulo.core.util.shell.Shell;
import org.apache.accumulo.core.util.shell.ShellCommandException;
import org.apache.accumulo.core.util.shell.Shell.Command;
import org.apache.accumulo.core.util.shell.ShellCommandException.ErrorCode;
import org.apache.commons.cli.CommandLine;
public class HiddenCommand extends Command {
private static Random rand = new SecureRandom();
@Override
public String description() {
return "The first rule of Accumulus is: \"You don't talk about Accumulus.\"";
}
@Override
public int execute(String fullCommand, CommandLine cl, Shell shellState) throws Exception {
if (rand.nextInt(10) == 0) {
shellState.getReader().beep();
shellState.getReader().printNewline();
shellState.getReader().printString("Sortacus lives!\n");
shellState.getReader().printNewline();
} else
throw new ShellCommandException(ErrorCode.UNRECOGNIZED_COMMAND, getName());
return 0;
}
@Override
public int numArgs() {
return Shell.NO_FIXED_ARG_LENGTH_CHECK;
}
@Override
public String getName() {
return "\0\0\0\0";
}
} | 1 |
return "ContentLength="
+ this.getContentLength()
+ ", ContentType="
+ this.getContentType(); | 0 |
*/
private short b;
/**
* Empty constructor needed for the Class.newInstance() statement in
* Instruction.readInstruction(). Not to be used otherwise.
*/
SIPUSH() {
}
public SIPUSH(short b) {
super(org.apache.bcel.Constants.SIPUSH, (short) 3);
this.b = b;
}
/**
* Dump instruction as short code to stream out.
*/
public void dump( DataOutputStream out ) throws IOException {
super.dump(out);
out.writeShort(b);
}
/**
* @return mnemonic for instruction
*/
public String toString( boolean verbose ) {
return super.toString(verbose) + " " + b;
}
/**
* Read needed data (e.g. index) from file.
*/
protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException {
length = 3;
b = bytes.readShort();
}
public Number getValue() {
return new Integer(b);
}
/** @return Type.SHORT
*/
public Type getType( ConstantPoolGen cp ) {
return Type.SHORT;
}
/**
* Call corresponding visitor method(s). The order is:
* Call visitor methods of implemented interfaces first, then
* call methods according to the class hierarchy in descending order,
* i.e., the most specific visitXXX() call comes last.
*
* @param v Visitor object
*/
public void accept( Visitor v ) {
v.visitPushInstruction(this);
v.visitStackProducer(this);
v.visitTypedInstruction(this);
v.visitConstantPushInstruction(this);
v.visitSIPUSH(this);
} | 0 |
import org.apache.http.entity.BasicHttpEntity;
post.setEntity(new BasicHttpEntity());
post.setEntity(new BasicHttpEntity());
impl = new CachingHttpClient(mockBackend, mockCache, new HeapResourceFactory(), params);
impl = new CachingHttpClient(mockBackend, mockCache, new HeapResourceFactory(), params);
impl = new CachingHttpClient(mockBackend, mockCache, new HeapResourceFactory(), params);
impl = new CachingHttpClient(mockBackend, mockCache, new HeapResourceFactory(), params);
impl = new CachingHttpClient(mockBackend, mockCache, new HeapResourceFactory(), params); | 0 |
when(filter1Reference.getProperty(Constants.SERVICE_ID)).thenReturn(4L); | 0 |
import java.util.Map;
protected Object getPropertyOfMapBean(Map<?, ?> bean, String propertyName)
protected void setPropertyOfMapBean(Map<String, Object> bean, String propertyName, Object value) | 0 |
private static final Pattern p = Pattern.compile("(\\$_\\$)|(\\$\\$)|(\\$)|(__)|(_)");
String replacement = "";
if (m.group(1) != null) replacement = "-";
if (m.group(2) != null) replacement = "\\$";
if (m.group(3) != null) replacement = "";
if (m.group(4) != null) replacement = "_";
if (m.group(5) != null) replacement = ".";
@Override | 0 |
import java.util.Objects;
private final Ordering<T> ordering;
protected ActiveLimitedStrategy(Ordering<T> ordering, int maxActive) {
this.ordering = Objects.requireNonNull(ordering);
.from(ordering.sortedCopy(doGetNextGroup(idle, active))) | 0 |
* The original filename in the user's file system.
* @param fileName The original filename in the user's file system, or
* Returns the original filename in the client's file system.
* @return The original filename in the client's file system. | 0 |
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at | 0 |
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at | 0 |
import org.apache.accumulo.core.conf.AccumuloConfiguration;
public static ServerPort startServer(AccumuloConfiguration conf, Property portHintProperty, TProcessor processor, String serverName, String threadName,
Property portSearchProperty,
int portHint = conf.getPort(portHintProperty);
minThreads = conf.getCount(minThreadProperty);
timeBetweenThreadChecks = conf.getTimeInMillis(timeBetweenThreadChecksProperty);
portSearch = conf.getBoolean(portSearchProperty); | 1 |
import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode; | 0 |
public AbstractSortedSetTest(final String name) {
final Iterator<E> colliter = getCollection().iterator();
final Iterator<E> confiter = getConfirmed().iterator();
final Object[] elements = new Object[30];
final Object[] elements = new Object[30];
final int length = getFullElements().length;
final int lobound = length / 3;
final int hibound = lobound * 2;
final int length = getFullElements().length;
final int lobound = length / 3;
final int hibound = lobound * 2;
final int length = getFullElements().length;
final int lobound = length / 3;
public TestSortedSetSubSet(final int bound, final boolean head) {
final Object[] allelements = AbstractSortedSetTest.this.getFullElements();
public TestSortedSetSubSet(final int lobound, final int hibound) {
final int length = hibound - lobound;
private SortedSet<E> getSubSet(final SortedSet<E> set) {
final E[] elements = AbstractSortedSetTest.this.getFullElements(); | 0 |
package org.apache.aurora.scheduler.metadata;
import org.apache.aurora.gen.AssignedTask;
import org.apache.aurora.gen.ScheduleStatus;
import org.apache.aurora.gen.ScheduledTask;
import org.apache.aurora.scheduler.events.PubsubEvent.TaskStateChange;
import org.apache.aurora.scheduler.events.PubsubEvent.TasksDeleted;
import org.apache.aurora.scheduler.events.PubsubEvent.Vetoed;
import org.apache.aurora.scheduler.filter.SchedulingFilter.Veto;
import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
import org.junit.Before;
import org.junit.Test;
| 0 |
* Copyright 2001-2004 The Apache Software Foundation.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.