Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import java.io.IOException;
0
import org.apache.commons.lang.StringUtils; import java.util.Collections; import java.util.HashSet; import java.util.Set; private static final String OOZIE_SITE_CONFIG = "oozie-site"; private static final String OOZIE_AUTHENTICATION_KERBEROS_NAME_RULES = "oozie.authentication.kerberos.name.rules"; updateOozieConfigs(); protected void updateOozieConfigs() throws AmbariException { AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class); for (final Cluster cluster : getCheckedClusterMap(ambariManagementController.getClusters()).values()) { Config oozieSiteProps = cluster.getDesiredConfigByType(OOZIE_SITE_CONFIG); if (oozieSiteProps != null) { // Remove oozie.authentication.kerberos.name.rules if empty String oozieAuthKerbRules = oozieSiteProps.getProperties().get(OOZIE_AUTHENTICATION_KERBEROS_NAME_RULES); if (StringUtils.isBlank(oozieAuthKerbRules)) { Set<String> removeProperties = new HashSet<String>(); removeProperties.add(OOZIE_AUTHENTICATION_KERBEROS_NAME_RULES); updateConfigurationPropertiesForCluster(cluster, OOZIE_SITE_CONFIG, null, removeProperties, true, false); } } } }
0
import org.junit.Assert; if (!outputDir.mkdirs()) { // either was not created or already existed Assert.assertTrue(outputDir.isDirectory()); // fail if missing }
0
* http://www.apache.org/licenses/LICENSE-2.0
0
final HttpRequest basicRequest = new BasicHttpRequest(theMethod, theUri); basicRequest.addHeader("Accept-Encoding", "gzip"); final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest); Assert.assertNotSame(basicRequest, newRequest); Assert.assertEquals(basicRequest.getRequestLine().getProtocolVersion(), newRequest final HttpRequest basicRequest = new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1); final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest); final HttpCacheEntry cacheEntry = HttpTestUtils.makeCacheEntry(headers); final HttpRequest result = impl.buildConditionalRequest(requestWrapper, cacheEntry); final HttpRequest basicRequest = new BasicHttpRequest(theMethod, theUri); basicRequest.addHeader("Accept-Encoding", "gzip"); final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest); Assert.assertNotSame(basicRequest, newRequest); Assert.assertEquals(basicRequest.getRequestLine().getProtocolVersion(), newRequest final HttpRequest basicRequest = new BasicHttpRequest("GET","/",HttpVersion.HTTP_1_1); final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest); final HttpRequest basicRequest = new BasicHttpRequest("GET","/",HttpVersion.HTTP_1_1); final HttpRequestWrapper requestWrapper = HttpRequestWrapper.wrap(basicRequest);
0
public static final String SVG_NUMBER_LIST_SEPARATOR
1
private final Set<String> clearedProperties = new HashSet<String>();
0
import org.apache.aurora.common.testing.easymock.EasyMockTest;
0
public class AwsModuleTest {
0
synchronized (this) { if (error) return; count--; synchronized (this) { error = true; } } else { e.printStackTrace(); // No UA so just output... } synchronized (this) { error = true; synchronized (this) { if (error) return; count--; } else { e.printStackTrace(); // No UA so just output... } synchronized (this) { error = true; synchronized (eir) { if (eir.count > 1) return; eir.count++; synchronized (eir) { if (eir.error) cancel(); synchronized (eihr) { if (eihr.count > 1) return; eihr.count++; synchronized (eihr) { if (eihr.error) cancel();
0
* * * * * * * * * * * * return (Bag<E>) EMPTY_BAG; return (SortedBag<E>) EMPTY_SORTED_BAG;
0
public DoubleArrayConverter(final Object defaultValue) { public Object convert(final Class type, final Object value) { final String[] values = (String[]) value; final double[] results = new double[values.length]; } catch (final Exception e) { final List list = parseElements(value.toString()); final double[] results = new double[list.size()]; } catch (final Exception e) {
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
private static ByteKey makeByteKey(ByteString key) { return ByteKey.copyFrom(key.asReadOnlyByteBuffer()); } return range.containsKey(makeByteKey(input.getKey())); return ByteKeyRange.of(makeByteKey(data.firstKey()), makeByteKey(data.lastKey())); || !source.getRange().containsKey(makeByteKey(entry.getKey()))) { return makeByteKey(o1).compareTo(makeByteKey(o2));
0
return input.apply("Map", ParDo.of(new DoFn<InputT, OutputT>() {
0
package org.apache.atlas; import org.apache.atlas.repository.graph.GraphProvider;
0
import com.google.cloud.dataflow.sdk.util.common.CounterSet; ExecutionContext context, CounterSet.AddCounterMutator addCounterMutator) throws Exception {
0
* * public void testMini() throws Exception { JexlContext jc = new MapContext(); JexlExpression assign = JEXL.createExpression("quux = 10"); Object o = assign.evaluate(jc); assertEquals("Result is not 10", new Integer(10), o); }
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.
0
* Returns a new FluentIterable whose iterator will return an unmodifiable * view of this iterable. * * @return a new iterable, providing an unmodifiable view of this iterable */ public FluentIterable<E> unmodifiable() { return of(IterableUtils.unmodifiableIterable(iterable)); } /**
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
/** Collector that outputs elements to {@link BeamCollector}. */ public class DoFnCollector<InputT, OutputT, ElemT> implements Collector<ElemT>, Context, Serializable { DoFnCollector( AccumulatorProvider accumulators, BeamCollector<InputT, OutputT, ElemT> beamCollector) { *
0
"defaultNaming() supports only windows of type %s, " + "but got window %s of type %s", return (window, pane, numShards, shardIndex, compression) -> FileSystems.matchNewResource(baseDirectory.get(), true /* isDirectory */) .resolve( innerNaming.getFilename(window, pane, numShards, shardIndex, compression), RESOLVE_FILE) .toString();
0
* * * assertEquals(2, ds.getConnectionInitSqls().size()); assertEquals("SELECT 1", ds.getConnectionInitSqls().get(0)); assertEquals("SELECT 2", ds.getConnectionInitSqls().get(1));
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/test/org/apache/commons/digester/ObjectParamRuleTestCase.java,v 1.4 2003/10/05 15:36:03 rdonkin Exp $ * $Revision: 1.4 $ * $Date: 2003/10/05 15:36:03 $ * ==================================================================== * * Copyright (c) 2001-2003 The Apache Software Foundation. All rights * notice, this list of conditions and the following disclaimer. * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgement: * "This product includes software developed by the * 4. The names "Apache", "The Jakarta Project", "Commons", and "Apache Software * from this software without prior written permission. For written * 5. Products derived from this software may not be called "Apache", * "Apache" nor may "Apache" appear in their names without prior * written permission of the Apache Software Foundation. */
0
import org.apache.batik.dom.anim.AnimatableElement;
0
import org.slf4j.Logger; import org.slf4j.LoggerFactory; private static final Logger log = LoggerFactory.getLogger(IteratorUtil.class);
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.felix.ipojo.test.scenarios.temporal.service; public interface ChildInterface extends ParentInterface1, ParentInterface2 { public void processChild(); }
0
new HashSet<String>(Arrays.asList("fs.defaultFS", "hbase.rootdir", "instance.volumes")); if (properties.containsKey("accumulo-site") && properties.get("accumulo-site").get("instance.volumes").equals(origValue)) { // accumulo-site's reference to the namenode is handled differently in HA mode, since the // reference must point to the logical nameservice, rather than an individual namenode return origValue; } Map<String, PropertyUpdater> accumuloSiteMap = new HashMap<String, PropertyUpdater>(); Map<String, PropertyUpdater> multiAccumuloSiteMap = new HashMap<String, PropertyUpdater>(); singleHostTopologyUpdaters.put("accumulo-site", accumuloSiteMap); multiHostTopologyUpdaters.put("accumulo-site", multiAccumuloSiteMap); accumuloSiteMap.put("instance.volumes", new SingleHostTopologyUpdater("NAMENODE")); multiAccumuloSiteMap.put("instance.zookeeper.host", new MultipleHostTopologyUpdater("ZOOKEEPER_SERVER"));
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/TagLibrary.java,v 1.13 2002/09/05 16:43:29 jstrachan Exp $ * $Revision: 1.13 $ * $Date: 2002/09/05 16:43:29 $ * $Id: TagLibrary.java,v 1.13 2002/09/05 16:43:29 jstrachan Exp $ * @version $Revision: 1.13 $ /** Creates a new Tag for the given tag name and attributes */ public Tag createTag(String name, Attributes attributes) throws Exception { Class type = (Class) tags.get(name); if ( type != null ) { return (Tag) type.newInstance(); } return null; }
0
if (condition.getEndTime() >= condition.getStartTime()) { stmt = PhoenixTransactSQL.prepareGetMetricsSqlStmt(conn, condition); rs = stmt.executeQuery(); while (rs.next()) { appendMetricFromResultSet(metrics, condition, metricFunctions, rs); } } else { LOG.warn("Skipping metrics query because endTime < startTime"); } catch (RuntimeException ex) { // We need to find out if this is a real IO exception // or exception "maxStamp is smaller than minStamp" // which is thrown in hbase TimeRange.java Throwable io = ex.getCause(); String className = null; for (StackTraceElement ste : io.getStackTrace()) { className = ste.getClassName(); } if (className != null && className.equals("TimeRange")) { // This is "maxStamp is smaller than minStamp" exception // Log error and return empty metrics LOG.debug(io); return new TimelineMetrics(); } else { throw ex; }
0
package org.apache.felix.connect.felix.framework.capabilityset;
0
protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory() throws Exception { return new LoggingSSLServerConnectionFactory(SSLTestContexts.createServerSSLContext()); protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory() throws Exception { return new LoggingSSLClientConnectionFactory(SSLTestContexts.createClientSSLContext());
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.migration; /** * View data migration exception. Indicates that an error occurred while * migrating data from one instance to another. */ public class ViewDataMigrationException extends Exception { /** * Constructor. * * @param msg message */ public ViewDataMigrationException(String msg) { super(msg); } /** * Constructor. * * @param msg message * @param throwable root exception */ public ViewDataMigrationException(String msg, Throwable throwable) { super(msg, throwable); } }
0
public static final String ROLLING_UPGRADE_MIN_STACK_KEY = "rolling.upgrade.min.stack"; public static final String ROLLING_UPGRADE_MAX_STACK_KEY = "rolling.upgrade.max.stack"; public static final String ROLLING_UPGRADE_MIN_STACK_DEFAULT = "HDP-2.2"; public static final String ROLLING_UPGRADE_MAX_STACK_DEFAULT = ""; public String getRollingUpgradeMinStack() { return properties.getProperty(ROLLING_UPGRADE_MIN_STACK_KEY, ROLLING_UPGRADE_MIN_STACK_DEFAULT); } public String getRollingUpgradeMaxStack() { return properties.getProperty(ROLLING_UPGRADE_MAX_STACK_KEY, ROLLING_UPGRADE_MAX_STACK_DEFAULT); }
0
* <p>Each of the calls to any of the {@link DoFn DoFn's} processing * <pre><{@code * }</pre> * <pre>{@code * }</pre> * <pre>{@code * }</pre>
0
Runnable failureHandler = () -> { List<QCMutation> mutations = new ArrayList<>(); failedMutations.drainTo(mutations); if (mutations.size() > 0) queue(mutations);
0
import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; import org.apache.commons.codec.DecoderException; import org.junit.Test; public class RFC1522CodecTest { @Test @Test
1
package org.apache.http.impl.client.cache; import org.apache.http.client.cache.HttpCacheEntry; interface HttpCache {
0
import com.google.cloud.dataflow.sdk.values.TimestampedValue; import com.google.common.base.Function; import com.google.common.collect.Iterables; protected TimestampedValue<Iterable<V>> finalValue(W window) throws Exception { Iterable<TimestampedValue<V>> result = windowingInternals.readTagList(tag); Instant timestamp = result.iterator().next().getTimestamp(); return TimestampedValue.of( Iterables.transform(result, new Function<TimestampedValue<V>, V>() { @Override public V apply(TimestampedValue<V> input) { return input.getValue(); } }), timestamp);
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
import org.apache.http.impl.IncomingHttpEntity; return new IncomingHttpEntity( null, len >= 0 ? len : -1, len == ContentLengthStrategy.CHUNKED, message.getFirstHeader(HttpHeaders.CONTENT_TYPE), message.getFirstHeader(HttpHeaders.CONTENT_ENCODING));
0
in.apply("AddKeys", ParDo.of(new OldDoFn<V, KV<K, V>>() {
0
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkNotNull; import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkState; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableMap;
0
* Copyright 2016 Seznam.cz, a.s.
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
StreamingWindowedElement<WID, Pair<KEY, VALUE>>, window.getEmissionWatermark(), Pair.of(i.get().getFirst(), i.get().getSecond())));
0
import org.apache.cocoon.configuration.Settings; * @version $Id$ return (Element[]) elements.toArray(new Element[elements.size()]); register(beanDef, beanName, null, registry); this.logger.debug("Registering bean with name " + beanName + (alias != null ? " (alias=" + alias + ") " : " ") + beanDef); "' as bean name and " + aliases + " as aliases"); fillBeanDefinition(beanDef, initMethod, requiresSettings); fillBeanDefinition(beanDef, initMethod, requiresSettings); return beanDef; } private void fillBeanDefinition(RootBeanDefinition beanDef, String initMethod, boolean requiresSettings) { protected void addComponent(Class componentClass, String beanName, String initMethod, boolean requiresSettings, BeanDefinitionRegistry registry) { final RootBeanDefinition beanDef = createBeanDefinition(componentClass, initMethod, requiresSettings); register(beanDef, beanName, registry); protected void addComponent(String componentClass, String beanName, String initMethod, boolean requiresSettings, BeanDefinitionRegistry registry) { final RootBeanDefinition beanDef = createBeanDefinition(componentClass, initMethod, requiresSettings); register(beanDef, beanName, registry);
0
TransformResult<Long> result = runEvaluator(triggering, inputBundle, transform); TransformResult<Long> result = runEvaluator(windowed, inputBundle, transform); TransformResult<Long> result = runEvaluator(windowed, inputBundle, transform); TransformResult<Long> result = runEvaluator(windowed, inputBundle, transform); private TransformResult<Long> runEvaluator( TransformResult<Long> result = evaluator.finishBundle();
0
import org.apache.cocoon.portal.om.AbstractParameters; import org.apache.cocoon.portal.om.Item; import org.apache.cocoon.portal.om.Layout;
0
/* * (c) COPYRIGHT 1999 World Wide Web Consortium * (Massachusetts Institute of Technology, Institut National de Recherche * en Informatique et en Automatique, Keio University). * All Rights Reserved. http://www.w3.org/Consortium/Legal/ * * $Id$ */ package org.w3c.css.sac; /** * @version $Revision$ * @author Philippe Le Hegaret * @see Selector#SAC_TEXT_NODE_SELECTOR * @see Selector#SAC_CDATA_SECTION_NODE_SELECTOR * @see Selector#SAC_COMMENT_NODE_SELECTOR */ public interface CharacterDataSelector extends SimpleSelector { /** * Returns the character data. */ public String getData(); }
1
package cz.seznam.euphoria.core.client.io; import java.io.Closeable; import java.io.IOException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Writer for data in a given partition. */ public abstract class Writer<T> implements Closeable { private static final Logger LOG = LoggerFactory.getLogger(Writer.class); private boolean closed = false; /** Write element to the output. */ public abstract void write(T elem) throws IOException; /** Commit the write process. */ public abstract void commit() throws IOException; /** Rollback the write process. Optional operation. */ public void rollback() throws UnsupportedOperationException, IOException { throw new UnsupportedOperationException("Unsupported"); } @Override public void close() throws IOException { if (closed) return; try { closed = true; rollback(); } catch (UnsupportedOperationException ex) { LOG.info("Failed to rollback the operation", ex); } } }
0
import java.nio.charset.StandardCharsets; serialized = new String(baos.toByteArray(), StandardCharsets.UTF_8); ByteArrayInputStream bais = new ByteArrayInputStream(serialized.getBytes(StandardCharsets.UTF_8));
0
volatile boolean readyToStart = false; readyToStart = true; /* */
0
import org.apache.beam.runners.core.metrics.MetricsContainerStepMap;
0
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; import javax.annotation.Nullable;
0
iters.add(smi); ColumnFamilySkippingIterator cfsi = new ColumnFamilySkippingIterator(delIter); ColumnQualifierFilter colFilter = new ColumnQualifierFilter(cfsi, columnSet);
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.zookeeper.server.watch; import java.util.Set; /** * Interface used to process the dead watchers related to closed cnxns. */ public interface IDeadWatcherListener { /** * Process the given dead watchers. * * @param deadWatchers the watchers which have closed cnxn */ public void processDeadWatchers(Set<Integer> deadWatchers); }
0
public static boolean check(final String cn) final ClassLoader cl = DaemonLoader.class.getClassLoader(); final Class<?> c = cl.loadClass(cn); } catch (final Throwable t) { } catch (final Throwable ex) { public static boolean load(final String className, String args[]) final ClassLoader cl = DaemonLoader.class.getClassLoader(); final String[] a = new String[args.length + 2]; final Class<?> dclass = cl.loadClass("org.apache.commons.daemon.Daemon"); catch (final Exception cnfex) { } catch (final NoSuchMethodException e) { final Context context = new Context(); final Object arg[] = new Object[1]; final Object arg[] = new Object[1]; catch (final InvocationTargetException e) { final Throwable thrown = e.getTargetException(); catch (final Throwable t) { final Object arg[] = null; } catch (final Throwable t) { final Object arg[] = null; catch (final Throwable t) { final Object arg[] = null; } catch (final Throwable t) { private void setAvailable(final boolean available) public void fail(final String message) public void fail(final Exception exception) public void fail(final String message, final Exception exception) public void setController(final DaemonController controller) public void setArguments(final String[]args)
0
Multibinder<TypesChangeListener> typesChangeListenerBinder = Multibinder.newSetBinder(binder(), TypesChangeListener.class); typesChangeListenerBinder.addBinding().toProvider(GraphBackedSearchIndexer.class);
0
* an instance of {@link SessionOutputBuffer}. * protected final SessionOutputBuffer sessionBuffer; * *
0
import java.io.IOException; import java.util.Objects;
0
* @version CVS $Id: Item.java,v 1.3 2003/05/22 15:19:43 cziegeler Exp $ layout.setParent(this);
0
* an IllegalStateException will be thrown, else a {@code null} will * @param allowNull if <code>true</code>, a {@code null} value may be * @return the session attached to the MINA session or {@code null} * and a {@code null} value will be returned. Else the identification * @return the remote identification or {@code null} if more data is needed
0
public static KnownHostHashValue parse(String patternString) { String pattern = GenericUtils.replaceWhitespaceAndTrim(patternString); public static <V extends KnownHostHashValue> V parse(String patternString, V value) { String pattern = GenericUtils.replaceWhitespaceAndTrim(patternString);
0
response.put("last_client_response_size", stats.getClientResponseStats().getLastBufferSize()); response.put("max_client_response_size", stats.getClientResponseStats().getMaxBufferSize()); response.put("min_client_response_size", stats.getClientResponseStats().getMinBufferSize()); response.put("last_proposal_size", leader.getProposalStats().getLastBufferSize()); response.put("max_proposal_size", leader.getProposalStats().getMaxBufferSize()); response.put("min_proposal_size", leader.getProposalStats().getMinBufferSize()); response.put("client_response", zkServer.serverStats().getClientResponseStats()); if (zkServer instanceof LeaderZooKeeperServer) { Leader leader = ((LeaderZooKeeperServer)zkServer).getLeader(); response.put("proposal_stats", leader.getProposalStats()); }
1
import org.apache.http.pool.ConnFactory; super(new InternalConnFactory(), defaultMaxPerRoute, maxTotal); static class InternalConnFactory implements ConnFactory<HttpRoute, OperatedClientConnection> { public OperatedClientConnection create(final HttpRoute route) throws IOException { return new DefaultClientConnection();
0
Copyright 2001,2003 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
newsgroup = stdin.readLine(); if (newsgroup == null) { break; } newsgroup = newsgroup.trim();
0
WindowedValue.of(value, c.timestamp(), c.windowingInternals().windows())));
0
import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Font; import org.apache.batik.util.resources.ResourceManager;
0
* @param localAddress the local socket address. Can be {@code null}, * @param attachment the attachment object. Can be {@code null}. * @param callback interface. Can be {@code null}.
0
import org.apache.mesos.v1.Protos; .setAgentId(Protos.AgentID.newBuilder().setValue(attributes.getSlaveId()))
0
import org.apache.felix.webconsole.AbstractWebConsolePlugin; Map params = ( Map ) request.getAttribute( AbstractWebConsolePlugin.ATTR_FILEUPLOAD );
0
import cz.seznam.euphoria.core.annotation.operator.StateComplexity; @Derived( state = StateComplexity.CONSTANT_IF_COMBINABLE, repartitions = 1 )
0
HttpPoolEntry local = this.poolEntry; if (local != null) { OperatedClientConnection conn = local.getConnection(); local.getTracker().reset(); HttpPoolEntry local = this.poolEntry; if (local != null) { OperatedClientConnection conn = local.getConnection(); local.getTracker().reset();
0
StoredCronJob job = new StoredCronJob(new JobConfiguration() .setOwner(new Identity().setUser("user")) .setKey(JOB_KEY) .setTaskConfig(task.newBuilder())); new JobConfiguration(job.getJobConfiguration()) .setOwner(new Identity(job.getJobConfiguration().getOwner()).setRole(JOB_KEY.getRole())) .setTaskConfig(backfilledTask.newBuilder()));
0
* @version CVS $Id: FOM_JavaScriptInterpreter.java,v 1.2 2003/06/22 18:12:27 coliver Exp $ FOM_Cocoon.init(scope); //int size = (params != null ? params.size() : 0); //NativeArray parameters = new NativeArray(size); //if (size != 0) { //for (int i = 0; i < size; i++) { //Interpreter.Argument arg = (Interpreter.Argument)params.get(i); //parameters.put(arg.name, parameters, arg.value); //} //} Object[] args = new Object[] {k}; cocoon.invalidate();
0
// This method should not be called directly. void __setState(int i) // Create the module instance. m_archive.getRevision(revision).getContent(), getFramework().getBundleStreamHandler());
1
weightedValue = new WeightedValue<>();
0
/* * Update the election vote here to ensure that all members of the * ensemble report the same vote to new servers that start up and * send leader election notifications to the ensemble. * * @see https://issues.apache.org/jira/browse/ZOOKEEPER-1732 */ self.updateElectionVote(newEpoch);
0
public UpgradeEntity getUpgradeInProgress() { throw new AmbariException("Unable to update the associated upgrade with the cluster", e); UpgradeEntity upgrade = getUpgradeInProgress(); if (null != upgrade) { return upgrade.isSuspended();
0
import org.apache.cocoon.portal.layout.LayoutException; import org.apache.cocoon.portal.om.CopletInstance; import org.apache.cocoon.portal.om.CopletInstanceFeatures; import org.apache.cocoon.portal.om.Layout; import org.apache.cocoon.portal.om.LayoutFeatures; try { portalLayoutRenderer.toSAX(l, this.portalService, ch); } catch (LayoutException e) { throw new SAXException(e); } portalLayout = LayoutFeatures.getFullScreenInfo(service, rootLayout); try { portalLayoutRenderer.toSAX(portalLayout, this.portalService, ch); } catch (LayoutException e) { throw new SAXException(e); }
0
* Copyright (c) 2001-2004 The Apache Software Foundation. All rights
0
if (dynamicSecureParts != null) { Iterator<Map.Entry<Object, SecurePart>> securePartsMapIterator = dynamicSecureParts.entrySet().iterator(); while (securePartsMapIterator.hasNext()) { Map.Entry<Object, SecurePart> securePartEntry = securePartsMapIterator.next(); final SecurePart securePart = securePartEntry.getValue(); if (securePart.getExternalReference() != null) { digestExternalReference(outputProcessorChain, securePart); } if (dynamicSecureParts != null) { Iterator<Map.Entry<Object, SecurePart>> securePartsMapIterator = dynamicSecureParts.entrySet().iterator(); loop: while (securePartsMapIterator.hasNext()) { Map.Entry<Object, SecurePart> securePartEntry = securePartsMapIterator.next(); final SecurePart securePart = securePartEntry.getValue(); if (securePart.isRequired()) { for (int i = 0; i < signaturePartDefs.size(); i++) { SignaturePartDef signaturePartDef = signaturePartDefs.get(i); if (signaturePartDef.getSecurePart() == securePart) { continue loop; } throw new XMLSecurityException("stax.signature.securePartNotFound", securePart.getName());
0
return Pair.of(schema, name(id)); } static String name(SqlIdentifier id) { if (id.isSimple()) { return id.getSimple(); } else { return Util.last(id.names); }
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.zookeeper.server.admin; import org.apache.zookeeper.server.ZooKeeperServer; /** * Interface for an embedded admin server that runs Commands. There is only one * functional implementation, JettyAdminServer. DummyAdminServer, which does * nothing, is used when we do not wish to run a server. */ public interface AdminServer { public void start() throws AdminServerException; public void shutdown() throws AdminServerException; public void setZooKeeperServer(ZooKeeperServer zkServer); public class AdminServerException extends Exception { public AdminServerException(String message, Throwable cause) { super(message, cause); } public AdminServerException(Throwable cause) { super(cause); } } }
1
ServerMetrics.getMetrics().UNRECOVERABLE_ERROR_COUNT.add(1);
0
import static org.junit.Assert.assertEquals; public class TrimmerOutputStreamTest { assertEquals(baos.size(), testStringBytes.length - 7); assertEquals(baos.toString(), testString); assertEquals(baos.size(), testStringBytes.length - 7); assertEquals(baos.toString(), stringBuffer.toString().substring(3, stringBuffer.length() - 4)); }
0
@Test public void testEnc() { System.out.println(TEST_CODER.asCloudObject()); }
0
public <R,P> R accept(NodeVisitor<? extends R, ? super P> visitor, P data) { return visitor.visit(this, data); }
0
final Method[] methods = SqlNullCheckedResultSet.class.getMethods(); final String methodName = methods[i].getName(); final String normalName = "get" + methodName.substring(GET_NULL_PREFIX.length()); final byte[] copy = new byte[this.nullBytes.length]; final Object result = method.invoke(this.rs, args); final Method nullMethod = nullMethods.get(method.getName()); final byte[] copy = new byte[nullBytes.length];
0
import org.apache.beam.sdk.values.BeamRecordType; public BeamTextCSVTable(BeamRecordType beamRowType, String filePattern) { this(beamRowType, filePattern, CSVFormat.DEFAULT); public BeamTextCSVTable(BeamRecordType beamRecordType, String filePattern, CSVFormat csvFormat) { super(beamRecordType, filePattern); new BeamTextCSVTableIOReader(beamRecordType, filePattern, csvFormat)); return new BeamTextCSVTableIOWriter(beamRecordType, filePattern, csvFormat);
0
Trace.on("testing");
0
// Make enough room for two IPv6 addresses to avoid re-allocation in the StringBuilder. final StringBuilder buffer = new StringBuilder(78);
0
import com.google.cloud.dataflow.sdk.util.common.worker.NativeReader; try (NativeReader.LegacyReaderIterator<KV<byte[], byte[]>> iterator = reader.iterator()) {
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
* Copyright 2001-2005 The Apache Software Foundation
0
public static String baseUrl = "http://localhost:21000/";;
0
StringBuilder buf = new StringBuilder(64);
0