Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
import org.apache.sshd.common.util.closeable.AbstractCloseable;
public class ClientUserAuthService extends AbstractCloseable implements Service { | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/test/org/apache/commons/digester/BetaBean.java,v 1.4 2003/10/09 21:09:48 rdonkin Exp $
* $Revision: 1.4 $
* $Date: 2003/10/09 21:09:48 $
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear. | 0 |
import org.osgi.service.converter.StandardConverter;
private Converter converter = new StandardConverter(); | 0 |
byteArrayKvListCaptor.getValue().stream()
kvGroups.stream()
mutationGroups.stream()
mutationGroups.stream() | 0 |
import org.apache.beam.vendor.grpc.v1p13p1.com.google.protobuf.ByteString; | 0 |
import org.apache.beam.sdk.runners.PTransformOverride;
pipeline.replace(PTransformOverride.of(override.getKey(), override.getValue())); | 0 |
log.info("{} {}", entry.getKey().toStringNoTruncate(), entry.getValue());
log.info("{} {}", entry.getKey().toStringNoTruncate(), ProtobufUtil.toString(Status.parseFrom(entry.getValue().get())));
log.info("{} {}", entry.getKey().toStringNoTruncate(), entry.getValue());
log.info("{} {}", entry.getKey().toStringNoTruncate(), ProtobufUtil.toString(status)); | 0 |
import cz.seznam.euphoria.core.client.operator.state.State; | 0 |
if ((i % (10 * 1000)) == 0) {
UtilWaitThread.sleep(5 * 1000); | 0 |
* @author <a href="mailto:[email protected]">Christophe Jolif</a>
public BridgeDOMInsertedRemovedListener(ConcreteBridgeContext context) {
public void handleEvent(Event evt) {
if (gn != null) {
if (event.getType().equals(DOM_NODE_INSERTED_TYPE)) {
// it means we know how to go from DOM to GVT for this node
if (graphicsNodeBridge != null) {
GraphicsNode childGVTNode =
graphicsNodeBridge.
createGraphicsNode(context,
(Element)child);
((CompositeGraphicsNode)gn).getChildren().
add(childGVTNode);
} | 0 |
public class JexlEvalContext implements
JexlContext,
JexlContext.NamespaceResolver,
JexlEngine.Options { | 0 |
import java.util.ArrayList;
import javax.naming.InvalidNameException;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.ldap.LdapName;
import javax.naming.ldap.Rdn;
final String subjectPrincipal = cert.getSubjectX500Principal().toString();
final String[] cns = extractCNs(subjectPrincipal);
static String[] extractCNs(final String subjectPrincipal) throws SSLException {
if (subjectPrincipal == null) {
return null;
}
final List<String> cns = new ArrayList<String>();
try {
final LdapName subjectDN = new LdapName(subjectPrincipal);
final List<Rdn> rdns = subjectDN.getRdns();
for (int i = rdns.size() - 1; i >= 0; i--) {
final Rdn rds = rdns.get(i);
final Attributes attributes = rds.toAttributes();
final Attribute cn = attributes.get("cn");
if (cn != null) {
try {
final Object value = cn.get();
if (value != null) {
cns.add(value.toString());
}
} catch (NamingException ignore) {
}
} catch (InvalidNameException e) {
throw new SSLException(subjectPrincipal + " is not a valid X500 distinguished name");
return cns.isEmpty() ? null : cns.toArray(new String[ cns.size() ]); | 0 |
/*
* 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.
*/
package org.apache.cocoon.forms.datatype.typeimpl;
import org.apache.cocoon.forms.datatype.Datatype;
import org.apache.cocoon.forms.datatype.DatatypeManager;
import org.w3c.dom.Element;
/**
* Builds {@link DecimalType}s.
* @version $Id$
*/
public class DecimalTypeBuilder extends AbstractDatatypeBuilder {
public Datatype build(Element datatypeElement, boolean arrayType, DatatypeManager datatypeManager) throws Exception {
DecimalType type = new DecimalType();
type.setArrayType(arrayType);
type.setBuilder(this);
buildValidationRules(datatypeElement, type, datatypeManager);
buildConvertor(datatypeElement, type);
return type;
}
} | 0 |
if (matchFound && (!negated)) {
if (negated) {
return new Pair<Pattern, Boolean>(Pattern.compile(sb.toString(), Pattern.CASE_INSENSITIVE), negated); | 0 |
package cz.seznam.euphoria.flink.batch;
import cz.seznam.euphoria.core.client.functional.UnaryFunctor;
import cz.seznam.euphoria.core.client.operator.FlatMap;
import cz.seznam.euphoria.flink.FlinkOperator;
import cz.seznam.euphoria.flink.functions.UnaryFunctorWrapper;
import org.apache.flink.api.java.DataSet;
class FlatMapTranslator implements BatchOperatorTranslator<FlatMap> {
@Override
@SuppressWarnings("unchecked")
public DataSet<?> translate(FlinkOperator<FlatMap> operator,
BatchExecutorContext context)
{
DataSet<?> input = context.getSingleInputStream(operator);
UnaryFunctor mapper = operator.getOriginalOperator().getFunctor();
return input
.flatMap(new UnaryFunctorWrapper(mapper))
.setParallelism(operator.getParallelism())
.name(operator.getName());
}
} | 0 |
package org.apache.sshd.client.subsystem.sftp.extensions.helpers; | 0 |
new BeamSqlInitCapExpression(operands).evaluate(record, null).getValue());
new BeamSqlInitCapExpression(operands).evaluate(record, null).getValue());
new BeamSqlInitCapExpression(operands).evaluate(record, null).getValue()); | 0 |
* or more contributor license agreements. See the NOTICE file
* regarding copyright ownership. The ASF licenses this file
* with the License. You may obtain a copy of the License at
* KIND, either express or implied. See the License for the | 0 |
import org.apache.beam.sdk.coders.StructuredCoder;
public static class Coder<T> extends StructuredCoder<ValueInSingleWindow<T>> { | 0 |
@Basic(fetch = FetchType.LAZY)
@Lob | 0 |
import org.apache.ambari.server.controller.utilities.PredicateHelper;
import org.apache.ambari.server.topology.LogicalRequest;
import org.apache.commons.lang.math.NumberUtils;
import com.google.common.collect.Sets;
// !!! check the id passed to see if it's a LogicalRequest. This safeguards against
// iterating all stages for all requests. That is a problem when the request
// is for an Upgrade, but was pulling the data anyway.
Map<String, Object> map = PredicateHelper.getProperties(predicate);
if (map.containsKey(STAGE_REQUEST_ID)) {
Long requestId = NumberUtils.toLong(map.get(STAGE_REQUEST_ID).toString());
LogicalRequest lr = topologyManager.getRequest(requestId);
if (null != lr) {
Collection<StageEntity> topologyManagerStages = lr.getStageEntities();
for (StageEntity entity : topologyManagerStages) {
Resource stageResource = toResource(entity, propertyIds);
if (predicate.evaluate(stageResource)) {
results.add(stageResource);
}
}
}
} else {
Collection<StageEntity> topologyManagerStages = topologyManager.getStages();
for (StageEntity entity : topologyManagerStages) {
Resource stageResource = toResource(entity, propertyIds);
if (predicate.evaluate(stageResource)) {
results.add(stageResource);
} | 0 |
public ArrayListValuedHashMap(final int initialListCapacity) {
public ArrayListValuedHashMap(final int initialMapCapacity, final int initialListCapacity) {
private void writeObject(final ObjectOutputStream oos) throws IOException {
private void readObject(final ObjectInputStream ois) throws IOException, ClassNotFoundException { | 0 |
log.warn(e.getMessage(), e);
log.debug("Unable to initate log sort for {}: ", source, e);
log.warn("Failed to initiate log sort {}", source, e);
log.info("Created zookeeper entry {} with data {}", path, work);
log.info("Volume replaced {} -> {}", walog, switchedWalog);
log.debug("Recovering {} to {}", filename, dest);
log.info("Starting recovery of {} (in : {}s), tablet {} holds a reference", filename, (delay / 1000), extent); | 0 |
private final AtomicBoolean failed;
this.failed = new AtomicBoolean(false);
if (failed.compareAndSet(false, true)) {
if (exchangeHandler != null) {
exchangeHandler.failed(cause);
} | 0 |
StringBuilder shortMonthNamesStr = new StringBuilder(BUFSZ); | 0 |
import java.io.File;
// Paths.get(x) will not work on win cause of the ":" after the drive letter
Files.copy(
new File(source).toPath(),
new File(destination).toPath(),
StandardCopyOption.REPLACE_EXISTING); | 0 |
* Creates a continuation for a batch call, and returns it in a <code>Callable</code>.
* Creates a continuation for a query call, and returns it in a <code>Callable</code>.
* Creates a continuation for an update call, and returns it in a <code>Callable</code>. | 0 |
String ret;
float factor;
for ( Performance perf : tests )
Results javaResults = perf.testJava( ), interpretedResults = perf.testExpression( false ),
compiledResults = perf.testExpression( true );
{
}
System.out.println( ( compiledResults.mvel ? "MVEL" : "OGNL" ) + " " + perf.getName( ) + ": "
+ perf.getExpression( ) );
System.out.println(
" java: " + javaResults.iterations + " iterations in " + javaResults.time + " ms" );
System.out.println(
" compiled: " + compiledResults.iterations + " iterations in " + compiledResults.time + " ms ("
+ compiledResults.getFactor( javaResults ) + "java)" );
System.out.println(
"interpreted: " + interpretedResults.iterations + " iterations in " + interpretedResults.time
+ " ms (" + interpretedResults.getFactor( javaResults ) + "java)" );
System.out.println( );
ex.printStackTrace( );
return (Results) _method.invoke( this ); | 0 |
* @version CVS $Id: LexicalTransformer.java,v 1.2 2003/03/19 15:42:14 cziegeler Exp $
public Serializable getKey() {
public SourceValidity getValidity() { | 0 |
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
public final class DelegateCoder<T, IntermediateT> extends CustomCoder<T> {
public boolean equals(Object o) {
if (o == null || this.getClass() != o.getClass()) {
return false;
}
DelegateCoder<?, ?> that = (DelegateCoder<?, ?>) o;
return Objects.equal(this.coder, that.coder)
&& Objects.equal(this.toFn, that.toFn)
&& Objects.equal(this.fromFn, that.fromFn);
}
@Override
public int hashCode() {
return Objects.hashCode(this.coder, this.toFn, this.fromFn);
}
@Override
return MoreObjects.toStringHelper(getClass())
.add("coder", coder)
.add("toFn", toFn)
.add("fromFn", fromFn)
.toString(); | 0 |
/** Utility methods for interacting with {@link DoFnLifecycleManager DoFnLifecycleManagers}. */ | 1 |
private final static Logger LOG = LoggerFactory.getLogger(AmbariMetaInfoTest.class);
@Test
public void testGetVersionDefinitionsForDisabledStack() throws AmbariException {
Map<String, VersionDefinitionXml> versionDefinitions = metaInfo.getVersionDefinitions();
Assert.assertNotNull(versionDefinitions);
// Check presence
Map.Entry<String, VersionDefinitionXml> vdfEntry = null;
for (Map.Entry<String, VersionDefinitionXml> entry : versionDefinitions.entrySet()) {
if (entry.getKey().equals("HDP-2.2.1")) {
vdfEntry = entry;
}
}
Assert.assertNotNull("Candidate stack and vdf for test case.", vdfEntry);
StackInfo stackInfo = metaInfo.getStack("HDP", "2.2.1");
// Strange that this is not immutable but works for this test !
stackInfo.setActive(false);
// Hate to use reflection hence changed contract to be package private
metaInfo.versionDefinitions = null;
versionDefinitions = metaInfo.getVersionDefinitions();
vdfEntry = null;
for (Map.Entry<String, VersionDefinitionXml> entry : versionDefinitions.entrySet()) {
if (entry.getKey().equals("HDP-2.2.1")) {
vdfEntry = entry;
}
}
Assert.assertNull("Disabled stack should not be returned by the API", vdfEntry);
}
| 0 |
import org.apache.commons.jelly.util.ClassLoaderUtils;
* @version $Revision: 1.6 $
parent = ClassLoaderUtils.getClassLoader(getClass()); | 0 |
private XMLUtils() {
// we don't allow instantiation
}
* Returns all ancestor elements of a given node up to the document element
* Returns all ancestor elements of a given node up to the given root element
*
* @param ctxNode
* @param rootElement
* @return
*/
public static Vector getAncestorElements(Node ctxNode, Node rootElement) {
Vector ancestorVector = new Vector();
if (ctxNode.getNodeType() != Node.ELEMENT_NODE) {
return ancestorVector;
}
Node parent = ctxNode;
Node parentOfRoot = rootElement.getParentNode();
while ((parent = parent.getParentNode()) != null
&& (parent.getNodeType() == Node.ELEMENT_NODE)
&& (parent != parentOfRoot)) {
ancestorVector.add(parent);
}
ancestorVector.trimToSize();
return ancestorVector;
}
/**
* Serializes the <CODE>contextNode</CODE> into the OutputStream, but
* supresses all Exceptions. This should only be used for debugging purposes,
* not in a production environment. | 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 javax.persistence.EnumType;
import javax.persistence.Enumerated;
* Cluster Type for cluster Handle
*/
@Enumerated(EnumType.STRING)
@Column(name = "cluster_type", nullable = false)
private ClusterType clusterType;
/**
this.clusterType = ClusterType.LOCAL_AMBARI;
* Get the type of cluster the view instance is attached to
*
* @return clusterType the type of cluster for cluster handle
*/
public ClusterType getClusterType() {
return clusterType;
}
/**
* Set the type of cluster for cluster handle
*
* @param clusterType
*/
public void setClusterType(ClusterType clusterType) {
this.clusterType = clusterType;
}
/**
| 0 |
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap; | 0 |
for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
int[] oldentry = (int[])(e.nextElement()); | 0 |
try {
reference.tie();
} catch (IOException ioe) {
// This would be from a close, Let it slide...
}
reference.release();
reference.release();
reference.release();
reference.release();
reference.release();
/* Do nothing drop out... */
public synchronized void retry() throws IOException {
wasClosed = false;
isTied = false;
public synchronized void close() throws IOException {
wasClosed = true;
if (isTied) {
super.close();
// System.err.println("Closing stream - from close");
}
/**
* Let stream know that it is perminately tied to one
* image decoder. This means that it can allow that
* decoder to close the stream.
*/
public synchronized void tie() throws IOException {
isTied = true;
if (wasClosed) {
super.close();
// System.err.println("Closing stream - from tie");
}
}
/**
* Close the stream.
*/
// System.err.println("Closing stream - from release");
boolean wasClosed = false;
boolean isTied = false; | 0 |
package org.apache.atlas.repository.store.graph.v2;
public class AtlasEntityStoreV2Test extends AtlasEntityTestBase { | 1 |
public TransformedMap<K, V1, V2> decode(InputStream inStream)
throws CoderException, IOException { | 0 |
*
* @since 4.0 | 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.ambari.server.agent.stomp.dto;
import java.util.List;
import java.util.TreeMap;
import org.apache.ambari.server.agent.CommandReport;
import com.fasterxml.jackson.annotation.JsonProperty;
public class CommandStatusReports {
@JsonProperty("clusters")
private TreeMap<String, List<CommandReport>> clustersComponentReports;
public CommandStatusReports() {
}
public TreeMap<String, List<CommandReport>> getClustersComponentReports() {
return clustersComponentReports;
}
public void setClustersComponentReports(TreeMap<String, List<CommandReport>> clustersComponentReports) {
this.clustersComponentReports = clustersComponentReports;
}
} | 1 |
package org.apache.felix.inventory; | 0 |
* service properties found from the AdapteeService:
* @AdapterService(adapteeService = AdapteeService.class)
* @Property(name="param", value="value")
* @return the adapter service interface(s)
* @return some additional properties
* @return the adaptee service interface this adapter is applying to.
* @return the adaptee filter
* @return the factory method
* @return the field used to inject the original service
* @return the add callback
* @return the changed callback
* @return the swap callback
* @return the remove callback
* @return the service propagation flag | 0 |
null)
.newBuilder()); | 0 |
import org.apache.accumulo.harness.AccumuloClusterHarness;
public class TableConfigurationUpdateIT extends AccumuloClusterHarness { | 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 |
public synchronized void setEventMask(final int ops) {
public synchronized void setEvent(final int op) {
public synchronized void clearEvent(final int op) {
public void setSocketTimeout(final int timeout) { | 0 |
* Copyright 2002-2006 The Apache Software Foundation.
*
*
*
* Implementation of JexlContext based on a HashMap.
public class HashMapContext extends HashMap implements JexlContext {
/** serialization version id jdk13 generated. */
/**
* {@inheritDoc}
*/
public void setVars(Map vars) {
/**
* {@inheritDoc}
*/
public Map getVars() { | 0 |
/*
* Copyright 2002-2006 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.
*/
package org.apache.commons.jexl;
import junit.framework.TestCase;
public class ScriptFactoryTest extends TestCase {
/**
* Creates a new test case.
* @param name the test case name.
*/
public ScriptFactoryTest(String name) {
super(name);
}
/**
* Ensure the factory can create a script from a String
* @throws Exception on a parse error
*/
public void testCreateFromString() throws Exception {
String code = ";";
assertNotNull("No script created", ScriptFactory.createScript(code));
}
} | 0 |
* Hide constructor for a utility class.
*/
private Util()
{
}
/** | 0 |
import org.apache.felix.sigil.common.progress.IProgress;
public void synchronize(IProgress progress) throws IOException
progress = progress.newTask(100);
progress.report("Synchronizing " + bundle.getSymbolicName() + " binary");
progress.report("Synchronizing " + bundle.getSymbolicName() + " source");
progress.report("Synchronizing " + bundle.getSymbolicName() + " licence");
private static void sync(File local, URI remote, IProgress progress)
progress = progress.newTask(contentLength);
progress.report("Downloading from " + url.getHost());
stream(in, out, progress);
progress.done();
private static void stream(InputStream in, OutputStream out, IProgress progress)
if (progress.isCanceled())
progress.worked(r); | 0 |
import org.apache.beam.sdk.transforms.windowing.GlobalWindow;
@Test
public void testCoderIsSerializableWithWellKnownCoderType() throws Exception {
CoderProperties.coderSerializable(CollectionCoder.of(GlobalWindow.Coder.INSTANCE));
} | 0 |
return _openDataConnection_(FTPCommand.getCommand(command), arg);
}
/**
* Returns a socket of the data connection.
* Wrapped as an {@link SSLSocket}, which carries out handshake processing.
* @param command The textual representation of the FTP command to send.
* @param arg The arguments to the FTP command.
* If this parameter is set to null, then the command is sent with
* no arguments.
* @return corresponding to the established data connection.
* Null is returned if an FTP protocol error is reported at any point
* during the establishment and initialization of the connection.
* @throws IOException If there is any problem with the connection.
* @see FTPClient#_openDataConnection_(int, String)
* @since 3.2
*/
@Override
protected Socket _openDataConnection_(String command, String arg)
throws IOException { | 0 |
LOG.info("SSL handshake complete with {} - {} - {}", sslSock.getRemoteSocketAddress(), sslSock.getSession().getProtocol(), sslSock.getSession().getCipherSuite());
LOG.info("Creating TLS-enabled quorum server socket");
LOG.info("Creating TLS-only quorum server socket"); | 0 |
import junit.framework.TestCase;
@Override
@Override
@Override | 0 |
@JsonIgnore
public boolean isUnassigned() {
return isUnAssigned(guid);
}
@JsonIgnore
public boolean isAssigned() {
return isAssigned(guid);
}
@JsonIgnore
public static boolean isAssigned(String guid) {
try {
UUID.fromString(guid);
} catch (IllegalArgumentException e) {
return false;
}
return true;
}
@JsonIgnore
public static boolean isUnAssigned(String guid) {
return guid != null && guid.length() > 0 && guid.charAt(0) == '-';
}
private static String nextInternalId() {
return "-" + Long.toString(s_nextId.getAndIncrement());
}
@JsonIgnore
public AtlasObjectId getAtlasObjectId() {
return new AtlasObjectId(getTypeName(), getGuid());
}
| 0 |
import com.twitter.nexus.gen.JobConfiguration;
public static TwitterTaskInfo populateFields(JobConfiguration job, TwitterTaskInfo config)
.setOwner(job.getOwner())
.setJobName(job.getName()) | 0 |
/* ====================================================================
* Copyright (c) 2003-2004 The Apache Software Foundation. All rights
* @version $Revision: 1.5 $ $Date: 2004/01/14 21:34:35 $ | 0 |
metaInfoXml.addError(msg); | 0 |
public static void updateTabletDir(KeyExtent extent, String newDir, Credentials creds, ZooLock lock) {
Mutation m = new Mutation(extent.getMetadataEntry());
TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN.put(m, new Value(newDir.getBytes()));
update(creds, lock, m, extent);
}
public static void setRootTabletDir(String dir) throws IOException {
IZooReaderWriter zoo = ZooReaderWriter.getInstance();
String zpath = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + RootTable.ZROOT_TABLET_PATH;
try {
zoo.putPersistentData(zpath, dir.getBytes(Constants.UTF8), -1, NodeExistsPolicy.OVERWRITE);
} catch (KeeperException e) {
throw new IOException(e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IOException(e);
}
}
Thread.currentThread().interrupt(); | 0 |
* @version $Id: URLCodec.java,v 1.13 2004/01/09 19:02:47 ggregory Exp $
private final static String US_ASCII = "US-ASCII";
protected String encoding = "UTF-8";
return new String(encode(pString.getBytes(encoding)), US_ASCII);
return encode(pString, this.encoding);
return new String(decode(pString.getBytes(US_ASCII)), encoding);
return decode(pString, this.encoding); | 0 |
private final Log log = LogFactory.getLog(getClass()); | 0 |
state.setCancellable(this.cancellable); | 0 |
import org.apache.hc.core5.http.config.H1Config;
public BrokenServerConnection(final H1Config h1Config) {
super(null, h1Config);
final BrokenServerConnection conn = new BrokenServerConnection(H1Config.DEFAULT); | 1 |
* Defines the {@link org.apache.beam.sdk.transforms.windowing.Window} transform
* {@link org.apache.beam.sdk.transforms.windowing.Trigger} for controlling when those
* {@link org.apache.beam.sdk.values.PCollection} into finite windows according to a
* {@link org.apache.beam.sdk.transforms.windowing.WindowFn}.
* {@link org.apache.beam.sdk.transforms.GroupByKey}s, including one
* <p>The {@link org.apache.beam.sdk.transforms.windowing.DefaultTrigger} will output a
* {@link org.apache.beam.sdk.transforms.windowing.AfterWatermark} for details on the
package org.apache.beam.sdk.transforms.windowing; | 0 |
return new CollectionSortedBag<>(bag); | 1 |
private final String rootFile;
this.rootFile = rootFile;
final String fileName = rootFile + name.getPath(); | 0 |
&& leftValue.floatValue() != rightValue.floatValue()); | 0 |
TreeSet<Text> cutPoints = new TreeSet<>(); | 0 |
return new TestSuite(LazyDynaMapTestCase.class); | 0 |
import org.apache.hc.client5.http.io.HttpClientConnectionManager;
import org.apache.hc.client5.http.sync.ExecChain;
import org.apache.hc.client5.http.sync.ExecChainHandler;
import org.apache.hc.core5.http.ClassicHttpRequest;
import org.apache.hc.core5.http.impl.io.HttpRequestExecutor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@Mock
private HttpClientConnectionManager connManager;
@Mock
private HttpRequestExecutor requestExecutor;
@Mock
private ExecChainHandler execChain;
@Mock
@Mock
@Mock
@Mock
@Mock
@Mock
@Mock
@Mock
MockitoAnnotations.initMocks(this);
client = new InternalHttpClient(connManager, requestExecutor, new ExecChainElement(execChain, null), routePlanner,
Mockito.<ClassicHttpRequest>any(),
Mockito.<ExecChain.Scope>any(),
Mockito.<ExecChain>any());
Mockito.<ClassicHttpRequest>any(),
Mockito.<ExecChain.Scope>any(),
Mockito.<ExecChain>any())).thenThrow(new HttpException()); | 0 |
/*
* Copyright 2003-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.
* @version $Revision: 1.11 $ $Date: 2004/02/18 00:59:06 $ | 0 |
final int b = in.read();
final int bytesRead = in.read(b);
final int bytesRead = in.read(b, off, len); | 0 |
import org.apache.http.HeaderIterator;
for (HeaderIterator it = request.headerIterator(); it.hasNext();) {
Header header = it.nextHeader(); | 0 |
if (value == null || value.trim().length() == 0) { | 0 |
ITaskConfig.build(state.getAssignedTask().getTask().newBuilder().setInstanceId(0));
.setInstanceId(0)
.setTask(task.newBuilder().setInstanceId(0))));
getTask(state.getAncestorId()).getAssignedTask().getTask().getInstanceId(),
state.getAssignedTask().getTask().getInstanceId()); | 0 |
public int isNodeIncludeDO(Node n, int level) {
return isNodeInclude(n);
} | 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
} | 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.
* @version $Revision: 1.11 $ $Date: 2004/02/18 01:15:42 $ | 0 |
* Returns a new {@link Read.Unbounded} {@link PTransform} reading from the given
* {@link UnboundedSource}.
* Helper class for building {@link Read} transforms. | 0 |
import org.apache.cocoon.environment.ObjectModelHelper;
* @see org.apache.cocoon.portal.RequestContext#getBasePath()
*/
public String getBasePath() {
return ObjectModelHelper.getRequest(provider.getObjectModel()).getSitemapURIPrefix();
}
/** | 0 |
public static ParDo.SingleOutput<Event, Event> snoop(final String name) {
public static <T> ParDo.SingleOutput<T, Void> devNull(String name) {
public static <T> ParDo.SingleOutput<T, T> log(final String name) {
public static <T> ParDo.SingleOutput<T, String> format(String name) {
public static <T> ParDo.SingleOutput<T, TimestampedValue<T>> stamp(String name) {
public static <T> ParDo.SingleOutput<T, T> cpuDelay(String name, final long delayMs) {
public static <T> ParDo.SingleOutput<T, T> diskBusy(String name, final long bytes) {
private static <T extends KnownSize> ParDo.SingleOutput<T, KnownSize> castToKnownSize() { | 0 |
public class Split {
return new UsingBuilder<>(DEFAULT_NAME, input); | 0 |
* Copyright 1999-2005 The Apache Software Foundation.
* @version $Id$
switch (validity.isValid()) {
if (resolver == null) {
return SourceValidity.UNKNOWN;
}
newSrc = resolver.resolveURI((String) this.uris.get(i));
if (newSrc != null) {
resolver.release(newSrc);
}
if (newValidity == SourceValidity.VALID) {
break;
}
return SourceValidity.VALID; | 0 |
* @version $Id$ | 0 |
* @version $Revision$ $Date$ | 0 |
@Override
protected HttpParams createHttpParams() {
@Override
protected ClientConnectionManager createClientConnectionManager() {
@Override
protected HttpContext createHttpContext() {
@Override
protected ConnectionReuseStrategy createConnectionReuseStrategy() {
@Override
protected AuthSchemeRegistry createAuthSchemeRegistry() {
@Override
protected CookieSpecRegistry createCookieSpecRegistry() {
@Override
protected BasicHttpProcessor createHttpProcessor() {
@Override
protected HttpRequestRetryHandler createHttpRequestRetryHandler() {
@Override
protected RedirectHandler createRedirectHandler() {
@Override
protected AuthenticationHandler createTargetAuthenticationHandler() {
@Override
protected AuthenticationHandler createProxyAuthenticationHandler() {
@Override
protected CookieStore createCookieStore() {
@Override
protected CredentialsProvider createCredentialsProvider() {
@Override
protected void populateContext(final HttpContext context) {
@Override
protected HttpRoutePlanner createHttpRoutePlanner() { | 0 |
* @author Apache Software Foundation | 0 |
+ "/topics/" + options.getJobName(); | 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 |
* @version CVS $Id: EP_Top.java,v 1.4 2004/01/31 08:50:39 antonio Exp $
public class EP_Top extends BaseElementProcessor {
public EP_Top() {
double getPoints() throws IOException {
if (_points == null) {
int getPrefUnit() throws IOException {
if (_pref_unit == null) { | 0 |
expect(logicalRequest.hasPendingHostRequests()).andReturn(false).anyTimes();
expect(group1.addComponent("KERBEROS_CLIENT")).andReturn(true).anyTimes();
expect(group2.addComponent("KERBEROS_CLIENT")).andReturn(true).anyTimes();
expect(logicalRequest.hasPendingHostRequests()).andReturn(true).anyTimes();
expect(logicalRequest.getCompletedHostRequests()).andReturn(Collections.EMPTY_LIST).anyTimes(); | 0 |
public void removing(ServerSession session, Path path, boolean isDirectory)
log.trace("removing(" + session + ")[dir=" + isDirectory + "] " + path);
public void removed(ServerSession session, Path path, boolean isDirectory, Throwable thrown)
log.trace("removed(" + session + ")[dir=" + isDirectory + "] " + path | 0 |
* the lenient flag can be used for a script (following HTTP MIME and XML
* Creates a Reader using an InputStream and the associated content-type
* Creates a Reader using an InputStream and the associated content-type
* Creates a Reader using an InputStream and the associated content-type | 0 |
import java.util.Collection;
import org.apache.commons.collections4.map.MultiValueMap;
/**
* Test class for populateMap(MultiMap).
*/
public static class X implements Comparable<X> {
int key;
String name;
public X(int key, String name) {
this.key = key;
this.name = name;
}
public int compareTo(X o) {
return key - o.key;
}
}
public void testPopulateMultiMap() {
// Setup Test Data
final List<X> list = new ArrayList<X>();
list.add(new X(1, "x1"));
list.add(new X(2, "x2"));
list.add(new X(2, "x3"));
list.add(new X(5, "x4"));
list.add(new X(5, "x5"));
// Now test key transform population
final MultiValueMap<Integer, X> map = MultiValueMap.multiValueMap(new TreeMap<Integer, Collection<X>>());
MapUtils.populateMap(map, list, new Transformer<X, Integer>() {
public Integer transform(X input) {
return input.key;
}
}, TransformerUtils.<X> nopTransformer());
assertEquals(list.size(), map.totalSize());
for (int i = 0; i < list.size(); i++) {
assertEquals(true, map.containsKey(list.get(i).key));
assertEquals(true, map.containsValue(list.get(i)));
}
}
| 0 |
* @version $Revision$ $Date$ | 0 |
public boolean isEnableAutoCommitOnReturn() {
return enableAutoCommitOnReturn;
}
public void setEnableAutoCommitOnReturn(boolean enableAutoCommitOnReturn) {
this.enableAutoCommitOnReturn = enableAutoCommitOnReturn;
}
public boolean isRollbackOnReturn() {
return rollbackOnReturn;
}
public void setRollbackOnReturn(boolean rollbackOnReturn) {
this.rollbackOnReturn = rollbackOnReturn;
}
Boolean connAutoCommit = null;
if (rollbackOnReturn) {
connAutoCommit = Boolean.valueOf(conn.getAutoCommit());
if(!connAutoCommit.booleanValue() && !conn.isReadOnly()) {
conn.rollback();
}
// DBCP-97 / DBCP-399 / DBCP-351 Idle connections in the pool should
// have autoCommit enabled
if (enableAutoCommitOnReturn) {
if (connAutoCommit == null) {
connAutoCommit = Boolean.valueOf(conn.getAutoCommit());
}
if(!connAutoCommit.booleanValue()) {
conn.setAutoCommit(true);
}
private boolean enableAutoCommitOnReturn = true;
private boolean rollbackOnReturn = true; | 0 |
ambariCustomCommandExecutionHelper.addExecutionCommandsToStage(actionExecutionContext, stage, new HashMap<String, String>(), null);
ambariCustomCommandExecutionHelper.addExecutionCommandsToStage(actionExecutionContext, stage, new HashMap<String, String>(), null);
ambariCustomCommandExecutionHelper.addExecutionCommandsToStage(actionExecutionContext, stage, new HashMap<String, String>(), null); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.