Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
* @version $Id$ | 0 |
FTPFile[] listFiles(String relPath) throws IOException; | 0 |
/** Simple mock implementation of {@link IKinesisProducer} for testing. */
public KinesisProducerMock() {}
@Override
public ListenableFuture<UserRecordResult> addUserRecord(
String stream, String partitionKey, ByteBuffer data) {
@Override
public ListenableFuture<UserRecordResult> addUserRecord(UserRecord userRecord) {
@Override
public ListenableFuture<UserRecordResult> addUserRecord(
String stream, String partitionKey, String explicitHashKey, ByteBuffer data) {
@Override
public List<Metric> getMetrics(String metricName, int windowSeconds)
@Override
public List<Metric> getMetrics(String metricName)
@Override
public List<Metric> getMetrics() throws InterruptedException, ExecutionException {
@Override
public List<Metric> getMetrics(int windowSeconds)
@Override
public void destroy() {}
@Override
public void flush(String stream) {
@Override
public void flush() {
@Override
public synchronized void flushSync() { | 1 |
* @author <a href="mailto:imario@apache.org">Mario Ivankovits</a>
* @version $Revision: 1.2 $ $Date: 2004/05/21 20:54:34 $ | 0 |
/* $Id$
* | 0 |
@Override
public Object getTableObject() {
return table;
} | 0 |
* @param _originalException
* @param _originalException | 0 |
package org.apache.beam.sdk.transforms.windowing;
import org.apache.beam.sdk.transforms.SerializableFunction;
import org.apache.beam.sdk.util.TimeDomain; | 0 |
* try(ClientChannel channel = session.createChannel(ClientChannel.CHANNEL_SHELL)) {
Throwable t = record.getThrown();
if (t != null) {
t.printStackTrace(pw);
if (GenericUtils.isEmpty(command) && isArgumentedOption("-p", argName)) {
if (GenericUtils.isEmpty(command) && ("-v".equals(argName) || "-vv".equals(argName) || "-vvv".equals(argName))) {
if (GenericUtils.isEmpty(command) && "-D".equals(argName)) {
} else if (GenericUtils.isEmpty(command) && "-A".equals(argName)) {
} else if (GenericUtils.isEmpty(command) && "-a".equals(argName)) {
if (GenericUtils.isEmpty(command) && target == null) {
if (GenericUtils.isEmpty(command)) {
channel = session.createChannel(Channel.CHANNEL_SHELL);
StringBuilder w = new StringBuilder();
w.append(cmd).append(' ');
channel = session.createChannel(Channel.CHANNEL_EXEC, w.toString().trim()); | 0 |
configProps.setProperty(Configuration.KDC_PORT.getKey(), Integer.toString(KDC_TEST_PORT)); | 0 |
* @param socket Socket associated with request
* @param serviceRegistrationResolver resolver for services.
* @param logger the logger | 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.testing;
import org.apache.beam.sdk.runners.PipelineRunner;
/**
* Category tag for validation tests which utilize {@link TestPipeline} for execution and expect
* to be executed by a {@link PipelineRunner}.
*/
public interface NeedsRunner {
} | 0 |
import org.apache.beam.sdk.values.PBegin;
extends PTransform<PBegin, PCollection<KV<URI, String>>> {
public PCollection<KV<URI, String>> apply(PBegin input) { | 0 |
/**
* Copyright 2013 Apache Software Foundation | 0 |
ColorModel srcCM = cr.getColorModel();
ColorSpace g2dCS = null;
if (g2dCM != null)
g2dCS = g2dCM.getColorSpace();
if (gc == null)
return null; // Can't tell
* @param destP The Place for the upper left corner of srcRect in dst. | 1 |
/** The target authentication handler. */
private AuthenticationHandler targetAuthHandler;
/** The proxy authentication handler. */
private AuthenticationHandler proxyAuthHandler;
protected abstract AuthenticationHandler createTargetAuthenticationHandler();
protected abstract AuthenticationHandler createProxyAuthenticationHandler();
public synchronized final AuthenticationHandler getTargetAuthenticationHandler() {
if (targetAuthHandler == null) {
targetAuthHandler = createTargetAuthenticationHandler();
}
return targetAuthHandler;
}
public synchronized void setTargetAuthenticationHandler(
final AuthenticationHandler targetAuthHandler) {
this.targetAuthHandler = targetAuthHandler;
}
public synchronized final AuthenticationHandler getProxyAuthenticationHandler() {
if (proxyAuthHandler == null) {
proxyAuthHandler = createProxyAuthenticationHandler();
return proxyAuthHandler;
public synchronized void setProxyAuthenticationHandler(
final AuthenticationHandler proxyAuthHandler) {
this.proxyAuthHandler = proxyAuthHandler;
getTargetAuthenticationHandler(),
getProxyAuthenticationHandler(), | 0 |
* flushing during shutdown is a performance optimization, its not required. The method will make an attempt to initiate flushes of all tables and give up if | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ByteListIterator.java,v 1.3 2003/11/07 17:24:13 rwaldhoff Exp $
* @version $Revision: 1.3 $ $Date: 2003/11/07 17:24:13 $
* @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/)
* | 0 |
* @param preserve Whether requested to preserve the permissions and timestamp | 0 |
if (!(cl.hasOption("file") || cl.hasOption("members")) && !cl.hasOption("add") && !cl.hasOption("remove")) { | 0 |
* Allow list parsing methods to create basic FTPFile entries if parsing fails.
* <p>
* In this case, the FTPFile will contain only the unparsed entry {@link FTPFile#getRawListing()}
* and {@link FTPFile#isValid()} will return {@code false}
* <p>
* If true, the FTPFile for any unparseable entries will contain only the unparsed entry
* {@link FTPFile#getRawListing()} and {@link FTPFile#isValid()} will return {@code false} | 0 |
protected int remainingCapacity() {
return buffer.capacity() - buffer.length();
}
@Override
protected int capacityIncrement() { | 0 |
import org.apache.felix.framework.resolver.Content;
public synchronized Content getContent() throws Exception | 0 |
String filename = url.getFile().replace('/', File.separatorChar);
filename = decodeUrl(filename);
return new File(filename);
return file.length();
return BigInteger.valueOf(file.length());
return file.length(); // will be 0 if file does not exist
return BigInteger.valueOf(fileOrDir.length()); | 0 |
private static Logger logger = Logger.getLogger(StringUtil.class); | 0 |
final DualTreeBidiMap<String, Integer> deserialised = (DualTreeBidiMap<String, Integer>) in.readObject(); | 0 |
super(org.apache.commons.bcel6.Const.LSHL); | 0 |
* If these checks pass, the tokens in the {@code Connection} header will
* be examined. In the absence of a {@code Connection} header, the
* non-standard but commonly used {@code Proxy-Connection} header takes
* it's role. A token {@code close} indicates that the connection cannot
* be reused. If there is no such token, a token {@code keep-alive}
* or if there are no {@code Connection} headers, the default policy for
* the HTTP version is applied. Since {@code HTTP/1.1}, connections are
* re-used by default. Up until {@code HTTP/1.0}, connections are not | 0 |
* @version $Revision$ | 0 |
import java.text.ParseException;
import java.text.SimpleDateFormat;
import org.apache.commons.logging.LogFactory;
// **** This has been changed due to BEANUTILS-449 ****
//convertValueToType(converter, "(B)", String.class, localizedDateValue, localizedDatePattern, expectedValue); | 0 |
* A {@link Coder} that encodes BigQuery {@link TableRow} objects in their native JSON format.
* {@inheritDoc}
*
* @throws NonDeterministicException always. A {@link TableRow} can hold arbitrary
* {@link Object} instances, which makes the encoding non-deterministic. | 0 |
* @version $Revision$ $Date$ | 0 |
* @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A> | 0 |
.pruningPrefix("com.google.auth") | 0 |
package org.w3c.dom.svg;
import org.w3c.dom.DOMException;
public interface SVGMatrix {
public float getA( );
public void setA( float a )
throws DOMException;
public float getB( );
public void setB( float b )
throws DOMException;
public float getC( );
public void setC( float c )
throws DOMException;
public float getD( );
public void setD( float d )
throws DOMException;
public float getE( );
public void setE( float e )
throws DOMException;
public float getF( );
public void setF( float f )
throws DOMException;
SVGMatrix multiply ( SVGMatrix secondMatrix );
SVGMatrix inverse ( )
throws SVGException;
SVGMatrix translate ( float x, float y );
SVGMatrix scale ( float scaleFactor );
SVGMatrix scaleNonUniform ( float scaleFactorX, float scaleFactorY );
SVGMatrix rotate ( float angle );
SVGMatrix rotateFromVector ( float x, float y )
throws SVGException;
SVGMatrix flipX ( );
SVGMatrix flipY ( );
SVGMatrix skewX ( float angle );
SVGMatrix skewY ( float angle );
} | 1 |
protected Map<String, Object> getAttributes(Path file, int flags, LinkOption... options) throws IOException {
protected Map<String, Object> resolveMissingFileAttributes(Path file, int flags, Map<String, Object> current, LinkOption... options) throws IOException {
protected Object resolveMissingFileAttributeValue(Path file, String name, Object value, FileInfoExtractor<?> x, LinkOption... options) throws IOException {
protected Map<String, Object> addMissingAttribute(Path file, Map<String, Object> current, String name, FileInfoExtractor<?> x, LinkOption... options) throws IOException {
protected Map<String, Object> readFileAttributes(Path file, String view, LinkOption... options) throws IOException {
protected void setFileAttributes(Path file, Map<String, ?> attributes, LinkOption... options) throws IOException {
protected void setFileAttribute(Path file, String view, String attribute, Object value, LinkOption... options) throws IOException {
protected void setFileTime(Path file, String view, String attribute, FileTime value, LinkOption... options) throws IOException {
protected void setFileOwnership(Path file, String attribute, Principal value, LinkOption... options) throws IOException {
protected void setFileExtensions(Path file, Map<String, byte[]> extensions, LinkOption... options) throws IOException {
protected void setFilePermissions(Path file, Set<PosixFilePermission> perms, LinkOption... options) throws IOException {
protected void setFileAccessControl(Path file, List<AclEntry> acl, LinkOption... options) throws IOException { | 0 |
import org.apache.felix.ipojo.extender.queue.Job;
public <T> Future<T> submit(Job<T> callable, Callback<T> callback, String description) {
public <T> Future<T> submit(Job<T> callable, String description) {
public <T> Future<T> submit(Job<T> callable) { | 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 |
/*
* 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.
*/
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.values.PCollection;
import org.junit.Rule;
import org.junit.Test;
public class TaskTest {
@Rule
public TestPipeline testPipeline = TestPipeline.create();
@Test
public void parDo() {
Create.Values<Integer> values = Create.of(1, 2, 3, 4, 5);
PCollection<Integer> numbers = testPipeline.apply(values);
PCollection<Integer> results = Task.applyTransform(numbers);
PAssert.that(results)
.containsInAnyOrder(10, 20, 30, 40, 50);
testPipeline.run().waitUntilFinish();
}
} | 0 |
* @version $Id$
assertEquals(file.toURI().toURL(), config.getURL());
factory.setConfigurationURL(new File(dir, "testDigesterConfiguration2.xml").toURI().toURL());
URL url = new URL(TARGET_DIR.toURI().toURL()
config.load(file.toURI().toURL()); | 0 |
public void testNoStagingLocationAndNoTempLocationFails() {
DataflowPipelineOptions options = PipelineOptionsFactory.as(DataflowPipelineOptions.class);
options.setRunner(DataflowPipelineRunner.class);
options.setProject("foo");
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("Missing required value for group");
thrown.expectMessage(DataflowPipelineOptions.DATAFLOW_STORAGE_LOCATION);
thrown.expectMessage("getStagingLocation");
thrown.expectMessage("getTempLocation");
DataflowPipelineRunner.fromOptions(options);
}
@Test
public void testStagingLocationAndNoTempLocationSucceeds() {
DataflowPipelineOptions options = PipelineOptionsFactory.as(DataflowPipelineOptions.class);
options.setRunner(DataflowPipelineRunner.class);
options.setGcpCredential(new TestCredential());
options.setProject("foo");
options.setStagingLocation("gs://spam/ham/eggs");
DataflowPipelineRunner.fromOptions(options);
}
@Test
public void testTempLocationAndNoStagingLocationSucceeds() {
DataflowPipelineOptions options = PipelineOptionsFactory.as(DataflowPipelineOptions.class);
options.setRunner(DataflowPipelineRunner.class);
options.setGcpCredential(new TestCredential());
options.setProject("foo");
options.setTempLocation("gs://spam/ham/eggs");
DataflowPipelineRunner.fromOptions(options);
}
@Test | 0 |
return new SwitchTransformer<>(predicates, transformers, defaultTransformer);
return new SwitchTransformer<>(false, preds, transformers, defaultTransformer); | 1 |
protected ElementValue(final int type, final ConstantPool cpool)
public static ElementValue readElementValue(final DataInput input, final ConstantPool cpool) throws IOException | 0 |
* http://www.apache.org/licenses/LICENSE-2.0 | 0 |
for (Object element : elements) {
Element currentElement = (Element) element;
for (Object element : elements) {
Element currentElement = (Element) element;
nodeToPaint.getGlobalTransform(); | 0 |
import org.apache.beam.sdk.values.WindowingStrategy; | 0 |
@Deprecated
String[] subjectAlts = getSubjectAlts(cert, host);
!isIPAddress(host);
* Extracts the array of SubjectAlt DNS or IP names from an X509Certificate.
* @param hostname
* @return Array of SubjectALT DNS or IP names stored in the certificate.
private static String[] getSubjectAlts(
final X509Certificate cert, final String hostname) {
int subjectType;
if (isIPAddress(hostname)) {
subjectType = 7;
} else {
subjectType = 2;
}
if (type == subjectType) {
* Extracts the array of SubjectAlt DNS names from an X509Certificate.
* Returns null if there aren't any.
* <p/>
* Note: Java doesn't appear able to extract international characters
* from the SubjectAlts. It can only extract international characters
* from the CN field.
* <p/>
* (Or maybe the version of OpenSSL I'm using to test isn't storing the
* international characters correctly in the SubjectAlts?).
*
* @param cert X509Certificate
* @return Array of SubjectALT DNS names stored in the certificate.
*/
public static String[] getDNSSubjectAlts(X509Certificate cert) {
return getSubjectAlts(cert, null);
}
/**
private static boolean isIPAddress(final String hostname) {
return hostname != null &&
(InetAddressUtils.isIPv4Address(hostname) ||
InetAddressUtils.isIPv6Address(hostname));
}
| 0 |
Map<TreeSet<String>,Long> diskUsage = TableDiskUsage.getDiskUsage(getServerConfig().getConfiguration(), tables, fs, conn, false); | 0 |
Object framework = URLHandlers.getFrameworkFromContext(Util.getFrameworkUUIDFromURL(url.getHost()));
framework = URLHandlers.getFrameworkFromContext(Util.getFrameworkUUIDFromURL(u.getHost()));
long bundleId = Util.getBundleIdFromRevisionId(Util.getRevisionIdFromURL(u.getHost())); | 0 |
import org.apache.beam.runners.direct.InProcessPipelineRunner;
String directOut = runPipeline(InProcessPipelineRunner.class); | 0 |
import java.util.SortedMap;
import java.util.TreeMap;
private SortedMap<String, List<Map<String, String>>> getRepos(Request request) {
SortedMap<String, List<Map<String, String>>> result = new TreeMap<String, List<Map<String, String>>>();
private SortedMap<String, List<Map<String, String>>> createResultForOperationSystems(Set<Object> set) {
SortedMap<String, List<Map<String, String>>> result = new TreeMap<String, List<Map<String, 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.
*/
/**
* This package contains implementations of the
* {@link org.apache.commons.collections.BidiMap BidiMap},
* {@link org.apache.commons.collections.OrderedBidiMap OrderedBidiMap} and
* {@link org.apache.commons.collections.SortedBidiMap SortedBidiMap} interfaces.
* A BidiMap is an extension to Map that allows keys and values to be looked up with equal ease.
* One example usage is a system communicating to a legacy datasource that must convert codes
* from the new format to the old format and vice versa.
* <p>
* The following implementations are provided in the package:
* <ul>
* <li>DualHashBidiMap - uses two HashMaps to implement BidiMap
* <li>DualTreeBidiMap - uses two TreeMaps to implement SortedBidiMap
* <li>TreeBidiMap - red-black tree implementation of OrderedBidiMap
* </ul>
* <p>
* The following decorators are provided in the package:
* <ul>
* <li>Unmodifiable - ensures the map cannot be altered
* </ul>
*
* @version $Id$
*/
package org.apache.commons.collections.bidimap; | 0 |
import java.io.InterruptedIOException;
throw new InterruptedIOException("Connection already shutdown"); | 0 |
public final class Selectors {
* A {@link FileSelector} that selects the base file/folder and its direct children.
* A {@link FileSelector} that selects only the direct children of the base folder.
* A {@link FileSelector} that selects all the descendants of the base folder, but does not select the base folder
* itself.
* A {@link FileSelector} that selects the base file/folder, plus all its descendants.
private Selectors() { | 1 |
/*
* Copyright 2000-2004 The Apache Software Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.bcel.generic;
| 0 |
// We cannot safely trust any other "instanceof" mechanism. We need to transitively verify
// the ancestor hierarchy.
JavaClass e = Repository.lookupClass(cname);
JavaClass t = Repository.lookupClass(Type.THROWABLE.getClassName());
JavaClass o = Repository.lookupClass(Type.OBJECT.getClassName());
while (e != o){
if (e == t) {
break; // It's a subclass of Throwable, OKAY, leave.
v = VerifierFactory.getVerifier(e.getSuperclassName());
vr = v.doPass1();
if (vr != VerificationResult.VR_OK){
throw new ClassConstraintException("Exceptions attribute '"+tostring(obj)+"' references '"+cname+"' as an Exception but '"+e.getSuperclassName()+"' in the ancestor hierachy does not pass verification pass 1: "+vr);
e = Repository.lookupClass(e.getSuperclassName());
}
if (e != t) {
throw new ClassConstraintException("Exceptions attribute '"+tostring(obj)+"' references '"+cname+"' as an Exception but it is not a subclass of '"+t.getClassName()+"'.");
return name.equals(Constants.CONSTRUCTOR_NAME); | 0 |
return new AccumuloReloadingVFSClassLoader(dynamicCPath, vfs, wrapper, 1000, true); | 0 |
PropertyUpgradeBehavior upgradeBehavior = property.getPropertyAmbariUpgradeBehavior();
if (upgradeBehavior.isDelete()) {
if (!toRemoveProperties.containsKey(configType)) {
toRemoveProperties.put(configType, new HashSet<String>());
toRemoveProperties.get(configType).add(property.getName());
} else if (upgradeBehavior.isUpdate()) {
if (!toUpdateProperties.containsKey(configType)) {
toUpdateProperties.put(configType, new HashSet<String>());
toUpdateProperties.get(configType).add(property.getName());
} else if (upgradeBehavior.isAdd()) {
if (!toAddProperties.containsKey(configType)) {
toAddProperties.put(configType, new HashSet<String>());
toAddProperties.get(configType).add(property.getName());
} | 0 |
import cz.seznam.euphoria.core.client.dataset.windowing.Batch;
import cz.seznam.euphoria.core.client.dataset.windowing.Time;
assertEquals(Batch.get(), join.getWindowing());
.windowBy(Time.of(Duration.ofHours(1)))
assertTrue(join.getWindowing() instanceof Time); | 0 |
public synchronized IModule[] getModules()
public synchronized boolean hasModule(IModule module)
public synchronized IModule getCurrentModule()
public synchronized void addModule(IModule module)
public synchronized int getState()
public synchronized void setState(int i)
public synchronized BundleContext getBundleContext()
public synchronized void setBundleContext(BundleContext context)
public synchronized BundleActivator getActivator()
public synchronized void setActivator(BundleActivator activator)
public synchronized boolean isStale()
public synchronized void setStale()
public synchronized boolean isExtension()
public synchronized void setExtension(boolean extension)
public synchronized boolean isLockable()
public synchronized void lock()
public synchronized void unlock()
public synchronized void syncLock(BundleInfo info) | 0 |
final StringBuilder buf = new StringBuilder();
final SSLIOSession tlsSession = tlsSessionRef.get();
if (tlsSession != null) {
buf.append(tlsSession);
} else {
buf.append(ioSession);
}
final IOEventHandler handler = getHandler();
if (handler != null) {
buf.append(handler);
}
return buf.toString(); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/java/org/apache/commons/beanutils/converters/CharacterArrayConverter.java,v 1.6 2003/10/09 20:43:16 rdonkin Exp $
* $Revision: 1.6 $
* $Date: 2003/10/09 20:43:16 $
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
* @version $Revision: 1.6 $ $Date: 2003/10/09 20:43:16 $ | 0 |
ExtendedSelector {
selector = sel;
simpleSelector = simple;
return ((ExtendedSelector)selector).getSpecificity() +
((ExtendedSelector)simpleSelector).getSpecificity();
*/
return selector;
*/
return simpleSelector; | 1 |
import org.apache.beam.runners.dataflow.worker.graph.CreateExecutableStageNodeFunction;
Function<MutableNetwork<Node, Edge>, MutableNetwork<Node, Edge>> transformToRunnerNetwork;
Function<MutableNetwork<Node, Edge>, Node> sdkFusedStage;
if (DataflowRunner.hasExperiment(options, "use_executable_stage_bundle_execution")) {
sdkFusedStage = new CreateExecutableStageNodeFunction(pipeline, idGenerator);
transformToRunnerNetwork =
new CreateRegisterFnOperationFunction(
idGenerator,
this::createPortNode,
lengthPrefixUnknownCoders.andThen(sdkFusedStage),
true);
} else {
sdkFusedStage =
pipeline == null
? RegisterNodeFunction.withoutPipeline(
idGenerator, sdkHarnessRegistry.beamFnStateApiServiceDescriptor())
: RegisterNodeFunction.forPipeline(
pipeline, idGenerator, sdkHarnessRegistry.beamFnStateApiServiceDescriptor());
transformToRunnerNetwork =
new CreateRegisterFnOperationFunction(
idGenerator,
this::createPortNode,
lengthPrefixUnknownCoders.andThen(sdkFusedStage),
false);
} | 0 |
// <!> TODO only when binding is enabled
BridgeEventSupport.addDOMListener(ctx, element);
| 0 |
LOG.warning(String.format("Unknown key type: %s", fields[0]));
continue; | 0 |
options.setRunner(DirectRunner.class); | 0 |
import java.util.concurrent.TimeUnit;
assertThat(queryResult.get(2, TimeUnit.MINUTES).size(), equalTo(3)); | 0 |
import java.sql.Types;
import org.apache.beam.dsls.sql.TestUtils;
import org.apache.beam.dsls.sql.mock.MockedBoundedTable;
public static final Date THE_DATE = new Date(100000);
sqlEnv.registerTable("ORDER_DETAILS",
MockedBoundedTable.of(
Types.BIGINT, "order_id",
Types.INTEGER, "site_id",
Types.DOUBLE, "price",
Types.TIMESTAMP, "order_time"
).addRows(
1L, 1, 1.0, THE_DATE,
2L, 2, 2.0, THE_DATE
)
);
PAssert.that(rows.apply(ParDo.of(new TestUtils.BeamSqlRow2StringDoFn())))
.containsInAnyOrder(
TestUtils.RowsBuilder.of(
Types.BIGINT, "order_id",
Types.INTEGER, "site_id",
Types.BIGINT, "cnt"
).addRows(
1L, 1, 1L,
2L, 2, 1L
).getStringRows()); | 0 |
tr.rotate(Math.PI * angle / 180); | 0 |
void endStream(List<? extends Header> trailers) throws IOException; | 1 |
/*
* Copyright 2000-2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/ | 0 |
if ("XMLSignatureFactory".equals(type)) {
if ("DOM".equals(algo)) {
} else if ("KeyInfoFactory".equals(type)) {
if ("DOM".equals(algo)) {
} else if ("TransformService".equals(type)) {
} else if ("http://www.w3.org/2006/12/xml-c14n11".equals(algo) ||
"http://www.w3.org/2006/12/xml-c14n11#WithComments".equals(algo)) { | 0 |
import java.nio.charset.StandardCharsets;
zk.create(path, "test".getBytes(StandardCharsets.UTF_8), Ids.OPEN_ACL_UNSAFE,
zk.create("/a", "test".getBytes(StandardCharsets.UTF_8), Ids.OPEN_ACL_UNSAFE,
assertArrayEquals("unexpected data", "test".getBytes(StandardCharsets.UTF_8), contents);
zk.create("/a", "test".getBytes(StandardCharsets.UTF_8), Ids.OPEN_ACL_UNSAFE,
assertArrayEquals("unexpected data", "test".getBytes(StandardCharsets.UTF_8), contents);
assertArrayEquals("unexpected data", "test".getBytes(StandardCharsets.UTF_8), contents); | 0 |
// RequestResourceFilter
columns.clear();
columns.add(new DBColumnInfo("request_id", Long.class, null, null, false));
columns.add(new DBColumnInfo("service_name", String.class, 255, null, true));
columns.add(new DBColumnInfo("component_name", String.class, 255, null, true));
columns.add(new DBColumnInfo("hosts", byte[].class, null, null, true));
dbAccessor.createTable("requestresourcefilter", columns, "request_id", "service_name", "component_name");
dbAccessor.addFKConstraint("requestresourcefilter", "FK_requestresourcefilter_req_id", "request_id", "request", "request_id", true); | 0 |
import org.apache.felix.bundlerepository.RepositoryAdmin; | 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.felix.mosgi.managedelements.memoryprobe;
import org.apache.felix.mosgi.console.ifc.TabIfc;
public interface MemoryProbeMBean extends TabIfc {
}
| 0 |
package org.apache.felix.sigil.model.common;
import static org.apache.felix.sigil.model.common.Expressions.and;
import static org.apache.felix.sigil.model.common.Expressions.not;
import static org.apache.felix.sigil.model.common.Expressions.or;
import static org.apache.felix.sigil.model.common.Ops.APPROX;
import static org.apache.felix.sigil.model.common.Ops.EQ;
import static org.apache.felix.sigil.model.common.Ops.GE;
import static org.apache.felix.sigil.model.common.Ops.GT;
import static org.apache.felix.sigil.model.common.Ops.LE;
import static org.apache.felix.sigil.model.common.Ops.LT; | 0 |
@Override | 0 |
* If an object cannot be added to the bag, an IllegalArgumentException is thrown.</p>
* <pre>Bag bag = PredicatedBag.decorate(new HashBag(), NotNullPredicate.INSTANCE);</pre></p>
* This class is Serializable from Commons Collections 3.1.</p>
* are validated.</p>
* @param <E> the type of the elements in the bag
public static <E> PredicatedBag<E> predicatedBag(Bag<E> bag, Predicate<? super E> predicate) {
return new PredicatedBag<E>(bag, predicate);
* are validated.</p>
/**
* {@inheritDoc}
*/
/**
* {@inheritDoc}
*/
/**
* {@inheritDoc}
*/
/**
* {@inheritDoc}
*/ | 0 |
* </p>
* <p>
* <strong>Example 1 - One configuration per table</strong>
* </p>
* BasicConfigurationBuilder<DatabaseConfiguration> builder =
* new BasicConfigurationBuilder<DatabaseConfiguration>(DatabaseConfiguration.class);
* <p>
* <strong>Example 2 - Multiple configurations per table</strong>
* </p>
* BasicConfigurationBuilder<DatabaseConfiguration> builder =
* new BasicConfigurationBuilder<DatabaseConfiguration>(DatabaseConfiguration.class); | 0 |
import cz.seznam.euphoria.core.client.functional.UnaryFunctor;
import cz.seznam.euphoria.operator.test.accumulators.SnapshotProvider;
import java.util.Map;
@Test
public void testCounterTest() {
execute(new AbstractTestCase<Integer, Integer>() {
@Override
protected Partitions<Integer> getInput() {
return Partitions.add(1, 2, 3, 4, 5, 6)
.add(0, 10, 20)
.build();
}
@Override
protected Dataset<Integer> getOutput(Dataset<Integer> input) {
return FlatMap.of(input).using(
(UnaryFunctor<Integer, Integer>) (elem, collector) -> {
collector.getCounter("input").increment();
collector.getCounter("sum").increment(elem);
collector.collect(elem * elem);
})
.output();
}
@Override
public int getNumOutputPartitions() {
return 2;
}
@Override
public void validate(Partitions<Integer> partitions) {
assertEquals(Arrays.asList(1, 4, 9, 16, 25, 36), partitions.get(0));
assertEquals(Arrays.asList(0, 100, 400), partitions.get(1));
}
@Override
public void validateAccumulators(SnapshotProvider snapshots) {
Map<String, Long> counters = snapshots.getCounterSnapshots();
assertEquals(Long.valueOf(9L), counters.get("input"));
assertEquals(Long.valueOf(51L), counters.get("sum"));
}
});
}
| 0 |
import org.apache.beam.dsls.sql.interpreter.operator.arithmetic.BeamSqlDivideExpression;
import org.apache.beam.dsls.sql.interpreter.operator.arithmetic.BeamSqlMinusExpression;
import org.apache.beam.dsls.sql.interpreter.operator.arithmetic.BeamSqlModExpression;
import org.apache.beam.dsls.sql.interpreter.operator.arithmetic.BeamSqlMultiplyExpression;
import org.apache.beam.dsls.sql.interpreter.operator.arithmetic.BeamSqlPlusExpression;
static BeamSqlExpression buildExpression(RexNode rexNode) {
// arithmetic operators
case "+":
return new BeamSqlPlusExpression(subExps);
case "-":
return new BeamSqlMinusExpression(subExps);
case "*":
return new BeamSqlMultiplyExpression(subExps);
case "/":
return new BeamSqlDivideExpression(subExps);
case "MOD":
return new BeamSqlModExpression(subExps);
throw new BeamSqlUnsupportedException("Operator: " + opName + " not supported yet!"); | 0 |
* @version $Revision$ $Date$ | 0 |
import org.apache.batik.transcoder.image.ImageTranscoder;
import org.apache.batik.transcoder.image.PNGTranscoder;
* alternate stylesheet.
* Returns the <tt>ImageTranscoder</tt> the Test should
* use
public ImageTranscoder getTestImageTranscoder(){
ImageTranscoder t = super.getTestImageTranscoder();
t.addTranscodingHint(PNGTranscoder.KEY_ALTERNATE_STYLESHEET,
parameter);
return t; | 0 |
Connector conn = Monitor.getContext().getConnector(principal, at); | 0 |
* <fb:value id="<i>widget-id</i>" path="<i>xpath-expression</i>">
* <fb:on-update>
* </fb:on-update>
* </fb:value>
* @version CVS $Id: ValueJXPathBindingBuilder.java,v 1.3 2004/04/01 12:59:57 mpo Exp $ | 0 |
defaultSchema.add(entry.getKey(), UdfImpl.create(method));
defaultSchema.add(functionName, UdfImpl.create(clazz, method)); | 0 |
import java.util.Map;
private Map<String, Map<String, String>> configurations;
@JsonProperty("configurations")
public Map<String, Map<String, String>> getConfigurations() {
return configurations;
}
@JsonProperty("configurations")
public void setConfigurations(Map<String, Map<String, String>> configurations) {
this.configurations = configurations;
} | 0 |
/** A collection of utility classes. */ | 0 |
getDigester().getLogger().debug("[SetPropertyRule]{" + getDigester().getMatch() + | 0 |
import java.nio.ByteBuffer;
@Deprecated
@Override
public Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException {
throw new UnsupportedOperationException();
}
@Deprecated
@Override
public Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException {
throw new UnsupportedOperationException();
}
@Deprecated
@Override
public Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException {
throw new UnsupportedOperationException();
}
@Deprecated
@Override
public AccumuloConfiguration getConfiguration() {
throw new UnsupportedOperationException();
}
@Deprecated
@Override
public void setConfiguration(AccumuloConfiguration conf) {}
| 0 |
if (!entry.getKey().getRow().toString().startsWith(MetadataTable.ID.canonicalID())) | 1 |
import org.apache.ambari.server.security.authentication.AmbariUserAuthentication; | 0 |
interface SaxBit extends Serializable {
void send(ContentHandler contentHandler) throws SAXException;
public final static class StartDocument implements SaxBit {
public final static class EndDocument implements SaxBit {
public final static class PI implements SaxBit {
public final static class StartDTD implements SaxBit {
public final static class EndDTD implements SaxBit {
public final static class StartEntity implements SaxBit {
public final static class EndEntity implements SaxBit {
public final static class SkippedEntity implements SaxBit {
public final static class StartPrefixMapping implements SaxBit {
public final static class EndPrefixMapping implements SaxBit {
public final static class StartElement implements SaxBit {
public final static class EndElement implements SaxBit {
public final static class Characters implements SaxBit {
public final static class Comment implements SaxBit {
public final static class StartCDATA implements SaxBit {
public final static class EndCDATA implements SaxBit {
public final static class IgnorableWhitespace implements SaxBit { | 0 |
final HttpContext context) throws IOException, ClientProtocolException {
final HttpContext localContext = context != null ? context : new BasicHttpContext();
final HttpRequest wrapped;
acceptEncodingInterceptor.process(wrapped, localContext);
final HttpResponse response = backend.execute(target, wrapped, localContext);
contentEncodingInterceptor.process(response, localContext);
if (Boolean.TRUE.equals(localContext.getAttribute(ResponseContentEncoding.UNCOMPRESSED))) { | 0 |
shellState.getReader().println("Removed "+pluginType+" on " + tableName);
shellState.getReader().println(ent.getKey() + ": " + ent.getValue()); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/test/org/apache/commons/validator/TestTypeValidator.java,v 1.6 2004/02/21 17:10:30 rleland Exp $
* $Revision: 1.6 $
* $Date: 2004/02/21 17:10:30 $
* Copyright 2001-2004 The Apache Software Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. | 0 |
import java.util.Map;
import org.apache.aurora.scheduler.storage.entities.IServerInfo;
import org.apache.mesos.Protos.DiscoveryInfo;
import org.apache.mesos.Protos.Port;
@VisibleForTesting
static final String DEFAULT_PORT_PROTOCOL = "TCP";
private final IServerInfo serverInfo;
MesosTaskFactoryImpl(
ExecutorSettings executorSettings,
TierManager tierManager,
IServerInfo serverInfo) {
this.serverInfo = requireNonNull(serverInfo);
@VisibleForTesting
static String getInverseJobSourceName(IJobKey job) {
return String.format("%s.%s.%s", job.getName(), job.getEnvironment(), job.getRole());
}
if (executorSettings.shouldPopulateDiscoverInfo()) {
configureDiscoveryInfos(task, taskBuilder);
}
private void configureDiscoveryInfos(IAssignedTask task, TaskInfo.Builder taskBuilder) {
DiscoveryInfo.Builder builder = taskBuilder.getDiscoveryBuilder();
builder.setVisibility(DiscoveryInfo.Visibility.CLUSTER);
builder.setName(getInverseJobSourceName(task.getTask().getJob()));
builder.setEnvironment(task.getTask().getJob().getEnvironment());
// A good sane choice for default location is current Aurora cluster name.
builder.setLocation(serverInfo.getClusterName());
for (Map.Entry<String, Integer> entry : task.getAssignedPorts().entrySet()) {
builder.getPortsBuilder().addPorts(
Port.newBuilder()
.setName(entry.getKey())
.setNumber(entry.getValue())
.setProtocol(DEFAULT_PORT_PROTOCOL)
);
}
} | 0 |
import org.apache.beam.sdk.options.PipelineOptionsFactory;
@Test
public void testGameStatsOptions() {
PipelineOptionsFactory.as(GameStats.Options.class);
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.