Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
boolean attr = false; boolean first = true;
0
/** Samza operator for {@link org.apache.beam.sdk.transforms.GroupByKey}. */ public GroupByKeyOp( TupleTag<KV<K, OutputT>> mainOutputTag, Coder<KeyedWorkItem<K, InputT>> inputCoder, SystemReduceFn<K, InputT, ?, OutputT, BoundedWindow> reduceFn, WindowingStrategy<?, BoundedWindow> windowingStrategy, OutputManagerFactory<KV<K, OutputT>> outputManagerFactory, String stepName) { public void open( Config config, TaskContext context, TimerRegistry<TimerKey<K>> timerRegistry, OpEmitter<KV<K, OutputT>> emitter) { this.pipelineOptions = Base64Serializer.deserializeUnchecked( config.get("beamPipelineOptions"), SerializablePipelineOptions.class) .get() .as(SamzaPipelineOptions.class); this.timerInternalsFactory = new SamzaTimerInternalsFactory<>(inputCoder.getKeyCoder(), timerRegistry); final StepContext stepContext = new StepContext() { @Override public StateInternals stateInternals() { return keyedInternals.stateInternals(); } @Override public TimerInternals timerInternals() { return keyedInternals.timerInternals(); } }; final SamzaExecutionContext executionContext = (SamzaExecutionContext) context.getUserContext(); this.fnRunner = DoFnRunnerWithMetrics.wrap(doFnRunner, executionContext.getMetricsContainer(), stepName); public void processElement( WindowedValue<KeyedWorkItem<K, InputT>> inputElement, OpEmitter<KV<K, OutputT>> emitter) {
1
package org.apache.accumulo.core.spi.cache; /** * @since 2.0.0 */ interface Weighable { <T extends Weighable> T getIndex(Supplier<T> supplier);
0
protected void onRequestReceived(final HttpRequest request) { if (request != null && this.headerlog.isDebugEnabled()) { this.headerlog.debug(this.id + " >> " + request.getRequestLine().toString()); Header[] headers = request.getAllHeaders(); for (int i = 0; i < headers.length; i++) { this.headerlog.debug(this.id + " >> " + headers[i].toString()); } } protected void onResponseSubmitted(final HttpResponse response) { if (response != null && this.headerlog.isDebugEnabled()) { this.headerlog.debug(this.id + " << " + response.getStatusLine().toString()); Header[] headers = response.getAllHeaders(); for (int i = 0; i < headers.length; i++) { this.headerlog.debug(this.id + " << " + headers[i].toString()); } }
0
headerMap,
0
validateDirectives(Collections.emptySet(), resourceDefinition.getCreateDirectives()); validateDirectives(Collections.emptySet(), resourceDefinition.getReadDirectives()); validateDirectives(Collections.emptySet(), resourceDefinition.getUpdateDirectives()); validateDirectives(Collections.emptySet(), resourceDefinition.getDeleteDirectives());
0
import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper; public static void authenticate(InstanceTokenWrapper auth, State state, Properties props) throws Exception {
0
* @version $Id$
0
package com.twitter.nexus.scheduler.configuration;
0
/** * {@inheritDoc} */
0
import org.apache.beam.vendor.protobuf.v3.com.google.protobuf.InvalidProtocolBufferException;
0
* The purpose of this class is to server as fake tserver that is a data sink like /dev/null. NullTserver modifies the metadata location entries for a table to // modify metadata
1
import org.apache.http.conn.ssl.TrustSelfSignedStrategy; // Trust own CA and all self-signed certs .loadTrustMaterial(trustStore, new TrustSelfSignedStrategy()) // Allow TLSv1 protocol only SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory( sslcontext, new String[] { "TLSv1" }, null,
0
import com.google.common.base.Optional; import com.google.common.collect.ImmutableSet; import org.apache.aurora.gen.JobUpdateQuery; import org.apache.aurora.scheduler.storage.entities.IJobUpdateDetails; import org.apache.aurora.scheduler.storage.entities.IJobUpdateSummary; @Override public ImmutableSet<IJobUpdateSummary> fetchJobUpdateSummaries(JobUpdateQuery query) { // TODO(maxim): implement DB mapping logic. return ImmutableSet.of(); } @Override public void deleteAllUpdatesAndEvents() { // TODO(maxim): implement DB mapping logic. } @Override public Optional<IJobUpdateDetails> fetchJobUpdateDetails(String updateId) { // TODO(maxim): implement DB mapping logic. return Optional.absent(); } @Override public ImmutableSet<IJobUpdateDetails> fetchAllJobUpdateDetails() { // TODO(maxim): implement DB mapping logic. return ImmutableSet.of(); }
0
ctx.collect(windowedValue);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/util/TypeUtils.java,v 1.7 2002/06/12 21:02:05 dmitri Exp $ * $Revision: 1.7 $ * $Date: 2002/06/12 21:02:05 $ * Global type conversion utilities. * * @version $Revision: 1.7 $ $Date: 2002/06/12 21:02:05 $ private static TypeConverter typeConverter = new BasicTypeConverter(); /** * Install an alternative type converter. */ public static synchronized void setTypeConverter(TypeConverter converter){ typeConverter = converter; /** * Returns the current type converter. */ public static TypeConverter getTypeConverter(){ return typeConverter; /** * @deprecated Use MethodLookupUtils */ public static Constructor lookupConstructor(Class targetClass, Object[] parameters){ return MethodLookupUtils.lookupConstructor(targetClass, parameters); /** * @deprecated Use MethodLookupUtils */ public static Method lookupStaticMethod(Class targetClass, String name, Object[] parameters){ return MethodLookupUtils.lookupStaticMethod(targetClass, name, parameters); /** * @deprecated Use MethodLookupUtils */ public static Method lookupMethod(Class targetClass, String name, Object[] parameters){ return MethodLookupUtils.lookupMethod(targetClass, name, parameters); return typeConverter.canConvert(object, toType); return typeConverter.convert(object, toType);
0
import com.google.cloud.dataflow.examples.common.DataflowExampleOptions; public interface TrafficFlowOptions extends ExamplePubsubTopicOptions, ExampleBigQueryTableOptions, DataflowExampleOptions { copiedOptions.setNumWorkers(options.as(DataflowExampleOptions.class).getInjectorNumWorkers());
0
/* * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.hc.core5.http; import java.io.IOException; /** * Signals that the target server failed to respond with a valid HTTP response. * * @since 4.0 */ public class NoHttpResponseException extends IOException { private static final long serialVersionUID = -7658940387386078766L; /** * Creates a new NoHttpResponseException with the specified detail message. * * @param message exception message */ public NoHttpResponseException(final String message) { super(message); } }
1
public static <E> PredicatedBuffer<E> predicatedBuffer(final Buffer<E> buffer, final Predicate<? super E> predicate) {
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 file. * *****************************************************************************/ package org.apache.batik.test; /** * Exception which Tests can throw when a specific assertion fails. * * @author <a href="mailto:vhardy@apache.org">Vincent Hardy</a> * @version $Id$ */ public abstract class AssertException extends TestErrorConditionException { public static final String ENTRY_KEY_ASSERTION_TYPE = "AssertException.entry.key.assertion.type"; /** * <tt>TestErrorConditionException</tt> implementation. */ public TestReport getTestReport(Test test){ DefaultTestReport report = new DefaultTestReport(test); report.setErrorCode(report.ERROR_ASSERTION_FAILED); report.addDescriptionEntry(ENTRY_KEY_ASSERTION_TYPE, getAssertionType()); addDescription(report); addStackTraceDescription(report); return report; } /** * Requests that the exception populates the TestReport with the * relevant information. */ public abstract void addDescription(TestReport report); /** * Returns the type of assertion which failed. e.g., "assertEquals" */ public abstract String getAssertionType(); }
0
* or more contributor license agreements. See the NOTICE file * regarding copyright ownership. The ASF licenses this file * with the License. You may obtain a copy of the License at * KIND, either express or implied. See the License for the
0
import java.io.IOException; import org.apache.beam.sdk.coders.Coder; import org.apache.beam.sdk.coders.Coder.Context; public class ValueAndCoderKryoSerializable<T> implements KryoSerializable { private static final JavaSerializer JAVA_SERIALIZER = new JavaSerializer(); public void write(Kryo kryo, Output output) { throw new RuntimeException(e); public void read(Kryo kryo, Input input) { throw new RuntimeException(e);
0
if (c == '(') int end = find(')', '(');
0
import org.apache.cocoon.portal.om.CopletInstance;
0
configuration.setProperty("atlas.services.enabled", false);
1
import com.google.common.collect.ImmutableSet; import org.apache.aurora.gen.storage.StoredJobUpdateDetails; public void saveJobUpdate(IJobUpdate update, String lockToken) { requireNonNull(update); requireNonNull(lockToken); detailsMapper.insertLockToken(updateId, lockToken); .transform(new Function<StoredJobUpdateDetails, IJobUpdateDetails>() { public IJobUpdateDetails apply(StoredJobUpdateDetails input) { return IJobUpdateDetails.build(input.getDetails()); public Set<StoredJobUpdateDetails> fetchAllJobUpdateDetails() { return ImmutableSet.copyOf(detailsMapper.selectAllDetails()); } @Override public boolean isActive(String updateId) { // We assume here that cascading deletes will cause a lock-update associative row to disappear // when the lock is invalidated. This further assumes that a lock row is deleted when a lock // is no longer valid. return detailsMapper.selectLockToken(updateId) != null;
0
public void set(String val, Object value) {
0
cat.debug("setElement(\"" + element.getTagName() + "\", \"" + BaseURI + "\")");
0
* * * Test for the SwappedDataInputStream. This also
0
ArrayList list = (ArrayList) root; assertEquals("Wrong number of classes created", 2 , list.size()); assertEquals("Pushed first", true , ((TestObject)list.get(0)).isPushed()); assertEquals("Didn't push second", false , ((TestObject)list.get(1)).isPushed());
0
public class HiveParititionTest extends MigrationBaseAsserts { public HiveParititionTest(AtlasGraph graph) { runFileImporter("parts_db");
0
final SocketConfig sconfig = SocketConfig.custom().setSoTimeout(100).build(); final SocketConfig sconfig = SocketConfig.custom().setSoTimeout(100).build(); final BasicPoolEntry entry = pool.createEntry(host, conn);
0
public int compareTo(Object reference) { throw new UnsupportedOperationException("This feature has not yet been implemented."); }
1
protected void addP(PropertyImpl prop)
0
@Nullable Iterable<WindowedValue<?>> elements = state.read();
0
if(units.length() == 0){ units = VALUE_OBJECT_BOUNDING_BOX; } at = SVGUtilities.convertAffineTransform(at, paintedNode, units); at);
0
import org.apache.batik.ext.awt.image.renderable.AffineRable; import org.apache.batik.ext.awt.image.rendered.CachableRed; import org.apache.batik.ext.awt.image.renderable.CompositeRable; import org.apache.batik.ext.awt.image.renderable.CompositeRule; import org.apache.batik.ext.awt.image.renderable.Filter; import org.apache.batik.ext.awt.image.renderable.FilterChainRable; import org.apache.batik.ext.awt.image.renderable.PadMode; import org.apache.batik.ext.awt.image.renderable.PadRable; import org.apache.batik.ext.awt.image.rendered.BufferedImageCachableRed; import org.apache.batik.ext.awt.image.rendered.RenderedImageCachableRed; import org.apache.batik.ext.awt.image.rendered.Any2LsRGBRed; import org.apache.batik.ext.awt.image.rendered.Any2sRGBRed; return new BufferedImageCachableRed((BufferedImage)ri); return new RenderedImageCachableRed(ri);
0
import com.google.common.base.Function; import com.google.common.base.Functions; import org.apache.aurora.scheduler.base.TaskGroupKey; import org.apache.aurora.scheduler.storage.entities.ITaskConfig; private final LoadingCache<TaskGroupKey, Fit> fitByGroupKey; fitByGroupKey = CacheBuilder.newBuilder() .build(new CacheLoader<TaskGroupKey, Fit>() { public Fit load(TaskGroupKey groupKey) { * @param groupKey The task group key to look up. public synchronized ImmutableSet<Veto> getNearestFit(TaskGroupKey groupKey) { Fit fit = fitByGroupKey.getIfPresent(groupKey); fitByGroupKey.invalidateAll(Iterables.transform(deletedEvent.getTasks(), Functions.compose( new Function<ITaskConfig, TaskGroupKey>() { @Override public TaskGroupKey apply(ITaskConfig task) { return TaskGroupKey.from(task); } }, Tasks.SCHEDULED_TO_INFO))); fitByGroupKey.invalidate(TaskGroupKey.from(event.getTask().getAssignedTask().getTask())); fitByGroupKey.getUnchecked(vetoEvent.getGroupKey()).maybeUpdate(vetoEvent.getVetoes());
0
private static final boolean REPORT = Boolean.parseBoolean(System.getProperty("PerformanceTest.report", "true"));; if (REPORT) { System.out.println("ClassParser.parse: " + parseTime); System.out.println("ClassGen.init: " + cgenTime); System.out.println("MethodGen.init: " + mgenTime); System.out.println("MethodGen.getMethod: " + mserTime); System.out.println("ClassGen.getJavaClass.getBytes: " + serTime); System.out.println("Total: " + total); System.out.println(); }
0
/* * $Id$ * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */
0
package org.apache.commons.vfs2.provider.ram; import org.apache.commons.vfs2.FileSystemException;
1
for (Reader.ReaderIterator<?> iterator = inMemoryReader.iterator();
0
import org.apache.hc.core5.http2.config.H2Setting; return createResetStream(streamId, error.getCode()); } public RawFrame createResetStream(final int streamId, final int code) { Args.positive(streamId, "Stream id"); payload.putInt(code); Args.notNegative(lastStream, "Last stream id"); if (debugData != null) { payload.put(debugData); } public abstract RawFrame createPushPromise(int streamId, ByteBuffer payload, boolean endHeaders); public RawFrame createWindowUpdate(final int streamId, final int increment) { Args.notNegative(streamId, "Stream id"); Args.positive(increment, "Increment"); final ByteBuffer payload = ByteBuffer.allocate(4); payload.putInt(increment); payload.flip(); return new RawFrame(FrameType.WINDOW_UPDATE.getValue(), 0, streamId, payload); }
0
throw formatExceptionMessage(SshException::new, "Write failed signalled while wait %d msec.", timeout);
0
import com.google.cloud.dataflow.sdk.runners.inprocess.GroupByKeyEvaluatorFactory.InProcessGroupByKeyOverrideFactory; import com.google.cloud.dataflow.sdk.runners.inprocess.InProcessCreate.InProcessCreateOverrideFactory; import com.google.cloud.dataflow.sdk.runners.inprocess.ViewEvaluatorFactory.InProcessViewOverrideFactory; private static Map<Class<? extends PTransform>, PTransformOverrideFactory> ImmutableMap.<Class<? extends PTransform>, PTransformOverrideFactory>builder() .put(Create.Values.class, new InProcessCreateOverrideFactory()) .put(GroupByKey.class, new InProcessGroupByKeyOverrideFactory()) .put(CreatePCollectionView.class, new InProcessViewOverrideFactory()) PTransformOverrideFactory overrideFactory = defaultTransformOverrides.get(transform.getClass()); if (overrideFactory != null) { PTransform<InputT, OutputT> customTransform = overrideFactory.override(transform); // If there is no override, or we should not apply the override, apply the original transform return super.apply(transform, input);
0
.format("/target/atlas-webapp-%s", System.getProperty("project.version"));
0
final int EXPECTED_TOTAL_COUNT = 191;
0
return ITaskConfig.build(new TaskConfig() .setExecutorConfig(new ExecutorConfig("aurora", "config")));
0
import org.apache.commons.configuration.ConfigurationAssert; static final File TEST_FILE = ConfigurationAssert.getTestFile("test.xml"); return TEST_FILE.toURI().toURL();
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. * */ package org.apache.commons.bcel6.generic; /** * DALOAD - Load double from array * <PRE>Stack: ..., arrayref, index -&gt; ..., result.word1, result.word2</PRE> * * @version $Id$ * @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A> */ public class DALOAD extends ArrayInstruction implements StackProducer { private static final long serialVersionUID = -8493938101832015094L; /** Load double from array */ public DALOAD() { super(org.apache.commons.bcel6.Constants.DALOAD); } /** * Call corresponding visitor method(s). The order is: * Call visitor methods of implemented interfaces first, then * call methods according to the class hierarchy in descending order, * i.e., the most specific visitXXX() call comes last. * * @param v Visitor object */ @Override public void accept( Visitor v ) { v.visitStackProducer(this); v.visitExceptionThrower(this); v.visitTypedInstruction(this); v.visitArrayInstruction(this); v.visitDALOAD(this); } }
1
case DEFLATE: return CompressedSource.from(new TextSource(filepattern)) .withDecompression(CompressedSource.CompressionMode.DEFLATE); ZIP(".zip"), /** * Deflate compressed. */ DEFLATE(".deflate");
0
public static ByteArrayInputStream toByteArrayInputStream(ByteBuffer buffer) {
0
@Override public void create(OutputStream out) throws IOException {
0
none(Constants.NONE, 0, 0, "None", 0, "None", 0) { aes128cbc(Constants.AES128_CBC, 16, 16, "AES", 128, "AES/CBC/NoPadding", 16), aes128ctr(Constants.AES128_CTR, 16, 16, "AES", 128, "AES/CTR/NoPadding", 16), aes192cbc(Constants.AES192_CBC, 16, 24, "AES", 192, "AES/CBC/NoPadding", 16), aes192ctr(Constants.AES192_CTR, 16, 24, "AES", 192, "AES/CTR/NoPadding", 16), aes256cbc(Constants.AES256_CBC, 16, 32, "AES", 256, "AES/CBC/NoPadding", 16), aes256ctr(Constants.AES256_CTR, 16, 32, "AES", 256, "AES/CTR/NoPadding", 16), arcfour128(Constants.ARCFOUR128, 8, 16, "ARCFOUR", 128, "RC4", 16) { return new BaseRC4Cipher(getIVSize(), getKdfSize(), getKeySize(), getCipherBlockSize()); arcfour256(Constants.ARCFOUR256, 8, 32, "ARCFOUR", 256, "RC4", 32) { return new BaseRC4Cipher(getIVSize(), getKdfSize(), getKeySize(), getCipherBlockSize()); blowfishcbc(Constants.BLOWFISH_CBC, 8, 16, "Blowfish", 128, "Blowfish/CBC/NoPadding", 8), tripledescbc(Constants.TRIPLE_DES_CBC, 8, 24, "DESede", 192, "DESede/CBC/NoPadding", 8); private final int blkSize; BuiltinCiphers( String factoryName, int ivsize, int kdfSize, String algorithm, int keySize, String transformation, int blkSize) { this.blkSize = blkSize; public int getCipherBlockSize() { return blkSize; } @Override return new BaseCipher( getIVSize(), getKdfSize(), getAlgorithm(), getKeySize(), getTransformation(), getCipherBlockSize());
0
import org.apache.accumulo.core.security.CredentialHelper; client.update(Tracer.traceInfo(), CredentialHelper.create(opts.principal, opts.getToken(), opts.instance), new KeyExtent(new Text("!!"), null, new Text("row_0003750000")).toThrift(), mutation.toThrift());
0
private int pos;
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.logfeeder.mapper; import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.apache.log4j.Logger; /** * Overrides the value for the field */ public class MapperFieldCopy extends Mapper { private static final Logger LOG = Logger.getLogger(MapperFieldCopy.class); private String copyName = null; @Override public boolean init(String inputDesc, String fieldName, String mapClassCode, Object mapConfigs) { init(inputDesc, fieldName, mapClassCode); if (!(mapConfigs instanceof Map)) { LOG.fatal("Can't initialize object. mapConfigs class is not of type Map. " + mapConfigs.getClass().getName()); return false; } @SuppressWarnings("unchecked") Map<String, Object> mapObjects = (Map<String, Object>) mapConfigs; copyName = (String) mapObjects.get("copy_name"); if (StringUtils.isEmpty(copyName)) { LOG.fatal("Map copy name is empty."); return false; } return true; } @Override public Object apply(Map<String, Object> jsonObj, Object value) { jsonObj.put(copyName, value); return value; } }
0
private final int bufferSize; private final int fragmentSizeHint; final int bufferSize, final int fragmentSizeHint, this.bufferSize = bufferSize; this.fragmentSizeHint = fragmentSizeHint; public int getBufferSize() { return bufferSize; } public int getFragmentSizeHint() { return fragmentSizeHint; } builder.append("[bufferSize=").append(this.bufferSize) .append(", fragmentSizeHint=").append(this.fragmentSizeHint) .append(", charset=").append(this.charset) private int bufferSize; private int fragmentSizeHint; this.fragmentSizeHint = -1; public Builder setBufferSize(final int bufferSize) { this.bufferSize = bufferSize; return this; } public Builder setFragmentSizeHint(final int fragmentSizeHint) { this.fragmentSizeHint = fragmentSizeHint; return this; final int bufSize = this.bufferSize > 0 ? this.bufferSize : 8 * 1024; final int fragmentHintSize = this.fragmentSizeHint >= 0 ? this.fragmentSizeHint : bufSize; bufSize, fragmentHintSize,
0
import java.util.Objects; @Override public boolean equals(Object object) { if (object instanceof GaugeCell) { GaugeCell gaugeCell = (GaugeCell) object; return Objects.equals(dirty, gaugeCell.dirty) && Objects.equals(gaugeValue.get(), gaugeCell.gaugeValue.get()) && Objects.equals(name, gaugeCell.name); } return false; } @Override public int hashCode() { return Objects.hash(dirty, gaugeValue.get(), name); }
0
final FileObject[] actualFiles = baseFolder.findFiles( selector ); assertEquals( expectedFiles.size(), actualFiles.length ); final FileObject actual = actualFiles[ i ];
0
import org.apache.ambari.logsearch.common.ConfigHelper; import org.apache.ambari.logsearch.common.PropertiesHelper; throw RESTErrorUtil.createRESTException("Solr configuration improper for " + logType.getLabel() +" logs", String jaasFile = PropertiesHelper.getProperty("logsearch.solr.jaas.file", "/etc/security/keytabs/logsearch_solr.service.keytab"); boolean securityEnabled = PropertiesHelper.getBooleanProperty("logsearch.solr.kerberos.enable", false); String historyCollection = PropertiesHelper.getProperty("logsearch.solr.collection.history","history"); ConfigHelper.extractSchemaFieldsName(namedList.toString(), schemaFieldsNameMap,schemaFieldTypeMap);
0
* @version $Id$
0
ReplicationTarget expected = new ReplicationTarget("remote_cluster_1", "4", tableId); workMaker.addWorkRecord(new Text(file), StatusUtil.fileClosedValue(), ImmutableMap.of("remote_cluster_1", "4"), tableId); expectedTargets.add(new ReplicationTarget(cluster.getKey(), cluster.getValue(), tableId)); workMaker.addWorkRecord(new Text(file), StatusUtil.fileClosedValue(), targetClusters, tableId);
0
assertEquals(Boolean.TRUE, ds.getDefaultAutoCommit()); assertEquals(Boolean.FALSE, ds.getDefaultReadOnly());
0
public interface WorkQueue { void doWork(Callable<Boolean> work); void scheduleWork(Callable<Boolean> work, long executeDelay, TimeUnit delayUnit);
0
import org.apache.ambari.server.state.SecurityType; addKerberosClientIfNecessary(clusterName, blueprintHostGroups); * Add the kerberos client to groups if kerberos is enabled for the cluster. * * @param clusterName cluster name * @param groups host groups * * @throws NoSuchParentResourceException unable to get cluster instance */ private void addKerberosClientIfNecessary(String clusterName, Map<String, HostGroupImpl> groups) throws NoSuchParentResourceException { //todo: logic would ideally be contained in the stack Cluster cluster; try { cluster = getManagementController().getClusters().getCluster(clusterName); } catch (AmbariException e) { throw new NoSuchParentResourceException("Parent Cluster resource doesn't exist. clusterName= " + clusterName); } if (cluster.getSecurityType() == SecurityType.KERBEROS) { for (HostGroupImpl group : groups.values()) { group.addComponent("KERBEROS_CLIENT"); } } } /**
0
* Signals a problem encountered when trying to map a * * @since 4.1
0
private static final long serialVersionUID = 1L;
0
* The minimum interval between two consecutive memory dumps being taken * in seconds. This property allows the limitation of the number of memory * dumps being taken. The default value for the interval is 6 hours. This * means that * a memory threshold event is ignored unless the last memory dump has been * taken * at least 6 hours earlier. * <p> * This property allows limiting the number of memory dumps in case memory * consumption is oscillating around the threshold point. * <p> * The property must be an integer value or be parseable to an integer * value. This should be a positive value or zero to force each memory * threshold event to cause a memory dump (discouraged). If the value is * negative or not parseable to an int, the default value of * {@link #DEFAULT_DUMP_INTERVAL 6 hours} applies. */ static final String PROP_DUMP_INTERVAL = "felix.memoryusage.dump.interval"; /** static final int DEFAULT_DUMP_THRESHOLD = 0; * The default interval betwen consecutive dumps (6 hours). */ static final long DEFAULT_DUMP_INTERVAL = 6 * 3600 * 1000; /**
0
import java.io.IOException; import java.nio.file.Files; @Test public void testGetCACertificateChain() throws IOException { Injector injector = getInjector(); File directory = folder.newFolder(); String caCertFileName = "myca.crt"; String caCertChainFileName = "myca_chain.pem"; Configuration configuration = injector.getInstance(Configuration.class); expect(configuration.getProperty(Configuration.SRVR_KSTR_DIR)).andReturn(directory.getAbsolutePath()).anyTimes(); expect(configuration.getProperty(Configuration.SRVR_CRT_NAME)).andReturn(caCertFileName).anyTimes(); expect(configuration.getProperty(Configuration.SRVR_CRT_CHAIN_NAME)).andReturn(caCertChainFileName).anyTimes(); final File caCertFile = new File(directory, caCertFileName); final File caCertChainFile = new File(directory, caCertChainFileName); CertificateManager certificateManager = new CertificateManager(); injector.injectMembers(certificateManager); replayAll(); String content; // Only the CA certificate file is available, this is the fallback option Files.write(caCertFile.toPath(), Collections.singleton(caCertFile.getAbsolutePath())); content = certificateManager.getCACertificateChainContent(); Assert.assertEquals(caCertFile.getAbsolutePath(), content.trim()); // The CA certificate chain file is available, this is the preferred option Files.write(caCertChainFile.toPath(), Collections.singleton(caCertChainFile.getAbsolutePath())); content = certificateManager.getCACertificateChainContent(); Assert.assertEquals(caCertChainFile.getAbsolutePath(), content.trim()); verifyAll(); }
0
import org.apache.felix.dm.annotation.api.ServiceDependency;
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: HSSFElementProcessorFactory.java,v 1.6 2004/03/05 13:02:03 bdelacretaz Exp $
1
* @version $Id$
0
clientHandler, this.params); }
0
* @throws IOException * @throws IOException
0
import com.google.common.base.Preconditions;
0
import org.apache.accumulo.core.iterators.system.MapFileIterator; public SortedKeyValueIterator<Key,Value> reserveMapFileReader(String mapFileName) throws IOException { return new MapFileIterator(this.conf, fs, mapFileName, conf);
0
/* * Copyright (C) 2015 Google Inc. * * 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 com.google.cloud.dataflow.sdk; import com.google.protobuf.ByteString; import org.hamcrest.Description; import org.hamcrest.TypeSafeMatcher; import java.io.Serializable; /** * Matchers that are useful when writing Dataflow tests. */ public class DataflowMatchers { /** * Matcher for {@link ByteString} that prints the strings in UTF8. */ public static class ByteStringMatcher extends TypeSafeMatcher<ByteString> implements Serializable { private ByteString expected; private ByteStringMatcher(ByteString expected) { this.expected = expected; } public static ByteStringMatcher byteStringEq(ByteString expected) { return new ByteStringMatcher(expected); } @Override public void describeTo(Description description) { description .appendText("ByteString(") .appendText(expected.toStringUtf8()) .appendText(")"); } @Override public void describeMismatchSafely(ByteString actual, Description description) { description .appendText("was ByteString(") .appendText(actual.toStringUtf8()) .appendText(")"); } @Override protected boolean matchesSafely(ByteString actual) { return actual.equals(expected); } } }
0
boolean hasNext = false; if (hasNext) while (true) { try { return hasNext = true; if (!hasNext && !hasNext()) hasNext = false;
0
package org.apache.commons.exec.launcher; import java.io.File; import java.io.IOException; import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.environment.Environment; public interface CommandLauncher { /** * Launches the given command in a new process. * * @param cmd * The command to execute * @param env * The environment for the new process. If null, the environment * of the current process is used. * @throws IOException * if attempting to run a command in a specific directory */ Process exec(final CommandLine cmd, final Environment env) throws IOException; /** * Launches the given command in a new process, in the given working * directory. * * @param cmd * The command to execute * @param env * The environment for the new process. If null, the environment * of the current process is used. * @param workingDir * The directory to start the command in. If null, the current * directory is used * @throws IOException * if trying to change directory */ Process exec(final CommandLine cmd, final Environment env, final File workingDir) throws IOException; }
1
* @author Stephen Kestle public interface PredicateDecorator<T> extends Predicate<T> { Predicate<? super T>[] getPredicates();
0
ITypedReferenceableInstance ref = metadataService.getEntityDefinition(guid); Map<String, AtlasEntityWithAssociations> entities = restAdapters.getAtlasEntity(ref); return getOrderedEntityList(entities, guid); return this.getById(guid); private List<AtlasEntityWithAssociations> getOrderedEntityList(Map<String, AtlasEntityWithAssociations> entities, String firstItemGuid) { List<AtlasEntityWithAssociations> ret = new ArrayList<>(entities.size()); for (AtlasEntityWithAssociations entity : entities.values()) { if (StringUtils.equals(entity.getGuid(), firstItemGuid)) { ret.add(0, entity); } else { ret.add(entity); } } return ret; }
0
.propagate(false).add("set").change("change").provides(AdaptedService.class).impl(new ServiceAdapter(e)).build(); .impl(new ServiceConsumer(e)).withSvc(AdaptedService.class, b -> b.add("set").change("change")).build(); Component adapter = adapter(m, OriginalService.class).propagate(false).impl(saimpl).provides(AdaptedService.class).add(saimpl::set).change(saimpl::change).build(); Component consumer = component(m).impl(scimpl).withSvc(AdaptedService.class, s -> s.add(scimpl::set).change(scimpl::change)).build();
0
import com.google.cloud.dataflow.sdk.util.DirectModeExecutionContext; PipelineOptionsFactory.create(), cloudSource, DirectModeExecutionContext.create());
0
// Client is talking HTTPS to proxy, so we should rewrite all HTTP-based URLs... String rewritten = null; value = rewritten; String rewritten = null; location = rewritten; private String rewriteUrlIfNeeded(String value) throws URISyntaxException final StringBuilder sb = new StringBuilder(); sb.append(this.clientProto); sb.append("://"); sb.append(this.serverName); if ( this.clientPort != -1 ) { sb.append(':'); sb.append(this.clientPort); } if ( uri.getPath() != null ) { sb.append(uri.getPath()); } if ( uri.getRawQuery() != null ) { sb.append('?'); sb.append(uri.getRawQuery()); } if ( uri.getRawFragment() != null ) { sb.append('#'); sb.append(uri.getRawFragment()); } return sb.toString();
0
metadataManager = new TimelineMetricMetadataManager(new Configuration(), hdb);
0
import org.apache.beam.vendor.protobuf.v3.com.google.protobuf.InvalidProtocolBufferException;
0
output.setSecureValidation(secureValidation);
0
package org.apache.commons.net.examples.nntp;
0
.withArrivalTimeWatermarkPolicy()
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/set/UnmodifiableSortedSet.java,v 1.3 2003/12/03 12:27:37 scolebourne Exp $ * @version $Revision: 1.3 $ $Date: 2003/12/03 12:27:37 $ public final class UnmodifiableSortedSet extends AbstractSortedSetDecorator implements Unmodifiable { private UnmodifiableSortedSet(SortedSet set) {
0
import com.twitter.common.util.Random; import com.twitter.mesos.scheduler.async.TaskScheduler.OfferReturnDelay; @CmdLine(name = "min_offer_hold_time", help = "Minimum amount of time to hold a resource offer before declining.") private static final Arg<Amount<Integer, Time>> MIN_OFFER_HOLD_TIME = Arg.create(Amount.of(5, Time.MINUTES)); bind(OfferReturnDelay.class).to(RandomJitterReturnDelay.class); /** * Returns offers after a random duration within a fixed window. */ private static class RandomJitterReturnDelay implements OfferReturnDelay { private static final int JITTER_WINDOW_MS = Amount.of(1, Time.MINUTES).as(Time.MILLISECONDS); private final int minHoldTimeMs = MIN_OFFER_HOLD_TIME.get().as(Time.MILLISECONDS); private final Random random = new Random.SystemRandom(new java.util.Random()); @Override public Amount<Integer, Time> get() { return Amount.of(minHoldTimeMs + random.nextInt(JITTER_WINDOW_MS), Time.MILLISECONDS); } }
0
* {@link NumberConverter} implementation that handles conversion to * and from <b>java.lang.Short</b> objects. * <p> * This implementation can be configured to handle conversion either * by using Short's default String conversion, or by using a Locale's pattern * or by specifying a format pattern. See the {@link NumberConverter} * documentation for further details. * <p> * Can be configured to either return a <i>default value</i> or throw a * <code>ConversionException</code> if a conversion error occurs. public final class ShortConverter extends NumberConverter { * Construct a <b>java.lang.Short</b> <i>Converter</i> that throws * a <code>ConversionException</code> if an error occurs. super(Short.class, false); * Construct a <b>java.lang.Short</b> <i>Converter</i> that returns * a default value if an error occurs. * if the value to be converted is missing or an error * occurs converting the value. super(Short.class, false, defaultValue);
0
if (a.containsKey("nlink")) { map.put(Attribute.NLink, a.get("nlink")); }
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.cauldron.sigil.model.common; import java.io.Serializable; import java.util.Map; public interface LDAPExpr extends Serializable { public static final LDAPExpr[] CHILDLESS = new LDAPExpr[] {}; public static LDAPExpr ACCEPT_ALL = Expressions.T; LDAPExpr[] getChildren(); void visit(ExprVisitor v); boolean equals(Object other); int hashCode(); boolean eval(Map<String, ?> map); }
0
import org.apache.accumulo.core.client.Accumulo; try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) { try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) {
0
private volatile Bundle[] m_extensionsCache; m_extensionsCache = new Bundle[0]; m_extensionsCache = null; public URLConnection openConnection(URL url) throws IOException Bundle[] extensions = m_extensionsCache; URL result = null; for (Bundle extBundle : extensions) try { result = ((BundleImpl) extBundle).getCurrentModule().getEntry(path); } catch (Exception ex) { // Maybe the bundle went away, so ignore this exception. } m_extensionsCache = new Bundle[0]; m_extensionsCache = (Bundle[]) m_extensions.toArray(new Bundle[m_extensions.size()]);
0
SimpleFunction<Integer, ?> simpleFn = new SimpleFunction<Integer, Integer>() { SimpleFunction<Integer, ?> mapFn = new SimpleFunction<Integer, Integer>() { MapElements<Integer, ?> map = MapElements.via(mapFn); Set<DisplayData> displayData = evaluator.<Integer>displayDataForPrimitiveTransforms(map);
0
import com.twitter.mesos.executor.util.Disk; long diskUsedBytes = Disk.recursiveFileSize(scanDirectory); long fileSize = Disk.recursiveFileSize(file);
0