Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
/**
* {@inheritDoc}
* <p>
* This implementation iterates over the elements of this list, checking each element in
* turn to see if it's contained in <code>coll</code>. If it's contained, it's removed
* from this list. As a consequence, it is advised to use a collection type for
* <code>coll</code> that provides a fast (e.g. O(1)) implementation of
* {@link Collection#contains(Object)}.
*/
/**
* {@inheritDoc}
* <p>
* This implementation iterates over the elements of this list, checking each element in
* turn to see if it's contained in <code>coll</code>. If it's not contained, it's removed
* from this list. As a consequence, it is advised to use a collection type for
* <code>coll</code> that provides a fast (e.g. O(1)) implementation of
* {@link Collection#contains(Object)}.
*/ | 0 |
CreateUpdateEntitiesResult creationResult = metadataService.createEntities(entitiesJson.toString());
Map<String,String> guidMap = creationResult.getGuidMapping().getGuidAssignments();
Map<Id, Referenceable> referencedObjects = findReferencedObjects(entity); | 0 |
* Copyright (c) OSGi Alliance (2000, 2012). All Rights Reserved.
* An {@code InvalidSyntaxException} object indicates that a filter string
* parameter has an invalid syntax and cannot be parsed. See {@link Filter} for
* a description of the filter string syntax.
* @version $Id: 8820ca2db85b557cef8da09ee861249dfb5ee914 $
* This method creates an {@code InvalidSyntaxException} object with the
* specified message and the filter string which generated the exception.
super(message(msg, filter));
* This method creates an {@code InvalidSyntaxException} object with the
* specified message and the filter string which generated the exception.
super(message(msg, filter), cause);
* Return message string for super constructor.
*/
private static String message(String msg, String filter) {
if ((msg == null) || (filter == null) || msg.indexOf(filter) >= 0) {
return msg;
}
return msg + ": " + filter;
}
/**
* @see BundleContext#getServiceReferences(Class, String)
* @see BundleContext#getServiceReferences(String, String)
* Returns the cause of this exception or {@code null} if no cause was set.
* @return The cause of this exception or {@code null} if no cause was set. | 0 |
import org.apache.commons.jelly.JellyTagException;
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException {
throw new JellyTagException( "This tag must be nested within an Ant task tag" ); | 0 |
import org.apache.http.params.BasicHttpParams;
HttpParams params = new BasicHttpParams(); | 0 |
MouseEvent mevent = (MouseEvent)
((DocumentEvent)elmt.getOwnerDocument()).createEvent("MouseEvents"); | 1 |
/**
* 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.aurora.common.net.monitoring;
/**
* Monitors active connections between two hosts..
*
* @author William Farner
*/
public interface ConnectionMonitor<K> {
/**
* Instructs the monitor that a connection was established.
*
* @param connectionKey Key for the host that a connection was established with.
*/
public void connected(K connectionKey);
/**
* Informs the monitor that a connection was released.
*
* @param connectionKey Key for the host that a connection was released for.
*/
public void released(K connectionKey);
} | 0 |
if ( configurationManager.isLogEnabled( LogService.LOG_DEBUG ) )
{
configurationManager.log( LogService.LOG_DEBUG, "Running task " + task, null );
}
if ( configurationManager.isLogEnabled( LogService.LOG_DEBUG ) )
{
configurationManager.log( LogService.LOG_DEBUG, "Scheduling task " + update, null );
} | 0 |
import org.apache.beam.sdk.values.WindowingStrategy; | 0 |
if (commandCount <= i || i < 0) { // don't allow redoing this redo | 0 |
* @param dStart gradient start point, in user space
* @param dEnd gradient end point, in user space | 1 |
import static org.easymock.EasyMock.createNiceMock;
import static org.easymock.EasyMock.createStrictMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.apache.ambari.server.AmbariException;
import org.apache.ambari.server.state.CommandScriptDefinition;
import org.apache.ambari.server.state.ComponentInfo;
import org.apache.ambari.server.state.CustomCommandDefinition;
import org.apache.ambari.server.state.PropertyInfo;
import org.apache.ambari.server.state.ServiceInfo;
import org.apache.ambari.server.state.ServiceOsSpecific;
import org.junit.Test;
assertEquals(4, properties.size()); | 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 |
* <pre><code>
* </code></pre> | 0 |
import org.apache.beam.runners.direct.DirectGroupByKey.DirectGroupAlsoByWindow;
import org.apache.beam.runners.direct.DirectGroupByKey.DirectGroupByKeyOnly;
import org.apache.beam.sdk.util.WindowingStrategy;
import org.apache.beam.sdk.values.TupleTag;
import org.apache.beam.sdk.values.TupleTagList;
p
.apply(Create.of(KV.of("foo", 3)))
.apply(new DirectGroupByKeyOnly<String, Integer>())
.apply(
new DirectGroupAlsoByWindow<String, Integer>(
WindowingStrategy.globalDefault(), WindowingStrategy.globalDefault()));
TupleTag<KeyedWorkItem<String, KV<String, Integer>>> keyedTag = new TupleTag<>();
.apply(new DirectGroupByKeyOnly<String, WindowedValue<KV<String, Integer>>>())
.apply(
new DirectGroupAlsoByWindow<String, WindowedValue<KV<String, Integer>>>(
WindowingStrategy.globalDefault(), WindowingStrategy.globalDefault()))
.apply(
ParDo.of(new ParDoMultiOverrideFactory.ToKeyedWorkItem<String, Integer>())
.withOutputTags(keyedTag, TupleTagList.empty()))
.get(keyedTag) | 0 |
if (Files.isDirectory(child)) {
} else if (Files.isRegularFile(child)) {
if (Files.isRegularFile(child)) { | 0 |
BufferedImage img = createImage(w, h);
* Creates a new image of the specified dimension.
* @param w the width of the image
* @param h the height of the image
*/
public abstract BufferedImage createImage(int w, int h);
/** | 0 |
* @see "<a href='http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1'>Chapter 17.13.4 'Form content types'</a>" | 0 |
import org.apache.accumulo.core.Constants;
byte[] bytes = output.getBytes(Constants.UTF8);
byte[] len = String.format("%6s#", Integer.toString(bytes.length, 36)).getBytes(Constants.UTF8);
String strLen = new String(len, Constants.UTF8);
String strFields = new String(bytes, Constants.UTF8); | 0 |
final String requestURI = UriUtils.concat(this.requestInfo.servletPath, this.requestInfo.pathInfo);
final String requestURI = UriUtils.concat(this.requestInfo.servletPath, this.requestInfo.pathInfo); | 0 |
label = label + "[" + listener.getCreatedDirectories().size() +
" " + listener.getChangedDirectories().size() +
" " + listener.getDeletedDirectories().size() +
" " + listener.getCreatedFiles().size() +
" " + listener.getChangedFiles().size() +
" " + listener.getDeletedFiles().size() + "]"; | 0 |
import org.apache.ambari.view.pig.utils.BadRequestFormattedException;
import org.apache.ambari.view.pig.utils.NotFoundFormattedException;
import org.junit.rules.ExpectedException;
@Rule public ExpectedException thrown = ExpectedException.none();
thrown.expect(NotFoundFormattedException.class);
scriptService.getScript("4242");
thrown.expect(NotFoundFormattedException.class);
scriptService.getScript(createdScriptId); | 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.27 $ $Date: 2004/02/28 13:32:54 $ | 0 |
import java.nio.charset.StandardCharsets;
Scanner file = new Scanner(new File(filename), StandardCharsets.UTF_8.name());
result.add(decode ? new Text(Base64.decodeBase64(line.getBytes(StandardCharsets.UTF_8))) : new Text(line)); | 0 |
* Copyright (C) 2015 Google Inc. | 0 |
/** Table schema for KafkaIO. */ | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestAll.java,v 1.9 2003/04/16 18:32:38 rwaldhoff Exp $
* @version $Revision: 1.9 $ $Date: 2003/04/16 18:32:38 $
suite.addTest(TestCollectionCharCollection.suite());
suite.addTest(TestCharCollectionCollection.suite());
suite.addTest(TestCharListList.suite());
suite.addTest(TestListCharList.suite());
suite.addTest(TestIteratorCharIterator.suite());
suite.addTest(TestListIteratorCharListIterator.suite());
suite.addTest(TestCharIteratorIterator.suite());
suite.addTest(TestCharListIteratorListIterator.suite());
| 0 |
svg12Factories.put(SVG12Constants.SVG_HANDLER_TAG,
new HandlerElementFactory());
/**
* To create a 'handler' element.
*/
protected static class HandlerElementFactory
implements ElementFactory {
public HandlerElementFactory() {
}
/**
* Creates an instance of the associated element type.
*/
public Element create(String prefix, Document doc) {
return new SVGOMHandlerElement(prefix, (AbstractDocument)doc);
}
}
| 0 |
public long expirationTime(final Integer key, final String value) {
public PassiveExpiringMapTest(final String testName) {
final Map<Integer, String> m = new HashMap<Integer, String>();
final Map<Integer, String> m = new PassiveExpiringMap<Integer, String>(
final Map<String, String> map = null;
} catch (final IllegalArgumentException ex) {
final ExpirationPolicy<String, String> policy = null;
} catch (final IllegalArgumentException ex) {
final TimeUnit unit = null;
} catch (final IllegalArgumentException ex) {
final Map<Integer, String> m = makeTestMap();
final Map<Integer, String> m = makeTestMap();
final Map<Integer, String> m = makeDecoratedTestMap();
final Map<Integer, String> m = makeTestMap();
final Map<Integer, String> m = makeTestMap();
final Map<Integer, String> m = makeTestMap();
final Map<Integer, String> m = makeTestMap();
final Map<Integer, String> m = makeTestMap();
final PassiveExpiringMap<String, String> m = new PassiveExpiringMap<String, String>( | 0 |
/*
* $HeadURL$
* $Revision$
* $Date$
* ====================================================================
* 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.
* ====================================================================
*
* 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.client.utils;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
public class TestAllUtils extends TestCase {
public TestAllUtils(String testName) {
super(testName);
}
public static Test suite() {
TestSuite suite = new TestSuite();
suite.addTest(TestURLEncodedUtils.suite());
return suite;
}
public static void main(String args[]) {
String[] testCaseName = { TestAllUtils.class.getName() };
junit.textui.TestRunner.main(testCaseName);
}
} | 0 |
package org.apache.sshd.client.auth; | 0 |
import com.google.api.client.util.BackOff;
import com.google.api.client.util.BackOffUtils;
import com.google.api.client.util.Sleeper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(BigQueryTableRowIterator.class);
// The maximum number of times a BigQuery request will be retried
private static final int MAX_RETRIES = 3;
// Initial wait time for the backoff implementation
private static final int INITIAL_BACKOFF_MILLIS = 1000;
} catch (IOException | InterruptedException e) {
private void readNext() throws IOException, InterruptedException {
Sleeper sleeper = Sleeper.DEFAULT;
BackOff backOff = new AttemptBoundedExponentialBackOff(MAX_RETRIES, INITIAL_BACKOFF_MILLIS);
TableDataList result = null;
while (true) {
try {
result = list.execute();
break;
} catch (IOException e) {
LOG.error("Error reading from BigQuery table {} of dataset {} : {}", ref.getTableId(),
ref.getDatasetId(), e.getMessage());
if (!BackOffUtils.next(sleeper, backOff)) {
LOG.error("Aborting after {} retries.", MAX_RETRIES);
throw e;
}
}
}
private void open() throws IOException, InterruptedException {
Sleeper sleeper = Sleeper.DEFAULT;
BackOff backOff = new AttemptBoundedExponentialBackOff(MAX_RETRIES, INITIAL_BACKOFF_MILLIS);
Table table = null;
while (true) {
try {
table = get.execute();
break;
} catch (IOException e) {
LOG.error("Error opening BigQuery table {} of dataset {} : {}", ref.getTableId(),
ref.getDatasetId(), e.getMessage());
if (!BackOffUtils.next(sleeper, backOff)) {
LOG.error("Aborting after {} retries.", MAX_RETRIES);
throw e;
}
}
}
| 0 |
import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
import org.ow2.chameleon.testing.helpers.IPOJOHelper;
import org.ow2.chameleon.testing.helpers.OSGiHelper;
mavenBundle().groupId( "org.apache.felix" ).artifactId( "org.apache.felix.log" ).version(asInProject()),
mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
.build( withiPOJO(new File(tmp, "provider.jar"), new File("component.xml")))
| 0 |
@Deprecated
@Deprecated | 0 |
import java.util.stream.Collectors;
public static List<FieldValueTypeInformation> sortBySchema(
List<FieldValueTypeInformation> types, Schema schema) {
Map<String, FieldValueTypeInformation> typeMap =
types
.stream()
.collect(Collectors.toMap(FieldValueTypeInformation::getName, Function.identity()));
return schema
.getFields()
.stream()
.map(f -> typeMap.get(f.getName()))
.collect(Collectors.toList());
}
Class<?> clazz, FieldValueTypeSupplier fieldValueTypeSupplier) {
for (FieldValueTypeInformation type : fieldValueTypeSupplier.get(clazz)) {
Schema.FieldType fieldType = fieldFromType(type.getType(), fieldValueTypeSupplier);
TypeDescriptor type, FieldValueTypeSupplier fieldValueTypeSupplier) {
return FieldType.array(fieldFromType(component, fieldValueTypeSupplier));
return FieldType.array(fieldFromType(TypeDescriptor.of(params[0]), fieldValueTypeSupplier));
FieldType keyType = fieldFromType(TypeDescriptor.of(params[0]), fieldValueTypeSupplier);
FieldType valueType = fieldFromType(TypeDescriptor.of(params[1]), fieldValueTypeSupplier);
return FieldType.row(schemaFromClass(type.getRawType(), fieldValueTypeSupplier)); | 0 |
import org.apache.http.client.methods.HttpRequestWrapper;
private final boolean allowHeadResponseCaching;
this.allowHeadResponseCaching = config.isHeadResponseCachingEnabled();
new CacheInvalidator(uriExtractor, storage, config.isHeadResponseCachingEnabled()));
if (resource == null) {
return false;
}
contentLength, resource.length());
variantMap,
allowHeadResponseCaching ? src.getRequestMethod() : null);
originResponse,
allowHeadResponseCaching);
originResponse,
allowHeadResponseCaching);
resource,
allowHeadResponseCaching ? request.getRequestLine().getMethod() : null);
return responseGenerator.generateResponse(HttpRequestWrapper.wrap(request, host), entry); | 0 |
package org.w3c.dom.svg;
public interface SVGLocatable {
public SVGElement getNearestViewportElement( );
public SVGElement getFarthestViewportElement( );
public SVGRect getBBox ( );
public SVGMatrix getCTM ( );
public SVGMatrix getScreenCTM ( );
public SVGMatrix getTransformToElement ( SVGElement element )
throws SVGException;
} | 0 |
import org.apache.sshd.util.EchoShell;
sshd = Utils.setupTestServer();
client = Utils.setupTestClient();
TestEchoShell.latch = new CountDownLatch(1);
TestEchoShell.latch.await();
TestEchoShell.latch = null;
}
public static class TestEchoShell extends EchoShell {
public static CountDownLatch latch;
@Override
public void destroy() {
if (latch != null) {
latch.countDown();
super.destroy(); | 0 |
import java.io.Serializable;
import org.apache.beam.sdk.util.SerializableUtils;
public static <InT, OutT extends Serializable> SerializableFunction<InT, OutT> clonesOf(
final OutT base) {
return new SerializableFunction<InT, OutT>() {
@Override
public OutT apply(InT input) {
return SerializableUtils.clone(base);
}
};
}
| 0 |
* Returns the bounding box of the specified glyph, considering only the
* glyph's metrics (ascent, descent, advance) rather than the actual glyph
* shape.
*/
public Rectangle2D getGlyphCellBounds(int glyphIndex) {
return getGlyphLogicalBounds(glyphIndex).getBounds2D();
}
/** | 0 |
import java.util.*;
import javax.servlet.*;
import org.apache.felix.webconsole.*;
import org.apache.felix.webconsole.internal.*;
import org.osgi.framework.*;
| 0 |
@Override
@Override
@Override | 0 |
import org.apache.xml.security.utils.XMLUtils;
_builder = XMLUtils.createDocumentBuilder(false); | 0 |
import org.apache.http.impl.io.HttpTransportMetricsImpl;
import org.apache.http.impl.nio.reactor.SessionOutputBuffer;
public LengthDelimitedEncoder(
final WritableByteChannel channel,
final SessionOutputBuffer buffer,
final HttpTransportMetricsImpl metrics,
long contentLength) {
super(channel, buffer, metrics);
}
if (bytesWritten > 0) {
this.metrics.incrementBytesTransferred(bytesWritten);
}
if (bytesWritten > 0) {
this.metrics.incrementBytesTransferred(bytesWritten);
} | 0 |
package org.apache.commons.dbcp2; | 1 |
depth = Integer.MAX_VALUE; | 0 |
InputT,
WindowInT,
KeyInT,
K,
OutputT,
OperatorT extends StateAwareWindowWiseSingleInputOperator<InputT, WindowInT, KeyInT, K, OutputT, W, OperatorT>>
extends StateAwareWindowWiseOperator<InputT, WindowInT, KeyInT, K, OutputT, W, OperatorT> {
protected final Dataset<InputT> input;
private final Dataset<OutputT> output;
Dataset<InputT> input,
UnaryFunction<KeyInT, K> extractor,
@Nullable Windowing<WindowInT, W> windowing,
public Collection<Dataset<InputT>> listInputs() {
public Dataset<InputT> input() {
public Dataset<OutputT> output() { | 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 |
} else if (context.window().maxTimestamp().isBefore(inputWM)) {
if (eowHold.isBefore(inputWM)) {
Preconditions.checkState(!gcHold.isBefore(inputWM), | 0 |
* Copyright (c) 2004 The Apache Software Foundation. All rights | 0 |
import org.apache.commons.beanutils.expression.Resolver;
* @see Resolver
*
* @deprecated The notation used for property name expressions is now
* dependant on the {@link Resolver} implementation being used.
*
* @deprecated The notation used for property name expressions is now
* dependant on the {@link Resolver} implementation being used.
*
* @deprecated The notation used for property name expressions is now
* dependant on the {@link Resolver} implementation being used.
*
* @deprecated The notation used for property name expressions is now
* dependant on the {@link Resolver} implementation being used.
*
* @deprecated The notation used for property name expressions is now
* dependant on the {@link Resolver} implementation being used. | 0 |
import org.apache.cocoon.util.log.DeprecationLogger;
// Get the "command" attribute
String actionCommand = DomHelper.getAttribute(widgetElement, "command", null);
// If unspecified, check the deprecated "action-command" deprecated attribute
if (actionCommand == null) {
actionCommand = DomHelper.getAttribute(widgetElement, "action-command", null);
if (actionCommand != null) {
DeprecationLogger.log("The 'action-command' attribute is deprecated and replaced by 'command', at " +
DomHelper.getLocation(widgetElement));
}
}
if (actionCommand == null) {
throw new Exception("Missing attribute 'command' at " + DomHelper.getLocation(widgetElement));
}
super.setupDefinition(widgetElement, definition);
definition.makeImmutable(); | 0 |
import java.util.NavigableMap;
public static final Set<PtyMode> MODES =
Collections.unmodifiableSet(EnumSet.allOf(PtyMode.class));
private static final NavigableMap<Integer, PtyMode> COMMANDS =
Collections.unmodifiableNavigableMap(
GenericUtils.toSortedMap(MODES, PtyMode::toInt, Function.identity(), Comparator.naturalOrder())); | 0 |
DoFnOperator<InputT, OutputT> createDoFnOperator(
DoFnOperator<InputT, OutputT> doFnOperator =
DoFnOperator<InputT, OutputT> doFnOperator =
public DoFnOperator<InputT, OutputT> createDoFnOperator(
OutputT> createDoFnOperator( | 0 |
final boolean release = obtainReadLock();
if ( release )
{
releaseReadLock();
}
final boolean release = obtainReadLock();
if ( release )
{
releaseReadLock();
} | 0 |
implements ImageOperation {
private String prefix;
private boolean enabled;
private float shearX;
private float shearY;
public void setPrefix( String prefix ) {
this.prefix = prefix;
public void setup( Parameters params ) {
enabled = params.getParameterAsBoolean( prefix + "enabled", true);
shearX = params.getParameterAsFloat( prefix + "shear-x", 0.0f );
shearY = params.getParameterAsFloat( prefix + "shear-y", 0.0f );
public WritableRaster apply( WritableRaster image ) {
if( ! enabled ) {
}
AffineTransform shear = AffineTransform.getShearInstance( shearX, shearY );
public String getKey() {
+ ( enabled ? "enable" : "disable" )
+ ":" + shearX
+ ":" + shearY
+ ":" + prefix; | 0 |
// version 0 of the uberSpect is an illusion due to order of construction; no need to clear cache
if (version > 0) {
script.clearCache();
}
return execute(context); | 0 |
*
public class WebdavFileNameParser extends HttpFileNameParser {
public WebdavFileNameParser() {
public static FileNameParser getInstance() { | 1 |
final CacheTestSuite suite = new CacheTestSuite(new NullFilesCacheTestCase()); | 1 |
import org.apache.accumulo.examples.wikisearch.ingest.WikipediaInputFormat;
import org.apache.accumulo.examples.wikisearch.ingest.WikipediaInputFormat.WikipediaInputSplit;
conf.set(WikipediaConfiguration.NUM_GROUPS, "1");
WikipediaInputSplit split = new WikipediaInputSplit(new FileSplit(tmpFile, 0, fs.pathToFile(tmpFile).length(), null),0); | 0 |
import org.apache.accumulo.server.fs.VolumeChooserEnvironmentImpl;
VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironmentImpl(tableInfo.tableId,
endRow, master.getContext()); | 0 |
import org.apache.hc.core5.annotation.NotThreadSafe;
import org.apache.hc.core5.util.Args; | 1 |
* @throws IllegalArgumentException
* @throws IllegalArgumentException | 0 |
import org.apache.http.client.AuthState; | 0 |
public Mname(SchedulerCore scheduler) { | 0 |
import com.twitter.common.zookeeper.testing.ZooKeeperTestServer;
ZooKeeperTestServer zooKeeperServer = new ZooKeeperTestServer(0, shutdownRegistry);
zooKeeperServer.startNetwork();
LOG.info("Embedded zookeeper cluster started on port " + zooKeeperServer.getPort());
return zooKeeperServer.createClient(zooKeeperSessionTimeout.get(), credentials); | 0 |
zkAdmin.reconfigure(joiners, null, null, -1, new Stat()); | 0 |
import org.apache.atlas.repository.store.graph.v2.AtlasEntityChangeNotifier;
import org.apache.atlas.repository.store.graph.v2.AtlasGraphUtilsV2;
List<String> glossaryGuids = AtlasGraphUtilsV2.findEntityGUIDsByType(GlossaryUtils.ATLAS_GLOSSARY_TYPENAME, sortOrder);
AtlasVertex vertex = AtlasGraphUtilsV2.findByUniqueAttributes(atlasTypeRegistry.getEntityTypeByName(GlossaryUtils.ATLAS_GLOSSARY_TYPENAME), new HashMap<String, Object>() {{
AtlasVertex vertex = AtlasGraphUtilsV2.findByUniqueAttributes(atlasTypeRegistry.getEntityTypeByName(GlossaryUtils.ATLAS_GLOSSARY_TERM_TYPENAME), new HashMap<String, Object>() {{
AtlasVertex vertex = AtlasGraphUtilsV2.findByUniqueAttributes(atlasTypeRegistry.getEntityTypeByName(GlossaryUtils.ATLAS_GLOSSARY_CATEGORY_TYPENAME), new HashMap<String, Object>() {{ | 1 |
import javax.xml.parsers.ParserConfigurationException;
import org.apache.xml.security.c14n.CanonicalizationException;
import org.apache.xml.security.c14n.InvalidCanonicalizerException;
import org.apache.xml.security.c14n.implementations.Canonicalizer20010315ExclOmitComments;
import org.apache.xml.security.signature.XMLSignatureInput;
import org.apache.xml.security.transforms.TransformSpi;
import org.apache.xml.security.transforms.Transforms;
import org.w3c.dom.Element;
return implementedTransformURI; | 0 |
* @version $Id$ | 0 |
/**
* Initialize the form by recursively initializing all its children. Any events occuring within the
* initialization phase are buffered and fired after initialization is complete, so that any action
* from a widget on another one occurs after that other widget has been given the opportunity to
* initialize itself.
*/
public void initialize() {
try {
// Start buffering events
this.bufferEvents = true;
super.initialize();
// Fire events, still buffering them: this ensures they will be handled in the same
// order as they were added.
fireEvents();
} finally {
// Stop buffering events
this.bufferEvents = false;
}
}
public WidgetDefinition getDefinition() { | 0 |
import org.apache.accumulo.fate.zookeeper.ZooReader;
DistributedTrace.enable(instance, new ZooReader(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut()), "shell", InetAddress.getLocalHost()
.getHostName()); | 1 |
import org.ops4j.pax.exam.junit.PaxExam;
@RunWith(PaxExam.class) | 0 |
import org.apache.accumulo.core.util.TableDiskUsage.Printer;
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws IOException, TableNotFoundException {
TableDiskUsage.printDiskUsage(acuConf, tablesToFlush, FileSystem.get(new Configuration()), shellState.getConnector(), new Printer() {
@Override
public void print(String line) {
try {
shellState.getReader().printString(line + "\n");
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
}); | 0 |
private static final Map<String, String> configTagVersion2Properties = new HashMap<String, String>() {
{
put("hive.server2.thrift.port", "10010");
}
};
}).times(3);
expect(configHelper.getEffectiveDesiredTags(EasyMock.anyObject(Cluster.class), EasyMock.eq("h1"))).andReturn(new HashMap<String, Map<String, String>>() {
{
put("hive-site", new HashMap<String, String>() {
{
put("tag", configTagVersion2);
}
});
}
}).times(2);
}).times(1);
expect(configHelper.getEffectiveConfigProperties(EasyMock.anyObject(Cluster.class), EasyMock.anyObject(Map.class))).andReturn(
new HashMap<String, Map<String, String>>() {
{
put("hive-site", configTagVersion2Properties);
}
}).times(2);
private void setupConfigHelper() {
}
newConfig.setProperties(configTagVersion2Properties);
Map<String, Map<String, String>> configurations = executionCommand.getConfigurations();
assertEquals("10010", configurations.get("hive-site").get("hive.server2.thrift.port")); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//cli/src/java/org/apache/commons/cli/BasicParser.java,v 1.5 2003/10/09 20:57:01 rdonkin Exp $
* $Revision: 1.5 $
* $Date: 2003/10/09 20:57:01 $
* any, must include the following acknowledgement:
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
* permission of the Apache Software Foundation. | 0 |
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.extension.svg;
import org.w3c.dom.Node;
import org.apache.batik.dom.AbstractDocument;
import org.apache.batik.extension.PrefixableStylableExtensionElement;
/**
* This class implements a regular polygon extension to SVG
*
* @author <a href="mailto:[email protected]">Thomas DeWeese</a>
* @version $Id$
*/
public class FlowRegionBreakElement
extends PrefixableStylableExtensionElement
implements BatikExtConstants {
/**
* Creates a new BatikRegularPolygonElement object.
*/
protected FlowRegionBreakElement() {
}
/**
* Creates a new BatikRegularPolygonElement object.
* @param prefix The namespace prefix.
* @param owner The owner document.
*/
public FlowRegionBreakElement(String prefix, AbstractDocument owner) {
super(prefix, owner);
}
/**
* <b>DOM</b>: Implements {@link org.w3c.dom.Node#getLocalName()}.
*/
public String getLocalName() {
return BATIK_EXT_FLOW_REGION_BREAK_TAG;
}
/**
* <b>DOM</b>: Implements {@link org.w3c.dom.Node#getNamespaceURI()}.
*/
public String getNamespaceURI() {
return BATIK_EXT_NAMESPACE_URI;
}
/**
* Returns a new uninitialized instance of this object's class.
*/
protected Node newNode() {
return new FlowRegionBreakElement();
}
} | 0 |
import org.apache.beam.sdk.values.Row;
@Override public BeamSqlPrimitive evaluate(Row inputRow, BoundedWindow window) { | 0 |
* @version $Revision$ | 0 |
private final WatermarkPolicyFactory watermarkPolicyFactory;
WatermarkPolicyFactory watermarkPolicyFactory,
watermarkPolicyFactory,
WatermarkPolicyFactory watermarkPolicyFactory,
this.watermarkPolicyFactory = watermarkPolicyFactory;
watermarkPolicyFactory,
watermarkPolicyFactory, | 0 |
*
* natural order, as per {@link java.util.Collections#reverseOrder()}.
*
*
*
* Returns <code>true</code> iff <i>that</i> Object is
* is a {@link Comparator} whose ordering is known to be
* equals <code>this.getClass()</code>, and the underlying
* | 0 |
import org.junit.jupiter.api.BeforeEach;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
@BeforeEach
@org.junit.jupiter.api.Test
@org.junit.jupiter.api.Test
@org.junit.jupiter.api.Test
@org.junit.jupiter.api.Test
@org.junit.jupiter.api.Test
@org.junit.jupiter.api.Test
@org.junit.jupiter.api.Test
@org.junit.jupiter.api.Test
@org.junit.jupiter.api.Test
@org.junit.jupiter.api.Test
myNodeCount > 0 && myNodeCount == nodeCount, "Node count mismatches" | 0 |
package org.apache.commons.vfs2;
* @throws org.apache.commons.vfs2.FileSystemException
* @see org.apache.commons.vfs2.FileContent#getAttribute | 1 |
Thread.sleep(Math.min(timeRemaining, 500)); | 0 |
package org.apache.beam.sdk.runners.inprocess;
import org.apache.beam.sdk.Pipeline.PipelineVisitor;
import org.apache.beam.sdk.runners.TransformTreeNode;
import org.apache.beam.sdk.transforms.GroupByKey;
import org.apache.beam.sdk.transforms.PTransform;
import org.apache.beam.sdk.values.PValue; | 0 |
import org.apache.beam.sdk.transforms.DoFn.ProcessContinuation;
/** Whether this {@link DoFn} returns a {@link ProcessContinuation} or void. */
public abstract boolean hasReturnValue();
@Nullable TypeDescriptor<? extends BoundedWindow> windowT,
boolean hasReturnValue) {
windowT,
hasReturnValue); | 0 |
@Override
public void testDefaultPrecision() {
testPrecision("-rw-r--r-- 78440 49231 127671 Jul 22 2010 Filename with whitespace.jpg", CalendarUnit.DAY_OF_MONTH);
}
@Override
public void testRecentPrecision() {
testPrecision("-rw-r--r-- 78440 49231 127671 Jul 22 14:51 Filename with whitespace.jpg", CalendarUnit.MINUTE);
}
| 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 |
* @version $Id$ | 0 |
/*
* Copyright 2000-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 |
import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.Point2D; | 0 |
import org.apache.http.impl.conn.PoolingClientConnectionManager;
PoolingClientConnectionManager cm = new PoolingClientConnectionManager(); | 0 |
import com.google.cloud.dataflow.sdk.options.PipelineOptions;
import com.google.cloud.dataflow.sdk.util.BatchModeExecutionContext;
import org.junit.Before;
private PipelineOptions options;
@Before
public void setUp() {
options = PipelineOptionsFactory.create();
}
options,
BatchModeExecutionContext.fromOptions(options))) {
DataflowExecutionContext context = BatchModeExecutionContext.fromOptions(options);
MapTaskExecutorFactory.create(options, mapTask, context)) {
Operation operation = MapTaskExecutorFactory.createOperation(options,
createReadInstruction("Read"), BatchModeExecutionContext.fromOptions(options),
Operation operation = MapTaskExecutorFactory.createOperation(options,
instruction, BatchModeExecutionContext.fromOptions(options), priorOperations, counterPrefix,
DataflowExecutionContext context = BatchModeExecutionContext.fromOptions(options);
Operation operation = MapTaskExecutorFactory.createOperation(options,
Operation operation = MapTaskExecutorFactory.createOperation(options,
instruction, BatchModeExecutionContext.fromOptions(options), priorOperations, counterPrefix,
Operation operation = MapTaskExecutorFactory.createOperation(options,
instruction, BatchModeExecutionContext.fromOptions(options), priorOperations, counterPrefix, | 0 |
for (Entry<Object, Object> entry : src.entrySet()) | 0 |
IOChannelUtils.registerIOFactoriesAllowOverride(options);
IOChannelUtils.registerIOFactoriesAllowOverride(options);
IOChannelUtils.registerIOFactoriesAllowOverride(options); | 0 |
NumberType<Long> filesPendingFormat = new NumberType<>(Long.valueOf(0), Long.valueOf(2 * totalWorkQueueSize), Long.valueOf(0), | 1 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//fileupload/src/java/org/apache/commons/fileupload/FileUpload.java,v 1.22 2003/06/01 17:33:24 martinc Exp $
* $Revision: 1.22 $
* $Date: 2003/06/01 17:33:24 $
* @version $Id: FileUpload.java,v 1.22 2003/06/01 17:33:24 martinc Exp $ | 0 |
/**
* The {@code getNull} string prefix.
* @since 1.4
*/
private static final String GET_NULL_PREFIX = "getNull";
if (methodName.startsWith(GET_NULL_PREFIX)) {
String normalName = "get" + methodName.substring(GET_NULL_PREFIX.length()); | 0 |
package org.apache.accumulo.tserver; | 1 |
@SuppressWarnings({"unchecked", "serial", "rawtypes", "unused"}) public class GCStatus implements org.apache.thrift.TBase<GCStatus, GCStatus._Fields>, java.io.Serializable, Cloneable, Comparable<GCStatus> {
public enum _Fields implements org.apache.thrift.TFieldIdEnum { | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.