Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
private static final long serialVersionUID = 5654582990564566355L;
0
opts.setPrincipal("root");
0
public Document createDocument(String ns, String root, String uri, Reader r) throws IOException { XMLReader parser = XMLReaderFactory.createXMLReader(parserClassName); * Returns true if the XML parser validates the XML stream, false * otherwise.
0
OnTimerMethodSpecifier onTimerMethodSpecifier = OnTimerMethodSpecifier.forClassAndTimerId(fnClass, timerId); Constructor<?> constructor = constructorCache.get(onTimerMethodSpecifier); OnTimerInvoker<InputT, OutputT> invoker = return invoker; * A cache of constructors of generated {@link OnTimerInvoker} classes, * keyed by {@link OnTimerMethodSpecifier}. private final LoadingCache<OnTimerMethodSpecifier, Constructor<?>> constructorCache = CacheBuilder.newBuilder().build( new CacheLoader<OnTimerMethodSpecifier, Constructor<?>>() { @Override public Constructor<?> load(final OnTimerMethodSpecifier onTimerMethodSpecifier) throws Exception { DoFnSignature signature = DoFnSignatures.getSignature(onTimerMethodSpecifier.fnClass()); Class<? extends OnTimerInvoker<?, ?>> invokerClass = generateOnTimerInvokerClass(signature, onTimerMethodSpecifier.timerId()); try { return invokerClass.getConstructor(signature.fnClass()); } catch (IllegalArgumentException | NoSuchMethodException | SecurityException e) { throw new RuntimeException(e); } } }); /**
0
* @param charIndex The index of the character that has been * hit. In the case of bidirectional text this will be the logical * character index not the visual index. The index is relative to * whole text within the selected TextNode. * @param leadingEdge Indicates which side of the character has * been hit.
0
import org.apache.http.conn.scheme.SchemeRegistry;
0
* Note that this class is intended as an in-memory replacement for RFile$Reader, so its behavior reflects * the same assumptions; namely, that this iterator is not responsible for respecting the columnFamilies * passed into seek(). If you want a Map-backed Iterator that returns only sought CFs, construct a new * ColumnFamilySkippingIterator(new SortedMapIterator(map)). * * @see org.apache.accumulo.core.iterators.system.ColumnFamilySkippingIterator
0
for (final CharArrayBuffer buffer : this.headerBufs) {
0
assertEquals("org.apache.accumulo.core.security.crypto.CachingHDFSSecretKeyEncryptionStrategy", params.getKeyEncryptionStrategyClass()); assertEquals("org.apache.accumulo.core.security.crypto.CachingHDFSSecretKeyEncryptionStrategy", params.getKeyEncryptionStrategyClass()); assertEquals("org.apache.accumulo.core.security.crypto.CachingHDFSSecretKeyEncryptionStrategy", params.getKeyEncryptionStrategyClass()); assertEquals("org.apache.accumulo.core.security.crypto.CachingHDFSSecretKeyEncryptionStrategy", params.getKeyEncryptionStrategyClass());
0
import com.twitter.mesos.scheduler.state.MaintenanceController;
0
* @version $Id$
0
import org.apache.sshd.util.Utils; sshd.setKeyPairProvider(Utils.createTestHostKeyProvider());
0
private final static class FileSystemOptionKey implements Comparable int ret = fileSystemClass.getName().compareTo(k.fileSystemClass.getName());
0
import org.apache.ambari.server.topology.TopologyManager; import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.expectLastCall; import static org.easymock.EasyMock.anyObject; import static org.easymock.EasyMock.eq; import static org.easymock.EasyMock.replay; TopologyManager topologyManager = EasyMock.createNiceMock(TopologyManager.class); expect(topologyManager.getRequests(Collections.EMPTY_LIST)).andReturn(Collections.EMPTY_LIST).anyTimes(); replay(topologyManager); HostResourceProvider.setTopologyManager(topologyManager); TopologyManager topologyManager = EasyMock.createNiceMock(TopologyManager.class); expect(topologyManager.getRequests(Collections.EMPTY_LIST)).andReturn(Collections.EMPTY_LIST).anyTimes(); replay(topologyManager); HostResourceProvider.setTopologyManager(topologyManager);
0
// should text be escaped - default to true for compatability private boolean escapeText = true; /** * Returns whether the body of this tag will be escaped or not. */ public boolean isEscapeText() { return escapeText; } /** * Sets whether the body of the tag should be escaped as text (so that &lt; and &gt; are * escaped as &amp;lt; and &amp;gt;), which is the default or leave the text as XML. */ public void setEscapeText(boolean escapeText) { this.escapeText = escapeText; } xmlWriter.setEscapeText(isEscapeText());
0
import org.apache.zookeeper.ZooDefs; import org.apache.zookeeper.server.quorum.flexible.QuorumVerifier; public synchronized void initConfigInZKDatabase(QuorumVerifier qv) { if (qv == null) return; // only happens during tests try { if (this.dataTree.getNode(ZooDefs.CONFIG_NODE) == null) { // should only happen during upgrade LOG.warn("configuration znode missing (hould only happen during upgrade), creating the node"); this.dataTree.addConfigNode(); } this.dataTree.setData(ZooDefs.CONFIG_NODE, qv.toString().getBytes(), -1, qv.getVersion(), System.currentTimeMillis()); } catch (NoNodeException e) { System.out.println("configuration node missing - should not happen"); } }
0
interface Params { Amount<Long, Time> dlogShutdownGracePeriod(); Amount<Long, Time> dlogSnapshotInterval(); Amount<Integer, Data> dlogMaxEntrySize(); } private final Params params; public LogStorageModule() { this.params = new Params() { @Override public Amount<Long, Time> dlogShutdownGracePeriod() { return SHUTDOWN_GRACE_PERIOD.get(); } @Override public Amount<Long, Time> dlogSnapshotInterval() { return SNAPSHOT_INTERVAL.get(); } @Override public Amount<Integer, Data> dlogMaxEntrySize() { return MAX_LOG_ENTRY_SIZE.get(); } }; } .toInstance(new Settings(params.dlogShutdownGracePeriod(), params.dlogSnapshotInterval())); .toInstance(params.dlogMaxEntrySize());
0
public void init(final FilterConfig filterConfig) throws ServletException { // nothing to do } public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { final HttpServletRequest req = (HttpServletRequest)request; final HttpServletResponse res = (HttpServletResponse)response; public void destroy() { // nothing to do
0
Option opt = (Option) getOptions().getOption(arg).clone();
0
import java.util.Arrays; assertSortOrder(new DoubleLexicoder(), Arrays.asList(Double.MIN_VALUE, Double.MAX_VALUE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, 0.0, 0.01, 0.001, 1.0, -1.0, -1.1, -1.01, Math.nextUp(Double.NEGATIVE_INFINITY), Math.nextAfter(0.0, Double.NEGATIVE_INFINITY), Math.pow(10.0, -30.0)));
0
import com.google.common.base.Predicate; import com.google.common.collect.Sets; import com.twitter.mesos.gen.ScheduleStatus; import java.util.Set; import static com.twitter.mesos.gen.ScheduleStatus.*; /** * Different states that an active task may be in. */ public static final Set<ScheduleStatus> ACTIVE_STATES = Sets.newHashSet( PENDING, STARTING, RUNNING); /** * Terminal states, which a task should not move from. */ public static final Set<ScheduleStatus> TERMINAL_STATES = Sets.newHashSet( FAILED, FINISHED, KILLED, KILLED_BY_CLIENT, LOST, NOT_FOUND ); /** * Filter that includes only active tasks. */ public static final Predicate<TrackedTask> ACTIVE_FILTER = new Predicate<TrackedTask>() { @Override public boolean apply(TrackedTask task) { return isActive(task.getStatus()); } }; /** * Filter that includes only terminal tasks. */ public static final Predicate<TrackedTask> TERMINATED_FILTER = new Predicate<TrackedTask>() { @Override public boolean apply(TrackedTask task) { return isTerminated(task.getStatus()); } }; public static boolean isActive(ScheduleStatus status) { return ACTIVE_STATES.contains(status); } public static boolean isTerminated(ScheduleStatus status) { return TERMINAL_STATES.contains(status); }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/AbstractObjectCreationFactory.java,v 1.9 2004/01/10 17:32:28 rdonkin Exp $ * $Revision: 1.9 $ * $Date: 2004/01/10 17:32:28 $ * Copyright (c) 2001-2004 The Apache Software Foundation. All rights * nor may "Apache" appear in their names without prior * @version $Revision: 1.9 $ $Date: 2004/01/10 17:32:28 $
0
import org.apache.beam.sdk.metrics.MetricKey;
0
final Path file = getTempTargetRelativeFile(getCurrentTestName());
0
void store(TypeSystem typeSystem) throws MetadataException; void store(TypeSystem typeSystem, ImmutableList<String> types) throws MetadataException; TypesDef restore() throws MetadataException;
0
package org.apache.commons.configuration.convert; import org.apache.commons.configuration.ListDelimiterHandler; import org.apache.commons.configuration.ValueTransformer;
0
"bootstrap.script", AmbariPath.getPath("/usr/lib/ambari-server/lib/ambari_server/bootstrap.py")); AmbariPath.getPath("/usr/lib/ambari-server/lib/ambari_server/setupAgent.py"));
0
* @throws Exception throws Exception @Path(value = "/{stackName0}") * @param stackName Name of the stack * @throws Exception throws Exception @Path(value = "/{stackName1}") @Path(value = "/{stackName2}")
0
this(doc, BaseURI, SignatureMethodURI, 0, Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS); Document doc, String BaseURI, String SignatureMethodURI, int HMACOutputLength) throws XMLSecurityException { this(doc, BaseURI, SignatureMethodURI, HMACOutputLength, Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS); } public XMLSignature( this(doc, BaseURI, SignatureMethodURI, 0, CanonicalizationMethodURI);
0
final String[] sa = a.split(":", 2);
0
deepCopy(existingConfigurations), null, kerberosDescriptorProperties); PrincipalKeyCredential administratorCredential = getKDCAdministratorCredentials(cluster.getClusterName()); try { kerberosOperationHandler.open(administratorCredential, kerberosDetails.getDefaultRealm(), kerberosConfiguration); } catch (KerberosOperationException e) { String message = String.format("Failed to process the identities, could not properly open the KDC operation handler: %s", e.getMessage()); LOG.error(message); throw new AmbariException(message, e); } // The KerberosOperationHandler needs to be closed, if it fails to close ignore the // exception since there is little we can or care to do about it now. try { kerberosOperationHandler.close(); } catch (KerberosOperationException e) { // Ignore this... }
0
import org.apache.atlas.typesystem.TypesDef; import scala.collection.JavaConversions; public static TypesDef getTypesDef(ImmutableList<EnumTypeDefinition> enums, ImmutableList<StructTypeDefinition> structs, ImmutableList<HierarchicalTypeDefinition<TraitType>> traits, ImmutableList<HierarchicalTypeDefinition<ClassType>> classes) { return new TypesDef(JavaConversions.asScalaBuffer(enums), JavaConversions.asScalaBuffer(structs), JavaConversions.asScalaBuffer(traits), JavaConversions.asScalaBuffer(classes)); }
0
import org.apache.zookeeper.server.ZooKeeperServerListener; int tickTime, long id, boolean localSessionsEnabled, ZooKeeperServerListener listener) { expirer, sessionsWithTimeouts, tickTime, id, listener); createLocalSessionTracker(expirer, tickTime, id, listener);
0
package org.apache.commons.digester3.annotations.processor; /* * 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. */ import static java.lang.String.format; import java.io.IOException; import java.io.OutputStream; import javax.annotation.processing.Filer; import com.sun.codemodel.CodeWriter; import com.sun.codemodel.JPackage; /** * @since 3.3 */ final class FilerCodeWriter extends CodeWriter { /** * Java source file extension. */ private static final String JAVA_FILE_EXTENSION = ".java"; private final Filer filer; public FilerCodeWriter( Filer filer ) { this.filer = filer; } @Override public OutputStream openBinary( JPackage pkg, String fileName ) throws IOException { String className = fileName.substring( 0, fileName.length() - JAVA_FILE_EXTENSION.length() ); return filer.createSourceFile( format( "%s.%s", pkg.name(), className ) ).openOutputStream(); } @Override public void close() throws IOException { // do nothing } }
0
// Necessary for resetting clients stale configs after starting service if ((RoleCommand.INSTALL.toString().equals(report.getRoleCommand()) || (RoleCommand.CUSTOM_COMMAND.toString().equals(report.getRoleCommand()) && "INSTALL".equals(report.getCustomCommand()))) && svcComp.isClientComponent()){ scHost.updateActualConfigs(report.getConfigurationTags()); scHost.setRestartRequired(false); }
0
* $HeadURL:https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpcore/trunk/module-nio/src/test/java/org/apache/http/mockup/TestHttpServer.java $ * $Revision:575207 $ * $Date:2007-09-13 09:57:05 +0200 (Thu, 13 Sep 2007) $ if (this.thread != null) { this.thread.join(500); }
0
LOG.debug("Waiting up to {} msec as assertion failed", mustEnd - System.currentTimeMillis(), e);
0
executor.submit(flow).get();
0
import java.io.IOException; import java.io.InputStream; public class ThreadInputStream extends InputStream { InputStream dflt; public ThreadInputStream(InputStream in) { dflt = in; } public int read(byte[] buffer, int offset, int length) throws IOException { return getCurrent().read(buffer, offset, length); } public int read(byte[] buffer) throws IOException { return getCurrent().read(buffer); } private InputStream getCurrent() { InputStream in = map.get(); if (in != null) { return in; } return dflt; } public int read() throws IOException { return getCurrent().read(); } public void setStream(InputStream in) { if (in != dflt && in != this) { map.set(in); } else { map.remove(); } } public void end() { map.remove(); } InputStream getRoot() { return dflt; }
0
/** Copied from package com.google.cloud.bigquery, see BEAM-4248. */ * Mode for a BigQuery Table field. {@link Mode#NULLABLE} fields can be set to {@code null}, {@link * Mode#REQUIRED} fields must be provided. {@link Mode#REPEATED} fields can contain more than one * value. NULLABLE, REQUIRED, REPEATED
1
public class DistributionCell implements MetricCell<Distribution, DistributionData> { /** Increment the distribution by the given amount. */ update(DistributionData.singleton(n)); } @Override public void update(DistributionData data) { } while (!value.compareAndSet(original, original.combine(data))); public void update(MetricCell<Distribution, DistributionData> other) { update(other.getCumulative()); } @Override
0
assertNull("Check no foo service", getContext().getServiceReference(FooService.class.getName())); ComponentFactory factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "Factories-FooProviderType-1"); assertNotNull("Check foo service", getContext().getServiceReference(FooService.class.getName())); assertEquals("Check the number of Foo", Utils.getServiceReferences(getContext(), FooService.class.getName(), null).length, 2); assertNull("Check no foo service", getContext().getServiceReference(FooService.class.getName())); assertNull("Check no foo service", getContext().getServiceReference(FooService.class.getName())); ComponentFactory cf = (ComponentFactory) Utils.getFactoryByName(getContext(), "org.apache.felix.ipojo.test.scenarios.component.SimpleType"); ServiceReference ref_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "SimpleInstance"); HandlerManagerFactory hf = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "controller"); HandlerManagerFactory hf2 = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "controller"); cf = (ComponentFactory) Utils.getFactoryByName(getContext(), "org.apache.felix.ipojo.test.scenarios.component.SimpleType"); ref_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "SimpleInstance"); hf2 = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "controller"); cf = (ComponentFactory) Utils.getFactoryByName(getContext(), "org.apache.felix.ipojo.test.scenarios.component.SimpleType"); ref_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "SimpleInstance");
0
* The interface for things that might be input to a * Returns the owning {@link Pipeline} of this {@code PInput}. * Expands this {@code PInput} into a list of its component input {@link PValue}s. * <p> A {@link PValue} expands to itself. * <p> A tuple or list of {@link PValue}s (e.g., {@link PCollectionTuple}, * and {@link PCollectionList}) expands to its component {@link PValue}s. * <p> After building, finalizes this {@code PInput} to make it ready for * being used as an input to a {@link PTransform}. * this {@code PInput}, so users do not normally call this explicitly.
0
import com.google.cloud.dataflow.sdk.transforms.windowing.InvalidWindows; new InvalidWindows( public void testInvalidWindows() {
0
import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.trace.instrument.TraceExecutorService; import org.apache.accumulo.trace.instrument.Tracer; // This needs to execute after the arbiter is stopped Scanner mscanner = new IsolatedScanner(conn.createScanner(Constants.METADATA_TABLE_NAME, Authorizations.EMPTY));
0
PropertiesConfiguration configProperties = new PropertiesConfiguration("atlas-buildinfo.properties"); response.put("Name", configProperties.getString("project.name", "apache-atlas")); throw new WebApplicationException(Servlets.getErrorResponse(e, Response.Status.INTERNAL_SERVER_ERROR));
0
import java.util.List; import org.apache.geronimo.gshell.clp.Option; import org.osgi.framework.Bundle; public class StopBundle extends BundlesCommand { protected void doExecute(List<Bundle> bundles) throws Exception { for (Bundle bundle : bundles) { bundle.stop(); }
0
return FtpFileName.parseUri( uri );
0
public void getProperties(Map<String,String> props, PropertyFilter filter) { for (Entry<String,String> prop : DefaultConfiguration.getInstance()) if (filter.accept(prop.getKey())) props.put(prop.getKey(), prop.getValue()); for (Entry<String,String> prop : xml) if (filter.accept(prop.getKey())) props.put(prop.getKey(), prop.getValue());
0
package org.apache.felix.ipojo.runtime.core.test.components.comparator; import org.osgi.framework.ServiceReference; import java.util.Comparator; public class GradeComparator implements Comparator { public int compare(Object arg0, Object arg1) { ServiceReference ref0 = null; ServiceReference ref1 = null; Integer grade0 = null; Integer grade1 = null; if (arg0 instanceof ServiceReference) { ref0 = (ServiceReference) arg0; grade0 = (Integer) ref0.getProperty("grade"); } if (arg1 instanceof ServiceReference) { ref1 = (ServiceReference) arg1; grade1 = (Integer) ref1.getProperty("grade"); } if (ref0 != null && ref1 != null && grade0 != null && grade1 != null) { return grade1.compareTo(grade0); // Best grade first. } else { return 0; // Equals } } }
0
package org.apache.commons.ognl;
0
log.error("Could not read all from cluster.", ioe);
0
@SuppressWarnings("unused") @SuppressWarnings("unused")
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.logsearch.config.api; /** * Monitors input configuration changes. */ public interface InputConfigMonitor { /** * Notification of a new input configuration. * * @param serviceName The name of the service for which the input configuration was created. * @param inputConfig The input configuration. * @throws Exception */ void loadInputConfigs(String serviceName, String inputConfig) throws Exception; /** * Notification of the removal of an input configuration. * * @param serviceName The name of the service of which's input configuration was removed. */ void removeInputs(String serviceName); }
0
import java.util.HashMap; private volatile Map<String, Object> convertedAttributes; if (convertedAttributes == null) { Map<String, Object> orgMap = capability.getPropertiesAsMap(); HashMap<String, Object> converted = new HashMap<String, Object>(orgMap.size()); for (Map.Entry<String, Object> entry : orgMap.entrySet()) { converted.put(NamespaceTranslator.getOSGiNamespace(entry.getKey()), entry.getValue()); } convertedAttributes = converted; // Cache the result } return convertedAttributes;
0
throw new IllegalStateException(e.getTargetException().getMessage());
0
import org.apache.hadoop.conf.Configuration; Configuration conf = job.getConfiguration(); AccumuloInputFormat.setInputInfo(conf, "root", "".getBytes(), "testtable1", new Authorizations()); AccumuloInputFormat.setMockInstance(conf, "testmrinstance"); AccumuloOutputFormat.setOutputInfo(conf, "root", "".getBytes(), false, "testtable2"); AccumuloOutputFormat.setMockInstance(conf, "testmrinstance");
0
return (Map<String, ?>) getValue(root);
0
/* * Copyright (c) 1999 World Wide Web Consortium, * (Massachusetts Institute of Technology, Institut National de * Recherche en Informatique et en Automatique, Keio University). All * Rights Reserved. This program is distributed under the W3C's Software * Intellectual Property License. This program is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY; without even * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. * See W3C License http://www.w3.org/Consortium/Legal/ for more details. * * $Id$ */ package org.w3c.css.sac.helpers; import org.w3c.css.sac.Parser; /** * @version $Revision$ * @author Philippe Le Hegaret */ public class ParserFactory { /** * Create a parser with given selectors factory and conditions factory. */ public Parser makeParser() throws ClassNotFoundException, IllegalAccessException, InstantiationException, NullPointerException, ClassCastException { String className = System.getProperty("org.w3c.css.sac.parser"); if (className == null) { throw new NullPointerException("No value for sac.parser property"); } else { return (Parser)(Class.forName(className).newInstance()); } } }
1
// old style stack map: unneeded for JDK5 and below; // illegal(?) for JDK6 and above. So just delete with a warning. System.err.println("Warning: Obsolete StackMap attribute ignored."); return new Unknown(name_index, length, file, constant_pool); // read new style stack map: StackMapTable. The rest of the code // calls this a StackMap for historical reasons.
0
import java.util.concurrent.atomic.AtomicBoolean; boolean test = false; if (initNode instanceof Test) { startTimer(initNode.toString()); test = true; } if (test) stopTimer(initNode.toString()); test = false; if (nextNode instanceof Test) { startTimer(nextNode.toString()); test = true; } if (test) stopTimer(nextNode.toString()); Thread timer = null; final int time = 5 * 1000 * 60; AtomicBoolean runningLong = new AtomicBoolean(false); long systemTime; /** * */ private void startTimer(final String nodeName) { runningLong.set(false); timer = new Thread(new Runnable() { @Override public void run() { try { log.debug("Starting timer for " + nodeName); systemTime = System.currentTimeMillis(); synchronized (timer) { timer.wait(time); } } catch (InterruptedException ie) { return; } log.warn("Node " + nodeName + " has been running for " + time / 1000.0 + " seconds. You may want to look into it."); runningLong.set(true); } }); timer.start(); } /** * */ private void stopTimer(String nodeName) { synchronized (timer) { timer.interrupt(); try { timer.join(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } if (runningLong.get()) log.warn("Node " + nodeName + ", which was running long, has now completed after " + (System.currentTimeMillis() - systemTime) / 1000.0 + " seconds"); }
0
import org.apache.ambari.server.controller.MaintenanceStateHelper; MaintenanceStateHelper maintHelper = createNiceMock(MaintenanceStateHelper.class); expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(maintHelper); replay(maintHelper, injector, clusters, cluster, host, response); MaintenanceStateHelper maintHelper = createNiceMock(MaintenanceStateHelper.class); expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(maintHelper); replay(maintHelper, injector, clusters, cluster); MaintenanceStateHelper maintHelper = createNiceMock(MaintenanceStateHelper.class); expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(maintHelper); replay(maintHelper, injector, clusters, cluster, host); MaintenanceStateHelper maintHelper = createNiceMock(MaintenanceStateHelper.class); expect(injector.getInstance(MaintenanceStateHelper.class)).andReturn(maintHelper); replay(maintHelper, injector, clusters, cluster, host1, host2, response, response2);
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
package org.apache.beam.sdk.extensions.sql.impl.rel;
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. */ private NoLabelFilter ref = new NoLabelFilter(); public NoLabelIterator deepCopy(IteratorEnvironment env) { return new NoLabelIterator(this, env); } private NoLabelIterator(NoLabelIterator other, IteratorEnvironment env) { setSource(other.getSource().deepCopy(env)); ref = other.ref; } public NoLabelIterator() {} private boolean matches(Key key, Value value) { return ref.accept(key, value); } @Override protected void consume() throws IOException { while (getSource().hasTop() && !matches(getSource().getTopKey(), getSource().getTopValue())) { getSource().next(); } } @Override public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException { super.init(source, options, env); ref.init(options); } @Override public IteratorOptions describeOptions() { return ref.describeOptions(); } @Override public boolean validateOptions(Map<String,String> options) { return ref.validateOptions(options); }
0
props.setProperty("test.basedir", "core/target/test-data"); "smb://HOME\\vfsusr:vfs%2f%25\\te:[email protected]/vfsusr/vfstest"); "ftp://vfsusr:vfs%2f%25\\te:[email protected]/vfstest"); props.setProperty("test.http.uri", "http://172.16.110.129/vfstest"); "webdav://vfsusr:vfs%2f%25\\te:[email protected]/vfstest"); "sftp://vfsusr:vfs%2f%25\\te:[email protected]/vfstest"); FtpProviderTestCase.suite(), UrlProviderHttpTestCase.suite(), VirtualProviderTestCase.suite(), TemporaryProviderTestCase.suite(), UrlProviderTestCase.suite(), HttpProviderTestCase.suite(), JarProviderTestCase.suite(), NestedJarTestCase.suite(), ZipProviderTestCase.suite(), NestedZipTestCase.suite(), TarProviderTestCase.suite(), TgzProviderTestCase.suite(), Tbz2ProviderTestCase.suite(), NestedTarTestCase.suite(), NestedTgzTestCase.suite(), NestedTbz2TestCase.suite(),
0
Range range = new KeyExtent(tableId, null, null).toMetadataRange();
0
private List<FieldObserver> observers; observers = new ArrayList<FieldObserver>(); for (Iterator<FieldObserver> e = observers.iterator(); e.hasNext();) { e.next().notify(this);
0
import org.slf4j.Logger; import org.slf4j.LoggerFactory; private static final Logger LOG = LoggerFactory.getLogger(HeartbeatMonitor.class); LOG.debug("Sending exec command details for {}", component); return new StringBuilder().append("requiresExecCmdDetails: ").append(requiresExecCmdDetails).toString();
1
import org.apache.cocoon.spring.configurator.impl.AbstractElementParser;
0
JexlEvalContext env = new JexlEvalContext(); JexlContext ctxt = new ReadonlyContext(env, env); env.setStrict(true); env.setSilent(false); } } env.set("x", "fourty-two"); }
1
IntersectingIterator.setColumnFamilies(ii, columns);
0
updateClassLoader(); public static Main launch(String[] args) throws Exception { updateClassLoader(); Main main = new Main(args); main.launch(); return main; } private static void updateClassLoader() throws Exception { File home = Utils.getKarafHome(); File file = new File(new File(home, "etc"), FRAMEWORK_PROPERTIES_FILE_NAME); if (!file.exists()) { throw new FileNotFoundException(file.getAbsolutePath()); } Properties props = new Properties(); InputStream is = new FileInputStream(file); props.load(is); is.close(); String framework = props.getProperty(KARAF_FRAMEWORK); if (framework == null) { throw new IllegalArgumentException("Property " + KARAF_FRAMEWORK + " must be set in the etc/" + FRAMEWORK_PROPERTIES_FILE_NAME + " configuration file"); } String bundle = props.getProperty(KARAF_FRAMEWORK + "." + framework); if (bundle == null) { throw new IllegalArgumentException("Property " + KARAF_FRAMEWORK + "." + framework + " must be set in the etc/" + FRAMEWORK_PROPERTIES_FILE_NAME + " configuration file"); } File bundleFile = new File(home, bundle); if (!bundleFile.exists()) { throw new FileNotFoundException(bundleFile.getAbsolutePath()); } URLClassLoader classLoader = (URLClassLoader) Bootstrap.class.getClassLoader(); Method mth = URLClassLoader.class.getDeclaredMethod("addURL", URL.class); mth.setAccessible(true); mth.invoke(classLoader, bundleFile.toURL()); }
0
* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * 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. import org.apache.felix.framework.util.SecureAction; private final static SecureAction m_secureAction = new SecureAction(); Constructor ctor = m_secureAction.getConstructor(lhs.getClass(), STRING_CLASS); m_secureAction.setAccesssible(ctor);
0
out.print("value of " + e.getParsedText() + " is : ", o, foo.convert(1)); out.print("value of " + e.getParsedText() + " is : ", o, foo.convert(1+7)); out.print("value of " + e.getParsedText() + " is : ", o, foo.convert(1+number.intValue()));
1
import org.apache.commons.digester3.Rule; import org.apache.commons.digester3.spi.RuleProvider; interface BackToLinkedRuleBuilder<R extends Rule> extends RuleProvider<R> {
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
0
"An arbitrary string of characters whose format is unspecified" + " and interpreted based on the context of the property to which it" + " applies.",
0
public static final StrictContentLengthStrategy INSTANCE = new StrictContentLengthStrategy();
0
import org.apache.sshd.common.util.buffer.BufferUtils; import org.bouncycastle.util.Arrays; private final byte[] id; public Handle(byte[] id) { // clone the original so the handle is imutable this.id = ValidateUtils.checkNotNullAndNotEmpty(id, "No handle ID", GenericUtils.EMPTY_OBJECT_ARRAY).clone(); } /** * @return A <U>cloned</U> instance of the identifier in order to * avoid inadvertent modifications to the handle contents */ public byte[] getIdentifier() { return id.clone(); } @Override public int hashCode() { return Arrays.hashCode(id); @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } // we do not ask getClass() == obj.getClass() in order to allow for derived classes equality if (!(obj instanceof Handle)) { return false; } if (Arrays.areEqual(id, ((Handle) obj).id)) { return true; } else { return false; } } return BufferUtils.printHex(BufferUtils.EMPTY_HEX_SEPARATOR, id); protected CloseableHandle(byte[] id) {
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.huetoambarimigration.utils; import org.json.simple.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.HashMap; public class MisconfigurationFormattedException extends WebApplicationException { private final static int STATUS = 500; private final static String message = "Parameter \"%s\" is set to null"; private final static Logger LOG = LoggerFactory.getLogger(MisconfigurationFormattedException.class); public MisconfigurationFormattedException(String name) { super(errorEntity(name)); } protected static Response errorEntity(String name) { HashMap<String, Object> response = new HashMap<String, Object>(); response.put("message", String.format(message, name)); response.put("trace", null); response.put("status", STATUS); return Response.status(STATUS).entity(new JSONObject(response)).type(MediaType.APPLICATION_JSON).build(); } }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/observed/standard/Attic/StandardModificationListener.java,v 1.1 2003/09/03 23:54:26 scolebourne Exp $ package org.apache.commons.collections.observed.standard; * @version $Revision: 1.1 $ $Date: 2003/09/03 23:54:26 $
0
* Copyright (c) OSGi Alliance (2001, 2015). All Rights Reserved. * @author $Id: 1de8679fcf7df57b019a93219f6b82222eb1525e $ * @deprecated * @deprecated * @deprecated * @deprecated public Bundle getBundle(Class<?> clazz);
1
package org.apache.aurora.scheduler.config.types; import org.apache.aurora.common.quantity.Amount; import org.apache.aurora.common.quantity.Time; public class TimeAmount extends Amount<Long, Time> { public TimeAmount(long number, Time unit) { super(number, unit, Long.MAX_VALUE); } @Override protected Long scale(double multiplier) { return (long) (getValue() * multiplier);
0
import org.apache.sshd.common.util.GenericUtils; } catch (RuntimeException e) { Throwable t = GenericUtils.peelException(e); Throwable err = null; if ((t instanceof IOException) || (t instanceof GeneralSecurityException)) { err = t; } else { t = GenericUtils.resolveExceptionCause(e); if ((t instanceof IOException) || (t instanceof GeneralSecurityException)) { err = t; } } if (err instanceof IOException) { throw (IOException) err; } else if (err instanceof GeneralSecurityException) { throw (GeneralSecurityException) err; } else { throw e; } BCrypt bcrypt = new BCrypt(); bcrypt.pbkdf(password, getSalt(), getNumRounds(), output);
0
/** Returns {@code true} if the trigger is finished. */ /** Sets the fact that the trigger is finished. */ /** Sets the trigger and all of its subtriggers to unfinished. */ /** Create an independent copy of this mutable {@link FinishedTriggers}. */
1
import org.apache.beam.sdk.annotations.Experimental; /** * For a {@code SerializableFunction<InputT, OutputT>} {@code fn}, returns a {@code PTransform} * given by applying {@code fn.apply(v)} to the input {@code PCollection<InputT>}. * * <p>Allows users to define a concise composite transform using a Java 8 lambda expression. For * example: * * <pre>{@code * PCollection<String> words = wordsAndErrors.apply( * (PCollectionTuple input) -> { * input.get(errorsTag).apply(new WriteErrorOutput()); * return input.get(wordsTag); * }); * }</pre> */ @Experimental public static <InputT extends PInput, OutputT extends POutput> PTransform<InputT, OutputT> compose(SerializableFunction<InputT, OutputT> fn) { return new PTransform<InputT, OutputT>() { @Override public OutputT expand(InputT input) { return fn.apply(input); } }; }
0
import org.apache.accumulo.core.security.Authorizations; checkSplits(REG_TABLE_NAME, NUM_PRE_SPLITS / 2, NUM_PRE_SPLITS * 2); Scanner scanner = getConnector().createScanner(table, Authorizations.EMPTY);
0
import org.apache.http.message.BufferedHeader; buffer.append("Cookie: "); return new Header[] { new BufferedHeader(buffer) };
0
package org.apache.ambari.common.rest.agent;
0
list.add("A Big String A Big String A Big String A Big String A Big String A Big String A Big String A Big String A Big String A Big String " + i++);
0
import org.apache.ambari.server.configuration.Configuration; Configuration _configuration = null; if(null == _configuration) _configuration = new Configuration(); String rollingUpgradeStack = _configuration.getRollingUpgradeStack(); // not applicable if not HDP 2.2.4.2 or later if (!rollingUpgradeStack.equals(stackName)) { String rollingUpgradeVersion = _configuration.getRollingUpgradeVersion(); if (VersionUtils.compareVersions(currentClusterRepositoryVersion, rollingUpgradeVersion) < 0) {
0
import org.apache.http.annotation.GuardedBy; import org.apache.http.annotation.ThreadSafe;
0
public class Repartition<IN> extends ElementWiseOperator<IN, IN> public static class Builder1<IN> { public Builder2<IN> partitionBy(Partitioner<IN> partitioner) { public Repartition<IN> setNumPartitions(int partitions) { public static class Builder2<IN> { public Repartition<IN> setNumPartitions(int partitions) { public static <IN> Builder1<IN> of(Dataset<IN> input) {
0
throw new StorageResolverException(ex, "empty");
0
// empty
0
public void beforeClusterStart(MiniAccumuloConfigImpl cfg) { TableExistsException, TableNotFoundException, IOException { public void testUserOperationsAudits() throws AccumuloSecurityException, AccumuloException, TableExistsException, IOException { public void testImportExportOperationsAudits() throws AccumuloSecurityException, AccumuloException, TableExistsException, TableNotFoundException, IOException { TableExistsException, TableNotFoundException, IOException { TableExistsException, TableNotFoundException, IOException { public void testFailedAudits() throws AccumuloException, IOException {
0
private final ExtensionManager m_extensionManager; // This overrides BundleImpl.close() which avoids removing the // system bundle module from the resolver state. @Override void close() { }
1
beginRead(false); beginRead(false); protected void beginRead(boolean optimize) beginWrite(false); // this constructs the root node protected void beginWrite(boolean optimize) super.beginRead(false); super.beginWrite(false);
0
import org.apache.beam.sdk.runners.TransformHierarchy; public CompositeBehavior enterCompositeTransform(TransformHierarchy.Node node) { public void leaveCompositeTransform(TransformHierarchy.Node node) { public void visitPrimitiveTransform(TransformHierarchy.Node node) { public void visitValue(PValue value, TransformHierarchy.Node producer) { TransformHierarchy.Node node, TransformHierarchy.Node node, private static String formatNodeName(TransformHierarchy.Node node) {
0