Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
private static final long serialVersionUID = -2505664948818681153L;
0
server.setForwardingFilter(AcceptAllForwardingFilter.INSTANCE);
0
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
0
final TimeValue timeout = requestConfig.getConnectionTimeout(); timeout, if (TimeValue.isPositive(timeout)) { endpoint.setSocketTimeout(timeout.toMillisIntBound());
0
int count = 0; for (Mutation m : mutations) count += m.size(); defaultMap.mutate(mutations, count); nativeMapWrapper.mutate(mutations, count); localityGroupMap.mutate(mutations, count); localityGroupMapWithNative.mutate(mutations, count);
0
ResultSetIterator(final ResultSetDynaClass dynaClass) { public boolean contains(final String name, final String key) { public Object get(final String name) { } catch (final SQLException e) { public Object get(final String name, final int index) { public Object get(final String name, final String key) { public void remove(final String name, final String key) { public void set(final String name, final Object value) { } catch (final SQLException e) { public void set(final String name, final int index, final Object value) { public void set(final String name, final String key, final Object value) { } catch (final SQLException e) { } catch (final SQLException e) {
0
package org.apache.batik.refimpl.gvt;
0
package org.apache.http.impl.client.cache;
0
import org.junit.Rule; @Rule public TestPipeline p = TestPipeline.create(); /** Test the {@link ParseEventFn} {@link org.apache.beam.sdk.transforms.DoFn}. */
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
m_mapPostProcessors = new HashMap<>(); listProcessors = new ArrayList<>();
0
import java.io.PrintWriter; import org.apache.commons.net.ProtocolCommandEvent; import org.apache.commons.net.ProtocolCommandListener; public class PrintCommandListener implements ProtocolCommandListener { private PrintWriter __writer; public PrintCommandListener(PrintWriter writer) { __writer = writer; } public void protocolCommandSent(ProtocolCommandEvent event) { __writer.print(event.getMessage()); __writer.flush(); } public void protocolReplyReceived(ProtocolCommandEvent event) { __writer.print(event.getMessage()); __writer.flush(); }
0
if (option == null || res == null) return TypeHandler.createValue(res, option.getType());
0
import org.apache.commons.collections.ComparatorUtils; public class NullComparator<E> implements Comparator<E>, Serializable { private Comparator<E> nonNullComparator; @SuppressWarnings("unchecked") this(ComparatorUtils.NATURAL_COMPARATOR, true); public NullComparator(Comparator<E> nonNullComparator) { @SuppressWarnings("unchecked") this(ComparatorUtils.NATURAL_COMPARATOR, nullsAreHigh); public NullComparator(Comparator<E> nonNullComparator, boolean nullsAreHigh) { if (nonNullComparator == null) { public int compare(E o1, E o2) { NullComparator<?> other = (NullComparator<?>) obj;
0
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ambari.server.orm.dao; import javax.persistence.EntityManager; import com.google.inject.Inject; import com.google.inject.Provider; import com.google.inject.Singleton; /** * */ @Singleton public class AlertDispatchDAO { /** * JPA entity manager */ @Inject Provider<EntityManager> entityManagerProvider; }
0
package org.apache.accumulo.test.continuous;
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Lists;
0
return InputConfigurator.createClient(callingClass, context.getConfiguration());
0
try (ByteArrayOutputStream os = new ByteArrayOutputStream()) { Transformer transformer = tFactory.newTransformer(); DOMSource source = new DOMSource(xsltElement); StreamResult result = new StreamResult(os); transformer.transform(source, result); stylesheet = new StreamSource(new ByteArrayInputStream(os.toByteArray())); } try (ByteArrayOutputStream baos1 = new ByteArrayOutputStream()) { StreamResult outputTarget = new StreamResult(baos1); transformer.transform(xmlSource, outputTarget); XMLSignatureInput output = new XMLSignatureInput(baos1.toByteArray()); output.setSecureValidation(secureValidation); return output; }
0
import com.google.cloud.hadoop.gcsio.GoogleCloudStorageReadOptions; GoogleCloudStorageReadOptions readOptions = GoogleCloudStorageReadOptions.builder().setFastFailOnNotFound(false).build(); null, "dummybucket", "dummyobject", null, new ClientRequestHelper<>(), readOptions);
0
* A java.util.Date property. */ private java.util.Date dateProperty; public java.util.Date getDateProperty() { return dateProperty; } public void setDateProperty(java.util.Date dateProperty) { this.dateProperty = dateProperty; } /** * A java.util.Date property. */ private java.util.Date[] dateArrayProperty; public java.util.Date[] getDateArrayProperty() { return dateArrayProperty; } public void setDateArrayProperty(java.util.Date[] dateArrayProperty) { this.dateArrayProperty = dateArrayProperty; } /**
0
* * * * @version CVS $Id$ *
0
import static org.apache.ambari.server.security.authorization.RoleAuthorization.CLUSTER_MANAGE_WIDGETS; import java.util.EnumSet; import org.apache.ambari.server.security.authorization.ResourceType; if (!isScopeAllowedForUser(scope, clusterName)) { String clusterName = propertyMap.get(WIDGET_CLUSTER_NAME_PROPERTY_ID).toString(); if (!isScopeAllowedForUser(scope, clusterName)) { private boolean isScopeAllowedForUser(String scope, String clusterName) throws AmbariException { if (WidgetEntity.USER_SCOPE.equals(scope)) { return AuthorizationHelper.isAuthorized(ResourceType.CLUSTER, getClusterResourceId(clusterName), EnumSet.of(CLUSTER_MANAGE_WIDGETS));
0
import java.util.Arrays; import java.util.Collection; import org.apache.sshd.common.NamedResource; import org.apache.sshd.common.util.ValidateUtils; import org.apache.sshd.server.auth.BuiltinUserAuthFactories; default String getUserAuthFactoriesNameList() { return NamedResource.Utils.getNames(getUserAuthFactories()); } default List<String> getUserAuthFactoriesNames() { return NamedResource.Utils.getNameList(getUserAuthFactories()); } default void setUserAuthFactoriesNameList(String names) { setUserAuthFactoriesNames(GenericUtils.split(names, ',')); } default void setUserAuthFactoriesNames(String ... names) { setUserAuthFactoriesNames(GenericUtils.isEmpty((Object[]) names) ? Collections.<String>emptyList() : Arrays.asList(names)); } default void setUserAuthFactoriesNames(Collection<String> names) { BuiltinUserAuthFactories.ParseResult result = BuiltinUserAuthFactories.parseFactoriesList(names); @SuppressWarnings({ "rawtypes", "unchecked" }) List<NamedFactory<UserAuth>> factories = (List) ValidateUtils.checkNotNullAndNotEmpty(result.getParsedFactories(), "No supported cipher factories: %s", names); Collection<String> unsupported = result.getUnsupportedFactories(); ValidateUtils.checkTrue(GenericUtils.isEmpty(unsupported), "Unsupported cipher factories found: %s", unsupported); setUserAuthFactories(factories); }
0
return new LinkEntry<>(next, hashCode, convertKey(key), value); return new LinkMapIterator<>(this); return new EntrySetIterator<>(this); return new KeySetIterator<>(this); return new ValuesIterator<>(this);
1
return new AfterEach(Arrays.asList(triggers));
0
public class URLFileName extends GenericFileName { public URLFileName(final String scheme, final String hostName, final int port, final int defaultPort, final String userName, final String password, final String path, final FileType type, final String queryString) { public String getQueryString() { public String getPathQuery() { public String getPathQueryEncoded(final String charset) throws URIException, FileSystemException { if (getQueryString() == null) { if (charset != null) { if (charset != null) { } else { * public FileName createName(final String absPath, final FileType type) { return new URLFileName(getScheme(), getHostName(), getPort(), getDefaultPort(), getUserName(), getPassword(), absPath, type, getQueryString()); protected String createURI() { if (getQueryString() != null) { * public String getURIEncoded(final String charset) throws FileSystemException, URIException {
1
protected static final String kerberosRule = "RULE:[1:$1@$0](.*@EXAMPLE.COM)s/@.*//\nDEFAULT";
0
* $Header: /home/cvs/jakarta-commons/latka/src/java/org/apache/commons/latka/jelly/PostTag.java,v 1.4 2002/07/14 16:41:38 dion Exp $ * $Revision: 1.4 $ * $Date: 2002/07/14 16:41:38 $ * Copyright (c) 1999-2001 The Apache Software Foundation. All rights * import org.apache.commons.httpclient.HttpUrlMethod; import org.apache.commons.httpclient.NameValuePair; /** * A http post * @author dion public class PostTag extends HttpTagSupport { /** the post method */ private UrlPostMethod _postMethod; /** Creates a new instance of PostTag */ public PostTag() { } /** * Return a {@link HttpUrlMethod method} to be used for post'ing * * @return a HttpUrlMethod implementation * @throws MalformedURLException when the {@link getUrl() url} or * {@link #getPath() path} is invalid */ protected HttpUrlMethod getHttpUrlMethod() throws MalformedURLException { if (_postMethod == null) { _postMethod = new UrlPostMethod(getResolvedUrl()); } return _postMethod; } /** * Set the current parameters on the url method ready for processing * * This method <strong>must</strong> be called after * {@link getHttpUrlMethod} protected void setParameters() { NameValuePair nvp = null; for (int index = 0; index < getParameters().size(); index++) { NameValuePair parameter = (NameValuePair) getParameters(). get(index); _postMethod.addParameter(parameter); }
0
import java.nio.charset.StandardCharsets; resp.setContentType("text/xml;charset=" + StandardCharsets.UTF_8.name()); sb.append("<?xml version=\"1.0\" encoding=\"" + StandardCharsets.UTF_8.name() + "\"?>\n");
0
import java.io.Serializable; import java.util.Arrays; import java.util.List;
0
import org.apache.hc.core5.http.ContentType; import org.apache.hc.core5.http.impl.io.EmptyInputStream; final BasicHttpEntity httpentity = new BasicHttpEntity(new ByteArrayInputStream(bytes), bytes.length, null); final BasicHttpEntity httpentity = new BasicHttpEntity(EmptyInputStream.INSTANCE, 10, ContentType.parseLenient("blah"), "yada", true); Assert.assertEquals("[Entity-Class: BasicHttpEntity, Content-Type: blah, Content-Encoding: yada, chunked: true]", final BasicHttpEntity httpentity = new BasicHttpEntity(new ByteArrayInputStream(bytes), bytes.length, ContentType.TEXT_PLAIN); final ByteArrayOutputStream out = new ByteArrayOutputStream();
0
import org.apache.accumulo.core.security.Credentials; List<KeyExtent> candidates = findTablets(!opts.selectFarTablets, new Credentials(opts.principal, opts.getToken()), opts.tableName, instance, tabletLocations); List<FileRef> files = getTabletFiles(new Credentials(opts.principal, opts.getToken()), opts.getInstance(), tableId, ke); private static List<KeyExtent> findTablets(boolean selectLocalTablets, Credentials credentials, String tableName, Instance zki, private static List<FileRef> getTabletFiles(Credentials credentials, Instance zki, String tableId, KeyExtent ke) throws IOException { return new ArrayList<FileRef>(MetadataTableUtil.getDataFileSizes(ke, credentials).keySet());
0
import javax.xml.stream.XMLStreamException; import java.io.IOException; import java.io.Writer; @Override public void writeAsEncodedUnicode(Writer writer) throws XMLStreamException { try { writer.write("<?"); writer.write(getTarget()); final String data = getData(); if (data != null && !data.isEmpty()) { writer.write(' '); writer.write(data); } writer.write("?>"); } catch (IOException e) { throw new XMLStreamException(e); } }
0
import java.util.ArrayList; private InMemoryTimerInternals timerInternals; this.timerInternals = new InMemoryTimerInternals(); return timerInternals; timerInternals.advanceProcessingTime(currentProcessingTime); timerInternals.advanceProcessingTime(currentProcessingTime); List<TimerInternals.TimerData> timers = new ArrayList<>(); TimerInternals.TimerData nextTimer; while ((nextTimer = timerInternals.removeNextProcessingTimer()) != null) { timers.add(nextTimer); }
0
/* * Copyright 2001-2004 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. package org.apache.commons.net.ftp.parser; * @version $Id: NTFTPEntryParser.java,v 1.11 2004/02/29 10:26:56 scolebourne Exp $
0
List<Long> clusterIds = new ArrayList<>();
0
if (version == null || version == "") { throw new DeploymentException(DeploymentException.CODE_BAD_HEADER, "Invalid '" + org.osgi.framework.Constants.BUNDLE_VERSION + "' header for manifest entry '" + getPath() + "'"); } m_customizer = parseBooleanHeader(attributes, Constants.DEPLOYMENTPACKAGE_CUSTOMIZER);
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
* @version CVS $Id: ProfileManager.java,v 1.8 2003/07/31 14:37:05 cziegeler Exp $ * @param layoutID The id of a layout object or null for the root object
0
Collections.emptySet();
0
/** Tests for {@link Trigger}. */ assertEquals( "Repeatedly.forever(AfterWatermark.pastEndOfWindow())", protected Trigger getContinuationTrigger(List<Trigger> continuationTriggers) { protected Trigger getContinuationTrigger(List<Trigger> continuationTriggers) {
1
* <pre> * </pre>
0
Map<String,Cluster> clusterMap = new HashMap<>(); Map<String, Host> hostMap = new HashMap<>();
0
import org.apache.http.util.CharArrayBuffer; * HTTP response writer that serializes its output to an instance of * {@link org.apache.http.io.SessionOutputBuffer}. public DefaultHttpResponseWriter(final LineFormatter formatter) { super(formatter); public DefaultHttpResponseWriter() { super(null); protected void writeHeadLine( final HttpResponse message, final CharArrayBuffer lineBuf) throws IOException { getLineFormatter().formatStatusLine(lineBuf, message.getStatusLine());
0
import java.util.List; private List<AgentAlert> alerts; /** * Sets alert information from the agent */ public void setAlerts(List<AgentAlert> alertInfo) { alerts = alertInfo; } /** * Gets alert information from the agent */ public List<AgentAlert> getAlerts() { return alerts; }
0
import org.apache.ambari.server.controller.AmbariManagementControllerImpl; ServiceOsSpecific hostOs = populateServicePackagesInfo(serviceInfo, osFamily); TreeMap<String, String> clusterLevelParams = null; TreeMap<String, String> ambariLevelParams = null; if (getManagementController() instanceof AmbariManagementControllerImpl){ AmbariManagementControllerImpl controller = ((AmbariManagementControllerImpl)getManagementController()); clusterLevelParams = controller.getMetadataClusterLevelParams(cluster, stackId); ambariLevelParams = controller.getMetadataAmbariLevelParams(); } TreeMap<String, String> agentLevelParams = new TreeMap<>(); agentLevelParams.put("hostname", hostName); agentLevelParams.put("public_hostname", publicHostName); jsonContent.put("ambariLevelParams", ambariLevelParams); jsonContent.put("clusterLevelParams", clusterLevelParams); jsonContent.put("agentLevelParams", agentLevelParams); protected ServiceOsSpecific populateServicePackagesInfo(ServiceInfo serviceInfo, String osFamily) {
0
System.out.println("Updating component with " + conf);
0
package org.osgi.converter; /** * Start a conversion for the given object. * * @param obj The object that should be converted. * @return A {@link Converting} object to complete the conversion. */ Converting convert(Object obj); /** * Obtain a builder to create a modified converter based on this converter. * For more details see the {@link ConverterBuilder} interface. * * @return A new Converter Builder. */ ConverterBuilder newConverterBuilder();
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/parser/XMLParser.java,v 1.9 2002/04/24 13:03:03 jstrachan Exp $ * $Revision: 1.9 $ * $Date: 2002/04/24 13:03:03 $ * $Id: XMLParser.java,v 1.9 2002/04/24 13:03:03 jstrachan Exp $ import org.apache.commons.jelly.expression.jexl.JexlExpressionFactory; * @version $Revision: 1.9 $ return new JexlExpressionFactory();
0
* @param t The original {@link Throwable} - ignored if {@code null} * @return If {@link Throwable#getCause()} is non-{@code null} then * the cause, otherwise the original exception - {@code null} if * the original exception was {@code null} */ public static Throwable resolveExceptionCause(Throwable t) { if (t == null) { return t; } Throwable c = t.getCause(); if (c == null) { return t; } else { return c; } } /**
0
import org.apache.beam.runners.core.construction.ArtifactServiceStager.StagedFile; stager.stage(Collections.singleton(StagedFile.of(file, file.getName()))); stager.stage( ImmutableList.of( StagedFile.of(file, file.getName()), StagedFile.of(otherFile, otherFile.getName()), StagedFile.of(thirdFile, thirdFile.getName())));
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Lists;
0
public void testGetRackSensitiveServicesNames() throws AmbariException { Set<String> res = metaInfo.getRackSensitiveServicesNames(STACK_NAME_HDP, "2.0.7"); assertEquals(1, res.size()); assertEquals("HDFS", res.iterator().next()); } @Test
0
/* * Copyright 2001-2004 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * @version $Revision: 1.5 $ $Date: 2004/02/18 00:59:20 $
0
import org.apache.commons.lang3.StringUtils; HealthCheckSelector selector = StringUtils.isNotBlank(tags) ? HealthCheckSelector.tags(tags.split(",")) : HealthCheckSelector.empty(); Collection<HealthCheckExecutionResult> results = healthCheckExecutor.execute(selector, options);
0
final MessageConstraints constraints = HttpParamConfig.getMessageConstraints(params); final HttpEntity entity = prepareDecoder(this.request); } catch (final HttpException ex) { } catch (final Exception ex) { final int bytesWritten = this.outbuf.flush(this.session.channel()); } catch (final Exception ex) {
0
import org.apache.batik.util.SMILConstants;
0
private static class ConfigurationDeserializer extends JsonDeserializer<Configuration> { DeserializationContext deserializationContext) throws IOException { private static class ConfigurationSerializer extends JsonSerializer<Configuration> { SerializerProvider serializerProvider) throws IOException {
0
* @version $Id$
0
import org.apache.accumulo.core.clientImpl.Table; import org.apache.accumulo.core.clientImpl.Tables;
0
import org.apache.accumulo.cloudtrace.instrument.Span; import org.apache.accumulo.cloudtrace.instrument.Trace; import org.apache.accumulo.cloudtrace.instrument.Tracer; import org.apache.accumulo.cloudtrace.thrift.TInfo;
0
* Copyright (C) 2015 Google Inc.
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. */ class ThriftTransportKey { ThriftTransportKey(String location, int port, long timeout) { String getLocation() { int getPort() { long getTimeout() { public boolean equals(Object o) { if (!(o instanceof ThriftTransportKey)) return false; public int hashCode() { if (hash == -1) hash = (location + Integer.toString(port) + Long.toString(timeout)).hashCode(); public String toString() {
0
* <li>their host name strings string-compare equal; or</li> * <li>A is a HDN string and has the form NB, where N is a non-empty * x.y.com domain-matches .Y.com but not Y.com.)</li>
0
public class PosixParserTest extends ParserTestCase super.setUp(); public void testBursting() throws Exception public void testUnrecognizedOptionWithBursting() throws Exception public void testMissingArgWithBursting() throws Exception public void testStopBursting2() throws Exception assertTrue("Confirm -c is set", cl.hasOption("c")); assertTrue("Confirm 2 extra args: " + cl.getArgList().size(), cl.getArgList().size() == 2); cl = parser.parse(options, cl.getArgs()); assertTrue("Confirm -c is not set", !cl.hasOption("c")); assertTrue("Confirm -b is set", cl.hasOption("b")); assertTrue("Confirm arg of -b", cl.getOptionValue("b").equals("toast")); assertTrue("Confirm 1 extra arg: " + cl.getArgList().size(), cl.getArgList().size() == 1); assertTrue("Confirm value of extra arg: " + cl.getArgList().get(0), cl.getArgList().get(0).equals("foobar")); .withDescription("Set time limit for execution, in minutes") public void testLongWithEqualSingleDash() throws Exception // not supported by the PosixParser } public void testShortWithEqual() throws Exception { // not supported by the PosixParser
0
* * dataSource = pds; connectionFactory.setMaxConnLifetimeMillis(getMaxConnLifetimeMillis());
0
for (InetAddress remoteAddress: addresses) { sock.connect(new InetSocketAddress(remoteAddress, port), timeout); throw new ConnectTimeoutException("Connect to " + remoteAddress + " timed out");
0
private final KeyExtent extent; private final MajorCompactionReason reason; private final VolumeManager volumeManager; private final AccumuloConfiguration tableConfig; private final BlockCache indexCache; private final BlockCache summaryCache; private final ServerContext context;
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
import org.apache.accumulo.fate.zookeeper.ZooUtil;
0
/**Signature - Optional ECDSAwithSHA224 */ public static final String ALGO_ID_SIGNATURE_ECDSA_SHA224 = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha224";
0
import org.apache.beam.vendor.grpc.v1p21p0.io.grpc.stub.CallStreamObserver; import org.apache.beam.vendor.grpc.v1p21p0.io.grpc.stub.StreamObserver;
0
Assert.assertTrue(qu.getPeer(observerIndex).peer.getName() .endsWith(String.format(":%d", port3)));
0
import org.apache.http.nio.testserver.HttpCoreNIOTestBase; import org.apache.http.nio.testserver.LoggingClientConnectionFactory; import org.apache.http.nio.testserver.LoggingServerConnectionFactory;
0
try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port) .verify(7L, TimeUnit.SECONDS) .getSession()) {
0
if (fileName == null) { } if (file != null) { } if (name == null) { } return expandProperty(configurationProperties.getProperty(PREFIX + name));
0
public void initializeSecurity(TCredentials itw, String rootuser) throws AccumuloSecurityException { // create the root user with all system privileges, no table privileges, and no record-level // authorizations zoo.putPersistentData(ZKUserPath + "/" + rootuser + ZKUserAuths, ZKSecurityTool.convertAuthorizations(Authorizations.EMPTY), NodeExistsPolicy.FAIL); public void changeAuthorizations(String user, Authorizations authorizations) throws AccumuloSecurityException { ZooReaderWriter.getInstance().putPersistentData(ZKUserPath + "/" + user + ZKUserAuths, ZKSecurityTool.convertAuthorizations(authorizations), NodeExistsPolicy.OVERWRITE); public boolean isValidAuthorizations(String user, List<ByteBuffer> auths) throws AccumuloSecurityException {
0
ELEMENT_PARAMETER_METHOD, DoFn.class)), TypeCasting.to(new TypeDescription.ForLoadedType(p.elementT().getRawType())));
0
public List<? extends UnboundedSource<Long, CountingSource.CounterMark>> split(
0
private static final Logger log = LoggerFactory.getLogger(Halt.class);
0
LOG.debug("Creating BeamFnMapTaskExecutor"); LOG.debug("Starting BeamFnMapTaskExecutor, launching progress thread"); LOG.debug("Stopping BeamFnMapTaskExecutor, grabbing final metric updates");
0
import org.apache.beam.sdk.io.BoundedSource.BoundedReader;
0
public static final String USE_LOCAL_CONFIGS_PROPERTY = "logfeeder.configs.local.enabled"; public static final boolean USE_LOCAL_CONFIGS_DEFAULT = false; public static final String USE_SOLR_FILTER_STORAGE_PROPERTY = "logfeeder.configs.filter.solr.enabled"; public static final boolean USE_SOLR_FILTER_STORAGE_DEFAULT = false; public static final String MONITOR_SOLR_FILTER_STORAGE_PROPERTY = "logfeeder.configs.filter.solr.monitor.enabled"; public static final boolean MONITOR_SOLR_FILTER_STORAGE_DEFAULT = true; public static final String SOLR_ZK_CONNECTION_STRING = "logfeeder.solr.zk_connect_string";
0
String invalidTablePropFormatString = "Invalid per-table property : {}, still removing from zookeeper if it's there."; Shell.log.warn(invalidTablePropFormatString, property); Shell.log.warn(invalidTablePropFormatString, property); Shell.log.warn(invalidTablePropFormatString, property); Shell.log.debug("Successfully deleted system configuration option."); Shell.log.debug("Successfully set system configuration option.");
0
* Copyright 2001-2004 The Apache Software Foundation * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * @version $Id: DeferredFileOutputStreamTest.java,v 1.4 2004/02/25 21:07:12 scolebourne Exp $
0
public void before() { public void testWriteMetricsWithCommittedSupported() throws Exception { @Test public void testWriteMetricsWithCommittedUnSupported() throws Exception { MetricQueryResults metricQueryResults = new CustomMetricQueryResults(false); PipelineOptions pipelineOptions = PipelineOptionsFactory.create(); pipelineOptions.setMetricsGraphitePort(port); pipelineOptions.setMetricsGraphiteHost("127.0.0.1"); MetricsGraphiteSink metricsGraphiteSink = new MetricsGraphiteSink(pipelineOptions); metricsGraphiteSink.writeMetrics(metricQueryResults); Thread.sleep(2000L); String join = String.join("\n", graphiteServer.getMessages()); String regexpr = "beam.counter.ns1.n1.attempted.value 20 [0-9]+\\n" + "beam.gauge.ns1.n3.attempted.value 120 [0-9]+\\n" + "beam.distribution.ns1.n2.attempted.min 3 [0-9]+\\n" + "beam.distribution.ns1.n2.attempted.max 9 [0-9]+\\n" + "beam.distribution.ns1.n2.attempted.count 4 [0-9]+\\n" + "beam.distribution.ns1.n2.attempted.sum 25 [0-9]+\\n" + "beam.distribution.ns1.n2.attempted.mean 6.25 [0-9]+"; assertTrue(join.matches(regexpr)); }
0
for (Method declaredMethod : AuroraSchedulerManager.Iface.class.getDeclaredMethods()) { .transform(input -> input.getType().getRawType()) input -> input.getAnnotation(AuthorizingParam.class) != null);
0
public void write(final byte[] b) throws IOException public void write(final byte[] b, final int off, final int len) throws IOException
0
import org.apache.beam.sdk.nexmark.model.AuctionPrice; import org.apache.beam.sdk.transforms.ParDo; public class SqlQuery2 extends PTransform<PCollection<Event>, PCollection<AuctionPrice>> { public PCollection<AuctionPrice> expand(PCollection<Event> allEvents) { .apply(getName() + ".ToRow", ToRow.parDo()) PCollection<Row> queryResultsRows = bidEventsRows.apply(query); return queryResultsRows .apply(auctionPriceParDo()) .setCoder(AuctionPrice.CODER); private ParDo.SingleOutput<Row, AuctionPrice> auctionPriceParDo() { return ADAPTERS.get(AuctionPrice.class).parDo(); }
0
import java.util.Arrays; import java.util.List; public static List<FrameworkMethod> computeTestMethodsForClass(final Class klass, final List<FrameworkMethod> defaultMethods) { List<FrameworkMethod> list = defaultMethods; String methodName = System.getProperty("test.method"); if (methodName == null) { LOG.info("No test.method specified. using default methods."); } else { LOG.info("Picked up test.method={}", methodName); try { list = Arrays.asList(new FrameworkMethod(klass.getMethod(methodName))); } catch (NoSuchMethodException nsme) { LOG.warn("{} does not have test.method={}. failing to default methods.", klass.getName(), methodName); } } return list; } @Override protected List<FrameworkMethod> computeTestMethods() { return computeTestMethodsForClass(getTestClass().getJavaClass(), super.computeTestMethods()); }
0
try { if (textElement.getTagName().equals(SVG_ALT_GLYPH_TAG)) { SVGAltGlyphElementBridge altGlyphBridge = (SVGAltGlyphElementBridge)ctx.getBridge(textElement); Glyph[] glyphArray = altGlyphBridge.createAltGlyphArray(ctx, textElement, fontSize, aci); if (glyphArray != null) { return new SVGGVTGlyphVector(null, glyphArray, frc); } } catch (SecurityException e) { ctx.getUserAgent().displayError(e); // Throw exception because we do not want to continue // processing. In the case of a SecurityException, the // end user would get a lot of exception like this one. throw e;
0
package org.apache.commons.beanutils2.priv;
1
for (MultiStatusResponse response : responses)
0
* @param fields * - the fields that are expected in the returned Map
0
@Category(com.google.cloud.dataflow.sdk.testing.RunnableOnService.class)
0
Object svc = usage.m_svcHolderRef.getAndSet(null).m_service; .getRegistration().ungetService(bundle, svc);
0
public class ZooCacheIT extends SimpleMacIT { assertEquals(0, exec(CacheTestClean.class, "/zcTest-42", "/tmp/zcTest-42").waitFor()); CacheTestReader.main(new String[]{"/zcTest-42", "/tmp/zcTest-42", getConnector().getInstance().getZooKeepers()}); assertEquals(0, exec(CacheTestWriter.class, "/zcTest-42", "/tmp/zcTest-42", "3","500").waitFor());
0
private static org.slf4j.Logger log =
1
String script = "import os\nos._exit(0)"; Command command = new Command("root", script, param); Command cleanUp = new Command("root", script, param); action.setComponent("hdfs"); action.setRole("datanode"); action2.setComponent("hdfs"); action3.setClusterId("cluster-003"); action3.setComponent("hdfs"); action3.setRole("datanode"); actionResult2.setCommandResult(new CommandResult(0, "stdout", "stderr")); actionResult2.setCleanUpResult(new CommandResult(0, "stdout", "stderr")); String script = "import os\nos._exit(0)"; Command command = new Command("root", script, param); Command cleanUp = new Command("root", script, param); action3.setUser("hdfs"); action3.setComponent("hdfs"); action4.setUser("hdfs"); action4.setComponent("hdfs");
0