Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import org.apache.beam.sdk.coders.CustomCoder; /** A {@link Coder} for {@link TimestampedValue}. */ public static class TimestampedValueCoder<T> extends CustomCoder<TimestampedValue<T>> {
0
import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; protected final String name; protected final String id; Constructor c; try { c = this.getClass().getConstructor(new Class[] {String.class, String.class}); final Layout clone = (Layout)c.newInstance(new Object[] {this.id, this.name}); // clone fields from AbstractParameters clone.parameters = new LinkedMap(this.parameters); // we don't clone the parent; we just set it to null clone.parent = null; clone.description = this.description; clone.rendererName = this.rendererName; clone.isStatic = this.isStatic; clone.temporaryAttributes = new LinkedMap(this.temporaryAttributes); return clone; } catch (NoSuchMethodException e) { throw new CloneNotSupportedException("Unable to find constructor for new layout object."); } catch (InstantiationException e) { throw new CloneNotSupportedException("Unable to create layout object."); } catch (InvocationTargetException e) { throw new CloneNotSupportedException("Unable to invoke constructor for new layout object."); } catch (IllegalArgumentException e) { throw new CloneNotSupportedException("Unable to invoke constructor for new layout object."); } catch (IllegalAccessException e) { throw new CloneNotSupportedException("Unable to invoke constructor for new layout object."); }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableSet.java,v 1.2 2003/10/02 22:48:40 scolebourne Exp $ import org.apache.commons.collections.AbstractTestSet; * @version $Revision: 1.2 $ $Date: 2003/10/02 22:48:40 $ public class TestObservableSet extends AbstractTestSet implements ObservedTestHelper.ObservedFactory { protected Set makeEmptySet() {
0
/** * 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.args.constraints; import java.lang.annotation.Retention; import java.lang.annotation.Target; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.RetentionPolicy.RUNTIME; /** * Annotation that indicates an entity must be writable. * * @author William Farner */ @Target(FIELD) @Retention(RUNTIME) public @interface CanWrite { }
0
* Copyright (c) 2003-2004 The Apache Software Foundation. All rights
0
INSTANCE_CRUD_INVALID_PARAMS(404, "ATLAS4049E", "Invalid instance creation/updation parameters passed : {0}"), INDEX_ROLLBACK_FAILED(500, "ATLAS5003E", "Index rollback failed for {0}"), INSTANCE_BY_UNIQUE_ATTRIBUTE_NOT_FOUND(400, "ATLAS40018E", "Instance {0} with unique attribute {1} does not exist"), UNKNOWN_ATTRIBUTE(400, "ATLAS40019E", "Attribute {0} not found for type {1}");
0
cluster.recalculateClusterVersionState(repoVersionEnt);
0
void prepare() throws StorageException;
0
import com.twitter.common.quantity.Amount; import com.twitter.common.quantity.Time; new TaskGroupsSettings( Amount.of(1L, Time.MILLISECONDS), bindMock(BackoffStrategy.class), RateLimiter.create(1000)));
1
public void testSplit() throws Exception { initialSource.split(desiredBundleSizeBytes, options);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/buffer/Attic/BinaryBuffer.java,v 1.3 2004/01/02 01:36:51 psteitz Exp $ * @version $Revision: 1.3 $ $Date: 2004/01/02 01:36:51 $ * @param index the index of the element to be percolated up
0
* The map of property maps keyed by property category. private final Map<String, Map<String, Object>> propertiesMap = new HashMap<String, Map<String, Object>>(); return propertiesMap; Map<String, Object> properties = propertiesMap.get(category); if (properties == null) { properties = new HashMap<String, Object>(); propertiesMap.put(category, properties); properties.put(PropertyHelper.getPropertyName(id), value); if (!propertiesMap.containsKey(id)) { propertiesMap.put(id, new HashMap<String, Object>()); Map<String, Object> properties = propertiesMap.get(PropertyHelper.getPropertyCategory(id)); return properties == null ? null : properties.get(PropertyHelper.getPropertyName(id)); sb.append(propertiesMap);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/RulesBase.java,v 1.7 2002/01/09 20:22:49 sanders Exp $ * $Revision: 1.7 $ * $Date: 2002/01/09 20:22:49 $ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights * @version $Revision: 1.7 $ $Date: 2002/01/09 20:22:49 $ if (this.namespaceURI != null) { } if ((rulesList == null) || (rulesList.size() < 1)) { Iterator keys = this.cache.keySet().iterator(); while (keys.hasNext()) { String key = (String) keys.next(); if (key.startsWith("*/")) { if (pattern.endsWith(key.substring(1))) { } } } } if (rulesList == null) { } return (rulesList); (item.getNamespaceURI() == null)) {
0
return m_name.equals(capability.getName()) && m_filter.matchCase(capability.getProperties()) && (m_filter.toString().indexOf("(mandatory:<*") >= 0 || capability.getProperties().get("mandatory:") == null);
0
import org.apache.accumulo.core.client.impl.Namespace; final NamespaceConfiguration defaultConf = new NamespaceConfiguration(Namespace.ID.DEFAULT, inst, DefaultConfiguration.getInstance());
0
import com.twitter.common_internal.zookeeper.ZooKeeperModule; install(new ZooKeeperModule( ZooKeeperClient.digestCredentials("mesos", "mesos"), ZooKeeperUtils.EVERYONE_READ_CREATOR_ALL));
0
import org.apache.accumulo.server.ServerContext; protected ServerContext context; public NamespaceConfiguration(Namespace.ID namespaceId, ServerContext context, this.context = context; this.path = context.getZooKeeperRoot() + Constants.ZNAMESPACES + "/" + namespaceId PropCacheKey key = new PropCacheKey(context.getInstanceID(), namespaceId.canonicalID()); propCache = zcf.getZooCache(context.getZooKeepers(), context.getZooKeepersSessionTimeOut(), new NamespaceConfWatcher(context));
0
public static <T> Collector<T, ?, SortedSet<T>> toSortedSet(Comparator<T> comparator) { } else if (values instanceof Collection<?>) {
0
/* * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cocoon.woody.datatype; import org.w3c.dom.Element; /** * Builds {@link SelectionList}s from an XML description. * * @version CVS $Id: SelectionListBuilder.java,v 1.7 2004/03/09 13:54:04 reinhard Exp $ */ public interface SelectionListBuilder { static final String ROLE = SelectionListBuilder.class.getName(); SelectionList build(Element selectionListElement, Datatype datatype) throws Exception; }
0
return status.getBegin() == Long.MAX_VALUE; return status.getBegin() != Long.MAX_VALUE;
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.sshd.common.util; import java.security.PublicKey; import org.apache.sshd.common.digest.MD5; /** * Utility class for keys * * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> */ public class KeyUtils { /** * Retrieve the public key fingerprint * * @param key the public key * @return the fingerprint */ public static String getFingerPrint(PublicKey key) { try { Buffer buffer = new Buffer(); buffer.putRawPublicKey(key); MD5 md5 = new MD5(); md5.init(); md5.update(buffer.array(), 0, buffer.wpos()); byte[] data = md5.digest(); return BufferUtils.printHex(data, 0, data.length, ':'); } catch (Exception e) { return "Unable to compute fingerprint"; } } private KeyUtils() { } }
0
* @version $Id$
0
/* * Find a principal type entity with the given name. * * @param name principal type name * * @return a matching principal type entity or null */ @RequiresSession public PrincipalTypeEntity findByName(String name) { TypedQuery<PrincipalTypeEntity> query = entityManagerProvider.get().createNamedQuery("PrincipalTypeEntity.findByName", PrincipalTypeEntity.class); query.setParameter("name", name); return daoUtils.selectSingle(query); } /** * Remove the entity instance. * * @param entity entity to remove */ @Transactional public void remove(PrincipalTypeEntity entity) { entityManagerProvider.get().remove(entity); } /** case PrincipalTypeEntity.ROLE_PRINCIPAL_TYPE: principalTypeEntity.setName(PrincipalTypeEntity.ROLE_PRINCIPAL_TYPE_NAME); break;
0
* Copyright 2002-2006 The Apache Software Foundation. * * * * Simple identifier - $foo or $foo.bar (both parts are identifiers). * * @author <a href="mailto:[email protected]">Geir Magnusson Jr.</a> * @version $Id$ public class ASTIdentifier extends SimpleNode { public ASTIdentifier(int id) { public ASTIdentifier(Parser p, int id) { /** Accept the visitor. * */ public Object jjtAccept(ParserVisitor visitor, Object data) { public Object value(JexlContext jc) throws Exception { * returns the value of itself applied to the object. We assume that an * identifier can be gotten via a get(String) public Object execute(Object obj, JexlContext jc) throws Exception { public String getIdentifierString() {
0
import java.util.Arrays; import java.util.List;
0
public static final String SKIP_COUNTER_TRANSFROMATION = "skipCounterDerivative"; HttpURLConnection connection = (HttpURLConnection) new URL(connectUrl).openConnection();
0
import org.apache.sshd.util.test.NoIoTestCase; import org.junit.experimental.categories.Category; @Category({ NoIoTestCase.class })
0
import static org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef.DEFAULT_SEARCHWEIGHT; private int searchWeight = DEFAULT_SEARCHWEIGHT; this(name, dataTypeName, multiplicity, false, false, true, null, null, DEFAULT_SEARCHWEIGHT); this(name, dataTypeName, multiplicity, isComposite, reverseAttributeName, DEFAULT_SEARCHWEIGHT); } public AttributeDefinition(String name, String dataTypeName, Multiplicity multiplicity, boolean isComposite, String reverseAttributeName, int searchWeight) { this(name, dataTypeName, multiplicity, isComposite, false, false, reverseAttributeName, null, searchWeight); this(name, dataTypeName, multiplicity, isComposite, isUnique, isIndexable,reverseAttributeName, options, DEFAULT_SEARCHWEIGHT); } public AttributeDefinition(String name, String dataTypeName, Multiplicity multiplicity, boolean isComposite, boolean isUnique, boolean isIndexable, String reverseAttributeName, Map<String, String> options, int searchWeight) { this.searchWeight = searchWeight; Objects.equals(options, that.options) && Objects.equals(searchWeight, that.searchWeight); reverseAttributeName, defaultValue, description, options, searchWeight); public void setSearchWeight(int searchWeight) { this.searchWeight = searchWeight; } public int getSearchWeight() { return searchWeight; }
0
import org.apache.beam.vendor.grpc.v1_13_1.com.google.protobuf.ByteString;
0
super.init(source, options, env);
0
processor.process(request, request.getEntity(), context); processor.process(response, response.getEntity(), context);
0
* <p> * TODO - Handle nested junctions.
0
package org.w3c.dom.svg; public interface SVGFESpotLightElement extends SVGElement { public SVGAnimatedNumber getX( ); public SVGAnimatedNumber getY( ); public SVGAnimatedNumber getZ( ); public SVGAnimatedNumber getPointsAtX( ); public SVGAnimatedNumber getPointsAtY( ); public SVGAnimatedNumber getPointsAtZ( ); public SVGAnimatedNumber getSpecularExponent( ); public SVGAnimatedNumber getLimitingConeAngle( ); }
1
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/Attic/ResettableIterator.java,v 1.1 2003/11/14 22:58:27 scolebourne Exp $ * @version $Revision: 1.1 $ $Date: 2003/11/14 22:58:27 $ public interface ResettableIterator extends Iterator {
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. */ /** * @version $Id$ */ private JXPathContext context; private RepeaterRow row; public RepeaterItem(Object handle) { super(); this.handle = handle; } public JXPathContext getContext() { return context; } public void setContext(JXPathContext context) { this.context = context; } public Object getHandle() { return handle; } public void setHandle(Object handle) { this.handle = handle; } public RepeaterRow getRow() { return row; } public void setRow(RepeaterRow attribute) { this.row = attribute; } public boolean equals(Object other) { if (!(other instanceof RepeaterItem)) return false; return this.handle.equals(((RepeaterItem) other).handle); } public int hashCode() { return this.handle.hashCode(); }
0
"help", "install", "lb", "log", "refresh", // Register "inspect" command for R4.3 or R4.2 depending // on the underlying framework. props.put("osgi.command.function", new String[] { "inspect" }); try { getClass().getClassLoader().loadClass("org.osgi.framework.wiring.BundleWiring"); bc.registerService( Inspect.class.getName(), new Inspect(bc), props); } catch (Throwable th) { bc.registerService( Inspect42.class.getName(), new Inspect42(bc), props); } props.put("osgi.command.scope", "felix"); props.put("osgi.command.function", new String[] { "cd", "ls" });
0
Copyright 2002-2003, 2006 The Apache Software Foundation final Object lock = new Object(); private volatile boolean wasNotified; (new ActionEvent(e.getWindow(), /** userID = null;
0
* ProxyClient can be used to establish a tunnel via an HTTP/1.1 proxy. if (this.authenticator.updateAuthState(proxy, ChallengeType.PROXY, response,
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
total++;
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
import net.jcip.annotations.Immutable; @Immutable
0
// Make sure that the other thread calling getException will see the assignment by the thread // calling run() public ActiveAssignmentRunnable(ConcurrentHashMap<KeyExtent,RunnableStartedAt> activeAssignments, KeyExtent extent, Runnable delegate) { RunnableStartedAt runnableWithStartTime = new RunnableStartedAt(this, System.currentTimeMillis());
0
import com.google.inject.Singleton; * Gets the next version that will be created for a given * {@link ClusterConfigEntity}. * * @param clusterId * the cluster that the service is a part of. * @param configType * the name of the configuration type (not {@code null}). * @return the highest existing value of the version column + 1 */ public Long findNextConfigVersion(long clusterId, String configType) { TypedQuery<Long> query = entityManagerProvider.get().createNamedQuery( "ClusterConfigEntity.findNextConfigVersion", Long.class); query.setParameter("clusterId", clusterId); query.setParameter("configType", configType); return daoUtils.selectSingle(query); } /**
0
} while (!domain.isEmpty());
0
import org.apache.hadoop.metadata.bridge.AEntityBean; public class HiveLineage extends AEntityBean implements Serializable {
0
import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.security.crypto.CryptoServiceFactory; AccumuloConfiguration aconf = SiteConfiguration.getInstance(); bcfr = new BCFile.Reader(fsin, fs.getFileStatus(path).getLen(), conf, aconf, CryptoServiceFactory.getConfigured(aconf));
0
@Deprecated @Override public void verifyDeterministic() { }
0
import java.util.Set; import org.apache.beam.sdk.coders.KvCoder; import org.apache.beam.sdk.values.PCollectionView; private final Set<String> sideInputCollections = new HashSet<>(); void registerSideInput(PCollectionView<?> view) { sideInputCollections.add(view.getTagInternal().getId()); } boolean sideInputEdge = sideInputCollections.contains(pCollId); boolean carriesKeyedValues = Utils.isKeyedValueCoder(coder); .to(destinationVertex, getNextFreeOrdinal(destinationVertex, true)); edge = carriesKeyedValues ? edge.distributed() : edge; edge = carriesKeyedValues ? edge.partitioned(new PartitionedKeyExtractor(coder)) : edge; private static class PartitionedKeyExtractor<K, V> implements FunctionEx<byte[], Object> { private final WindowedValue.WindowedValueCoder<KV<K, V>> coder; this.coder = (WindowedValue.WindowedValueCoder<KV<K, V>>) coder; WindowedValue<KV<K, V>> windowedValue = CoderUtils.decodeFromByteArray(coder, b); // todo: decoding twice.... KvCoder<K, V> kvCoder = (KvCoder<K, V>) coder.getValueCoder(); return CoderUtils.encodeToByteArray(kvCoder.getKeyCoder(), windowedValue.getValue().getKey());
0
attribmap.put(param.getName().toLowerCase(Locale.ROOT), param); final String s = attrib.getName().toLowerCase(Locale.ROOT);
0
package org.apache.beam.sdk.coders; import static org.apache.beam.sdk.util.Structs.addString; import static org.apache.beam.sdk.util.Structs.addStringList; import org.apache.beam.sdk.util.CloudObject; import org.apache.beam.sdk.util.PropertyNames; import org.apache.beam.sdk.util.SerializableUtils; import org.apache.beam.sdk.util.StringUtils;
0
help = "The name service name for the mesos scheduler thrift server.") help = "Map of machine hosts to job keys." private static final Arg<Map<String, String>> MACHINE_RESTRICTIONS = help = "Mesos address for the master, can be a mesos address or zookeeper path.") @CmdLine(name = "executor_path", help = "Path to the executor launch script.") bind(new TypeLiteral<Supplier<Optional<SchedulerDriver>>>() { }).to(DriverReference.class); bind(new TypeLiteral<Optional<String>>() { }).annotatedWith(GcExecutor.class) bind(new TypeLiteral<PulseMonitor<String>>() { }) bind(new TypeLiteral<PulseMonitor<String>>() { }) bind(Key.get(new TypeLiteral<Map<String, String>>() { }, /** * Command to register a thread stack printer that identifies initiator of a shutdown. */ private static final Function<StackTraceElement, String> STACK_ELEM_TOSTRING = + String.format("(%s:%s)", element.getFileName(), element.getLineNumber()); Iterables.transform(Arrays.asList(thread.getStackTrace()), STACK_ELEM_TOSTRING)))
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
public Shape getPaintedOutline(Shape shape){ return stroke.createStrokedShape(shape); }
0
import org.apache.beam.runners.flink.translation.wrappers.ImpulseInputFormat; TRANSLATORS.put(PTransformTranslation.IMPULSE_TRANSFORM_URN, new ImpulseTranslatorBatch()); private static class ImpulseTranslatorBatch implements FlinkBatchPipelineTranslator.BatchTransformTranslator< PTransform<PBegin, PCollection<byte[]>>> { @Override public void translateNode(PTransform<PBegin, PCollection<byte[]>> transform, FlinkBatchTranslationContext context) { String name = transform.getName(); PCollection<byte[]> output = context.getOutput(transform); TypeInformation<WindowedValue<byte[]>> typeInformation = context.getTypeInfo(output); DataSource<WindowedValue<byte[]>> dataSource = new DataSource<>( context.getExecutionEnvironment(), new ImpulseInputFormat(), typeInformation, name); context.setOutputDataSet(output, dataSource); } }
0
* @param opcode Instruction opcode
0
* @author <a href="mailto:[email protected]">Vincent Hardy</a>
1
@Override throw new RuntimeException(e); @Override
0
HashSet<Column> columns = new HashSet<>(); HashSet<Column> columns = new HashSet<>(); HashSet<Column> columns = new HashSet<>();
1
* Defines the interface of a <code>Test</code> case. It is * <code>AbstractTest</code> class or follow the same implementation * <code>run</code> method, which is critical for the operation * Returns this <code>Test</code>'s name. * Returns the <code>Test</code>'s qualified id, that is, * Returns the <code>Test</code>'s id. The notion of * identifier is left to the user of the <code>Test</code> * Sets this <code>Test</code>'s id. * Requests this <code>Test</code> to run and produce a * Returns this <code>Test</code>'s parent, in case this * <code>Test</code> is part of a <code>TestSuite</code>. * Set this <code>Test</code>'s parent.
0
import org.apache.hadoop.fs.Path; public void unassign(Collection<TabletLocationState> tablets, Map<TServerInstance, List<Path>> logsForDeadServers) throws DistributedStoreException { List<Path> logs = logsForDeadServers.get(tls.futureOrCurrent()); for (Path entry : logs) { LogEntry logEntry = new LogEntry(RootTable.EXTENT, System.currentTimeMillis(), tls.futureOrCurrent().getLocation().toString(), entry.toString()); public void markLogsAsUnused(AccumuloServerContext context, Map<TServerInstance,List<Path>> logs) {
0
package org.apache.ambari.infra.solr;
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 * 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
assertEquals(Long.valueOf(cfg.getMaxLatency(TimeUnit.MILLISECONDS)), bwOpts.batchLatency); assertEquals(Long.valueOf(cfg.getTimeout(TimeUnit.MILLISECONDS)), bwOpts.batchTimeout); assertEquals(Long.valueOf(cfg.getMaxMemory()), bwOpts.batchMemory); assertEquals(Long.valueOf(3000), bwOpts.batchLatency); assertEquals(Long.valueOf(2000), bwOpts.batchTimeout); assertEquals(Long.valueOf(1024 * 1024), bwOpts.batchMemory);
0
for (String element : CONFIG_SECTIONS) { if (element.equals(nodeName))
0
//curBufferPos += transferAmt;
0
* @version $Id: TestXMLConfiguration.java,v 1.12 2004/10/04 18:14:59 ebourg Exp $ public void testSetProperty() throws Exception { conf.setProperty("element.string", "hello"); assertEquals("'element.string'", "hello", conf.getString("element.string")); assertEquals("XML value of element.string", "hello", conf.getXmlProperty("element.string")); }
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.beam.sdk.io.gcp.datastore; import org.apache.beam.sdk.options.Default; import org.apache.beam.sdk.options.Description; import org.apache.beam.sdk.testing.TestPipelineOptions; import javax.annotation.Nullable; /** * V1Beta3 Datastore related pipeline options. */ public interface V1Beta3TestOptions extends TestPipelineOptions { @Description("Project ID to read from datastore") @Default.String("apache-beam-testing") String getProject(); void setProject(String value); @Description("Datastore Entity kind") @Default.String("beam-test") String getKind(); void setKind(String value); @Description("Datastore Namespace") String getNamespace(); void setNamespace(@Nullable String value); }
0
import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.BeforeAll; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; @BeforeAll @org.junit.jupiter.api.AfterAll @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 Assumptions.assumeTrue(bcInstalled);
0
* @version $Revision: 1.8 $ $Date: 2004/06/03 22:02:12 $ /** Serialization version */ private static final long serialVersionUID = 722374056718497858L;
0
// The following is optional and allows to display our configuration from webconsole .setHeading("Task Configuration") .setDescription("Configuration for the Task Service") .setCardinality(0) .setType(String.class) .setHeading("Task Interval") .setDescription("Declare here the interval used to trigger the Task") .setDefaults(new String[] {"10"}) .setId("interval"))));
0
private final ClientSessionImpl session; private int currentMethod; NamedFactory<UserAuth> factory = NamedResource.Utils.findByName(pref, String.CASE_INSENSITIVE_ORDER, authFactories); * userAuth = NamedFactory.Utils.create(authFactories, method); if (userAuth == null) {
1
package com.twitter.mesos; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Marks a method as a JNI callback. */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface JNICallback { // marker }
0
BeanDefinitionBuilder defBuilder = BeanDefinitionBuilder.rootBeanDefinition(PipelineComponentInfoFactoryBean.class);
0
* Gets the alert definitions for the specified stack and service. * * @param stackName * the stack name * @param stackVersion * the stack version * @param serviceName * the service name * @return the alert definitions for a stack or an empty list if none (never * {@code null}). * Gets the alert definitions for the specified stack and service. * * @return the alert definitions for a stack or an empty list if none (never * {@code null}). return Collections.emptySet(); stackDefinitions.addAll(serviceDefinitions);
0
if (isValidType(type) && isValidDirection(direction)) if (!isValidType(type)) { out.println("Invalid argument: " + type); } if (!isValidDirection(direction)) { out.println("Invalid argument: " + direction); } bundles = new Bundle[ids.length]; bundles = new Bundle[ids.length]; bundles = new Bundle[ids.length]; bundles = new Bundle[ids.length]; bundles = new Bundle[ids.length]; bundles = new Bundle[ids.length]; bundles = new Bundle[ids.length]; bundles = new Bundle[ids.length]; private static boolean isValidType(String type) { return (PACKAGE_TYPE.startsWith(type) || BUNDLE_TYPE.startsWith(type) || FRAGMENT_TYPE.startsWith(type) || SERVICE_TYPE.startsWith(type)); } private static boolean isValidDirection(String direction) return (CAPABILITY.startsWith(direction) || REQUIREMENT.startsWith(direction));
0
package org.apache.felix.karaf.shell.commands; import org.apache.felix.karaf.shell.console.OsgiCommandSupport; // print Karaf informations
0
* $Header: /cvshome/build/org.osgi.util.tracker/src/org/osgi/util/tracker/ServiceTrackerCustomizer.java,v 1.13 2007/02/19 19:04:33 hargrave Exp $ * Copyright (c) OSGi Alliance (2000, 2007). All Rights Reserved. * <code>ServiceTracker</code> object to customize the service objects that * are tracked. The <code>ServiceTrackerCustomizer</code> object is called * when a service is being added to the <code>ServiceTracker</code> object. * The <code>ServiceTrackerCustomizer</code> can then return an object for the * tracked service. The <code>ServiceTrackerCustomizer</code> object is also * called when a tracked service is modified or has been removed from the * <code>ServiceEvent</code> being received by a <code>ServiceTracker</code> * object. Since <code>ServiceEvent</code> s are synchronously delivered by * the Framework, it is highly recommended that implementations of these methods * do not register (<code>BundleContext.registerService</code>), modify ( * <p> * The <code>ServiceTracker</code> class is thread-safe. It does not call a * <code>ServiceTrackerCustomizer</code> object while holding any locks. * <code>ServiceTrackerCustomizer</code> implementations must also be * thread-safe. * * @ThreadSafe * @version $Revision: 1.13 $ * parameters of the <code>ServiceTracker</code> object is added to it. * This method should return the service object to be tracked for this * <code>ServiceReference</code> object. The returned service object is * stored in the <code>ServiceTracker</code> object and is available from * the <code>getService</code> and <code>getServices</code> methods. * <code>ServiceReference</code> object or <code>null</code> if * the <code>ServiceReference</code> object should not be tracked. public void modifiedService(ServiceReference reference, Object service); public void removedService(ServiceReference reference, Object service);
0
log.debug("Closing connections idle longer than " + idleTimeout + " " + tunit);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/model/beans/PropertyIterator.java,v 1.10 2003/03/25 02:41:34 dmitri Exp $ * $Revision: 1.10 $ * $Date: 2003/03/25 02:41:34 $ * @version $Revision: 1.10 $ $Date: 2003/03/25 02:41:34 $ propertyNodePointer = (PropertyPointer) pointer.getPropertyPointer().clone(); return propertyNodePointer.getValuePointer();
0
/* String guid = repositoryService.createEntity(entityStream, ENTITY_TYPE); */
0
public void sendOneMessageWithoutAttributes() throws IOException { List<OutgoingMessage> outgoing = ImmutableList.of( new OutgoingMessage( DATA.getBytes(), null /* attributes */, TIMESTAMP, getRecordId(DATA))); try (PubsubTestClientFactory factory = PubsubTestClient.createFactoryForPublish( TOPIC, outgoing, ImmutableList.<OutgoingMessage>of())) { PubsubUnboundedSink sink = new PubsubUnboundedSink( factory, StaticValueProvider.of(TOPIC), TIMESTAMP_ATTRIBUTE, ID_ATTRIBUTE, NUM_SHARDS, 1 /* batchSize */, 1 /* batchBytes */, Duration.standardSeconds(2), RecordIdMethod.DETERMINISTIC); p.apply(Create.of(ImmutableList.of(DATA))) .apply(ParDo.of(new Stamp(null /* attributes */))) .apply(sink); p.run(); } // The PubsubTestClientFactory will assert fail on close if the actual published // message does not match the expected publish message. } @Test
0
* Cookies are considered identical if their names are equal and * their domain attributes match ignoring case. * </p> @Contract(threading = ThreadingBehavior.STATELESS)
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.impl.io; import org.apache.http.HttpMessage; import org.apache.http.HttpResponse; import org.apache.http.io.SessionOutputBuffer; import org.apache.http.message.BasicStatusLine; import org.apache.http.params.HttpParams; import org.apache.http.util.CharArrayBuffer; public class HttpResponseWriter extends AbstractMessageWriter { public HttpResponseWriter(final SessionOutputBuffer buffer, final HttpParams params) { super(buffer, params); } protected void writeHeadLine( final CharArrayBuffer lineBuffer, final HttpMessage message) { BasicStatusLine.format(lineBuffer, ((HttpResponse) message).getStatusLine()); } }
0
* @version CVS $Id: TraversableGenerator.java,v 1.1 2003/10/23 07:55:49 gcasper Exp $
0
for (File childFile : childFiles) { private final File file; private final int depth;
0
@Parameter(names = {"-h", "-?", "--help", "-help"}, help = true) public void parseArgs(String programName, String[] args, Object... others) {
0
if (!isZKServerRunning()) { if (!isZKServerRunning()) { /** * @return true if the server is running, false otherwise. */ return zkServer != null && zkServer.isRunning();
0
public CalendarConverter(final Object defaultValue) {
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.batik.css.HiddenChildElementSupport; for (Element t = e; t != null; t = HiddenChildElementSupport.getParentElement(t)) { if (t instanceof SVGTransformable) { String s = t.getAttributeNS(null, "transform"); } else if (t instanceof SVGSVGElement) { return v * cssToUserSpace (type, val.getFloatValue(type), (SVGElement)HiddenChildElementSupport.getParentElement(e), d, c); float fs = cssToUserSpace (type, val.getFloatValue(type), (SVGElement)HiddenChildElementSupport.getParentElement(e), d, c);
0
* 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. * @version $Revision: 1.4 $ $Date: 2003/10/09 21:31:42 $
0
@Test(timeout = 4 * 60 * 1000)
0
import org.apache.beam.sdk.transforms.OldDoFn; * A OldDoFn that creates entity for a long number. static class CreateEntityFn extends OldDoFn<Long, Entity> {
0
import com.google.cloud.dataflow.sdk.testing.RunnableOnService; @Category(RunnableOnService.class) @Category(RunnableOnService.class)
0
Map<String, Map<String, Collection<DependencyInfo>>> missingDependencies = new HashMap<>(); Collection<String> cardinalityFailures = new HashSet<>(); new HashMap<>(); Collection<String> processedServices = new HashSet<>(); Map<String, Collection<String>> allRequiredProperties = new HashMap<>(); Map<String, Map<String, String>> operationalConfiguration = new HashMap<>(clusterConfigurations); ArrayList<HostGroup> hostGroupsForComponent = new ArrayList<>(blueprint.getHostGroupsForComponent(component)); Set<String> givenHostGroups = new HashSet<>(); typeRequirements = new HashSet<>(); hostGroupMissingProps = new HashMap<>(); Collection<String> cardinalityFailures = new HashSet<>(); Map<String, Collection<DependencyInfo>> missingDependencies = new HashMap<>(); for (String component : new HashSet<>(group.getComponentNames())) { missingCompDependencies = new HashSet<>(); Collection<String> cardinalityFailures = new HashSet<>();
0
* @version CVS $Id: BlobSourceFactory.java,v 1.2 2003/03/16 18:03:54 vgritsenko Exp $
0
Canonicalizer.ALGO_ID_C14N_PHYSICAL).canonicalizeSubtree(contextNode)
0
* * * * @version $Revision: 1.7 $ registerTag("assertThrows", AssertThrowsTag.class); if (attributeName.equals("xpath")) { return new XPathExpression(attributeValue, xpathExpr, tagScript);
0
return getPublicKeyType().getSimpleName() + ": " + getSupportedKeyTypes();
0