Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
/**
* Tests for while statement.
* @author Dion Gillard
* @since 1.1
*/ | 0 |
private final Map<HostAndPort,Long> firstSeenDead;
* @param firstSeenDead
* mutable map of a host to when it was first seen dead
GarbageCollectWriteAheadLogs(Instance instance, VolumeManager fs, boolean useTrash, Map<HostAndPort,Long> firstSeenDead) throws IOException {
this.firstSeenDead = first... | 0 |
import org.apache.beam.sdk.transforms.windowing.GlobalWindows;
import org.apache.beam.sdk.transforms.windowing.Window;
* Test rule which observes elements of the {@link PCollection} and checks whether they
* match the success criteria.
*
* <p>Uses a random temporary Pubsub topic for synchronization.
/... | 0 |
package org.apache.aurora.scheduler.state;
import com.twitter.common.testing.easymock.EasyMockTest;
import com.twitter.common.util.testing.FakeClock;
import org.apache.aurora.gen.AssignedTask;
import org.apache.aurora.gen.Identity;
import org.apache.aurora.gen.ScheduleStatus;
import org.apache.aurora.gen.ScheduledTask... | 0 |
/**
* Tests that we correctly record alert occurance information.
*/
@Test
public void testAlertOccurrences() {
String definitionName = ALERT_DEFINITION + "1";
String serviceName = "HDFS";
String componentName = "NAMENODE";
String text = serviceName + " " + componentName + " is OK";
Al... | 0 |
import static org.junit.Assert.assertEquals;
| 0 |
* <td><code>TIFF_BYTE</code></td> <td><code>byte</code></td>
* <td><code>TIFF_ASCII</code></td> <td><code>String</code></td>
* <td><code>TIFF_SHORT</code></td> <td><code>char</code></td>
* <td><code>TIFF_LONG</code></td> <td><code>long</code></td>
* <td><code>TIFF_RATIONAL</co... | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/axes/SelfContext.java,v 1.2 2001/09/21 23:22:44 dmitri Exp $
* $Revision: 1.2 $
* $Date: 2001/09/21 23:22:44 $
import org.apache.commons.jxpath.Pointer;
* EvalContext that returns the ... | 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... | 0 |
package org.apache.sshd.common.config.keys.impl;
import org.apache.sshd.common.config.keys.KeyEntryResolver;
import org.apache.sshd.common.config.keys.KeyUtils;
BigInteger p = KeyEntryResolver.decodeBigInt(keyData);
BigInteger q = KeyEntryResolver.decodeBigInt(keyData);
BigInteger g = KeyEntryRe... | 0 |
@NamedQuery(name = "UpgradeEntity.findLatestForClusterInDirection",
query = "SELECT u FROM UpgradeEntity u JOIN RequestEntity r ON u.requestId = r.requestId WHERE u.clusterId = :clusterId AND u.direction = :direction ORDER BY r.startTime DESC"),
query = "SELECT u FROM UpgradeEntity u JOIN RequestEntity r ... | 0 |
import static org.junit.Assert.assertFalse;
testWithValidProvidedContext(jsc);
testWithInvalidContext(null);
}
/**
* A SparkRunner with a stopped provided Spark context cannot run pipelines.
* @throws Exception
*/
@Test
public void testWithStoppedProvidedContext() throws ... | 0 |
import org.codehaus.jackson.map.ObjectMapper;
import java.io.IOException;
private static final ObjectMapper mapper = new ObjectMapper();
String ret;
try {
ret = mapper.writeValueAsString(obj);
}catch (IOException e){
ret = null;
}
return ret;
... | 0 |
import org.apache.cocoon.xml.XMLUtils;
* @version CVS $Id: Form.java,v 1.3 2004/03/09 13:17:26 cziegeler Exp $
contentHandler.startElement(Constants.INSTANCE_NS, FORM_EL, Constants.INSTANCE_PREFIX_COLON + FORM_EL, XMLUtils.EMPTY_ATTRIBUTES);
contentHandler.startElement(Constants.INSTANCE_NS, CHILDREN_E... | 0 |
package org.apache.commons.net.ftp.ftp2.parser;
* @version $Id: VMSFTPEntryParser.java,v 1.12 2004/06/29 04:54:29 dfs Exp $ | 0 |
/**
* Callback interface that can be used to customize various aspects of
* the TLS/SSl protocol.
*
* @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
*
* @version $Revision$
*/
/**
* Triggered when the SSL connection is being initialized. Custom handlers
* can use this callback to... | 0 |
public HttpResponse receiveResponseHeader() throws HttpException, IOException {
HttpResponse response = super.receiveResponseHeader(); | 0 |
DummyHostname1, System.currentTimeMillis()), DummyCluster, HBASE, false);
DummyCluster, "HDFS", false);
DummyCluster, "HDFS", false);
DummyCluster, "HDFS", false); | 0 |
import java.util.HashMap;
private HashMap<Long,QuorumServer> servers = null;
HashMap<Long,QuorumServer> servers = new HashMap<Long,QuorumServer>();
if ((parts.length != 2) &&
(parts.length != 3)){
+ " does not have the form... | 0 |
import org.apache.http.client.URICollection;
* Attribute name of a {@link org.apache.http.client.URICollection} object that
* represents a collection of all redirect locations received in the process
* of request execution.
*/
public static final String REDIRECT_LOCATIONS = "http.protocol.redire... | 0 |
import java.io.InputStream;
* Writes the entire contents of the specified input stream to this
* byte stream. Bytes from the input stream are read directly into the
* internal buffers of this streams.
*
* @param in the input stream to read from
* @return total number of bytes read from the... | 0 |
import static org.apache.atlas.model.instance.AtlasRelationship.Status.ACTIVE;
if (obj instanceof AtlasRelatedObjectId) {
AtlasRelatedObjectId relatedObjId = (AtlasRelatedObjectId) obj;
ret = relatedObjId.getRelationshipStatus() == ACTIVE ? new AtlasObjectId((AtlasObjectId) obj) : null;... | 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 ... | 0 |
*
* @param element the element to assign a partition to
*
* @return a partition of the element | 0 |
dst.put(buffer()); | 0 |
assertNotNull(session);
assertNotNull(session); | 0 |
import org.apache.hc.client5.http.sync.methods.HttpGet;
import org.apache.hc.client5.http.sync.methods.HttpOptions; | 0 |
@Override
@Override | 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 ap... | 1 |
import org.apache.beam.sdk.Pipeline;
import org.apache.flink.util.Preconditions;
private boolean hasRun;
private boolean hasUnboundedSources;
public void translate(Pipeline pipeline) {
super.translate(pipeline);
hasRun = true;
}
@Override
hasUnboundedSources = true;
boolean hasUnboundedSourc... | 0 |
* @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a> | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/set/ListOrderedSet.java,v 1.3 2003/12/25 00:50:10 scolebourne Exp $
* @version $Revision: 1.3 $ $Date: 2003/12/25 00:50:10 $
static class OrderedSetIterator extends AbstractIt... | 0 |
SVGPath.toSVGPathData(missingGlyphShape, generatorContext));
SVGPath.toSVGPathData(glyphShape, generatorContext)); | 0 |
final NullWriter writer = new NullWriter(); | 0 |
import org.apache.http.nio.NHttpClientConnection;
NHttpClientConnection conn = entry.getConnection();
conn.getContext().setAttribute("executor", this);
conn.requestOutput(); | 0 |
public void testNullValue() {
try {
new GreaterPredicate<Integer>("category/foo", null);
Assert.fail("Expected IllegalArgumentException for null value.");
} catch (IllegalArgumentException e) {
// expected
}
}
@Test | 0 |
private static class LogWork {
static class LoggerOperation { | 0 |
/** Returns {@code true} if this window intersects the given window. */
return this.startMillis < that.endMillis && this.endMillis > that.startMillis;
/** Returns the minimal window covers both this window and the given window. */
Math.min(this.startMillis, that.startMillis), Math.max(this.endMillis, th... | 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 ... | 0 |
* Ensures that all threads spawned for ZooKeeper and Thrift connectivity are reaped after calling
* CleanUp.shutdown().
* Because this is destructive across the current context classloader, the normal teardown methods
* will fail (because they attempt to create a Connector). Until the ZooKeeperInstance and Connecto... | 0 |
* Copyright 2016-2017 Seznam.cz, a.s. | 0 |
import junit.framework.Assert;
| 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 ... | 0 |
import org.apache.commons.jxpath.ri.NamespaceResolver;
private NamespaceResolver localNamespaceResolver;
/* (non-Javadoc)
* @see org.apache.commons.jxpath.ri.model.NodePointer#getNamespaceResolver()
*/
public synchronized NamespaceResolver getNamespaceResolver() {
if (localNamespaceResolve... | 0 |
import org.apache.sshd.util.BaseTest;
public class SftpTest extends BaseTest { | 0 |
/**
* There is currently an open issue in the specification in whether a
* call to Configuration.setBundleLocation() might trigger a configuration
* update or not.
* We have test cases in our integration test suite for both cases. To
* enable the respective tests set this field accordingly:... | 0 |
import org.apache.commons.beanutils.ConversionException;
import org.apache.commons.beanutils.ConvertUtils;
StringBuilder input = new StringBuilder();
// StringBuilder | 0 |
// when the version gets reported back, we set this repo to resolved
entity.setResolved(true);
expectLastCall().once();
| 0 |
import org.apache.ambari.view.pig.utils.UserLocalObjects;
FSDataOutputStream stream = UserLocalObjects.getHdfsApi(context).create(newFilePath, false); | 0 |
HttpResponse response = null;
preprocessRequest(request, context);
protected HttpResponse sendRequest(
HttpResponse response = null;
protected HttpResponse receiveResponse(
HttpResponse response = null;
final HttpResponse response, | 0 |
/*
* Copyright 1999-2005 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... | 0 |
this.uriprefix = prefix;
this.uri = uri;
public void setObjectModel(Map objectmodel) {
this.objectmodel = objectmodel;
}
| 0 |
ENTITY_CREATE, ENTITY_UPDATE, ENTITY_DELETE, TAG_ADD, TAG_DELETE,
ENTITY_IMPORT_CREATE, ENTITY_IMPORT_UPDATE, ENTITY_IMPORT_DELETE | 0 |
* @deprecated since 1.4, replaced by {@link org.apache.accumulo.core.iterators.user.SummingArrayCombiner} with
* {@link org.apache.accumulo.core.iterators.user.SummingArrayCombiner.Type#VARLEN} | 0 |
static class TestTargetAuthenticationStrategy extends TargetAuthenticationStrategy {
public TestTargetAuthenticationStrategy() {
TestTargetAuthenticationStrategy authStrategy = new TestTargetAuthenticationStrategy();
this.httpclient.setTargetAuthenticationStrategy(authStrategy);
Asse... | 0 |
p2.put("instance.name","fooProvider");
p1.put("instance.name","callback"); | 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 ... | 0 |
* <p>
* The following parameters can be used to customize the behavior of this
* class:
* <ul>
* <li>{@link org.apache.http.params.CoreConnectionPNames#SOCKET_BUFFER_SIZE}</li>
* <li>{@link org.apache.http.params.CoreConnectionPNames#MAX_HEADER_COUNT}</li>
* <li>{@link org.apache.http.params.CoreConnectionP... | 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 |
* @version $Id$ | 0 |
* Copyright 2005-2011 The Apache Software Foundation.
private final List<Transform> transforms;
public DOMRetrievalMethod(String uri, String type,
List<Transform> transforms)
{
this.transforms = Collections.emptyList();
List<Transform> transformsCopy =
... | 0 |
* @version CVS $Id: FileSavingEnvironment.java,v 1.5 2003/11/16 00:52:08 vgritsenko Exp $
this.objectModel.put(ObjectModelHelper.REQUEST_OBJECT,
new CommandLineRequest(this, null, uri, null, attributes, parameters));
this.objectModel.put(ObjectModelHelper.RESPONSE_OBJECT,
... | 0 |
.uniqueIndex(input -> names.next()); | 0 |
PAssert.thatSingleton(input.apply("Count", Count.globally())).isEqualTo(numElements);
PAssert.thatSingleton(input.apply(Distinct.create()).apply("UniqueCount", Count.globally()))
.isEqualTo(numElements);
PAssert.thatSingleton(input.apply("Min", Min.globally())).isEqualTo(0L);
PAssert.thatSinglet... | 0 |
import java.io.ByteArrayOutputStream;
import java.io.IOException;
// we need to serializer the elements to byte arrays, since they might contain
// elements that are not serializable by Java serialization. We deserialize them
// in the FlatMap function using the Coder.
List<byte[]> serializedElements = Li... | 0 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger logger = LoggerFactory | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/test/org/apache/commons/jxpath/ri/compiler/VariableTest.java,v 1.4 2003/10/09 21:31:43 rdonkin Exp $
* $Revision: 1.4 $
* $Date: 2003/10/09 21:31:43 $
* any, must include the following acknowledgement:
* Alterna... | 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 ... | 0 |
final FileExtensionConfigurationBuilderProvider provider =
final ConfigurationDeclaration decl =
final FileExtensionConfigurationBuilderProvider provider =
final ConfigurationDeclaration decl = setUpDecl();
final FileExtensionConfigurationBuilderProvider provider = setUpProvider(... | 0 |
/*
* Copyright (C) 2015 Google Inc.
*
* 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 ... | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/StaticBucketMap.java,v 1.6 2003/12/29 15:26:39 scolebourne Exp $
* @version $Revision: 1.6 $ $Date: 2003/12/29 15:26:39 $
*
* @param map the map of entries to add
... | 0 |
ResourceType.initializeEmptyCliArgsForTest(); | 0 |
* @version CVS $Id: CocoonComponentManager.java,v 1.2 2003/03/12 12:55:16 cziegeler Exp $
env.setAttribute("CocoonComponentManager.processor", processor);
* Return the processor that is actually processing the request
*/
public static Processor getLastProcessor(Environment env) {
return (... | 0 |
* {@link GearpumpPipelineTranslator} knows how to translate {@link Pipeline} objects into Gearpump
* {@link Graph}.
private static final Logger LOG = LoggerFactory.getLogger(GearpumpPipelineTranslator.class);
* A map from {@link PTransform} subclass to the corresponding {@link TransformTranslator} to use
* to... | 1 |
* List<PortForwarder> pfs = startForwarding();
* private List<PortForwarder> startForwarding() throws IOException {
* List<PortForwarder> res = new ArrayList<PortForwarder>();
* private void stopForwarding(List<PortForwarder> pfs) throws Exception { | 0 |
@Override
@Override | 0 |
* @param violationCode
* numeric violation code
* Checks a mutation for constraint violations. If the mutation contains no violations, returns null. Otherwise, returns a list of violation codes.
* @param env
* constraint environment
* @param mutation
* mutation to ch... | 0 |
import org.apache.accumulo.core.data.TableId;
void stateChanged(TableId tableId, TableState tState); | 0 |
instanceKey = InstanceKeyDataSourceFactory.registerNewInstance(this);
instanceKey = InstanceKeyDataSourceFactory.registerNewInstance(this); | 0 |
* $todo$ implement exclusive-c14n
* $todo$ implement exclusive-c14n | 0 |
import org.apache.accumulo.core.data.TableId;
TableId tableId, Text endRow) { | 0 |
* @version $Id: JexlTest.java,v 1.36 2004/05/19 15:22:45 proyal Exp $
public void testSizeAsProperty() throws Exception
{
JexlContext jc = JexlHelper.createContext();
jc.getVars().put("map", Collections.singletonMap( "size", "cheese"));
assertExpression(jc, "map['size']", "cheese");
... | 0 |
public class AsyncClientH2FullDuplexExchange { | 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... | 0 |
/* ====================================================================
* Copyright (c) 2003-2004 The Apache Software Foundation. All rights
* @version $Revision: 1.3 $ $Date: 2004/01/14 21:34:36 $ | 0 |
private final Map<String, String> blockContexts;
protected BlockContextURLConnection(URL url, Map<String, String> blockContexts) {
// check if there the BlockContext map is not null.
// This null check can't be done earlier because in development
// environments, the cocoon-block-deploy... | 0 |
@Override
@Override | 0 |
import org.apache.hc.core5.util.TimeValue;
private TimeValue socketTmeout;
private TimeValue connectTimeout;
public Request socketTimeout(final TimeValue timeout) {
public Request connectTimeout(final TimeValue timeout) { | 1 |
@Basic
@Column(name = "note")
private String note;
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
} | 0 |
import org.apache.batik.util.SVGConstants;
import org.w3c.dom.Element;
/**
* Whether the presence of the specified element should cause
* the document to be dynamic. If this element isn't handled
* by this BridgeExtension, just return false.
*
* @param e The element to check.
*/
... | 0 |
throw new SQLException("Borrow prepareStatement from pool failed", e);
throw new SQLException("MaxOpenCallableStatements limit reached", e);
throw new SQLException("Borrow callableStatement from pool failed", e);
throw new SQLException("MaxOpenCallableStatements limit rea... | 0 |
+ " job_key, slave_host, shard_id, status,"
+ " VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)",
+ " job_key = ?, slave_host = ?, shard_id = ?," | 0 |
/*
package org.apache.felix.framework.resolver;
public class ResourceNotFoundException extends Exception
public ResourceNotFoundException(String msg)
super(msg); | 0 |
import java.net.UnknownHostException;
throws SocketException, IOException, UnknownHostException, BindException | 0 |
import org.apache.beam.runners.core.construction.ParDos.ParDoPayloadTranslator;
import org.apache.beam.sdk.transforms.ParDo;
ImmutableMap.<Class<? extends PTransform>, TransformPayloadTranslator>builder()
.put(ParDo.MultiOutput.class, ParDoPayloadTranslator.create())
.build(); | 0 |
import org.apache.sshd.common.config.keys.KeyUtils;
myKpairGen = SecurityUtils.getKeyPairGenerator(KeyUtils.EC_ALGORITHM);
KeyFactory myKeyFac = SecurityUtils.getKeyFactory(KeyUtils.EC_ALGORITHM); | 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... | 0 |
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import org.apache.ambari.server.actionmanager.CommandExecutionType;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
import com.google.inject.assistedinject.AssistedInject; | 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 ma... | 0 |
implements Element {
if (!DOMUtilities.isValidName(name)) { | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.