Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
private static final Integer INTEGER_0 = 0;
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
public class CalculatorFlow extends AbstractContinuable {
0
// Master is creating entries in the replication table from the metadata table every second. // Compaction should trigger the record to be written to metadata. Wait a bit to ensure // that the master has time to work. Thread.sleep(5000);
0
import java.util.Collections; import java.util.HashSet; import java.util.Map; import java.util.Set; String component = getComponentName(resource); return new HashSet<String>(GANGLIA_CLUSTER_NAME_MAP.containsKey(component) ? GANGLIA_CLUSTER_NAME_MAP.get(component) : Collections.<String>emptyList());
0
public boolean hasNamespacePermission(String user, String namespace, throw new NamespaceNotFoundException(namespace, null, "while checking permissions"); public boolean hasCachedNamespacePermission(String user, String namespace, public void grantNamespacePermission(String user, String namespace, public void revokeNamespacePermission(String user, String namespace, public void cleanNamespacePermissions(String namespace) throws AccumuloSecurityException {
0
// if this is an abstract component we store the extra info in the property if ( component.isAbstract() ) { prop.setPrivate(isPrivate); prop.setLabel(tag.getNamedParameter(Constants.PROPERTY_LABEL)); prop.setDescription(tag.getNamedParameter(Constants.PROPERTY_DESCRIPTION)); prop.setCardinality(tag.getNamedParameter(Constants.PROPERTY_CARDINALITY)); }
0
import static org.junit.Assert.assertNotNull; assertNotNull(commands);
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: NotifyingCascadingRuntimeException.java,v 1.2 2004/03/05 13:02:49 bdelacretaz Exp $
1
try (BatchWriter bw = c.createBatchWriter(tableName, cfg)) { for (int i = 0; i < n; i++) { Mutation m = new Mutation(i + ""); m.put("", "", ""); bw.addMutation(m); }
0
if (userEntity == null) {
0
// Decode query string only // Path should not be decoded here (username can contain '?') String href = m_request.getURI(); int pos = href.indexOf('?'); if (pos != -1) { try { href = href.substring(0, pos + 1) + URLDecoder.decode(href.substring(pos + 1), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Unable to decode URI: " + e, e); } } processNode(result.getResultTree(), href);
0
import java.util.Set; import org.apache.ambari.server.state.stack.upgrade.ServiceCheckGrouping; Grouping serviceCheckGroup = null; if (g.name.equals("SERVICE_CHECK_1")) { serviceCheckGroup = g; } List<String> expected_priority = Arrays.asList("HDFS", "HBASE", "YARN"); assertNotNull(serviceCheckGroup); assertEquals(ServiceCheckGrouping.class, serviceCheckGroup.getClass()); ServiceCheckGrouping scg = (ServiceCheckGrouping) serviceCheckGroup; Set<String> priorities = scg.getPriorities(); assertEquals(3, priorities.size()); i = 0; for (String s : priorities) { assertEquals(expected_priority.get(i++), s); }
0
@SuppressWarnings("boxing")
0
public void channelClosed(Channel channel, Throwable reason) { public void channelInitialized(Channel channel) { handleChannelEvent("Initialized", channel); } @Override public void channelClosed(Channel channel, Throwable reason) { log.info("channelClosed(" + channel + ") reason=" + reason); log.info("handleChannelEvent({})[{}] id={}", channel, name, id); // we expect failures either on channel init or open out.reset(); err.reset(); channel.open().verify(11L, TimeUnit.SECONDS); log.info("Channel established at retry#" + retryCount); try (OutputStream stdin = channel.getInvertedIn()) { stdin.write((getCurrentTestName() + "-retry#" + retryCount + "\n").getBytes(StandardCharsets.UTF_8)); } outputDebugMessage("%s at retry #%d: %s", e.getClass().getSimpleName(), retryCount, e.getMessage()); } catch(IllegalStateException e) { // sometimes due to timing issues we get this problem assertTrue("Premature exception phase - count=" + retryCount, retryCount > 0); assertTrue("Session not closing", session.isClosing() || session.isClosed()); log.warn("Session closing prematurely: " + session); return; assertEquals("Mismatched total failures count on test end", 2, eventsMap.size()); assertEquals("Mismatched open failures count on test end: " + failuresSet, 1, failuresSet.size()); public void channelClosed(Channel channel, Throwable reason) { super(ValidateUtils.checkNotNullAndNotEmpty(name, "No event name provided")); this.name = name;
0
// FIXME use different class loader public void doAddComponent( final String role,
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions;
0
if (Files.exists(linkPath, IoUtils.EMPTY_LINK_OPTIONS)) { Files.delete(linkPath); }
0
import org.apache.accumulo.fate.zookeeper.IZooReaderWriter; import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeExistsPolicy; import org.apache.accumulo.fate.zookeeper.ZooUtil.NodeMissingPolicy;
1
oos.writeObject(cacheEntry); return (HttpCacheEntry) ois.readObject();
0
boolean reuse = false; // The connection is in or can be brought to a re-usable state. reuse = reuseStrategy.keepAlive(response, context); if(reuse) { // Set the idle duration of this connection long duration = keepAliveStrategy.getKeepAliveDuration(response, context); managedConn.setIdleDuration(duration, TimeUnit.MILLISECONDS); } releaseConnection(); releaseConnection(); entity = new BasicManagedEntity(entity, managedConn, reuse); protected void releaseConnection() { // Release the connection through the ManagedConnection instead of the // ConnectionManager directly. This lets the connection control how // it is released. try { managedConn.releaseConnection(); } catch(IOException ignored) { LOG.debug("IOException releasing connection", ignored); } private void abortConnection() { try { mcc.releaseConnection(); } catch(IOException ignored) { LOG.debug("Error releasing connection", ignored); }
0
defaultRegion = (Rectangle2D)in.getBounds2D().clone(); defaultRegion.add(in2.getBounds2D());
0
/* * Copyright 2004-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cocoon.portal.coplets.basket.events; import org.apache.cocoon.portal.coplets.basket.Briefcase; /** * Clean all briefcases or a single one. * * @version $Id$ */ public class CleanBriefcaseEvent extends ContentStoreEvent { /** * Constructor * If this constructor is used all baskets will be cleaned */ public CleanBriefcaseEvent() { // nothing to do here } /** * Constructor * One briefcase will be cleaned * @param briefcase The briefcase */ public CleanBriefcaseEvent(Briefcase briefcase) { super(briefcase); } }
0
import org.apache.beam.runners.core.metrics.ExecutionStateTracker; import org.apache.beam.runners.core.metrics.ExecutionStateTracker.ExecutionState;
0
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkState;
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.FluentIterable; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Iterables;
0
w.write ("<!DOCTYPE "); if (sysID != null) StringBuffer result = new StringBuffer( s.length() );
0
/* * Copyright 2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cocoon.deployer.filemanager; import java.io.InputStream; import java.io.OutputStream; /** * A simple interface that makes it possible to implement different ways of doing filesystem operations, * may it be transaction or non-transaction. */ public interface FileManager { public InputStream readResource(String resource) throws FileManagerException; public OutputStream writeResource(String string) throws FileManagerException; public void rollbackTransaction(Exception ex) throws FileManagerException; public void commitTransaction() throws FileManagerException; }
0
import org.apache.hc.core5.util.Timeout; Timeout connectTimeout,
0
DataflowPortabilityApiUnsupported.class DataflowPortabilityApiUnsupported.class KV.of(42, BoundedWindow.TIMESTAMP_MIN_VALUE.plus(1774))); @Category({ ValidatesRunner.class, UsesTimersInParDo.class, DataflowPortabilityApiUnsupported.class }) DataflowPortabilityApiUnsupported.class @Category({ ValidatesRunner.class, UsesTimersInParDo.class, DataflowPortabilityApiUnsupported.class }) DataflowPortabilityApiUnsupported.class DataflowPortabilityApiUnsupported.class DataflowPortabilityApiUnsupported.class
0
* Read buffer size for NIO2 sessions * See {@link org.apache.sshd.common.io.nio2.Nio2Session} */ public static final String NIO2_READ_BUFFER_SIZE = "nio2-read-buf-size"; /**
0
import javax.xml.stream.Location; try for (int i = 0, nb = reader.getAttributeCount(); i < nb; i++) resource.put(reader.getAttributeLocalName(i), reader.getAttributeValue(i)); int event; while ((event = reader.nextTag()) == XMLStreamConstants.START_ELEMENT) String element = reader.getLocalName(); if (CATEGORY.equals(element)) { CategoryImpl category = parseCategory(reader); resource.addCategory(category); } else if (CAPABILITY.equals(element)) { CapabilityImpl capability = parseCapability(reader); resource.addCapability(capability); } else if (REQUIRE.equals(element)) { RequirementImpl requirement = parseRequire(reader); resource.addRequire(requirement); } else { ignoreTag(reader); } // Sanity check if (event != XMLStreamConstants.END_ELEMENT || !RESOURCE.equals(reader.getLocalName())) throw new Exception("Unexpected state"); } return resource; } catch (Exception e) { Location loc = reader.getLocation(); if (loc != null) { throw new Exception("Error while parsing resource " + resource.getId() + " at line " + loc.getLineNumber() + " and column " + loc.getColumnNumber(), e); throw new Exception("Error while parsing resource " + resource.getId(), e);
0
@Description("The maximum number of elements in a bundle.") @Default.Long(1000) Long getMaxBundleSize(); void setMaxBundleSize(Long size);
0
Set<String> jsonIgnoreMethodNames = FluentIterable.from(ReflectHelpers.getClosureOfMethodsOnInterfaces(interfaces)) .filter(AnnotationPredicates.JSON_IGNORE.forMethod) .transform(input -> input.getName()) .toSet();
0
return new LessEqualsPredicate<>(prop, val);
0
* the {@link #makeObject()} method.
0
import org.xml.sax.SAXException; import org.xml.sax.ContentHandler; * @version CVS $Id: Convertor.java,v 1.2 2004/04/10 13:40:27 bruno Exp $ /** * Generates a bit of information about this convertor (optional). */ void generateSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException;
0
* @param message the message to check * @param mode the mode type
0
private List<Long> data1 = new ArrayList<>(); private List<Long> data2 = new ArrayList<>(); private List<Long> data3 = new ArrayList<>(); private List<Long> data4 = new ArrayList<>(); private List<Long> data5 = new ArrayList<>(); List<List<Long>> data = new ArrayList<>(); TreeSet<Text> sortedEnc = new TreeSet<>(); ListLexicoder<Long> listLexicoder = new ListLexicoder<>(new LongLexicoder()); List<List<Long>> unenc = new ArrayList<>(); assertDecodes(new ListLexicoder<>(new LongLexicoder()), data1); assertDecodes(new ListLexicoder<>(new LongLexicoder()), data2); assertDecodes(new ListLexicoder<>(new LongLexicoder()), data3); assertDecodes(new ListLexicoder<>(new LongLexicoder()), data4); assertDecodes(new ListLexicoder<>(new LongLexicoder()), data5);
1
import org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.ByteString; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Suppliers; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Iterables;
0
loop: for (LogWork logWork : work) { * * @param meta * the cq for the "log" entry in +r/!0 logPath = fs.choose(Optional.<String> absent(), ServerConstants.getBaseUris()) + Path.SEPARATOR + ServerConstants.WAL_DIR + Path.SEPARATOR + logger + Path.SEPARATOR + filename;
0
import org.apache.ambari.server.api.predicate.InvalidQueryException; public Predicate toPredicate() throws InvalidQueryException;
0
g.setFont(new java.awt.Font("Lucida Sans", java.awt.Font.BOLD, 12)); java.awt.Font defaultFont = new java.awt.Font("Lucida Sans", java.awt.Font.BOLD, 16);
0
c.tableOperations().addFilesTo(tableName).from(dir).load();
0
prov.put("instance.name","FooProvider1"); prov.put("instance.name","FooProvider2"); i1.put("instance.name","Subscriber1"); i2.put("instance.name","Subscriber2"); i3.put("instance.name","Subscriber3");
0
return new ValueWithRecordId<>(
0
* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
import org.eclipse.jetty.server.SessionManager; SessionManager sessionManager; sessionManager = mock(SessionManager.class); bind(SessionManager.class).toInstance(sessionManager);
0
{ set.remove(reference); if (set.isEmpty()) { highestReference = null; } else { highestReference = set.last(); } }
0
@Experimental REPLICATION_MIN_THREADS("replication.receiver.min.threads", "1", PropertyType.COUNT, "Minimum number of threads for replciation"), @Experimental REPLICATION_THREADCHECK("replication.receiver.threadcheck.time", "5s", PropertyType.TIMEDURATION, "The time between adjustments of the replication thread pool."), || key.startsWith(Property.TABLE_COMPACTION_STRATEGY_PREFIX.getKey()) || key.startsWith(REPLICATION_PREFIX.getKey());
1
import org.apache.hc.core5.pool.nio.NIOConnFactory; import org.apache.hc.core5.reactor.ConnectingIOReactor; import org.apache.hc.core5.reactor.IOSession; import org.apache.hc.core5.reactor.SessionRequest; import org.apache.hc.core5.reactor.SessionRequestCallback;
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.sigil.config.internal; import java.io.File; import org.apache.felix.sigil.config.IBldProject; /** * @author dave * */ public class InlineResource extends AbstractResource { /** * @param bPath */ public InlineResource(IBldProject project, String bPath) { super(project, bPath); } /* (non-Javadoc) * @see org.apache.felix.sigil.core.Resource#getLocalFile() */ public String getLocalFile() { return bPath; } public String toString() { return '@' + bPath; } /* (non-Javadoc) * @see org.apache.felix.sigil.core.Resource#toBNDInstruction(java.io.File[]) */ public String toBNDInstruction(File[] classpath) { StringBuilder sb = new StringBuilder(); sb.append('@'); File f = project.resolve(bPath); if (f.exists()) { sb.append(f); } else sb.append(bPath); return sb.toString(); } }
0
/* * Copyright 2016-2018 Seznam.cz, a.s.
0
import org.apache.http.annotation.NotThreadSafe;
0
* @param is The input stream to scan. * must be '&amp;'.
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
Map<String, Object> requestProps = new HashMap<>(); Map<String, Object> requestProps = new HashMap<>(); requestProps = new HashMap<>(); Map<String, Object> requestProps = new HashMap<>(); Map<String, Object> requestProps = new HashMap<>();
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.dm.lambda.samples.hello; import java.util.Dictionary; import org.osgi.service.log.LogService; /** * Our service consumer. We depend on a ServiceProvider, and on a configuration. * * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a> */ public class ServiceConsumer { volatile ServiceProvider service; volatile LogService log; Dictionary<?, ?> conf; public void updated(Dictionary<String, Object> conf) { this.conf = conf; } public void start() { log.log(LogService.LOG_INFO, "ServiceConsumer.start: calling service.hello()"); this.service.hello(); } }
0
public CoderTypeSerializer<T> duplicate() { return new CoderTypeSerializer<>(coder);
0
public Optional<String> getLockToken(String updateId) { return jobUpdateStore.getLockToken(updateId);
0
if (s.length() == 0) {
0
public static <TransformT extends PTransform> void registerTransformTranslator( Class<TransformT> transformClass, TransformTranslator<? extends TransformT> transformTranslator) { public <TransformT extends PTransform> TransformTranslator<TransformT> getTransformTranslator(Class<TransformT> transformClass) { public interface TransformTranslator<TransformT extends PTransform> { public void translate(TransformT transform, <InputT extends PInput> InputT getInput(PTransform<InputT, ?> transform); <OutputT extends POutput> OutputT getOutput(PTransform<?, OutputT> transform); public <InputT extends PInput> InputT getInput(PTransform<InputT, ?> transform) { return (InputT) currentTransform.input; public <OutputT extends POutput> OutputT getOutput(PTransform<?, OutputT> transform) { return (OutputT) currentTransform.output; private <ElemT, ViewT> void translateTyped( View.CreatePCollectionView<ElemT, ViewT> transform, private <K, InputT, OutputT> void translateHelper( final Combine.GroupedValues<K, InputT, OutputT> transform, private <InputT, OutputT> void translateMultiHelper( ParDo.BoundMulti<InputT, OutputT> transform, private <InputT, OutputT> void translateSingleHelper( ParDo.Bound<InputT, OutputT> transform,
0
* $Revision: 1.5 $ * $Date: 2003/10/09 21:05:29 $ * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * permission of the Apache Software Foundation.
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.accumulo.proxy; import org.apache.thrift.protocol.TCompactProtocol; import org.apache.thrift.protocol.TProtocolFactory; import org.junit.BeforeClass; /** * */ public class TCompactProxyIT extends SimpleProxyBase { private static final TCompactProtocol.Factory factory = new TCompactProtocol.Factory(); @BeforeClass public static void setup() throws Exception { setupMiniCluster(factory); } @Override public TProtocolFactory getProtocol() { return factory; } }
0
private void headersContain(final Header[] headers, final String name, final String value) {
0
* <code>ResultSet</code> into a <code>List</code> of beans. This class is * * The RowProcessor implementation to use when converting rows /** * /** * * @param convert The <code>RowProcessor</code> implementation * * *
0
import org.apache.commons.vfs.Capability; protected void addCapabilities(final Collection<Capability> caps)
0
void updateAlertTargets(long alertTargetId,
0
import com.jcraft.jsch.JSch; private static final Collection<String> GANYMEDE_MACS = private final MacFactory factory; private final String jschMacClass; private SshServer sshd; private int port; public MacTest(MacFactory factory, String jschMacClass) { this.factory = factory; this.jschMacClass = jschMacClass; } Assume.assumeTrue("Factory not supported: " + macName, GANYMEDE_MACS.contains(macName));
0
import java.util.Map; import org.apache.bcel.Constants; import org.apache.bcel.classfile.Constant; import org.apache.bcel.classfile.ConstantCP; import org.apache.bcel.classfile.ConstantClass; import org.apache.bcel.classfile.ConstantDouble; import org.apache.bcel.classfile.ConstantFieldref; import org.apache.bcel.classfile.ConstantFloat; import org.apache.bcel.classfile.ConstantInteger; import org.apache.bcel.classfile.ConstantInterfaceMethodref; import org.apache.bcel.classfile.ConstantLong; import org.apache.bcel.classfile.ConstantMethodref; import org.apache.bcel.classfile.ConstantNameAndType; import org.apache.bcel.classfile.ConstantPool; import org.apache.bcel.classfile.ConstantString; import org.apache.bcel.classfile.ConstantUtf8; private Map string_table = new HashMap(); private Map class_table = new HashMap(); private Map utf8_table = new HashMap(); private Map n_a_t_table = new HashMap(); private Map cp_table = new HashMap();
0
import java.util.SortedSet; import java.util.TreeSet; SortedSet<String> roleSet = new TreeSet<String>();
0
builder.put(FloatCoder.class, CoderProviders.fromStaticMethods(Float.class, Float.class));
0
import org.junit.Assert; import org.junit.Test; public class TestResponseParser { @Test Assert.fail("IllegalArgumentException should have been thrown"); Assert.fail("IllegalArgumentException should have been thrown"); Assert.fail("IllegalArgumentException should have been thrown"); @Test Assert.assertNotNull(statusline); Assert.assertEquals(200, statusline.getStatusCode()); Assert.assertEquals("OK", statusline.getReasonPhrase()); Assert.assertEquals(HttpVersion.HTTP_1_1, statusline.getProtocolVersion()); Assert.assertEquals(3, headers.length); @Test Assert.fail("NoHttpResponseException should have been thrown"); @Test Assert.assertNotNull(httpresponse); Assert.assertEquals(5, timeoutCount); Assert.assertNotNull(statusline); Assert.assertEquals(200, statusline.getStatusCode()); Assert.assertEquals("OK", statusline.getReasonPhrase()); Assert.assertEquals(HttpVersion.HTTP_1_1, statusline.getProtocolVersion()); Assert.assertEquals(3, headers.length);
0
final List<NameValuePair> params = new ArrayList<>();
0
"WHERE confighosts.hostEntity.hostName=:hostname"), @Column(name = "host_id", nullable = false, insertable = true, updatable = true) private Long hostId; @JoinColumn(name = "host_id", referencedColumnName = "host_id", nullable = false, insertable = false, updatable = false) }) public Long getHostId() { return hostId; } public void setHostId(Long hostId) { this.hostId = hostId; public String getHostname() { return hostEntity != null ? hostEntity.getHostName() : null; if (!hostEntity.equals(that.hostEntity)) return false; result = 31 * result + hostEntity.hashCode();
0
import java.nio.charset.StandardCharsets; super(string, timeInMillis, SCHEME, (USER + ":" + secret).getBytes(StandardCharsets.UTF_8));
0
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument; import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkNotNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import javax.annotation.Nonnull; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableSet; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Maps; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Ordering; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.graph.ElementOrder; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.graph.EndpointPair; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.graph.Graphs; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.graph.MutableNetwork; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.graph.Network; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.graph.NetworkBuilder; @SuppressFBWarnings( value = "NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION", justification = "https://github.com/google/guava/issues/920") public int compare(@Nonnull NodeT t0, @Nonnull NodeT t1) {
0
* * * /** * @version $Revision: 1.5 $ } //------------------------------------------------------------------------- TestSuite parent = (TestSuite) context.getVariable("org.apache.commons.jelly.junit.suite"); } //------------------------------------------------------------------------- /** //-------------------------------------------------------------------------
1
import org.apache.accumulo.core.util.ratelimit.RateLimiter; RateLimiter getReadLimiter(); RateLimiter getWriteLimiter(); mfw = fileFactory.openWriter(outputFilePathName, ns, ns.getConf(), env.getWriteLimiter(), acuTableConf); reader = fileFactory.openReader(mapFile.path().toString(), false, fs, fs.getConf(), env.getReadLimiter(), acuTableConf);
1
private final byte[] lenBytes = new byte[Integer.BYTES];
0
* Upon receiving an incoming request <tt>HttpAsyncService</tt> verifies * the message for compliance with the server expectations using * {@link HttpAsyncExpectationVerifier}, if provided, and then * {@link HttpAsyncRequestHandlerResolver} is used to resolve the request URI * to a particular {@link HttpAsyncRequestHandler} intended to handle * the request with the given URI. The protocol handler uses the selected * {@link HttpAsyncRequestHandler} instance to process the incoming request * and to generate an outgoing response. * <p/>
0
super(operands, SqlTypeName.DOUBLE);
0
private String repositoryVersionId; builder.append(", Repository version ID(") .append(repositoryVersionId) public AddUpgradeRequestAuditEventBuilder withRepositoryVersionId(String repositoryVersionId) { this.repositoryVersionId = repositoryVersionId;
0
package org.apache.commons.digester3.rule;
0
import org.apache.ambari.server.mpack.MpackManagerFactory; bind(MpackManagerFactory.class).toInstance(createNiceMock(MpackManagerFactory.class));
0
package org.apache.beam.sdk.extensions.joinlibrary;
0
String[] elts2 = (list.toArray(new String[0])); String[] elts4b = (list.toArray(elts4)); return list.toArray(new String[0]);
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
package org.apache.ambari.metrics.alertservice.prototype.common; import java.util.Arrays; public static double mean(double[] values) { return sum / values.length; public static double variance(double[] values) { public static double sdev(double[] values, boolean useBesselsCorrection) { int n = (useBesselsCorrection) ? values.length - 1 : values.length; public static double median(double[] values) { double[] clonedValues = Arrays.copyOf(values, values.length); Arrays.sort(clonedValues); int n = values.length; return clonedValues[(n-1)/2]; return ( clonedValues[(n-1)/2] + clonedValues[n/2] ) / 2;
0
import java.io.IOException; import java.util.Collection;
0
@Override
0
true /* recovery enabled */, "Component100 Client")); false /* recovery not enabled */, "Component101 Client")); true /* recovery enabled */, "Component102 Client")); false /* recovery not enabled */, "Component101 Client")); false /* recovery not enabled */, "Component102 Client")); false /* recovery not enabled */, "Component103 Client"));
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/impl/TextScript.java,v 1.12 2003/01/24 05:26:13 morgand Exp $ * $Revision: 1.12 $ * $Date: 2003/01/24 05:26:13 $ * $Id: TextScript.java,v 1.12 2003/01/24 05:26:13 morgand Exp $ import org.apache.commons.jelly.JellyException; import org.xml.sax.SAXException; * @version $Revision: 1.12 $ public void run(JellyContext context, XMLOutput output) throws JellyException { try { output.write(text); } catch (SAXException e) { throw new JellyException("could not write to XMLOutput",e); }
0
import org.apache.accumulo.core.client.impl.thrift.ClientService.Iface; import org.apache.accumulo.core.util.Pair; String server = null; Pair<String,Iface> pair = ServerClient.getConnection(instance); server = pair.getFirst(); client = pair.getSecond(); log.debug("ClientService request failed " + server + ", retrying ... ", tte); String server = null; Pair<String,Iface> pair = ServerClient.getConnection(instance); server = pair.getFirst(); client = pair.getSecond(); log.debug("ClientService request failed " + server + ", retrying ... ", tte); public static Pair<String,ClientService.Iface> getConnection(Instance instance) throws TTransportException { Pair<String,TTransport> pair = ThriftTransportPool.getInstance().getAnyTransport(servers); ClientService.Iface client = ThriftUtil.createClient(new ClientService.Client.Factory(), pair.getSecond()); return new Pair<String,ClientService.Iface>(pair.getFirst(), client);
0
case PRIMITIVE: if (attributeInfo.getVertexUniquePropertyName() != null) { instanceVertex.removeProperty(attributeInfo.getVertexUniquePropertyName()); } break;
0
* Autogenerated by Thrift Compiler (0.9.1) import org.apache.thrift.async.AsyncMethodCallback; import org.apache.thrift.server.AbstractNonblockingServer.*; @SuppressWarnings("all") public class TConstraintViolationSummary implements org.apache.thrift.TBase<TConstraintViolationSummary, TConstraintViolationSummary._Fields>, java.io.Serializable, Cloneable, Comparable<TConstraintViolationSummary> { @Override lastComparison = Boolean.valueOf(isSetConstrainClass()).compareTo(other.isSetConstrainClass()); lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.constrainClass, other.constrainClass); lastComparison = Boolean.valueOf(isSetViolationCode()).compareTo(other.isSetViolationCode()); lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.violationCode, other.violationCode); lastComparison = Boolean.valueOf(isSetViolationDescription()).compareTo(other.isSetViolationDescription()); lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.violationDescription, other.violationDescription); lastComparison = Boolean.valueOf(isSetNumberOfViolatingMutations()).compareTo(other.isSetNumberOfViolatingMutations()); lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numberOfViolatingMutations, other.numberOfViolatingMutations);
0
import org.apache.beam.sdk.options.ApplicationNameOptions; import org.apache.beam.sdk.options.DataflowPipelineOptions; import org.apache.beam.sdk.options.Default; import org.apache.beam.sdk.options.Description; import org.apache.beam.sdk.options.PipelineOptions; import org.apache.beam.sdk.options.StreamingOptions;
0
@Deprecated @Override
0
response = new HashSet<>(); Set<RootServiceComponentResponse> response = new HashSet<>(); Set<RootServiceHostComponentResponse> response = new HashSet<>(); Set<HostResponse> filteredHosts = new HashSet<>(hosts);
0
import org.apache.sshd.server.command.Command;
0