Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
/** * Implements chunked transfer coding. The content is sent in small chunks. * Entities transferred using this decoder can be of unlimited length. * * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a> * * @version $Revision$ */
0
import org.apache.sshd.common.util.io.IoUtils;
0
package org.apache.beam.sdk.io.aws2.options;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/decorators/Attic/AbstractCollectionDecorator.java,v 1.4 2003/08/31 17:24:46 scolebourne Exp $ * any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * @version $Revision: 1.4 $ $Date: 2003/08/31 17:24:46 $
0
import org.apache.beam.model.pipeline.v1.RunnerApi; import org.apache.beam.model.pipeline.v1.RunnerApi.FunctionSpec; import org.apache.beam.model.pipeline.v1.RunnerApi.IsBounded; import org.apache.beam.model.pipeline.v1.RunnerApi.ReadPayload; import org.apache.beam.model.pipeline.v1.RunnerApi.SdkFunctionSpec;
0
* @return {@code true}. This coder is injective. */ @Override public boolean consistentWithEquals() { return true; } /** * {@inheritDoc} *
0
package org.apache.hc.core5.http.nio.support.classic;
0
/* * Copyright (C) The Apache Software Foundation. All rights reserved. * * This software is published under the terms of the Apache Software License * version 1.1, a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.apache.commons.vfs.provider; import org.apache.commons.logging.Log; import org.apache.commons.vfs.FileSystemException; /** * A partial {@link VfsComponent} implementation. * * @author <a href="mailto:[email protected]">Adam Murdoch</a> * @version $Revision: 1.1 $ $Date: 2002/08/21 14:28:07 $ */ public abstract class AbstractVfsComponent implements VfsComponent { private FileSystemProviderContext context; private Log log; /** * Sets the Logger to use for the component. */ public final void setLogger( final Log log ) { this.log = log; } /** * Sets the context for this file system provider. */ public final void setContext( final FileSystemProviderContext context ) { this.context = context; } /** * Initialises the component. This implementation does nothing. */ public void init() throws FileSystemException { } /** * Closes the provider. This implementation does nothing. */ public void close() { } /** * Returns the logger for this file system to use. */ protected final Log getLogger() { return log; } /** * Returns the context for this provider. */ protected final FileSystemProviderContext getContext() { return context; } }
0
import static org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Iterables.size; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableMap; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableSet;
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.ambari.server.events.listeners.requests.StateUpdateListener; import org.springframework.context.annotation.Bean; import com.google.inject.Injector; @Bean public StateUpdateListener requestStatusListener(Injector injector) { return new StateUpdateListener(injector); }
1
@SuppressWarnings("unused") // used to create a CoderFactory
0
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((exception == null) ? 0 : exception.hashCode()); result = prime * result + ((outcome == null) ? 0 : outcome.hashCode()); result = prime * result + ((output == null) ? 0 : output.hashCode()); return result; } @Override
0
List<String> hostList = new ArrayList<>(); Map<String, List<Integer>> zkTopology = new HashMap<>(); zkTopology.put("ZOOKEEPER_SERVER", new ArrayList<>(zkServerHosts)); List<String> hostList = new ArrayList<>(); Map<String, List<Integer>> hdfsTopology = new HashMap<>(); hdfsTopology.put("DATANODE", new ArrayList<>(datanodeHosts)); Set<String> changedHosts = new HashSet<>(); List<String> hostList = new ArrayList<>(); Map<String, List<Integer>> hdfsTopology = new HashMap<>(); hdfsTopology.put("GANGLIA_MONITOR", new ArrayList<>(monitorHosts)); Set<String> changedHosts = new HashSet<>(); List<String> hostList = new ArrayList<>(); Set<String> changedHosts = new HashSet<>(); Map<String, String> hostAttributes = new HashMap<>();
1
import org.apache.ambari.server.controller.internal.URLStreamProvider; URLStreamProvider streamProvider, URLStreamProvider streamProvider,
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.ambari.server.controller.spi; import org.apache.ambari.server.controller.internal.SortRequestImpl; import java.util.List; /** * Holder for request information used for sorting the results. */ public interface SortRequest { /** * Get a list of @SortRequestProperty. */ public List<SortRequestProperty> getProperties(); /** * Get a list of propertyIds */ public List<String> getPropertyIds(); /** * Enumeration for order of sorting */ public enum Order { ASC, DESC } }
0
// Creates a stream of Artist components .mapToObj(i -> createArtists(m_dm)).peek(m_components::add) // For each artist in the stream, creates a new stream of Album components // For each Album, creates a new stream of Track components return dm.createComponent().setInterface(Artist.class.getName(), null).setImplementation(new ArtistImpl(m_controller)); artist.add(dm.createServiceDependency().setService(Album.class, filter).setRequired(true).setCallbacks("addAlbum", null)); return dm.createComponent().setInterface(Album.class.getName(), props).setImplementation(new AlbumImpl(m_controller)); album.add(dm.createServiceDependency().setService(Track.class, f).setRequired(true).setCallbacks("addTrack", null)); return dm.createComponent().setInterface(Track.class.getName(), p).setImplementation(new TrackImpl(m_controller));
0
* @version CVS $Id: AntBuildGenerator.java,v 1.1 2003/09/04 12:42:41 cziegeler Exp $
0
String sourceTableId = entry.getValue().getSourceTableId().canonicalID(); String queuedWork = queuedWorkForPeer.get(target.getSourceTableId().canonicalID()); String queuedWork = workForPeer.get(target.getSourceTableId().canonicalID()); workForPeer.put(target.getSourceTableId().canonicalID(), queueKey); String queuedWork = queuedWorkForPeer.get(target.getSourceTableId().canonicalID()); String queuedWork = queuedWorkForPeer.get(target.getSourceTableId().canonicalID()); queuedWorkForPeer.remove(target.getSourceTableId().canonicalID());
1
import org.apache.thrift.transport.TTransport; public TabletServerStatus getTableMap(boolean usePooledConnection) throws TException, ThriftSecurityException { if (usePooledConnection == true) throw new UnsupportedOperationException(); TTransport transport = ThriftUtil.createTransport(address, ServerConfiguration.getSystemConfiguration()); TabletClientService.Iface client = ThriftUtil.createClient(new TabletClientService.Client.Factory(), transport); if (transport != null) transport.close();
0
@Nullable Coder<KeyedWorkItem<String, KV<InputT, RestrictionT>>> inputCoder,
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.testutils.fakes; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.beam.sdk.testutils.TestResult; import org.apache.beam.sdk.testutils.publishing.BigQueryResultsPublisher; /** A fake implementation of {@link BigQueryResultsPublisher} for testing purposes only. */ public class FakeBigQueryResultsPublisher extends BigQueryResultsPublisher { private Map<String, List<TestResult>> recordsPerTable; public FakeBigQueryResultsPublisher() { super(null, null); this.recordsPerTable = new HashMap<>(); } @Override public void publish(TestResult result, String tableName, long nowInMillis) { List<TestResult> results = recordsPerTable.get(tableName); if (results == null) { results = new ArrayList<>(); } results.add(result); recordsPerTable.put(tableName, results); } public List<TestResult> getRecords(String table) { return recordsPerTable.get(table); } }
0
document = db.parse(in);
0
import com.google.cloud.dataflow.sdk.io.range.OffsetRangeTracker; import com.google.cloud.dataflow.sdk.util.common.worker.AbstractBoundedReaderIterator; protected abstract class FileBasedIterator extends AbstractBoundedReaderIterator<T> { protected final OffsetRangeTracker rangeTracker; protected final ProgressTracker<Integer> progressTracker; protected ByteArrayOutputStream nextElement; FileBasedIterator( CopyableSeekableByteChannel seeker, long startOffset, long offset, @Nullable Long endOffset, ProgressTracker<Integer> progressTracker, DecompressingStreamFactory compressionStreamFactory) throws IOException { long stopOffset = (endOffset == null) ? OffsetRangeTracker.OFFSET_INFINITY : endOffset; this.rangeTracker = new OffsetRangeTracker(startOffset, stopOffset); this.progressTracker = checkNotNull(progressTracker); protected boolean hasNextImpl() throws IOException { long startOffset = offset; ByteArrayOutputStream element = readElement(); // As a side effect, updates "offset" if (element != null && rangeTracker.tryReturnRecordAt(true, startOffset)) { nextElement = element; progressTracker.saw((int) (offset - startOffset)); } else { nextElement = null; } protected T nextImpl() throws IOException { // If endOffset is unspecified, we don't know the fraction consumed. if (rangeTracker.getStopPosition() != Long.MAX_VALUE) { progress.setPercentComplete((float) rangeTracker.getFractionConsumed()); if (rangeTracker.trySplitAtPosition(splitOffset)) { return new DynamicSplitResultWithPosition(cloudPositionToReaderPosition(splitPosition)); } else { * Returns the end offset of the iterator or Long.MAX_VALUE if unspecified. long getEndOffset() { return rangeTracker.getStopPosition();
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.cocoon.servletservice; /** * Interface for servlet services that are mounted on a specific path. * The inteface is not needed for using the {@link DispatcherServlet} * as it mounts all servlet beans that has a property named mountPath. * The main use for the interface is to b e able to create an AOP mixin * with an ordinary Java proxy. * @version $Id$ */ public interface Mountable { /** * The mount path of the servlet * @return */ public String getMountPath(); }
0
* This default implementation removes entries that do not parse as files.
0
IZooReaderWriter zoo = ZooReaderWriter.getInstance(); IZooReaderWriter zoo = ZooReaderWriter.getInstance(); ZooReaderWriter.getInstance().recursiveDelete(ZKUserPath + "/" + user, NodeMissingPolicy.FAIL); ZooReaderWriter.getInstance().putPrivatePersistentData(ZKUserPath + "/" + principal, ZKSecurityTool.createPass(pt.getPassword()),
0
import org.springframework.security.core.GrantedAuthority;
0
public static CoGbkResultSchema of(List<TupleTag<?>> tags) {
0
import org.apache.http.LoggingClientConnectionFactory; import org.apache.http.LoggingServerConnectionFactory; final HttpParams params) throws Exception { return new LoggingServerConnectionFactory(params); final HttpParams params) throws Exception { return new LoggingClientConnectionFactory(params);
0
return algo + ":" + BufferUtils.toHex(':', data).toLowerCase();
0
* @version $Rev: 527592 $, $Date$ *
0
public BaseIOReactor() throws IOException { protected void addChannel(final SocketChannel channel) throws IOException {
0
* limitations under the License.
0
import org.apache.cocoon.components.flow.Interpreter; * @see org.apache.cocoon.sitemap.Sitemap#getProcessor() public Processor getProcessor() { /** * @see org.apache.cocoon.sitemap.Sitemap#getInterpreter(java.lang.String) */ public Interpreter getInterpreter(String language) { // TODO We ignore the language for now return (Interpreter)this.getProcessor().getAttribute(Interpreter.ROLE); }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/TestTransformedSortedBag.java,v 1.3 2003/11/18 22:37:15 scolebourne Exp $ * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:15 $ public Bag makeBag() {
0
package org.apache.accumulo.core.client.mapreduce; public class BatchScanConfig implements Writable { public BatchScanConfig(String tableName) { public BatchScanConfig(DataInput input) throws IOException { public BatchScanConfig setRanges(List<Range> ranges) { public BatchScanConfig fetchColumns(Set<Pair<Text,Text>> columns) { public BatchScanConfig setIterators(List<IteratorSetting> iterators) { public BatchScanConfig setAutoAdjustRanges(boolean autoAdjustRanges) { public BatchScanConfig setUseLocalIterators(boolean useLocalIterators) { public BatchScanConfig setOfflineScan(boolean offlineScan) { public BatchScanConfig setUseIsolatedScanners(boolean useIsolatedScanners) { BatchScanConfig that = (BatchScanConfig) o;
0
? OptUtil.getNamespaceOpt(cl, shellState) : null; tableIdOption = new Option("l", "list-ids", false, "display internal table ids along with the table name");
0
import org.apache.zookeeper.ZKParameterized; @Parameterized.UseParametersRunnerFactory(ZKParameterized.RunnerFactory.class)
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.runtime.core.test.components; import org.apache.felix.ipojo.runtime.core.test.services.CheckService; import org.apache.felix.ipojo.runtime.core.test.services.FooService; import java.util.Properties; public class MultipleFilterCheckSubscriber implements CheckService { private FooService[] m_foo; private int binded; public MultipleFilterCheckSubscriber(){ } public boolean check() { for (int i = 0; i < m_foo.length; i++) { m_foo[i].foo(); } return true; } public Properties getProps() { Properties props = new Properties(); props.put("Bind", new Integer(binded)); props.put("Size", new Integer(m_foo.length)); return props; } private void Bind() { binded++; } private void Unbind() { binded--; } }
0
// there's a little race between getting the children and fetching // the data. The log can be removed in between. m.put(new byte[] {}, new byte[] {}, new byte[] {}); m.putDelete(new byte[] {}, new byte[] {});
0
line = GenericUtils.replaceWhitespaceAndTrim(line); String[] hosts = GenericUtils.split(line, ',');
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: AbstractPreceptorAction.java,v 1.4 2004/03/05 13:02:19 bdelacretaz Exp $
1
import org.apache.commons.logging.Log; import org.apache.commons.vfs.provider.VfsComponentContext; * @version $Revision: 1.8 $ $Date: 2002/11/23 00:33:52 $
0
import org.apache.beam.sdk.options.PipelineOptions; checkJdbc(pipeline.getOptions()); private void checkJdbc(PipelineOptions pipelineOptions) throws Exception { Connection connection = JdbcDriver.connect(tableProvider, pipelineOptions);
0
private static final long serialVersionUID = 1083167395296383469L;
0
import java.util.List;
0
Element filterDef = domFactory.createElement(SVG_FILTER_TAG); Element feFuncR = domFactory.createElement(SVG_FE_FUNC_R_TAG); Element feFuncG = domFactory.createElement(SVG_FE_FUNC_G_TAG); Element feFuncB = domFactory.createElement(SVG_FE_FUNC_B_TAG); feFuncA = domFactory.createElement(SVG_FE_FUNC_A_TAG); Element group = domFactory.createElement(SVG_G_TAG); Element rectGroupOne = domFactory.createElement(SVG_G_TAG); Element rectGroupTwo = domFactory.createElement(SVG_G_TAG); rect.setAttribute(SVG_FILTER_ATTRIBUTE, filterDesc.getFilterValue()); rect.setAttribute(SVG_FILTER_ATTRIBUTE, filterDesc.getFilterValue());
0
Collector collector = QueueCollector.wrap(out); collector, item::getStamp);
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: EventAware.java,v 1.3 2004/03/05 13:01:56 bdelacretaz Exp $
1
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
public static final String PUBSUB_SERIALIZED_ATTRIBUTES_FN = "pubsub_serialized_attributes_fn";
0
import java.util.Collection; * Users (helper) object used to obtain privilege entities. protected static Users users; * @param users the users helper instance ViewInstanceDAO viewInstanceDAO, Users users) { GroupPrivilegeResourceProvider.users = users; final Collection<PrivilegeEntity> privileges = users.getGroupPrivileges(groupEntity);
0
return new Command[] {new DebugCommand()};
0
* Returns an SHA-1 digest. * * @return An SHA-1 digest instance. * @throws IllegalArgumentException * when a {@link NoSuchAlgorithmException} is caught, which should never happen because SHA-1 is a * built-in algorithm * @see MessageDigestAlgorithms#SHA_1 * @since 1.7 */ public static MessageDigest getSha1Digest() { return getDigest(MessageDigestAlgorithms.SHA_1); } /** * @since 1.7 */ public static byte[] sha1(byte[] data) { return getSha1Digest().digest(data); } /** * Calculates the SHA-1 digest and returns the value as a <code>byte[]</code>. * * @param data * Data to digest * @return SHA-1 digest * @throws IOException * On error reading from the stream * @since 1.7 */ public static byte[] sha1(InputStream data) throws IOException { return digest(getSha1Digest(), data); } /** * Calculates the SHA-1 digest and returns the value as a <code>byte[]</code>. * * @param data * Data to digest * @return SHA-1 digest public static MessageDigest updateDigest(final MessageDigest messageDigest, byte[] valueToDigest) { messageDigest.update(valueToDigest); public static MessageDigest updateDigest(final MessageDigest messageDigest, final String valueToDigest) { messageDigest.update(getBytesUtf8(valueToDigest));
0
import static org.junit.Assert.assertSame; import java.util.List; * Tests whether all error listeners can be cleared. */ @Test public void testClearErrorListeners() { EventListener<ConfigurationEvent> cl = new EventListenerTestImpl(null); ErrorListenerTestImpl el1 = new ErrorListenerTestImpl(null); ErrorListenerTestImpl el2 = new ErrorListenerTestImpl(null); ErrorListenerTestImpl el3 = new ErrorListenerTestImpl(null); source.addEventListener(ConfigurationErrorEvent.READ, el1); source.addEventListener(ConfigurationErrorEvent.ANY, el2); source.addEventListener(ConfigurationEvent.ANY, cl); source.addEventListener(ConfigurationErrorEvent.WRITE, el3); source.clearErrorListeners(); List<EventListenerRegistrationData<?>> regs = source.getEventListenerRegistrations(); assertEquals("Wrong number of event listener registrations", 1, regs.size()); assertSame("Wrong remaining listener", cl, regs.get(0).getListener()); } /** private static class CountingEventSource extends BaseEventSource implements Cloneable
0
* limitations under the License.
0
import org.apache.beam.portability.v1.Endpoints; private final Endpoints.ApiServiceDescriptor apiServiceDescriptor;
0
* Copyright (c) OSGi Alliance (2017). All Rights Reserved. * * 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 * @author $Id$
0
import org.apache.http.HttpConnectionMetrics; public HttpConnectionMetrics getMetrics() { return null; }
0
* Options used to configure streaming. @Description("Set to true if running a streaming pipeline.")
0
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hedwig.server.persistence; import junit.framework.Test; import junit.framework.TestSuite; import org.apache.hedwig.server.persistence.LocalDBPersistenceManager; import org.apache.hedwig.server.persistence.PersistenceManager; public class TestLocalDBPersistenceManagerBlackBox extends TestPersistenceManagerBlackBox { @Override protected void tearDown() throws Exception { super.tearDown(); ((LocalDBPersistenceManager) persistenceManager).reset(); } @Override long getLowestSeqId() { return 1; } @Override PersistenceManager instantiatePersistenceManager() { return LocalDBPersistenceManager.instance(); } @Override public long getExpectedSeqId(int numPublished) { return numPublished; } public static Test suite() { return new TestSuite(TestLocalDBPersistenceManagerBlackBox.class); } }
0
import org.apache.hc.core5.http.ClassicHttpResponse; import org.apache.hc.core5.http.io.EofSensorInputStream; import org.apache.hc.core5.http.io.EofSensorWatcher; import org.apache.hc.core5.http.io.entity.HttpEntityWrapper; public static void enchance(final ClassicHttpResponse response, final ConnectionHolder connHolder) {
0
package org.apache.beam.runners.dataflow.options; import org.apache.beam.sdk.options.Default; import org.apache.beam.sdk.options.Description; import org.apache.beam.sdk.options.PipelineOptions;
0
bind(AttributeStore.Mutable.class).to(AttributeStoreImpl.class);
0
package cz.seznam.euphoria.beam.window; import java.util.Objects; import org.apache.beam.sdk.extensions.euphoria.core.client.dataset.windowing.Window; /** * Window used as type parameter of {@link BeamWindowing}. */ final class UnsupportedWindow extends Window<UnsupportedWindow> { private UnsupportedWindow(){ //Do not instantiate } @Override public int compareTo(UnsupportedWindow o) { throw new UnsupportedOperationException(); } @Override public long maxTimestamp() { throw new UnsupportedOperationException(); } @Override public int hashCode() { throw new UnsupportedOperationException(); } @Override public boolean equals(Object obj) { return Objects.equals(this, obj); } }
0
import com.twitter.mesos.scheduler.base.JobKeys; import com.twitter.mesos.scheduler.base.Query;
0
* @param e The &lt;image&gt; element that can't be loaded.
0
ListDataSource.unbounded(sequenceInts(0, N)) .withReadDelay(Duration.ofMillis(2))); ListDataSource.unbounded(sequenceInts(0, N)) .withReadDelay(Duration.ofMillis(2))); Flow flow = Flow.create("Test"); ListDataSource<Pair<Integer, String>> input = ListDataSource.bounded(Arrays.asList( Pair.of(1, "one"), Pair.of(1, "two"), Pair.of(1, "three"), Pair.of(1, "one"), Pair.of(2, "two"), Pair.of(1, "three"), Pair.of(1, "three"))); Dataset<Pair<Integer, String>> pairs = flow.createInput(input); .keyBy(e -> e) .valueBy(e -> 1L) ListDataSink<Pair<CompositeKey<Integer, String>, Long>> out = ListDataSink.get(1); output.persist(out); out.getOutput(0).stream().map(p -> {
0
* <p>It is generally safe for <i>applications</i> to depend on experimental * APIs, at the cost of some extra work during upgrades. However, it is * generally inadvisable for <i>libraries</i> (which get included on users' * class paths, outside the library developers' control) to do so.
0
import org.apache.accumulo.mini.MiniAccumuloCluster; import org.apache.accumulo.mini.MiniAccumuloConfig;
0
/* * Copyright 2002-2004 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * @version $Revision: 1.18 $ $Date: 2004/02/18 01:15:42 $
0
* A script scope, stores the declaration of parameters and local variables as symbols. * The map of named variables aka script parameters and local variables. * Each parameter is associated to a symbol and is materialized as an offset in the stacked array used * Checks whether an identifier is a local variable or argument, ie a symbol. * @param name the symbol name * @return the symbol index public Integer getSymbol(String name) { return getSymbol(name, true); * Checks whether an identifier is a local variable or argument, ie a symbol. * @param name the symbol name * @return the symbol index private Integer getSymbol(String name, boolean hoist) { Integer pr = parent.getSymbol(name, false); * This method creates an new entry in the symbol map. * This method creates an new entry in the symbol map. * Gets this script symbols names, i.e. parameters and local variables. * @return the symbol names public String[] getSymbols() { * Gets this script parameters, i.e. symbols assigned before creating local variables. * Gets this script local variable, i.e. symbols assigned to local variables. * @return the local variable names
1
import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Optional; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableMap; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Lists;
0
public void dump() { for (Entry<String, Map<Object, Set<BundleCapability>>> entry : m_indices.entrySet()) { boolean header1 = false; for (Entry<Object, Set<BundleCapability>> entry2 : entry.getValue().entrySet()) { boolean header2 = false; for (BundleCapability cap : entry2.getValue()) { if (cap.getRevision().getBundle().getBundleId() != 0) { if (!header1) { System.out.println(entry.getKey() + ":"); header1 = true; } if (!header2) { System.out.println(" " + entry2.getKey()); header2 = true; } System.out.println(" " + cap); } } } } }
0
request.cancel();
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
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/map/TestFixedSizeSortedMap.java,v 1.3 2003/11/18 22:37:17 scolebourne Exp $ * @version $Revision: 1.3 $ $Date: 2003/11/18 22:37:17 $ public Map makeFullMap() { public boolean isPutAddSupported() { public boolean isRemoveSupported() {
0
import org.apache.http.util.Args; Args.notNull(params, "HTTP parameters"); Args.notNull(params, "HTTP parameters"); Args.notNull(params, "HTTP parameters"); Args.notNull(params, "HTTP parameters"); Args.notNull(params, "HTTP parameters"); return params.getBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true); Args.notNull(params, "HTTP parameters"); Args.notNull(params, "HTTP parameters"); return params.getIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, -1); Args.notNull(params, "HTTP parameters"); Args.notNull(params, "HTTP parameters"); Args.notNull(params, "HTTP parameters"); Args.notNull(params, "HTTP parameters"); return params.getIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 0); Args.notNull(params, "HTTP parameters"); params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, timeout); Args.notNull(params, "HTTP parameters"); return params.getBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, true); Args.notNull(params, "HTTP parameters"); params.setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, value); Args.notNull(params, "HTTP parameters"); Args.notNull(params, "HTTP parameters");
0
import java.util.Comparator; System.out.println(Util.getUnderlineString(title.length())); List<Method> methods = null; // If the specified command doesn't have a scope, then // search for matching methods by ignoring the scope. int scopeIdx = name.indexOf(':'); if (scopeIdx < 0) { for (Entry<String, List<Method>> entry : commands.entrySet()) { String k = entry.getKey().substring(entry.getKey().indexOf(':') + 1); if (name.equals(k)) { methods = entry.getValue(); break; } } } // Otherwise directly look up matching methods. else { methods = commands.get(name); } String scope = (String) ref.getProperty("osgi.command.scope"); commands.put(scope + ":" + func, new ArrayList()); List<Method> commandMethods = commands.get(scope + ":" + method.getName());
0
@SuppressWarnings("deprecation") // tests some deprecated classes
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. */
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.felix.bundlerepository; /** * A pair of requirement and resource indicating a reason * why a resource has been chosen. * The reason indicates which resource and which requirement * has been satisfied by the selected resource. */ public interface Reason { Resource getResource(); Requirement getRequirement(); }
0
import org.apache.http.protocol.ExecutionContext; HttpRequest request = (HttpRequest) context.getAttribute(ExecutionContext.HTTP_REQUEST);
0
/* (non-Javadoc) * @see org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context) */ /* (non-Javadoc) * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager) */
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableIntCollectionCollection.java,v 1.3 2003/11/07 20:07:51 rwaldhoff Exp $ * * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) * * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $
0
SocketServer server = new SocketServer(conf.getPort(Property.MONITOR_LOG4J_PORT)[0]);
0
import org.apache.batik.transcoder.TranscoderException; ImageTranscoder transcoder ((ImageTranscoder)transcoder).transcodeToStream(isource, ostream); } catch(TranscoderException ex) { error("while writing "+inputURI+" to "+output+"\n"+ex.getMessage());
0
public abstract class AbstractKeyedHandler<K, V> implements ResultSetHandler<Map<K, V>> { public Map<K, V> handle(ResultSet rs) throws SQLException { Map<K, V> result = createMap(); protected Map<K, V> createMap() { return new HashMap<K, V>();
0
/* * Copyright (c) OSGi Alliance (2008, 2009). All Rights Reserved. * * 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.osgi.service.blueprint.reflect; /** * Metadata for a property to be injected into a bean. The properties of a bean * are obtained from {@link BeanMetadata#getProperties()}. * * This is specified by the <code>property</code> elements of a bean. Properties * are defined according to the Java Beans conventions. * * @ThreadSafe * @version $Revision: 7563 $ */ public interface BeanProperty { /** * Return the name of the property to be injected. The name follows Java * Beans conventions. * * This is specified by the <code>name</code> attribute. * * @return The name of the property to be injected. */ String getName(); /** * Return the Metadata for the value to be injected into a bean. * * This is specified by the <code>value</code> attribute or in inlined text. * * @return The Metadata for the value to be injected into a bean. */ Metadata getValue(); }
0
* </p> * <p> * </p> * </p> * </p> * </p> * </p>
0
* <p>The output timestamp is the minimum of getOutputTimestamp applied to the non-late elements
0
// Implementstion methods
0
KeyedWorkItem<?, Object> work =
0
public void contextualize(Context avalonContext) throws ContextException { this.context = avalonContext; public void service(ServiceManager serviceManager) throws ServiceException { this.manager = serviceManager;
0
*/ public interface UnconditionalBranch { }
0
if ("DSA".equals(algorithm)) { } else if ("RSA".equals(algorithm)) { } else if ("EC".equals(algorithm)) { if ("KeyInfo".equals(tag) && XMLSignature.XMLNS.equals(namespace)) {
0
tmpMap.put(_Fields.MAX_MEMORY, new org.apache.thrift.meta_data.FieldMetaData("maxMemory", org.apache.thrift.TFieldRequirementType.DEFAULT, tmpMap.put(_Fields.LATENCY_MS, new org.apache.thrift.meta_data.FieldMetaData("latencyMs", org.apache.thrift.TFieldRequirementType.DEFAULT, tmpMap.put(_Fields.TIMEOUT_MS, new org.apache.thrift.meta_data.FieldMetaData("timeoutMs", org.apache.thrift.TFieldRequirementType.DEFAULT, tmpMap.put(_Fields.THREADS, new org.apache.thrift.meta_data.FieldMetaData("threads", org.apache.thrift.TFieldRequirementType.DEFAULT, if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { } else { } else { } else { } else {
0
package org.apache.accumulo.core.file.rfile.bcfile; import java.io.PrintStream; import java.util.Map.Entry; import java.util.Set; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.file.FileUtil; import org.apache.accumulo.core.file.rfile.bcfile.BCFile.MetaIndexEntry; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; public class PrintInfo { public static void printMetaBlockInfo(Configuration conf, FileSystem fs, Path path) throws Exception { FSDataInputStream fsin = fs.open(path); BCFile.Reader bcfr = new BCFile.Reader(fsin, fs.getFileStatus(path).getLen(), conf); Set<Entry<String, MetaIndexEntry>> es = bcfr.metaIndex.index.entrySet(); for (Entry<String, MetaIndexEntry> entry : es) { PrintStream out = System.out; out.println("Meta block : "+entry.getKey()); out.println(" Raw size : "+String.format("%,d",entry.getValue().getRegion().getRawSize())+" bytes"); out.println(" Compressed size : "+String.format("%,d",entry.getValue().getRegion().getCompressedSize())+" bytes"); out.println(" Compression type : "+entry.getValue().getCompressionAlgorithm().getName()); out.println(); } } public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); @SuppressWarnings("deprecation") FileSystem fs = FileUtil.getFileSystem(conf, AccumuloConfiguration.getSiteConfiguration()); Path path = new Path(args[0]); printMetaBlockInfo(conf, fs, path); } }
1
PROPERTY_IDS.add(ClusterResourceProvider.SECURITY); PROPERTY_IDS.add(ClusterResourceProvider.CREDENTIALS); AddServiceRequest request = createAddServiceRequest(requestInfoProperties); private static AddServiceRequest createAddServiceRequest(Map<String, String> requestInfoProperties) {
0