Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
/*
* 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.
*/
public class SynchronizedIterator<K extends WritableComparable<?>,V extends Writable> implements SortedKeyValueIterator<K,V> {
public SynchronizedIterator() {}
public SynchronizedIterator(SortedKeyValueIterator<K,V> source) { | 0 |
public BeamQueryPlanner(BeamSqlEnv sqlEnv, SchemaPlus schema) {
FrameworkConfig config =
Frameworks.newConfigBuilder()
.parserConfig(SqlParser.configBuilder().setLex(Lex.MYSQL).build())
.defaultSchema(schema)
.traitDefs(traitDefs)
.context(Contexts.EMPTY_CONTEXT)
.ruleSets(BeamRuleSets.getRuleSets(sqlEnv))
.costFactory(null)
.typeSystem(BeamRelDataTypeSystem.BEAM_REL_DATATYPE_SYSTEM)
.operatorTable(new ChainedSqlOperatorTable(sqlOperatorTables))
.build();
return PCollectionTuple.empty(basePipeline).apply(relNode.toPTransform()); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/java/org/apache/commons/beanutils/PropertyUtils.java,v 1.35 2002/12/01 22:38:27 rdonkin Exp $
* $Revision: 1.35 $
* $Date: 2002/12/01 22:38:27 $
* @version $Revision: 1.35 $ $Date: 2002/12/01 22:38:27 $
* to contain String-valued <strong>simple</strong> property names as the keys, pointing
* bean.<strong>Note</strong> that this method is intended to perform
* a "shallow copy" of the properties and so complex properties
* (for example, nested ones) will not be copied.</p> | 0 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(BigQueryIOTranslator.class);
// If user does not specify a project we assume the table to be located in the project
// that owns the Dataflow job.
String projectIdFromOptions = context.getPipelineOptions().getProject();
LOG.warn(String.format(BigQueryIO.SET_PROJECT_FROM_OPTIONS_WARNING, table.getDatasetId(),
table.getDatasetId(), table.getTableId(), projectIdFromOptions));
table.setProjectId(projectIdFromOptions);
// If user does not specify a project we assume the table to be located in the project
// that owns the Dataflow job.
String projectIdFromOptions = context.getPipelineOptions().getProject();
LOG.warn(String.format(BigQueryIO.SET_PROJECT_FROM_OPTIONS_WARNING, table.getDatasetId(),
table.getTableId(), projectIdFromOptions));
table.setProjectId(projectIdFromOptions); | 0 |
* href="../datasources/package-summary.html">jdbc2pool package documentation</a>
* @version $Id: DriverAdapterCPDS.java,v 1.3 2003/08/13 12:17:36 dirkv Exp $ | 0 |
public static String getDirectory(String subDir) {
final String userDir = System.getProperty("user.dir");
return getTestFilePath(userDir, subDir, "");
}
| 0 |
* HTTP protocol processor is a collection of protocol interceptors that
* implements the 'Chain of Responsibility' pattern, where each individual
* protocol interceptor is expected to work on a particular aspect of the HTTP
* protocol the interceptor is responsible for.
* <p>
* Usually the order in which interceptors are executed should not matter as
* long as they do not depend on a particular state of the execution context.
* If protocol interceptors have interdependencies and therefore must be
* executed in a particular order, they should be added to the protocol
* processor in the same sequence as their expected execution order.
* <p>
* Protocol interceptors must be implemented as thread-safe. Similarly to
* servlets, protocol interceptors should not use instance variables unless
* access to those variables is synchronized. | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.jexl.parser;
/**
* Base class for parser nodes - holds an 'image' of the token for later use.
*/
class JEXLNode {
/**
* Create the interpreter with the default settings.
*/
public JEXLNode() {
}
/** token value. */
public String image;
} | 0 |
cookie_value = ObjectModelHelper.getCookie(objectModel, cookie_name, -1).getValue();
// ignore
} | 0 |
import org.apache.http.params.HttpParamsLinker;
this.httpexecutor = new HttpRequestExecutor();
HttpParamsLinker.link(request, params);
HttpParamsLinker.link(response, params); | 0 |
import org.apache.sshd.util.test.NoIoTestCase;
import org.junit.experimental.categories.Category;
@Category({ NoIoTestCase.class }) | 0 |
import java.util.ArrayList;
static abstract class GetRanges<K, V> extends InputFormatBase<K,V> {
public static List<Range> getRanges(Configuration conf) throws IOException {
return InputFormatBase.getRanges(conf);
}
};
@Test
public void testSetRanges() throws IOException {
JobContext job = ContextFactory.createJobContext();
List<Range> ranges = new ArrayList<Range>();
for (int i = 0; i < 100000; i++) {
ranges.add(new Range(new Text(String.format("%05x", i))));
}
AccumuloInputFormat.setRanges(job.getConfiguration(), ranges);
List<Range> ranges2 = GetRanges.getRanges(job.getConfiguration());
assertEquals(ranges, ranges2);
} | 0 |
|| (ap.handleAuthentication(this, authPacket.getAuth())
!= KeeperException.Code.OK)) {
KeeperException.Code.AUTHFAILED.intValue());
KeeperException.Code.OK.intValue()); | 0 |
import java.util.Iterator;
import java.util.List;
import org.apache.cocoon.configuration.PropertyProvider;
protected String sitemapUri;
protected List directories;
protected boolean useDefaultIncludes;
protected Properties globalSitemapVariables;
protected MutableSettings createSettings() {
final BeanFactory parentBeanFactory = ((HierarchicalBeanFactory)this.beanFactory).getParentBeanFactory();
final Settings parent = (Settings)parentBeanFactory.getBean(Settings.ROLE);
if ( directories != null ) {
final Iterator i = directories.iterator();
while ( i.hasNext() ) {
final String directory = (String)i.next();
// now read all properties from the properties directory
this.readProperties(directory, properties);
// read all properties from the mode dependent directory
this.readProperties(directory + '/' + mode, properties);
}
}
// Next look for a custom property provider in the parent bean factory
if (parentBeanFactory != null && parentBeanFactory.containsBean(PropertyProvider.ROLE) ) {
try {
final PropertyProvider provider = (PropertyProvider)parentBeanFactory.getBean(PropertyProvider.ROLE);
final Properties providedProperties = provider.getProperties(s, mode, this.sitemapUri);
if ( providedProperties != null ) {
properties.putAll(providedProperties);
}
} catch (Exception ignore) {
this.logger.warn("Unable to get properties from provider.", ignore);
this.logger.warn("Continuing initialization.");
}
PropertyHelper.replaceAll(globalSitemapVariables, s); | 0 |
import org.apache.cocoon.objectmodel.ObjectModel;
import org.apache.cocoon.xml.NamespacesTable;
ObjectModel objectModel,
ExecutionContext executionContext, MacroContext macroContext, NamespacesTable namespaces,
ev = ev.execute(consumer, objectModel,
executionContext, macroContext, namespaces, startEvent, endEvent);
ev = call.execute(consumer, objectModel,
executionContext, macroContext, null, startEvent, endEvent);
ev = ev.execute(consumer, objectModel, executionContext,
macroContext, namespaces, startEvent, endEvent);
Instruction si, ObjectModel objectModel,
ExecutionContext executionContext, MacroContext macroContext, NamespacesTable namespaces)
execute(builder, objectModel, executionContext, macroContext, namespaces, si.getNext(), si.getEndInstruction()); | 0 |
import static org.apache.felix.http.sslfilter.internal.SslFilterConstants.HDR_X_FORWARDED_PORT;
@Test
public void test_getServerPort() throws Exception
{
HttpServletRequest req = Mockito.mock(HttpServletRequest.class);
SslFilterRequest sreq = new SslFilterRequest(req, null);
when(req.getHeader(HDR_X_FORWARDED_PORT)).thenReturn(null);
assertEquals(-1, sreq.getServerPort());
when(req.getHeader(HDR_X_FORWARDED_PORT)).thenReturn("");
assertEquals(-1, sreq.getServerPort());
when(req.getHeader(HDR_X_FORWARDED_PORT)).thenReturn("WRONG");
assertEquals(-1, sreq.getServerPort());
when(req.getHeader(HDR_X_FORWARDED_PORT)).thenReturn("W1");
assertEquals(-1, sreq.getServerPort());
when(req.getHeader(HDR_X_FORWARDED_PORT)).thenReturn("443");
assertEquals(443, sreq.getServerPort());
when(req.getHeader(HDR_X_FORWARDED_PORT)).thenReturn("80");
assertEquals(80, sreq.getServerPort());
when(req.getHeader(HDR_X_FORWARDED_PORT)).thenReturn("4502");
assertEquals(4502, sreq.getServerPort());
} | 0 |
/**
* The Ephemeral TLS Diffie-Hellman (DH) key size.
* Supported from Java 8.
*/
@Markdown(description = "The Ephemeral TLS Diffie-Hellman (DH) key size. Supported from Java 8.")
public static final ConfigurationProperty<Integer> TLS_EPHEMERAL_DH_KEY_SIZE = new ConfigurationProperty<>(
"security.server.tls.ephemeral_dh_key_size", 2048);
configsMap.put(TLS_EPHEMERAL_DH_KEY_SIZE.getKey(), getProperty(TLS_EPHEMERAL_DH_KEY_SIZE));
* @return Ephemeral TLS DH key size
*/
public int getTlsEphemeralDhKeySize() {
int keySize = NumberUtils.toInt(getProperty(TLS_EPHEMERAL_DH_KEY_SIZE));
if (keySize == 0) {
throw new IllegalArgumentException("Invalid " + TLS_EPHEMERAL_DH_KEY_SIZE + " " + getProperty(TLS_EPHEMERAL_DH_KEY_SIZE));
}
return keySize;
}
/** | 0 |
public static final ScannerOpts SOPTS = new ScannerOpts();
public static final BatchWriterOpts BWOPTS = new BatchWriterOpts();
| 0 |
package org.apache.batik.gvt.filter;
import org.apache.batik.ext.awt.image.GraphicsUtil; | 0 |
import org.apache.beam.sdk.transforms.DoFn;
/**
* Category tag for validation tests which utilize splittable {@link ParDo} with a {@link
* DoFn.BoundedPerElement} {@link DoFn}.
*/
public interface UsesBoundedSplittableParDo {} | 0 |
PTransformTranslation.toProto(transform, Collections.emptyList(), SdkComponents.create())
transform, Collections.emptyList(), SdkComponents.create()) | 0 |
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
import org.apache.beam.sdk.values.TimestampedValue;
import org.joda.time.Duration;
import org.joda.time.Instant;
import org.junit.Assert;
| 0 |
operator.setup();
operator.teardown(); | 0 |
import java.util.concurrent.Future;
import org.apache.hc.core5.concurrent.FutureCallback;
* Multi-core I/O reactor that can ask as both {@link ConnectionInitiator}
* and {@link ConnectionAcceptor}. Internally this I/O reactor distributes newly created
* I/O session equally across multiple I/O worker threads for a more optimal resource
* utilization and a better I/O performance. Usually it is recommended to have
* one worker I/O reactor per physical CPU core.
public class DefaultListeningIOReactor implements IOReactorService, ConnectionInitiator, ConnectionAcceptor {
* @param listenerThreadFactory the factory to create I/O dispatch threads.
* Can be {@code null}.
* @param listenerThreadFactory the factory to create listener thread.
final ThreadFactory dispatchThreadFactory,
final ThreadFactory listenerThreadFactory,
threads[i + 1] = (dispatchThreadFactory != null ? dispatchThreadFactory : DISPATCH_THREAD_FACTORY).newThread(new IOReactorWorker(dispatcher));
threads[0] = (listenerThreadFactory != null ? listenerThreadFactory : LISTENER_THREAD_FACTORY).newThread(new IOReactorWorker(listener));
this(eventHandlerFactory, config, null, null, sessionShutdownCallback);
this(eventHandlerFactory, null, null, null, null);
public Future<ListenerEndpoint> listen(final SocketAddress address, final FutureCallback<ListenerEndpoint> callback) {
return listener.listen(address, callback);
}
public Future<ListenerEndpoint> listen(final SocketAddress address) {
return listen(address, null);
@Override
public Future<IOSession> connect(
final TimeValue timeout,
final FutureCallback<IOSession> callback) throws IOReactorShutdownException {
return dispatchers[i].connect(remoteEndpoint, remoteAddress, localAddress, timeout, attachment, callback); | 0 |
* </p> | 0 |
//private String bundleVersion;
private String importPackage;
/*
*/
if (getImportPackage() != null) {
entries.put("Import-Package", getImportPackage());
}
/*
*/
public String getImportPackage() {
return importPackage;
}
public void setImportPackage(String importPackage) {
this.importPackage = importPackage;
}
| 0 |
import org.apache.ambari.server.ldap.LdapModule;
Injector injector = Guice.createInjector(new ControllerModule(), new MpackCheckerAuditModule(), new LdapModule()); | 0 |
@Override | 0 |
public static <J, K, U, V> TransformedMap<J, K, U, V> transformingMap(final Map<K, V> map,
final Transformer<? super J, ? extends K> keyTransformer,
final Transformer<? super U, ? extends V> valueTransformer) {
protected TransformedMap(final Map<K, V> map, final Transformer<? super J, ? extends K> keyTransformer,
final Transformer<? super U, ? extends V> valueTransformer) {
private void writeObject(final ObjectOutputStream out) throws IOException {
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
protected K transformKey(final J object) {
protected V transformValue(final U object) {
protected Map<K, V> transformMap(final Map<? extends J, ? extends U> map) {
final Map<K, V> result = new LinkedMap<K, V>(map.size());
for (final Map.Entry<? extends J, ? extends U> entry : map.entrySet()) {
protected V checkSetValue(final U value) {
public V put(final J key, final U value) {
public void putAll(final Map<? extends J, ? extends U> mapToCopy) { | 0 |
import org.apache.commons.configuration.event.ConfigurationErrorListener;
import org.apache.commons.configuration.event.ConfigurationListener;
import org.apache.commons.configuration.event.EventSource;
import org.easymock.EasyMock;
/**
* Tests asEventSource() if the passed in object implements this interface.
*/
@Test
public void testAsEventSourceSupported()
{
XMLConfiguration src = new XMLConfiguration();
assertSame("Wrong result", src, ConfigurationUtils.asEventSource(src, true));
}
/**
* Tests asEventSource() if an exception is expected.
*/
@Test(expected = ConfigurationRuntimeException.class)
public void testAsEventSourceNonSupportedEx()
{
ConfigurationUtils.asEventSource(this, false);
}
/**
* Tests asEventSource() if a mock object has to be returned.
*/
@Test
public void testAsEventSourceUnsupportedMock()
{
ConfigurationListener cl = EasyMock.createMock(ConfigurationListener.class);
ConfigurationErrorListener el = EasyMock.createMock(ConfigurationErrorListener.class);
EasyMock.replay(cl, el);
EventSource source = ConfigurationUtils.asEventSource(this, true);
source.addConfigurationListener(cl);
source.addErrorListener(el);
assertFalse("Wrong result (1)", source.removeConfigurationListener(cl));
assertFalse("Wrong result (2)", source.removeErrorListener(el));
source.addConfigurationListener(null);
} | 0 |
public static class TestContext extends MapContext implements JexlContext.NamespaceResolver { | 0 |
import com.google.common.collect.ImmutableSet;
ClassType(TypeSystem typeSystem, String name, String description, ImmutableSet<String> superTypes, int numFields) {
ClassType(TypeSystem typeSystem, String name, String description, ImmutableSet<String> superTypes, AttributeInfo... fields) | 0 |
while (n != null) {
getElementsByTagName(n, name, result);
n = n.getNextSibling();
}
while (n != null) {
getElementsByTagNameNS(n, namespaceURI, localName, result);
n = n.getNextSibling();
} | 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 |
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at | 0 |
import org.apache.accumulo.core.client.impl.Table;
public static TabletLocator getTabletLocator(Class<?> implementingClass, Configuration conf, Table.ID tableId) throws TableNotFoundException {
public static Map<String,Map<KeyExtent,List<Range>>> binOffline(Table.ID tableId, List<Range> ranges, Instance instance, Connector conn) | 1 |
/**
* TODO Add javadoc
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$
*/ | 0 |
import org.apache.batik.ext.awt.g2d.GraphicContext;
| 0 |
/**
* Abstract {@link NHttpMessageWriter} that serves as a base for all message
* writer implementations.
*
* @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
*
* @version $Revision$
*/
/**
* Creates an instance of this class.
*
* @param buffer the session output buffer.
* @param formatter the line formatter.
* @param params HTTP parameters.
*/
/**
* Writes out the first line of {@link HttpMessage}.
*
* @param message HTTP message.
* @throws HttpException in case of HTTP protocol violation
*/ | 0 |
import org.apache.beam.sdk.testing.TestPipeline;
public final TestPipeline p = TestPipeline.create(); | 0 |
// for debugging
@Override
public String toString() {
return super.toString() + " ACK " + _blockNumber;
} | 0 |
if(layout != null) {
}
clone.layout.setParent(clone); | 0 |
this.charSequence = charSequence != null ? charSequence : "";
if (length < 0 || offset < 0 || offset + length > array.length) {
int dest = (int)Math.min(charSequence.length(), idx + n); | 0 |
import org.apache.hadoop.metadata.repository.typestore.GraphBackedTypeStore;
this.typeStore = GraphBackedTypeStore.class; | 0 |
@Override | 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.hedwig.util;
public class Pair<T, U> {
private T x;
private U y;
public Pair(T x, U y) {
this.x = x;
this.y = y;
}
public static <T, U> Pair<T, U> of(T x, U y) {
return new Pair<T, U>(x, y);
}
public T first() {
return x;
}
public U second() {
return y;
}
} | 0 |
final byte[] bytes = "Message content".getBytes(Consts.ASCII.name());
final InputStream content = new ByteArrayInputStream(bytes);
final BasicHttpEntity httpentity = new BasicHttpEntity();
final byte[] bytes = "Message content".getBytes(Consts.ASCII.name());
final InputStream content = new ByteArrayInputStream(bytes);
final BasicHttpEntity httpentity = new BasicHttpEntity();
} catch (final IllegalStateException ex) {
} catch (final IllegalStateException ex) {
final byte[] bytes = "Message content".getBytes(Consts.ASCII.name());
final InputStream content = new ByteArrayInputStream(bytes);
final BasicHttpEntity httpentity = new BasicHttpEntity();
final byte[] bytes2 = out.toByteArray();
} catch (final IllegalStateException ex) {
} catch (final IllegalArgumentException ex) { | 0 |
log.debug("{} with {} iterations and {} threads and cache invalidates {}% took {} second(s)",
tableConf, iterations, numThreads, ((1. / randomMax) * 100.), (end - start) / 1000); | 0 |
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkState;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ArrayListMultimap;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ListMultimap;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Sets; | 0 |
import org.apache.accumulo.core.clientImpl.ClientConfConverter;
import org.apache.accumulo.core.clientImpl.ConnectorImpl;
import org.apache.accumulo.core.clientImpl.Credentials;
import org.apache.accumulo.core.clientImpl.Namespace;
import org.apache.accumulo.core.clientImpl.thrift.TableOperationExceptionType;
import org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException;
return ((ConnectorImpl) instance.getConnector(creds.getPrincipal(), creds.getToken()))
.getAccumuloClient();
org.apache.accumulo.core.clientImpl.thrift.SecurityErrorCode.INVALID_INSTANCEID); | 0 |
import org.apache.http.NotImplementedException;
@Test(expected = NotImplementedException.class) | 0 |
if (c.trigger().areAllSubtriggersFinished()) {
for (ExecutableTrigger<W> subTrigger : c.trigger().unfinishedSubTriggers()) {
for (ExecutableTrigger<W> subTrigger : c.trigger().subTriggers()) { | 0 |
@SuppressWarnings("deprecation")
KerberosToken krbToken = new KerberosToken(principal, rootUser.getKeytab(), true);
token = krbToken;
@SuppressWarnings("deprecation")
KerberosToken krbToken = new KerberosToken(systemUser.getPrincipal(), systemUser.getKeytab(), true);
Connector conn = cluster.getConnector(systemUser.getPrincipal(), krbToken); | 0 |
public enum BuiltinDigests implements DigestInformation, NamedFactory<Digest> {
md5(Constants.MD5, "MD5", 16),
sha1(Constants.SHA1, "SHA-1", 20),
sha256(Constants.SHA256, "SHA-256", 32),
sha384(Constants.SHA384, "SHA-384", 48),
sha512(Constants.SHA512, "SHA-512", 64);
private final String algorithm;
private final int blockSize;
public final String getAlgorithm() {
return algorithm;
}
@Override
public final int getBlockSize() {
return blockSize;
}
@Override
@Override
public final Digest create() {
return new BaseDigest(getAlgorithm(), getBlockSize());
}
BuiltinDigests(String factoryName, String algorithm, int blockSize) {
this.factoryName = factoryName;
this.algorithm = algorithm;
this.blockSize = blockSize; | 0 |
.withIsReady(elementsAllowed::get) | 0 |
values.put(CSSConstants.CSS_BLOCK_VALUE,
values.put(CSSConstants.CSS_COMPACT_VALUE,
values.put(CSSConstants.CSS_INLINE_VALUE,
values.put(CSSConstants.CSS_INLINE_TABLE_VALUE,
values.put(CSSConstants.CSS_LIST_ITEM_VALUE,
values.put(CSSConstants.CSS_MARKER_VALUE,
values.put(CSSConstants.CSS_NONE_VALUE,
values.put(CSSConstants.CSS_RUN_IN_VALUE,
values.put(CSSConstants.CSS_TABLE_VALUE,
values.put(CSSConstants.CSS_TABLE_CAPTION_VALUE,
values.put(CSSConstants.CSS_TABLE_CELL_VALUE,
values.put(CSSConstants.CSS_TABLE_COLUMN_VALUE,
values.put(CSSConstants.CSS_TABLE_COLUMN_GROUP_VALUE,
values.put(CSSConstants.CSS_TABLE_FOOTER_GROUP_VALUE,
values.put(CSSConstants.CSS_TABLE_HEADER_GROUP_VALUE,
values.put(CSSConstants.CSS_TABLE_ROW_VALUE,
values.put(CSSConstants.CSS_TABLE_ROW_GROUP_VALUE,
return false;
return CSSConstants.CSS_DISPLAY_PROPERTY; | 1 |
/*
import java.util.Enumeration;
public Enumeration getResources(String name)
{
try
{
return getClass().getClassLoader().getResources(name);
}
catch (IOException ex)
{
return null;
}
}
| 1 |
*
*
*
/**
| 1 |
import org.apache.felix.dm.Component;
Component consumer = m.createComponent().setImplementation(c).add(m.createBundleDependency().setCallbacks("add", "remove"));
Component consumerWithFilter = m.createComponent().setImplementation(new FilteredConsumer(e)).add(m.createBundleDependency().setFilter("(Bundle-SymbolicName=org.apache.felix.dependencymanager)").setCallbacks("add", "remove"));
Component consumerWithFilter = m.createComponent() | 0 |
public void close() throws IOException {
reader.close();
} | 0 |
import java.io.IOException;
FileUtils.deleteQuietly(reportDir);
if (!reportDir.mkdirs()) {
throw new IOException("Unable to (re-)create " + reportDir); | 0 |
import com.google.common.base.Joiner; | 0 |
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
private Map props;
props = new HashMap();
public void start() throws BundleException {
framework = new Felix(props, null);
framework.start();
while(framework.getState()!=Bundle.ACTIVE) {
framework.stopAndWait();
framework = null; | 0 |
import org.apache.accumulo.core.trace.TraceSamplers;
import org.apache.htrace.impl.ProbabilitySampler;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "path provided by admin")
ProbabilitySampler sampler = TraceSamplers.probabilitySampler(tracePercent); | 0 |
import static com.google.cloud.dataflow.sdk.util.common.Counter.AggregationKind.SUM;
import com.google.cloud.dataflow.sdk.util.common.Counter;
public static final String SOURCE_NAME = "GroupingShuffleSource";
@Nullable final CounterSet.AddCounterMutator addCounterMutator;
@Nullable final String operationName;
// Counts how many bytes were from by a given operation from a given shuffle session.
@Nullable Counter<Long> perOperationPerDatasetBytesCounter;
BatchModeExecutionContext executionContext,
CounterSet.AddCounterMutator addCounterMutator,
String operationName)
this.addCounterMutator = addCounterMutator;
this.operationName = operationName;
// We cannot initialize perOperationPerDatasetBytesCounter here, as it
// depends on shuffleReaderConfig, which isn't populated yet.
}
private synchronized void initCounter(String datasetId) {
if (perOperationPerDatasetBytesCounter == null
&& addCounterMutator != null
&& operationName != null) {
perOperationPerDatasetBytesCounter =
addCounterMutator.addCounter(
Counter.longs(
"dax-shuffle-" + datasetId + "-wf-" + operationName + "-read-bytes",
SUM));
}
ApplianceShuffleReader asr = new ApplianceShuffleReader(shuffleReaderConfig);
String datasetId = asr.getDatasetId();
initCounter(datasetId);
new ChunkingShuffleBatchReader(asr)));
if (GroupingShuffleReader.this.perOperationPerDatasetBytesCounter != null) {
GroupingShuffleReader.this.perOperationPerDatasetBytesCounter.addValue(byteSize);
} | 0 |
throw new IllegalStateException("An exception occurs during factory initialization", e); | 0 |
import org.junit.Assert; | 0 |
public SampleTransform() throws InvalidTransformException { | 0 |
* Java byte code version.
*/
private int m_version;
/**
m_version = ck.getClassVersion();
public int getClassVersion() {
return m_version;
} | 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.
* ====================================================================
*
* 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.hc.core5.http.nio.reactor;
import java.nio.channels.SelectionKey;
/**
* Type of I/O event notifications I/O sessions can declare interest in.
*
* @since 4.0
*/
public interface EventMask {
/**
* Interest in data input.
*/
public static final int READ = SelectionKey.OP_READ;
/**
* Interest in data output.
*/
public static final int WRITE = SelectionKey.OP_WRITE;
/**
* Interest in data input/output.
*/
public static final int READ_WRITE = READ | WRITE;
} | 1 |
import org.apache.accumulo.core.data.TabletID;
* @deprecated since 1.7.0 use {@link #getTablet()}
@Deprecated
public abstract org.apache.accumulo.core.data.KeyExtent getExtent();
/**
* @return tablet the scan is running against, if a batch scan may be one of many or null
* @since 1.7.0
*/
public abstract TabletID getTablet(); | 1 |
* Copyright 2003-2005 The Apache Software Foundation | 0 |
import org.apache.batik.dom.svg.XMLBaseSupport;
String baseURI = XMLBaseSupport.getXMLBase(ref); | 0 |
import org.apache.felix.ipojo.util.DependencyMetadataHelper;
int policy = DependencyMetadataHelper.getPolicy(service);
Comparator cmp = DependencyMetadataHelper.getComparator(service, getCompositeManager().getGlobalContext());
Comparator cmp = DependencyMetadataHelper.getComparator(imp, getCompositeManager().getGlobalContext());
Class spec = DependencyMetadataHelper.loadSpecification(specification, getCompositeManager().getGlobalContext());
int policy = DependencyMetadataHelper.getPolicy(imp); | 0 |
List<String> counterValues = new ArrayList<String>();
for (Exception ex : exceptions)
{
counterValues.add(ex.getMessage());
}
assertTrue("" + counterValues, exceptions.isEmpty()); | 0 |
import org.apache.atlas.model.typedef.AtlasStructDef; | 0 |
"at least one between 'className', 'attributeName' or 'creationFactory' has to be specified" ); | 0 |
import org.apache.beam.runners.core.construction.SerializablePipelineOptions;
private final SerializablePipelineOptions serializedOptions;
this.serializedOptions = new SerializablePipelineOptions(pipelineOptions);
serializedOptions.get(), restored.getValue()));
source.createReader(serializedOptions.get(), null);
serializedOptions.get(), | 0 |
public void removed(ServerSession session, Path path, boolean isDirectory, Throwable thrown) throws IOException { | 0 |
/*
* Copyright 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 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.osgi.framework.installer;
public interface Status
{
public void setText(String s);
} | 1 |
public class ByteOrderUtilsTest {
return ByteOrderUtils.parseByteOrder(value); | 0 |
*
*
package org.apache.commons.vfs2.provider.ftp.test;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemManager;
import org.apache.commons.vfs2.FileSystemOptions;
import org.apache.commons.vfs2.impl.DefaultFileSystemManager;
import org.apache.commons.vfs2.provider.ftp.FtpFileProvider;
import org.apache.commons.vfs2.provider.ftp.FtpFileSystemConfigBuilder;
import org.apache.commons.vfs2.test.AbstractProviderTestConfig;
import org.apache.commons.vfs2.test.ProviderTestConfig;
import org.apache.commons.vfs2.test.ProviderTestSuite; | 1 |
Job job = Job.getInstance(getConf()); | 0 |
import org.apache.beam.sdk.transforms.OldDoFn;
* {@link OldDoFn.ProcessContext} for {@link FlinkMultiOutputDoFnFunction} that supports
OldDoFn<InputT, OutputT> doFn, | 0 |
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
import org.apache.beam.sdk.transforms.windowing.GlobalWindow;
public void processElement(@Element T element, OutputReceiver<T> out,
BoundedWindow window) {
String message = prefix + element.toString();
if (!(window instanceof GlobalWindow)) {
message = message + " Window:" + window.toString();
}
LOGGER.info(message); | 0 |
public class Usage {
int m_stack = 0;
* List of used objects.
Object[] m_objects;
* Increment the statck level.
*/
public void inc() {
m_stack++;
}
/**
* Decrement the stack level.
* @return true if the stack is 0 after the decrement.
public boolean dec() {
m_stack--;
return m_stack == 0;
}
/**
* Clear the service object array.
*/
public void clear() {
m_objects = null;
}
} | 0 |
public interface Storage<T> { | 0 |
} else if (this.queryParams != null && !this.queryParams.isEmpty()) { | 0 |
* @version $Revision$ $Date$ | 0 |
@SuppressWarnings("unused")
@SuppressWarnings("unused")
@SuppressWarnings("unused")
@SuppressWarnings("unused") | 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.
* @version $Id: TestConnectionPool.java,v 1.13 2004/02/28 11:47:51 dirkv Exp $ | 0 |
org.apache.commons.logging.LogFactory.getLog(X509SKIResolver.class); | 0 |
package org.apache.xml.security.test.dom.c14n.helper; | 0 |
import java.util.Optional;
(task, jobState, storeProvider) -> Optional.empty(); | 0 |
* </p>
* </p>
* </p>
* </p>
* </p>
* </p> | 0 |
/* ====================================================================
* Copyright (c) 2001-2004 The Apache Software Foundation. All rights
* @version $Id: BulkTest.java,v 1.9 2004/01/14 21:34:31 scolebourne Exp $ | 0 |
public void process(ProcessContext context, OffsetRangeTracker tracker)
for (long i = tracker.currentRestriction().getFrom(); tracker.tryClaim(i); ++i) { | 0 |
* Helper to create a context. In the current implementation of JEXL, there
* is one implementation of JexlContext - {@link HashMapContext}, and there
* is no reason not to directly instantiate {@link HashMapContext} in your
* own application.
* @version $Id: JexlHelper.java,v 1.4 2004/06/12 23:53:17 tobrien Exp $
protected static JexlHelper getInstance()
{
return helper;
}
/**
* Returns a new {@link JexlContext}.
* @return a new JexlContext
*/
/**
* Creates and returns a new {@link JexlContext}. The current implementation
* creates a new instance of {@link HashMapContext}.
* @return a new JexlContext
*/ | 0 |
import java.util.Collections;
protected String path;
public ScpCommand(String command) {
this.name = command;
log.debug("Executing command {}", command);
String[] args = command.split(" ");
} else {
path = command.substring(command.indexOf(args[i-1]) + args[i-1].length() + 1);
break;
helper.receive(root.getFile(path), optR, optD, optP);
helper.send(Collections.singletonList(path), optR, optP); | 0 |
log.debug("Send SSH_MSG_USERAUTH_REQUEST for publickey"); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.