Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import org.apache.commons.configuration2.ConfigurationDecoder; ConfigurationDecoder decoder = EasyMock.createMock(ConfigurationDecoder.class); .setListDelimiterHandler(listHandler) .setConfigurationDecoder(decoder)); assertEquals("Wrong decoder", decoder, cc2.getConfigurationDecoder());
0
StringBuilder buffer = new StringBuilder();
0
/** * Start the resolution process and return whether the constraints have * been successfully met or not. * The resolution can be interrupted by a call to Thread.interrupt() at any * time. The result will be to stop the resolver and throw an InterruptedException. * * @return <code>true</code> if the resolution has succeeded else <code>false</code> * @throws InterrupteResolutionException if the resolution has been interrupted */
0
import java.io.DataOutputStream; public void dump(DataOutputStream dos) throws IOException { super.dump(dos); dos.writeByte(parameter_annotation_table.length); for (int i = 0; i < parameter_annotation_table.length; i++) { parameter_annotation_table[i].dump(dos); } }
0
@Test public void equalityTest() { PipelineOptions options = PipelineOptionsFactory.create(); SerializablePipelineOptions serializablePipelineOptions = new SerializablePipelineOptions(options); String json = serializablePipelineOptions.toString(); SerializablePipelineOptions serializablePipelineOptions2 = new SerializablePipelineOptions(json); assertEquals( "SerializablePipelineOptions created from options and from json differ", serializablePipelineOptions, serializablePipelineOptions2); }
0
package org.apache.accumulo.hadoopImpl.mapreduce.lib.partition;
0
* Simple test cases.
0
import java.io.DataOutputStream; import java.io.IOException;
0
import org.apache.beam.sdk.transforms.DoFn; import org.apache.beam.sdk.transforms.ParDo; import org.apache.beam.sdk.values.KV; import org.joda.time.Instant; PCollection<KV<Long, Byte>> output = p.apply(Read.from(source)) .apply(ParDo.of(new ExtractIndexFromTimestamp())); ArrayList<KV<Long, Byte>> expectedOutput = new ArrayList<>(); for (int i = 0; i < expected.length; i++) { expectedOutput.add(KV.of((long) i, expected[i])); } PAssert.that(output).containsInAnyOrder(expectedOutput); @Override public Instant getCurrentTimestamp() throws NoSuchElementException { return new Instant(getCurrentOffset()); } } } private static class ExtractIndexFromTimestamp extends DoFn<Byte, KV<Long, Byte>> { @ProcessElement public void processElement(ProcessContext context) { context.output(KV.of(context.timestamp().getMillis(), context.element()));
0
import org.apache.sshd.common.util.AbstractLoggingBean; public class ScpCommand extends AbstractLoggingBean implements Command, Runnable, FileSystemAware { String argVal=args[i]; if (argVal.charAt(0) == '-') { for (int j = 1; j < argVal.length(); j++) { char option=argVal.charAt(j); switch(option) { default: // ignored String prevArg=args[i - 1]; path = command.substring(command.indexOf(prevArg) + prevArg.length() + 1); @Override @Override @Override @Override @Override @Override @Override @Override
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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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.impala.hooks; import java.util.Objects; /** * {@link PostQueryHookContext} encapsulates immutable information sent from the * BE to a post-query hook. */ public class PostQueryHookContext { private final String lineageGraph; public PostQueryHookContext(String lineageGraph) { this.lineageGraph = Objects.requireNonNull(lineageGraph); } /** * Returns the lineage graph sent from the backend during * {@link QueryExecHook#postQueryExecute(PostQueryHookContext)}. This graph * object will generally contain more information than it did when it was * first constructed in the frontend, because the backend will have filled * in additional information. * <p> * The returned object is serilized json string of the graph sent from the backend. * </p> * * @return lineage graph from the query that executed */ public String getLineageGraph() { return lineageGraph; } @Override public String toString() { return "PostQueryHookContext{" + "lineageGraph='" + lineageGraph + '\'' + '}'; } }
0
import org.apache.felix.sigil.eclipse.ui.util.DefaultTableProvider; import org.apache.felix.sigil.eclipse.ui.util.ResourcesDialogHelper;
0
import org.apache.excalibur.source.Source; } else if ( obj instanceof Source ) { return ((Source)obj).getInputStream();
0
@CmdLine(name = "require_contact_email", help = "If true, reject jobs that do not specify a contact email address.") public static final Arg<Boolean> REQUIRE_CONTACT_EMAIL = Arg.create(true); if (REQUIRE_CONTACT_EMAIL.get() && (!config.isSetContactEmail() || !config.getContactEmail().matches("[^@][email protected]"))) { throw new TaskDescriptionException( "A valid twitter.com contact email address is required."); }
0
import org.apache.beam.sdk.transforms.SerializableFunction; public static TypeInformation forGetter( Method method, SerializableFunction<String, String> fieldNamePolicy) { name = fieldNamePolicy.apply(name);
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
* @version $Id$
0
private static int ping(ClientContext context, List<String> args) { InstanceOperations io = context.instanceOperations(); private static void flushAll(final ClientContext context) { Runnable flushTask = () -> { try { Set<String> tables = context.tableOperations().tableIdMap().keySet(); for (String table : tables) { if (table.equals(MetadataTable.NAME)) continue; try { context.tableOperations().flush(table, null, null, false); flushesStarted.incrementAndGet(); } catch (TableNotFoundException e) { // ignore } catch (Exception e) { log.warn("Failed to intiate flush {}", e.getMessage()); siteConfig = context.instanceOperations().getSiteConfiguration(); systemConfig = context.instanceOperations().getSystemConfiguration(); localUsers = Lists.newArrayList(context.securityOperations().listLocalUsers()); for (String namespace : context.namespaceOperations().list()) { printNameSpaceConfiguration(context, namespace, outputDirectory); SortedSet<String> tableNames = context.tableOperations().list(); printTableConfiguration(context, tableName, outputDirectory); printUserConfiguration(context, user, outputDirectory); for (String namespace : context.namespaceOperations().list()) { printNameSpaceConfiguration(context, namespace, outputDirectory); printTableConfiguration(context, tableName, outputDirectory); printUserConfiguration(context, user, outputDirectory);
0
field, name
0
* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
public String getDefaultPassword() { return defaultPassword; }
0
GraphicsNodeRenderContext rc = = CSSUtilities.getComputedStyle(filterElement); = CSSUtilities.getComputedStyle(filterElement);
0
public BufferedHeader(final CharArrayBuffer buffer) return BasicHeaderValueParser.DEFAULT .parseElements(this.buffer, cursor);
0
dbAccessor.addColumn("clusters", new DBAccessor.DBColumnInfo("resource_id", Long.class, 1, 1, false));
0
* <p>{@code CURRENT_BATCH_TIME - TIME_OF_BATCH_WHICH_SET_THE_WATERMARK <= BATCH_DURATION } public WatermarkSyncedDStream( final Queue<JavaRDD<WindowedValue<T>>> rdds, final Long batchDuration, final StreamingContext ssc) { LOG.trace( "BEFORE waiting for watermark sync, " + "LastWatermarkedBatchTime: {}, current batch time: {}", GlobalWatermarkHolder.getLastWatermarkedBatchTime(), batchTime); LOG.info( "Waited {} millis for watermarks to sync up with the current batch ({})", stopwatch.elapsed(TimeUnit.MILLISECONDS), batchTime); LOG.trace( "AFTER waiting for watermark sync, " + "LastWatermarkedBatchTime: {}, current batch time: {}", GlobalWatermarkHolder.getLastWatermarkedBatchTime(), batchTime); public void start() {} public void stop() {}
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.swssf.xmlsec.impl.stax; import org.swssf.xmlsec.ext.stax.XMLSecEndElement; import org.swssf.xmlsec.ext.stax.XMLSecStartElement; import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamConstants; import java.util.Collections; import java.util.Iterator; /** * @author $Author$ * @version $Revision$ $Date$ */ public class XMLSecEndElementImpl extends XMLSecEventBaseImpl implements XMLSecEndElement { private final QName elementName; public XMLSecEndElementImpl(QName elementName, XMLSecStartElement parentXmlSecStartElement) { this.elementName = elementName; setParentXMLSecStartElement(parentXmlSecStartElement); } @Override public QName getName() { return elementName; } @Override public Iterator getNamespaces() { return Collections.emptyList().iterator(); } @Override public int getEventType() { return XMLStreamConstants.END_ELEMENT; } @Override public boolean isEndElement() { return true; } @Override public XMLSecEndElement asEndElement() { return this; } }
0
@Override
0
import java.util.Properties; import org.apache.cocoon.portal.PortalException; import org.apache.commons.lang.BooleanUtils; * @see org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect#prepareConfiguration(java.util.Properties) public Object prepareConfiguration(Properties configuration) throws PortalException { pc.tagName = configuration.getProperty("tag-name", "composite"); pc.rootTag = BooleanUtils.toBoolean(configuration.getProperty("root-tag", "true")); pc.itemTag = BooleanUtils.toBoolean(configuration.getProperty("item-tag", "true")); pc.itemTagName = configuration.getProperty("item-tag-name", ITEM_STRING); pc.rootTagId = configuration.getProperty("root-tag-id", null); pc.rootTagClass = configuration.getProperty("root-tag-class", null);
0
return params.get("charset");
0
return (other instanceof MockMemKey) && super.equals(other) && count == ((MockMemKey) other).count; MockTable(MockNamespace namespace, boolean limitVersion, TimeType timeType, String tableId, Map<String,String> properties) { public MockTable(MockNamespace namespace, TimeType timeType, String tableId, Map<String,String> properties) { Key key = new Key(m.getRow(), 0, m.getRow().length, u.getColumnFamily(), 0, u.getColumnFamily().length, u.getColumnQualifier(), 0, u.getColumnQualifier().length, u.getColumnVisibility(), 0, u.getColumnVisibility().length, u.getTimestamp());
0
import org.apache.hc.core5.http.EntityDetails; public interface AsyncEntityProducer extends AsyncDataProducer, EntityDetails {
0
import org.junit.Test; import static org.junit.Assert.*; public class LoopingIteratorTest { @Test @Test @Test @Test @Test @Test @Test @Test
0
protected Path detectTargetFolder() throws IllegalArgumentException {
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.client5.http.impl.cache; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; public class ConsumableInputStream extends InputStream { private final ByteArrayInputStream buf; private boolean closed = false; public ConsumableInputStream(final ByteArrayInputStream buf) { this.buf = buf; } @Override public int read() throws IOException { return buf.read(); } @Override public void close() { closed = true; try { buf.close(); } catch (final IOException e) { } } public boolean wasClosed() { return closed; } }
0
final String s = BasicLineFormatter.formatProtocolVersion } catch (final IllegalArgumentException ex) { } catch (final IllegalArgumentException ex) { final RequestLine requestline = new BasicRequestLine("GET", "/stuff", HttpVersion.HTTP_1_1); final String s = BasicLineFormatter.formatRequestLine(requestline, null); } catch (final IllegalArgumentException ex) { } catch (final IllegalArgumentException ex) { } catch (final IllegalArgumentException ex) { } catch (final IllegalArgumentException ex) { final Header header1 = new BasicHeader("name", "value"); final Header header2 = new BasicHeader("name", null); } catch (final IllegalArgumentException ex) { } catch (final IllegalArgumentException ex) {
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/test/org/apache/commons/validator/DoubleTest.java,v 1.9 2003/08/03 17:39:11 dgraham Exp $ * $Revision: 1.9 $ * $Date: 2003/08/03 17:39:11 $ * @version $Revision: 1.9 $ $Date: 2003/08/03 17:39:11 $ * validator-numeric.xml.
0
public void failed(final SessionRequest request, final Exception ex) { future.failed(ex);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/iterators/TestSingletonListIterator.java,v 1.5 2003/08/31 17:28:40 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 $Id: TestSingletonListIterator.java,v 1.5 2003/08/31 17:28:40 scolebourne Exp $
0
package org.apache.atlas.typesystem; import org.apache.atlas.typesystem.persistence.Id;
0
//Cannot be instantiated
0
public static long getSnapSizeInBytes() { long size = Long.getLong("zookeeper.snapSizeLimitInKb", 4194304L); // 4GB by default if (size <= 0) { LOG.info("zookeeper.snapSizeLimitInKb set to a non-positive value {}; disabling feature", size); } return size * 1024; // Convert to bytes }
0
result += counts.unassigned() + counts.assignedToDeadServers() + counts.assigned();
0
* @version CVS $Id: DOMStreamer.java,v 1.8 2003/03/17 10:44:07 bruno Exp $ // the following lines enable the creation of explicit xmlns attributes //String pr1 = pr.equals("") ? "xmlns" : pr; //String qn = pr.equals("") ? "xmlns" : "xmlns:" + pr; //newAttrs.addAttribute("", pr1, qn, "CDATA", ns);
0
ZooReaderWriter zk = new ZooReaderWriter(conn.info().getZooKeepers(), conn.info().getZooKeepersSessionTimeOut(), "");
0
StackId getDesiredStackId(); /** * Gets the repository for the desired version of this service by consulting * the repository states of all known components. */ RepositoryVersionState getRepositoryState();
0
import com.twitter.mesos.executor.Task; Task task = executor.getTask(taskId); template.setAttribute("taskState", task.getScheduleStatus()); TwitterTaskInfo taskInfo = task.getTaskInfo(); template.setAttribute("leasedPorts", task.getResourceConsumption().getLeasedPorts()); template.setAttribute("taskDir", task.getRootDir());
0
// FIXME - Due to a bug in castor, we have to allow null ids for now if ( id == null ) { this.id = null; return; }
0
package com.twitter.aurora.scheduler; import com.twitter.aurora.gen.TwitterTaskInfo; import com.twitter.aurora.scheduler.Driver.DriverImpl; import com.twitter.aurora.scheduler.PulseMonitor.PulseMonitorImpl; import com.twitter.aurora.scheduler.SchedulerLifecycle.DriverReference; import com.twitter.aurora.scheduler.events.TaskEventModule; import com.twitter.aurora.scheduler.periodic.GcExecutorLauncher; import com.twitter.aurora.scheduler.periodic.GcExecutorLauncher.GcExecutor;
1
* @Parameter(names = "--maxColF", description = "maximum column family value to use", converter = ShortConverter.class) @Parameter(names = "--maxColQ", description = "maximum column qualifier value to use", converter = ShortConverter.class) *
0
import org.apache.accumulo.core.security.tokens.UserPassToken; final boolean valid = shellState.getConnector().securityOperations().authenticateUser(new UserPassToken(user, password));
0
if (failures != null && failures.length > 0) { throw new Exception(failures.length + " failure files found importing files from " + dir); }
0
final StringBuilder sb = new StringBuilder(); for (final ElementValue evalue : evalues) { final StringBuilder sb = new StringBuilder();
1
import org.junit.Ignore; @Ignore("TODO(BEAM-5070) Test is flaky. Fix before reenabling.")
0
Collection<Supplier<Iterable<String>>> suppliers = new ArrayList<>(providers.size());
0
* Bridge class for the &lt;radialGradient&gt; element.
0
private static final TableRow row1 = new TableRow().set("corpus", "king_lear").set("word", "snuffleupaguses"); private static final TableRow row2 = new TableRow().set("corpus", "macbeth").set("word", "antidisestablishmentarianism"); private static final TableRow row3 = new TableRow().set("corpus", "king_lear").set("word", "antidisestablishmentarianism"); private static final TableRow row4 = new TableRow().set("corpus", "macbeth").set("word", "bob"); private static final TableRow row5 = new TableRow().set("corpus", "king_lear").set("word", "hi"); static final TableRow[] ROWS_ARRAY = new TableRow[] {row1, row2, row3, row4, row5}; private static final KV<String, String> tuple3 = KV.of("antidisestablishmentarianism", "king_lear"); private static final KV<String, String> combinedTuple1 = KV.of("antidisestablishmentarianism", "king_lear,macbeth"); static final KV<String, String>[] COMBINED_TUPLES_ARRAY = new KV[] {combinedTuple1, combinedTuple2}; private static final TableRow resultRow1 = new TableRow().set("word", "snuffleupaguses").set("all_plays", "king_lear"); private static final TableRow resultRow2 = new TableRow() .set("word", "antidisestablishmentarianism") .set("all_plays", "king_lear,macbeth");
1
package org.apache.felix.dependencymanager.test2.integration.api; import org.ops4j.pax.exam.junit.PaxExam; import org.apache.felix.dependencymanager.test2.components.Ensure; import org.apache.felix.dependencymanager.test2.integration.common.TestBase; @RunWith(PaxExam.class) public class FELIX3057_EmptyServiceReferenceArray extends TestBase { public void testWithoutIndex() throws Exception { public void testWithIndex() throws Exception {
0
import org.apache.sshd.common.Factory; import org.apache.sshd.common.util.threads.ExecutorService; this(null); protected DefaultIoServiceFactoryFactory(Factory<ExecutorService> factory) { super(factory); Factory<ExecutorService> executorServiceFactory = getExecutorServiceFactory(); if (executorServiceFactory != null) { factory.setExecutorServiceFactory(executorServiceFactory);
1
os.close();
0
import org.apache.avalon.framework.logger.Logger; * @version CVS $Id: DateSelector.java,v 1.3 2003/10/24 08:49:49 cziegeler Exp $ DateSelectorContext csc = new DateSelectorContext(this.getLogger()); Logger logger; public DateSelectorContext(Logger logger) { this.logger = logger; if (this.logger.isDebugEnabled()) { this.logger.debug( if (this.logger.isDebugEnabled()) { this.logger.debug(
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 de.kalpatec.pojosr.framework; import java.util.Enumeration; import java.util.zip.ZipEntry; class EntriesEnumeration implements Enumeration { private final Enumeration m_enumeration; private final String m_prefix; private volatile Object current; public EntriesEnumeration(Enumeration enumeration) { this(enumeration, null); } public EntriesEnumeration(Enumeration enumeration, String prefix) { m_enumeration = enumeration; m_prefix = prefix; } public boolean hasMoreElements() { while ((current == null) && m_enumeration.hasMoreElements()) { String result = (String) ((ZipEntry) m_enumeration.nextElement()).getName(); if (m_prefix != null){ if (result.startsWith(m_prefix)) { current = result.substring(m_prefix.length()); } } else { current = result; } } return (current != null); } public Object nextElement() { try { if (hasMoreElements()) { return current; } else { return m_enumeration.nextElement(); } } finally { current = null; } } }
0
x1Str = SVG_LINEAR_GRADIENT_X1_DEFAULT_VALUE; y1Str = SVG_LINEAR_GRADIENT_Y1_DEFAULT_VALUE; x2Str = SVG_LINEAR_GRADIENT_X2_DEFAULT_VALUE; y2Str = SVG_LINEAR_GRADIENT_Y2_DEFAULT_VALUE;
0
import cz.seznam.euphoria.flink.accumulators.FlinkAccumulatorFactory; import org.apache.flink.api.common.functions.RichGroupReduceFunction; private StorageProvider stateStorageProvider; private void loadConfig(Settings settings, ExecutionEnvironment env) { loadConfig(context.getSettings(), context.getExecutionEnvironment()); .reduceGroup(new RSBKReducer(origOperator, stateStorageProvider, windowing, context.getAccumulatorFactory(), context.getSettings())) extends RichGroupReduceFunction<BatchElement<?, Pair>, BatchElement<?, Pair>> implements ResultTypeQueryable<BatchElement<?, Pair>> { private final FlinkAccumulatorFactory accumulatorFactory; private final Settings settings; Windowing windowing, FlinkAccumulatorFactory accumulatorFactory, Settings settings) { this.accumulatorFactory = accumulatorFactory; this.settings = settings; accumulatorFactory.create(settings, getRuntimeContext()),
0
* * */ protected String localizedDecimalPattern; protected String localizedIntegerPattern; protected String defaultDecimalPattern; protected String defaultIntegerPattern; // Set the Default Locale back to the original value
0
import java.security.PrivilegedAction; import org.apache.hadoop.security.UserGroupInformation; private void parseSpans(Scanner scanner, Map<String,Stats> summary) { for (Entry<Key,Value> entry : scanner) { RemoteSpan span = TraceFormatter.getRemoteSpan(entry); Stats stats = summary.get(span.description); if (stats == null) { summary.put(span.description, stats = new Stats()); } stats.addSpan(span); } } Entry<Scanner,UserGroupInformation> pair = getScanner(sb); final Scanner scanner = pair.getKey(); final Map<String,Stats> summary = new TreeMap<String,Stats>(); if (null != pair.getValue()) { pair.getValue().doAs(new PrivilegedAction<Void>() { public Void run() { parseSpans(scanner, summary); return null; } }); } else { parseSpans(scanner, summary);
0
import javax.inject.Inject;
1
* A constraint that checks the visibility of columns against the actor's authorizations. Violation codes:
0
import com.google.cloud.dataflow.sdk.transforms.windowing.WindowFn; private final WindowingStrategy<?, W> windowingStrategy; public WatermarkHold(WindowingStrategy<?, W> windowingStrategy) { this.windowingStrategy = windowingStrategy; * <p>If the value was not late, then the input watermark must be less than the timestamp, and we * can use {@link WindowFn#getOutputTime} to determine the appropriate output time. * * <p>If the value was late, we pessimistically assume the worst and attempt to hold the watermark * to {@link BoundedWindow#maxTimestamp()} plus {@link WindowingStrategy#getAllowedLateness()}. * That allows us to output the result at {@link BoundedWindow#maxTimestamp()} without being * dropped. ? c.window().maxTimestamp().plus(windowingStrategy.getAllowedLateness()) : windowingStrategy.getWindowFn().getOutputTime(c.timestamp(), c.window());
0
serverSession.shudownOutputStream();
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. */
0
* read(in, row); read(in, cf); read(in, cq); read(in, cv); ts = WritableUtils.readVLong(in); }
0
* * Checks whether a tryInvoke return value indicates a failure or not. * <p>Usage is : <code>Object r = tryInvoke(...); if (tryFailed(r) {...} else {...}</code> *
1
* @version CVS $Id: AbstractEnvironment.java,v 1.23 2004/05/29 17:39:38 cziegeler Exp $ protected String prefix = "";
0
response.setCode(toStatusCode(ex, response)); String message = ex.getMessage(); if (message == null) { message = ex.toString(); } response.setEntity(new StringEntity(message, ContentType.TEXT_PLAIN)); } protected int toStatusCode(final Exception ex, final ClassicHttpResponse response) { final int code; code = HttpStatus.SC_NOT_IMPLEMENTED; code = HttpStatus.SC_HTTP_VERSION_NOT_SUPPORTED; code = HttpStatus.SC_NOT_IMPLEMENTED; code = HttpStatus.SC_BAD_REQUEST; code = HttpStatus.SC_INTERNAL_SERVER_ERROR; return code;
0
import org.apache.http.HttpRequestInterceptor; import org.apache.http.params.SyncBasicHttpParams; import org.apache.http.protocol.HttpProcessor; import org.apache.http.protocol.ImmutableHttpProcessor; private final HttpProcessor httpproc; this.params = new SyncBasicHttpParams(); this.httpproc = new ImmutableHttpProcessor( new HttpRequestInterceptor[] { new RequestContent(), new RequestTargetHost(), new RequestConnControl(), new RequestUserAgent(), new RequestExpectContinue() }); this.context = new BasicHttpContext();
0
/* * Copyright 2013 Twitter, 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. */
0
import org.apache.beam.sdk.transforms.DoFn; import org.apache.beam.sdk.transforms.windowing.BoundedWindow; .of(new DoFn<KV<String, Integer>, KV<String, Integer>>() { @ProcessElement private static class UserSessionInfoFn extends DoFn<KV<String, Integer>, Integer> { @ProcessElement public void processElement(ProcessContext c, BoundedWindow window) { IntervalWindow w = (IntervalWindow) window; .of(new DoFn<GameActionInfo, GameActionInfo>() { @ProcessElement
0
import org.apache.commons.vfs.util.FileObjectUtils; FileObject fo = getFileSystem() ((SftpFileObject) FileObjectUtils.getAbstractFileObject(fo)).setStat(stat.getAttrs()); return (FileObject[]) children.toArray(new FileObject[children
0
private static final String COMMAND_PARAM_STRUCT_OUT = "structured_out"; MasterHostResolver resolver = Direction.UPGRADE == direction ? new MasterHostResolver(cluster) : new MasterHostResolver(cluster, version); UpgradeContext ctx = new UpgradeContext(resolver, version, direction); actionContext.setIgnoreMaintenance(true); actionContext.setIgnoreMaintenance(true); actionContext.setIgnoreMaintenance(true); if (null != mt.structuredOut) { commandParams.put(COMMAND_PARAM_STRUCT_OUT, mt.structuredOut); } actionContext.setIgnoreMaintenance(true);
0
public boolean handleUpdate(AlertDefinitionEventType eventType, AlertCluster update) { changed = !alertDefinitions.keySet().containsAll(update.alertDefinitions.keySet()); if (changed) { alertDefinitions.putAll(update.alertDefinitions); } else { for (Map.Entry<Long, AlertDefinition> e : update.alertDefinitions.entrySet()) { Long definitionId = e.getKey(); AlertDefinition newDefinition = e.getValue(); AlertDefinition oldDefinition = alertDefinitions.put(definitionId, newDefinition); changed = changed || !oldDefinition.deeplyEquals(newDefinition); staleIntervalMultiplier = update.getStaleIntervalMultiplier(); changed = alertDefinitions.keySet().removeAll(update.alertDefinitions.keySet()); return changed;
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
/** * Copyright 2013 Apache Software Foundation
0
Scanner s = new ScannerImpl(context, new Table.ID("foo"), Authorizations.EMPTY); Scanner s = new ScannerImpl(context, new Table.ID("foo"), Authorizations.EMPTY); Scanner s = new ScannerImpl(context, new Table.ID("foo"), expected); new ScannerImpl(context, new Table.ID("foo"), null);
1
if (null == context.getSaslParams()) { checkArgument(password != null, "password is null"); } if (null == context.getSaslParams()) { client.createLocalUser(Tracer.traceInfo(), context.rpcCreds(), principal, ByteBuffer.wrap(password.getPassword())); } else { client.createLocalUser(Tracer.traceInfo(), context.rpcCreds(), principal, ByteBuffer.wrap(new byte[0])); }
0
package org.apache.commons.beanutils2.bugs; import org.apache.commons.beanutils2.PropertyUtils;
1
private static final long serialVersionUID = -7355623307528443725L;
0
public final class HttpConnectionManagerParams implements ConnManagerPNames { /** The default maximum number of connections allowed per host */ private static ConnPerRoute DEFAULT_CONN_PER_ROUTE = new ConnPerRoute() { public int getMaxForRoute(HttpRoute route) { return ConnPerRouteBean.DEFAULT_MAX_CONNECTIONS_PER_ROUTE; } }; * Sets maximum number of connections allowed per route lookup interface. public static void setMaxConnectionsPerRoute(final HttpParams params, final ConnPerRoute connPerRoute) { params.setParameter(MAX_CONNECTIONS_PER_ROUTE, connPerRoute); * Returns maximum number of connections allowed per route lookup interface. public static ConnPerRoute getMaxConnectionsPerRoute(final HttpParams params) { ConnPerRoute connPerRoute = (ConnPerRoute) params.getParameter(MAX_CONNECTIONS_PER_ROUTE); if (connPerRoute == null) { connPerRoute = DEFAULT_CONN_PER_ROUTE; return connPerRoute; params.setIntParameter(MAX_TOTAL_CONNECTIONS, maxTotalConnections); return params.getIntParameter(MAX_TOTAL_CONNECTIONS, DEFAULT_MAX_TOTAL_CONNECTIONS);
0
import org.osgi.framework.Bundle; import org.ow2.chameleon.testing.helpers.Dumps; CheckService checker = osgiHelper.waitForService(CheckService.class, null, 1000);
0
public Object structuralValue(@Nullable T value) {
0
import org.apache.ambari.annotations.ApiIgnore; @POST @ApiIgnore // until documented @GET @ApiIgnore // until documented @GET @ApiIgnore // until documented @PUT @ApiIgnore // until documented
0
import org.apache.batik.gvt.GraphicsNodeRenderContext; public void buildGraphicsNode(GraphicsNode node, BridgeContext ctx,
0
public SocketHttpDataReceiver(final Socket socket, int buffersize) throws IOException { if (buffersize < 0) { buffersize = socket.getReceiveBufferSize(); } if (buffersize < 1024) { buffersize = 1024;
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.view.filebrowser.utils; import org.json.simple.JSONObject; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.HashMap; public class MisconfigurationFormattedException extends WebApplicationException { private final static int STATUS = 500; private final static String message = "Parameter \"%s\" is set to null"; public MisconfigurationFormattedException(String name) { super(errorEntity(name)); } protected static Response errorEntity(String name) { HashMap<String, Object> response = new HashMap<String, Object>(); response.put("message", String.format(message, name)); response.put("trace", null); response.put("status", STATUS); return Response.status(STATUS).entity(new JSONObject(response)).type(MediaType.APPLICATION_JSON).build(); } }
0
"cluster1", "HDFS");
0
super(HTraceConfiguration.fromMap(Collections .singletonMap(CountSampler.SAMPLER_FREQUENCY_CONF_KEY, Long.toString(frequency))));
0
import org.apache.commons.jxpath.ri.compiler.NodeTest; NodeIterator it = getNodeIterator(context, parentPointer, step); NodeIterator it = getNodeIterator(context, parent, step); NodeIterator it = getNodeIterator(context, parent, step); EvalContext context, NodeTest nodeTest = step.getNodeTest(); QName qname = ((NodeNameTest) nodeTest).getNodeName(); String prefix = qname.getPrefix(); if (prefix != null) { String namespaceURI = context.getJXPathContext() .getNamespaceURI(prefix); nodeTest = new NodeNameTest(qname, namespaceURI); } return pointer.childIterator(nodeTest, false, null);
0
* @version $Revision$
1
package org.apache.beam.sdk.transforms.join; import org.apache.beam.sdk.util.common.Reiterable; import org.apache.beam.sdk.util.common.Reiterator; import org.apache.beam.sdk.values.TupleTag; import org.apache.beam.sdk.values.TupleTagList;
0
* Deprecated since 2.1. * * @deprecated Use {@link #Bzip2FileObject(AbstractFileName, FileObject, Bzip2FileSystem)} instead.
0
buf.append("<FONT COLOR=\"#00FF00\">").append(Constants.getTypeName(bytes.readByte())).append( if (Constants.getNoOfOperands(opcode) > 0) { + Constants.getAttributeName(tag) + "</A></LI>\n"); + Constants.getAttributeName(tag) + "</A></LI>\n");
0