Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
* @version $Revision$ $Date$ | 0 |
throw new BadLocationStateException("found two assignments for the same extent " + key.getRow() + ": " + future + " and " + location, entry.getKey().getRow());
throw new BadLocationStateException("found two locations for the same extent " + key.getRow() + ": " + current + " and " + location, entry.getKey().getRow()); | 0 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger log = LoggerFactory.getLogger(QueryMetadataTable.class);
log.error("Table '{}' not found.", MetadataTable.NAME, e); | 0 |
import org.apache.cocoon.portal.services.PortalManager;
pm.render(xmlConsumer, this.properties); | 0 |
log.error("{} trying to convert bytes to long, but byte array isn't length 8", LongSummation.class.getSimpleName()); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestSetUtils.java,v 1.7 2003/08/31 17:28:43 scolebourne Exp $
* $Revision: 1.7 $
* $Date: 2003/08/31 17:28:43 $
* any, must include the following acknowledgement:
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear. | 0 |
* @version $Revision$ | 0 |
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
private final CountDownLatch accessibleLatch = new CountDownLatch(1);
if (implementationAccessible)
{
accessibleLatch.countDown();
}
try
{
if (accessibleLatch.await( m_componentManager.getLockTimeout(), TimeUnit.MILLISECONDS ) && m_implementationAccessible)
{
return m_implementationObject;
}
}
catch ( InterruptedException e )
{
return null;
} | 0 |
import org.apache.hc.core5.http.protocol.HttpProcessorBuilder;
@Override
protected HttpProcessor createClientHttpProcessor() {
return HttpProcessorBuilder.create().addAll(
new RequestContent(),
new RequestTargetHost(),
new RequestConnControl(),
new RequestUserAgent("TEST-CLIENT/1.1"))
.build();
}
| 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
| 0 |
package org.apache.beam.runners.spark.translation;
import org.apache.beam.runners.spark.EvaluationResult;
public void computeOutputs() { | 0 |
/**
* Returns a filter that accepts files in addition to the {@link File} objects accepted by the given filter.
*
* @param fileFilter a base filter to add to
* @return a filter that accepts files
*/
/**
* Returns a filter that accepts directories in addition to the {@link File} objects accepted by the given filter.
*
* @param dirFilter a base filter to add to
* @return a filter that accepts directories
*/
private static IOFileFilter setUpEffectiveDirFilter(IOFileFilter dirFilter) {
return dirFilter == null ? FalseFileFilter.INSTANCE : FileFilterUtils.and(dirFilter,
}
public static Iterator<File> iterateFilesAndDirs(File directory, IOFileFilter fileFilter, IOFileFilter dirFilter) {
return listFilesAndDirs(directory, fileFilter, dirFilter).iterator();
} | 1 |
import java.util.concurrent.TimeUnit;
* @param tunit ignored
long timeout,
TimeUnit tunit) { | 0 |
import org.apache.ambari.view.pig.persistence.DataStoreStorage;
import java.util.HashMap;
import java.util.Map;
private Storage storageInstance = null;
private static Map<String, StorageUtil> viewSingletonObjects = new HashMap<String, StorageUtil>();
public static StorageUtil getInstance(ViewContext context) {
if (!viewSingletonObjects.containsKey(context.getInstanceName()))
viewSingletonObjects.put(context.getInstanceName(), new StorageUtil(context));
return viewSingletonObjects.get(context.getInstanceName());
}
public static void dropAllConnections() {
viewSingletonObjects.clear();
}
private ViewContext context;
* Constructor of storage util
*/
public StorageUtil(ViewContext context) {
this.context = context;
}
/**
* Get storage instance. If one is not created, creates instance.
public synchronized Storage getStorage() {
storageInstance = new DataStoreStorage(context);
public void setStorage(Storage storage) { | 0 |
import java.util.HashMap;
import java.util.Map;
import org.apache.avro.reflect.Nullable; | 0 |
SerializableUtils.clone(supplier).get(), Matchers.containsInAnyOrder(otherWindow, window));
WindowSupplier.of(new FailingCoder(), Collections.singleton(window)); | 0 |
public final class FilterMapping extends AbstractMapping
public void register(HttpService httpService)
if (httpService instanceof ExtHttpService)
{
register((ExtHttpService) httpService);
}
else
{
// Warn the user that something strange is going on...
SystemLogger.warning("Unable to register filter for " + this.pattern + ", as no ExtHttpService seems to be present!", null);
}
public void unregister(HttpService httpService)
if (httpService instanceof ExtHttpService)
{
unregister((ExtHttpService) httpService);
}
else
{
// Warn the user that something strange is going on...
SystemLogger.warning("Unable to unregister filter for " + this.pattern + ", as no ExtHttpService seems to be present!", null);
}
}
Filter getFilter()
{
return filter;
int getRanking()
return ranking;
if (!isRegistered() && getContext() != null)
// Warn that something might have gone astray...
SystemLogger.warning("Failed to register filter for " + this.pattern, null);
SystemLogger.debug("Failed to register filter for " + this.pattern + "; details:", e);
private void unregister(ExtHttpService httpService)
if (isRegistered())
try
{
httpService.unregisterFilter(this.filter);
}
catch (Exception e)
{
// Warn that something might have gone astray...
SystemLogger.debug("Failed to unregister filter for " + this.pattern, e);
}
finally
{
// Best effort: avoid mappings that are registered which is reality aren't registered...
setRegistered(false);
} | 0 |
import cz.seznam.euphoria.flink.FlinkElement;
.returns((Class) FlinkElement.class) | 0 |
log( "Error reading configuration PID " + pid, e );
if ( value.getClass().getComponentType().isPrimitive() )
{
final int len = Array.getLength(value);
final Object[] tmp = new Object[len];
for ( int j = 0; j < len; j++ )
{
tmp[j] = Array.get(value, j);
}
value = tmp;
} | 0 |
import org.apache.accumulo.server.HighlyAvailableService;
public class Monitor implements HighlyAvailableService {
public static HighlyAvailableService HA_SERVICE_INSTANCE = null;
// Servlets need access to limit requests when the monitor is not active, but Servlets are instantiated
// via reflection. Expose the service this way instead.
Monitor.HA_SERVICE_INSTANCE = monitor;
getMonitorLock();
} catch (Exception e) {
log.error("Failed to get Monitor ZooKeeper lock");
throw new RuntimeException(e);
}
try {
@Override
public boolean isActiveService() {
if (null != monitorLock && monitorLock.isLocked()) {
return true;
}
return false;
} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/java/org/apache/commons/beanutils/ResultSetDynaClass.java,v 1.9 2003/01/15 21:59:39 rdonkin Exp $
* $Revision: 1.9 $
* $Date: 2003/01/15 21:59:39 $
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
* @version $Revision: 1.9 $ $Date: 2003/01/15 21:59:39 $ | 0 |
import org.apache.atlas.typesystem.exception.EntityNotFoundException;
import org.apache.atlas.typesystem.exception.TypeNotFoundException;
import org.apache.atlas.utils.ParamChecker;
import java.util.Arrays;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
Referenceable col1 = new Referenceable("column_type", values);
columns.add(col1);
assertReferenceables(arrClsColumns.get(0), columns.get(0));
Referenceable col2 = new Referenceable("column_type", valuesCol5);
col1.set("type", "type1");
final List<Referenceable> updateColumns = Arrays.asList(col1, col2);
assertReferenceables(arrColumnsList.get(0), updateColumns.get(0));
assertReferenceables(arrColumnsList.get(1), updateColumns.get(1));
assertReferenceables(arrColumnsList.get(1), columns.get(1));
assertReferenceables(arrColumnsList.get(2), columns.get(2));
col1 = new Referenceable("column_type", values);
columns.add(col1);
assertReferenceables(arrColumnsList.get(0), columns.get(0));
private void assertReferenceables(Referenceable r1, Referenceable r2) {
assertEquals(r1.getTypeName(), r2.getTypeName());
assertTrue(r1.getTraits().equals(r2.getTraits()));
for (String attr : r1.getValuesMap().keySet()) {
assertTrue(r1.getValuesMap().get(attr).equals(r2.getValuesMap().get(attr)));
}
//TODO assert trait instances and complex attributes
} | 0 |
* @version $Revision$ | 0 |
package org.apache.beam.sdk.io.hdfs;
* Tests for HDFSFileSource.
public class HDFSFileSourceTest {
HDFSFileSource<IntWritable, Text> source =
HDFSFileSource.from(file.toString(), SequenceFileInputFormat.class,
HDFSFileSource<IntWritable, Text> source =
HDFSFileSource.from(new File(file1.getParent(), "file*").toString(),
HDFSFileSource<IntWritable, Text> source =
HDFSFileSource.from(new File(file1.getParent(), "file*").toString(),
HDFSFileSource<IntWritable, Text> source =
HDFSFileSource.from(file.toString(), SequenceFileInputFormat.class, | 0 |
/** "http://issues.apache.org/bugzilla/show_bug.cgi?id=12400" */ | 0 |
public class DefaultListeningIOReactor extends AbstractIOReactorBase implements IOReactorService, ConnectionAcceptor {
IOWorkers.Selector getWorkerSelector() {
return workerSelector;
}
@Override | 0 |
if (prefix != null) {
String namespaceURI = context.getJXPathContext()
.getNamespaceURI(prefix); | 0 |
// modify metadata
ZooKeeperInstance zki = new ZooKeeperInstance(new ClientConfiguration().withInstance(opts.iname).withZkHosts(opts.keepers));
AccumuloServerContext context = new AccumuloServerContext(new ServerConfigurationFactory(zki));
TServerUtils.startTServer(context.getConfiguration(), HostAndPort.fromParts("0.0.0.0", opts.port), processor, "NullTServer", "null tserver", 2, 1, 1000, 10 * 1024 * 1024, null, -1); | 1 |
log.error("{}", e.getMessage(), e); | 0 |
* @deprecated To implement a coder, do not use any {@code Context}. Just implement only those
* abstract methods which do not accept a {@code Context} and leave the default implementations
* for methods accepting a {@code Context}.
* same, then it must be the case that {@code structuralValue(x).equals(structuralValue(y))}. | 0 |
package org.apache.xml.security.test.dom.keys.content.x509; | 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.bcel6.data;
@MarkerAnnotationInvisible
@MarkerAnnotation
public class MarkedType
{
} | 1 |
boolean useCache = null != getContext().getFileSystemManager().getFilesCache(); | 0 |
import org.apache.sshd.common.PropertyResolverUtils;
PropertyResolverUtils.updateProperty(client, FactoryManager.MAX_PACKET_SIZE, 1024 * 16);
PropertyResolverUtils.updateProperty(client, FactoryManager.WINDOW_SIZE, 1024 * 8); | 0 |
import org.apache.aurora.scheduler.configuration.executor.ExecutorSettings;
public static ResourceBag bagFromTask(ITaskConfig task, ExecutorSettings executorSettings) {
return bagFromResources(task.getResources(), RESOURCE_TO_TYPE, QUANTIFY_RESOURCE)
.add(executorSettings.getExecutorOverhead(task));
}
| 0 |
try {
connState.reset();
} catch (IOException ex) {
if (this.eventListener != null) {
this.eventListener.fatalIOException(ex, conn);
}
}
public void finishInput() throws IOException {
public void finishOutput() throws IOException {
public void reset() throws IOException { | 0 |
throw new InterruptedIOException("Connection has been shut down");
throw new ConnectionShutdownException(); | 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.felix.ipojo.manipulator.util;
/**
* {@code Strings} is a utility class that helps to manipulate String.
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
public class Strings {
/**
* Utility class: no public constructor
*/
private Strings() {}
/**
* Transform a FQN of a class (format {@literal org.objectweb.asm.Visitor}) into
* a normalized resource name ({@literal org/objectweb/asm/Visitor.class}).
* @param classname FQN of a class to be transformed
* @return resource name
*/
public static String asResourcePath(String classname) {
return classname.replace('.', '/').concat(".class");
}
/**
* Transform a normalized resource path ({@literal org/objectweb/asm/Visitor.class}) into
* a fully qualified class name (format {@literal org.objectweb.asm.Visitor}).
* @param path normalized resource path to be transformed
* @return class name
*/
public static String asClassName(String path) {
String transformed = path.replace('/', '.');
return transformed.substring(0, transformed.length() - ".class".length());
}
} | 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 | 1 |
import org.apache.cocoon.forms.FormsException;
if (!(definition instanceof RepeaterActionDefinition)) {
throw new FormsException("Ancestor definition " + definition.getClass().getName() + " is not a RepeaterActionDefinition.",
getLocation());
}
RepeaterActionDefinition other = (RepeaterActionDefinition) definition;
this.name = other.name;
if (!(definition instanceof DeleteRowsActionDefinition)) {
throw new FormsException("Ancestor definition " + definition.getClass().getName() + " is not a DeleteRowsActionDefinition.",
getLocation());
}
DeleteRowsActionDefinition other = (DeleteRowsActionDefinition) definition;
this.selectName = other.selectName;
if (!(definition instanceof InsertRowsActionDefinition)) {
throw new FormsException("Ancestor definition " + definition.getClass().getName() + " is not an InsertRowsActionDefinition.",
getLocation());
}
InsertRowsActionDefinition other = (InsertRowsActionDefinition) definition;
this.selectName = other.selectName;
if (!(definition instanceof ChangePageActionDefinition)) {
throw new FormsException("Ancestor definition " + definition.getClass().getName() + " is not a ChangePageActionDefinition.",
getLocation());
ChangePageActionDefinition other = (ChangePageActionDefinition) definition;
this.method = other.method; | 0 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(FlinkBatchPipelineTranslator.class);
LOG.info(genSpaces(this.depth) + "enterCompositeTransform- " + formatNodeName(node));
LOG.info(genSpaces(this.depth) + "doingCompositeTransform- " + formatNodeName(node));
LOG.info(genSpaces(this.depth) + "leaveCompositeTransform- " + formatNodeName(node));
LOG.info(genSpaces(this.depth) + "visitTransform- " + formatNodeName(node));
LOG.info(node.getTransform().getClass().toString()); | 0 |
import com.google.cloud.dataflow.sdk.util.WindowingStrategy;
final Object windowingStrategy =
"serialized windowing strategy");
if (!(windowingStrategy instanceof WindowingStrategy)) {
"unexpected kind of WindowingStrategy: " + windowingStrategy.getClass().getName());
final AssignWindowsDoFn assignFn = new AssignWindowsDoFn(
((WindowingStrategy) windowingStrategy).getWindowFn()); | 0 |
final List<Boolean> list = new ArrayList<>(); | 1 |
package org.apache.felix.sigil.utils.properties; | 0 |
return 1f;
return 1f; | 0 |
String tablesDir = instance.getConfiguration().get(Property.INSTANCE_DFS_DIR) + "/tables"; | 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 |
// Note that the above list is in UPPER case.
// The code currently converts strings to lower case (as per the tables below)
| 0 |
@Override
public SlidingStats load(Method method) { | 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 |
private static final Arg<Module> AUTH_MODULE = Arg.create(new UnsecureAuthModule());
ImmutableList.of(SessionValidator.class, CapabilityValidator.class); | 0 |
Utils.checkTableDoesNotExist(environment.getContext(), cloneInfo.tableName, cloneInfo.tableId,
Tables.clearCache(environment.getContext());
Tables.clearCache(environment.getContext()); | 0 |
/**
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.cli2.commandline;
import java.util.ArrayList;
import org.apache.commons.cli2.WriteableCommandLine;
import org.apache.commons.cli2.WriteableCommandLineTestCase;
public class WriteableCommandLineImplTest extends WriteableCommandLineTestCase {
/* (non-Javadoc)
* @see org.apache.commons.cli2.WriteableCommandLineTest#createWriteableCommandLine()
*/
protected WriteableCommandLine createWriteableCommandLine() {
return new WriteableCommandLineImpl(root,new ArrayList());
}
public void testToMakeEclipseSpotTheTestCase(){
// nothing to test
}
} | 0 |
package org.apache.atlas.discovery.graph;
import org.apache.atlas.MetadataException;
import org.apache.atlas.query.Expressions;
import org.apache.atlas.query.GraphPersistenceStrategies;
import org.apache.atlas.query.GraphPersistenceStrategies$class;
import org.apache.atlas.query.TypeUtils;
import org.apache.atlas.repository.Constants;
import org.apache.atlas.repository.MetadataRepository;
import org.apache.atlas.repository.graph.GraphBackedMetadataRepository;
import org.apache.atlas.typesystem.ITypedReferenceableInstance;
import org.apache.atlas.typesystem.ITypedStruct;
import org.apache.atlas.typesystem.persistence.Id;
import org.apache.atlas.typesystem.types.AttributeInfo;
import org.apache.atlas.typesystem.types.IDataType;
import org.apache.atlas.typesystem.types.Multiplicity;
import org.apache.atlas.typesystem.types.StructType;
import org.apache.atlas.typesystem.types.TraitType;
import org.apache.atlas.typesystem.types.TypeSystem; | 0 |
package org.apache.commons.vfs.util;
import org.apache.commons.vfs.util.OsFamily; | 0 |
import org.apache.felix.resolver.util.CopyOnWriteSet;
private final OpenHashMap<Resource, Object> m_populateResultCache;
Map<Resource, WrappedResource> wrappedHosts,
OpenHashMap<Resource, Object> populateResultCache,
m_populateResultCache = new OpenHashMap<Resource, Object>();
m_subtitutableMap = new OpenHashMap<Capability, Requirement>();
for (Map.Entry<Resource, Object> populated : m_populateResultCache.fast())
OpenHashMap<String, List<Capability>> exportNames = new OpenHashMap<String, List<Capability>>() {
@Override
protected List<Capability> compute(String s) {
return new ArrayList<Capability>(1);
}
};
List<Capability> caps = exportNames.getOrCompute(packageName);
String packageName = (String) substitutes.get(0).getAttributes().get(PackageNamespace.PACKAGE_NAMESPACE);
if (!exportedPackages.containsAll(substitutes))
OpenHashMap<Capability, Integer> substituteStatuses = new OpenHashMap<Capability, Integer>(m_subtitutableMap.size());
for (Map.Entry<Capability, Integer> substituteStatus : substituteStatuses.fast())
return candidates.get(0);
CopyOnWriteSet<Capability> capPath = m_delta.getOrCompute(req);
CopyOnWriteSet<Capability> capPath = m_delta.getOrCompute(req);
for (Entry<Requirement, CopyOnWriteList<Capability>> entry : m_candidateMap.fast())
{
CopyOnWriteSet<Requirement> dependents = m_dependentMap.getOrCompute(cap); | 0 |
import org.apache.ambari.server.actionmanager.HostRoleCommandFactory;
import org.apache.ambari.server.stageplanner.RoleGraphFactory;
import org.apache.ambari.server.state.stack.upgrade.Grouping;
import com.google.inject.Inject;
import com.google.inject.assistedinject.Assisted;
* Used by some {@link Grouping}s to generate commands. It is exposed here
* mainly for injection purposes since the XML is not created by Guice.
*/
@Inject
private HostRoleCommandFactory m_hrcFactory;
/**
* Used by some {@link Grouping}s to determine command ordering. It is exposed
* here mainly for injection purposes since the XML is not created by Guice.
*/
@Inject
private RoleGraphFactory m_roleGraphFactory;
/**
@Inject
public UpgradeContext(@Assisted Cluster cluster, @Assisted UpgradeType type,
@Assisted Direction direction, @Assisted Map<String, Object> upgradeRequestMap) {
/**
* Gets the injected instance of a {@link RoleGraphFactory}.
*
* @return a {@link RoleGraphFactory} instance (never {@code null}).
*/
public RoleGraphFactory getRoleGraphFactory() {
return m_roleGraphFactory;
}
/**
* Gets the injected instance of a {@link HostRoleCommandFactory}.
*
* @return a {@link HostRoleCommandFactory} instance (never {@code null}).
*/
public HostRoleCommandFactory getHostRoleCommandFactory() {
return m_hrcFactory;
} | 0 |
import com.google.common.io.Resources; | 0 |
super(null, route, Mockito.mock(HttpConnection.class), timeToLive, tunit);
super(null, route, conn, timeToLive, tunit); | 0 |
package org.apache.ambari.infra.solr.commands;
import org.apache.ambari.infra.solr.AmbariSolrCloudClient;
import org.apache.ambari.infra.solr.domain.AmbariSolrState; | 0 |
package org.apache.beam.sdk.extensions.euphoria.beam.common;
import org.apache.beam.sdk.extensions.euphoria.core.client.functional.UnaryFunction; | 0 |
import cz.seznam.euphoria.core.client.operator.hint.ComputationHint;
import org.apache.spark.storage.StorageLevel;
List<DataSink<?>> translateInto(Flow flow, StorageLevel storageLevel) {
if (dag.getNode(op).getChildren().size() > 1
&& op.getHints().contains(ComputationHint.EXPENSIVE)) {
out.persist(storageLevel);
sparkOutput.mapToPair(el ->
new Tuple2<>(NullWritable.get(), el.getElement()));
TranslateAcceptor(Class<O> type, @Nullable UnaryPredicate<O> accept) { | 0 |
long finishAt = System.currentTimeMillis() + (seconds * 1000L); | 0 |
import javax.xml.parsers.DocumentBuilder;
private DocumentBuilder db;
db = XMLUtils.createDocumentBuilder(false);
Document doc = db.newDocument();
Document doc = db.newDocument(); | 0 |
import org.apache.beam.vendor.grpc.v1p13p1.com.google.protobuf.ByteString; | 0 |
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; | 0 |
import java.nio.charset.Charset;
import org.apache.http.Consts;
final byte[] content = "Message content".getBytes(Consts.ISO_8859_1);
final byte[] bytes = "Message content".getBytes(Consts.ISO_8859_1);
final byte[] bytes = "Message content".getBytes(Consts.ISO_8859_1);
final byte[] content = "Message content".getBytes(Consts.ISO_8859_1);
final byte[] bytes = "Message content".getBytes(Consts.ISO_8859_1);
final byte[] bytes = "Message content".getBytes(Consts.ISO_8859_1);
final byte[] bytes = content.getBytes(Consts.ISO_8859_1);
final byte[] bytes = content.getBytes(Charset.forName("KOI8-R"));
final byte[] bytes = content.getBytes(Consts.UTF_8); | 0 |
setFormats(new DateFormat[]{format}); | 0 |
import org.apache.http.annotation.Immutable; | 0 |
public TriggerResult onElement(TriggerContext<W> c, OnElementEvent<W> e) throws Exception {
Instant delayUntil = c.lookup(DELAYED_UNTIL_TAG, e.window());
delayUntil = computeTargetTimestamp(e.eventTimestamp());
c.setTimer(e.window(), delayUntil, TimeDomain.EVENT_TIME);
c.store(DELAYED_UNTIL_TAG, e.window(), delayUntil);
public TriggerResult onMerge(TriggerContext<W> c, OnMergeEvent<W> e) throws Exception {
for (Instant delayedUntil : c.lookup(DELAYED_UNTIL_TAG, e.oldWindows()).values()) {
c.store(DELAYED_UNTIL_TAG, e.newWindow(), earliestTimer);
c.setTimer(e.newWindow(), earliestTimer, TimeDomain.EVENT_TIME);
public TriggerResult onTimer(TriggerContext<W> c, OnTimerEvent<W> e) throws Exception {
public TriggerResult onElement(TriggerContext<W> c, OnElementEvent<W> e) throws Exception {
c.setTimer(e.window(),
computeTargetTimestamp(e.window().maxTimestamp()), TimeDomain.EVENT_TIME);
public TriggerResult onMerge(Trigger.TriggerContext<W> c, OnMergeEvent<W> e) throws Exception {
for (W oldWindow : e.oldWindows()) {
c.setTimer(e.newWindow(), e.newWindow().maxTimestamp(), TimeDomain.EVENT_TIME);
public TriggerResult onTimer(TriggerContext<W> c, OnTimerEvent<W> e) throws Exception { | 0 |
*
*
*
/**
throw new Exception( msg );
throw new Exception( msg ); | 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 CVS $Id: MutableEnvironmentFacade.java,v 1.6 2004/03/05 13:02:55 bdelacretaz Exp $ | 1 |
if (Artifact.SCOPE_COMPILE.equals(artifact.getScope())
|| Artifact.SCOPE_SYSTEM.equals(artifact.getScope())
|| Artifact.SCOPE_PROVIDED.equals(artifact.getScope())) { | 0 |
public Multiplicity(int lower, int upper, boolean isUnique) { | 0 |
@org.junit.jupiter.api.Test | 0 |
package org.apache.felix.gogo.runtime; | 0 |
return this.readUnsignedByte() != 0; | 0 |
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath));
c14nAndCompare(fileIn, fileRef, fileOut, c14nURI, xpath, namespace));
Document doc = XMLUtils.read(new FileInputStream(fileIn), false);
doc = XMLUtils.read(is, true);
c14nURI, xpath, namespace);
Document doc = XMLUtils.read(fileIn, false); | 0 |
counter++;
| 0 |
* Copyright 2016-2017 Seznam.cz, a.s. | 0 |
package org.apache.bcel.classfile; | 1 |
input -> {
assertEquals(path, input.getFileLocation());
assertFalse(input.isSuccess());
assertTrue(input.getError() instanceof TikaException);
return null; | 0 |
* @see PrivateKeyEntryDecoder#getSupportedKeyTypes()
ValidateUtils.checkNotNullAndNotEmpty(decoder.getSupportedKeyTypes(), "No supported key type"); | 0 |
import org.apache.commons.configuration.convert.DefaultListDelimiterHandler; | 0 |
import org.apache.accumulo.core.client.admin.ScanType;
* | 0 |
final Future<IOSession> sessionFuture = connPool.getSession(target, connectTimeout,
new FutureCallback<IOSession>() { | 0 |
return;
return; | 0 |
import org.apache.accumulo.core.Constants;
return sb.toString().getBytes(Constants.UTF8);
String[] longstrs = new String(b, Constants.UTF8).split(","); | 0 |
request.setHeader(new Header("User-Agent", "Elemental HTTP client")); | 0 |
import org.apache.batik.dom.svg.SVGOMElement;
ImageNode imgNode = (ImageNode)instantiateGraphicsNode();
// System.out.println("Bounds: " + bounds);
// System.out.println("ImgB: " + imgBounds);
imgNode.setVisible(CSSUtilities.convertVisibility(e));
/**
* Returns false as shapes are not a container.
*/
public boolean isComposite() {
return false;
}
/**
* This method is invoked during the build phase if the document
* is dynamic. The responsability of this method is to ensure that
* any dynamic modifications of the element this bridge is
* dedicated to, happen on its associated GVT product.
*/
protected void initializeDynamicSupport(BridgeContext ctx,
Element e,
GraphicsNode node) {
this.e = e;
this.node = node;
this.ctx = ctx;
// HACK due to the way images are represented in GVT
ImageNode imgNode = (ImageNode)node;
ctx.bind(e, imgNode.getImage());
((SVGOMElement)e).setSVGContext(this);
}
| 0 |
* @author <a href="mailto:deweese@apache.org">deweese</a> | 1 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/test/org/apache/commons/validator/EmailTest.java,v 1.6 2003/01/20 06:50:26 turner Exp $
* $Revision: 1.6 $
* $Date: 2003/01/20 06:50:26 $
* @version $Revision: 1.6 $ $Date: 2003/01/20 06:50:26 $
* <p>Tests the e-mail validation with an RCS-noncompliant character in
* the address.</p>
*/
public void testEmailWithBogusCharacter() throws ValidatorException {
// Create bean to run test on.
ValueBean info = new ValueBean();
info.setValue("andy.noble@\u008fdata-workshop.com");
valueTest(info, false);
}
/** | 0 |
import org.apache.cocoon.core.container.spring.avalon.AvalonEnvironment;
import org.apache.cocoon.core.container.spring.avalon.ComponentInfo;
import org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo;
if ( info.getRootLogger() != null ) {
logger = env.logger.getChildLogger(info.getRootLogger());
parent = WebApplicationContextUtils.getWebApplicationContext(servletContext);
parent = (ApplicationContext)servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE); | 0 |
description = "merge small tablets even if merging them to larger"
+ " tablets might cause a split") | 0 |
package com.twitter.aurora.scheduler.periodic;
import com.twitter.aurora.gen.AssignedTask;
import com.twitter.aurora.gen.ScheduledTask;
import com.twitter.aurora.gen.TaskQuery;
import com.twitter.aurora.scheduler.base.Query;
import com.twitter.aurora.scheduler.base.ScheduleException;
import com.twitter.aurora.scheduler.base.Tasks;
import com.twitter.aurora.scheduler.configuration.Resources;
import com.twitter.aurora.scheduler.filter.SchedulingFilter;
import com.twitter.aurora.scheduler.state.SchedulerCore;
import com.twitter.aurora.scheduler.storage.Storage;
import com.twitter.aurora.scheduler.storage.Storage.StorageException;
import static com.twitter.aurora.gen.ScheduleStatus.PENDING;
import static com.twitter.aurora.scheduler.base.Tasks.SCHEDULED_TO_ASSIGNED; | 1 |
import org.apache.beam.sdk.state.ValueState;
import org.apache.beam.sdk.transforms.windowing.Sessions;
import org.apache.beam.sdk.transforms.windowing.Window;
import org.joda.time.Duration;
*
* <p>Implements {@link Serializable} because it is caught in closures.
private void verifyMergingStatefulParDoRejected(PipelineOptions options) throws Exception {
Pipeline p = Pipeline.create(options);
p.apply(Create.of(KV.of(13, 42)))
.apply(Window.<KV<Integer, Integer>>into(Sessions.withGapDuration(Duration.millis(1))))
.apply(ParDo.of(new DoFn<KV<Integer, Integer>, Void>() {
@StateId("fizzle")
private final StateSpec<ValueState<Void>> voidState = StateSpecs.value();
@ProcessElement
public void process() {}
}));
thrown.expectMessage("merging");
thrown.expect(UnsupportedOperationException.class);
p.run();
}
@Test
public void testMergingStatefulRejectedInStreaming() throws Exception {
PipelineOptions options = buildPipelineOptions();
options.as(StreamingOptions.class).setStreaming(true);
verifyMergingStatefulParDoRejected(options);
}
@Test
public void testMergingStatefulRejectedInBatch() throws Exception {
PipelineOptions options = buildPipelineOptions();
options.as(StreamingOptions.class).setStreaming(false);
verifyMergingStatefulParDoRejected(options);
}
| 0 |
final SequencesComparator<Character> comparator =
final ExecutionVisitor<Character> ev = new ExecutionVisitor<Character>();
final String[] shadokAlph = new String[] {
final List<String> sentenceBefore = new ArrayList<String>();
final List<String> sentenceAfter = new ArrayList<String>();
final Random random = new Random(4564634237452342L);
final SequencesComparator<String> comparator =
final int lgMax = 5;
final String[] shadokAlph = new String[] {
final List<List<String>> newTab = new ArrayList<List<String>>();
for (final String element : shadokAlph) {
for (final List<String> sentence : shadokSentences) {
final List<String> newSentence = new ArrayList<String>(sentence);
final ExecutionVisitor<String> ev = new ExecutionVisitor<String>();
final StringBuilder concat = new StringBuilder();
private List<Character> sequence(final String string) {
final List<Character> list = new ArrayList<Character>();
public void setList(final List<T> array) {
public void visitInsertCommand(final T object) {
public void visitKeepCommand(final T object) {
public void visitDeleteCommand(final T object) {
final StringBuffer buffer = new StringBuffer();
for (final T c : v) { | 0 |
import org.apache.http.protocol.HttpCoreContext;
final HttpCoreContext context = HttpCoreContext.create();
registry.lookup(request, context);
final HttpCoreContext context = HttpCoreContext.create();
h = registry.lookup(new BasicHttpRequest("GET", "/that.view?param=value"), context);
h = registry.lookup(new BasicHttpRequest("GET", "/that.form?whatever"), context);
h = registry.lookup(new BasicHttpRequest("GET", "/whatever"), context); | 0 |
}
public void test_create_hmac_sha1_40_exclusive_c14n_comments_detached()
}
private void test_create_hmac_sha1_exclusive_c14n_comments_detached(boolean fortyBit)
(CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS,
fac.newSignatureMethod(SignatureMethod.HMAC_SHA1, spec),
Collections.singletonList(fac.newTransform(Transform.ENVELOPED,
fac.newCanonicalizationMethod(CanonicalizationMethod.EXCLUSIVE,
fac.newSignatureMethod(SignatureMethod.HMAC_SHA1, null), | 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 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.