Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; * @version $Id: Introspector.java,v 1.4 2002/12/16 10:41:59 jstrachan Exp $
0
FinishedTriggersProperties.verifyGetAfterSet(FinishedTriggersSet.fromSet(new HashSet<>())); FinishedTriggersProperties.verifyClearRecursively(FinishedTriggersSet.fromSet(new HashSet<>())); FinishedTriggersSet finishedSet = FinishedTriggersSet.fromSet(new HashSet<>());
0
* limitations under the License.
0
/** * @since Mar 14, 2002 * @version CVS $Id: InstanceImpl.java,v 1.2 2003/03/16 17:49:05 vgritsenko Exp $
0
public class PubsubUnboundedSource extends PTransform<PBegin, PCollection<PubsubMessage>> { static class PubsubReader extends UnboundedSource.UnboundedReader<PubsubMessage> { public PubsubMessage getCurrent() throws NoSuchElementException { return new PubsubMessage(current.elementBytes, current.attributes); static class PubsubSource extends UnboundedSource<PubsubMessage, PubsubCheckpoint> { public Coder<PubsubMessage> getDefaultOutputCoder() { private static class StatsFn extends DoFn<PubsubMessage, PubsubMessage> { public PCollection<PubsubMessage> expand(PBegin input) {
0
import org.apache.accumulo.core.data.TableId; public Path getFullPath(TableId tableId, String path) {
0
ServerConstants.getTablesDirs(context));
0
final SocketHolder socketHolder = ensureOpen(); final HttpRequest request = this.requestParser.parse(this.inbuffer, socketHolder.getInputStream()); final SocketHolder socketHolder = ensureOpen(); final HttpEntity entity = createIncomingEntity(request, this.inbuffer, socketHolder.getInputStream(), len); final SocketHolder socketHolder = ensureOpen(); this.responseWriter.write(response, this.outbuffer, socketHolder.getOutputStream()); final SocketHolder socketHolder = ensureOpen(); final OutputStream outstream = createContentOutputStream(len, this.outbuffer, socketHolder.getOutputStream(), entity.getTrailers());
0
import java.util.logging.Logger; import com.twitter.common.args.constraints.CanRead; import com.twitter.common.args.constraints.CanWrite; import com.twitter.common.args.constraints.Exists; import com.twitter.common.args.constraints.IsDirectory; private static final Logger LOG = Logger.getLogger(DbStorageModule.class.getName()); @Exists @CanRead @CanWrite @IsDirectory LOG.info("Using db storage path: " + dbFilePath);
0
package org.apache.felix.dm.annotation.api.dependency;
0
import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Collection; import java.util.List; @SuppressWarnings("rawtypes") } else if (obj instanceof Collection) { return encodeCollection((Collection) obj); } else if (obj.getClass().isArray()) { return encodeCollection(asCollection(obj)); private Collection<?> asCollection(Object arr) { // Arrays.asList() doesn't work for primitive arrays int len = Array.getLength(arr); List<Object> l = new ArrayList<>(len); for (int i=0; i<len; i++) { l.add(Array.get(arr, i)); } return l; } private String encodeCollection(Collection<?> collection) { StringBuilder sb = new StringBuilder("["); boolean first = true; for (Object o : collection) { if (first) first = false; else sb.append(','); sb.append(encode(o)); } sb.append("]"); return sb.toString(); } @SuppressWarnings({ "rawtypes", "unchecked" })
0
public class DMCommand {
0
import static org.apache.accumulo.fate.util.UtilWaitThread.sleepUninterruptibly;
1
return SimpleFilter.compareSubstring((List<String>) rhs, (String) lhs);
0
import org.apache.beam.dsls.sql.planner.BeamSqlRelUtils; import org.apache.beam.dsls.sql.schema.BeamSqlRecordType; import org.apache.beam.dsls.sql.schema.BeamSqlRow; @Override public PCollection<BeamSqlRow> buildBeamPipeline(PCollectionTuple inputPCollections) PCollection<BeamSqlRow> upstream = BeamSqlRelUtils.getBeamRelInput(input) BeamSqlRowComparator comparator = new BeamSqlRowComparator(fieldIndices, orientation, PCollection<List<BeamSqlRow>> rawStream = .setCoder(ListCoder.<BeamSqlRow>of(upstream.getCoder())); new SubListFn<BeamSqlRow>(startIndex, startIndex + count))) .setCoder(ListCoder.<BeamSqlRow>of(upstream.getCoder())); PCollection<BeamSqlRow> orderedStream = rawStream.apply( "flatten", Flatten.<BeamSqlRow>iterables()); orderedStream.setCoder(new BeamSqlRowCoder(BeamSqlRecordType.from(getRowType()))); private static class BeamSqlRowComparator implements Comparator<BeamSqlRow>, Serializable { public BeamSqlRowComparator(List<Integer> fieldsIndices, @Override public int compare(BeamSqlRow row1, BeamSqlRow row2) {
0
public static Object createValue(final String str, final Object obj) throws ParseException public static Object createValue(final String str, final Class<?> clazz) throws ParseException public static Object createObject(final String classname) throws ParseException public static Number createNumber(final String str) throws ParseException public static Class<?> createClass(final String classname) throws ParseException public static Date createDate(final String str) public static URL createURL(final String str) throws ParseException public static File createFile(final String str) public static File[] createFiles(final String str)
0
import java.util.UUID; public static void create(String sandboxName) { File.separatorChar + "storage" + File.separatorChar + sandboxName; File.separatorChar + "index" + File.separatorChar + sandboxName; public static void create() { // Append a suffix to isolate the database for each instance UUID uuid = UUID.randomUUID(); create(uuid.toString()); }
0
* * * * * * * * // unless offset it kept track of super(seekableInput, size); this.seekableInput = seekableInput; this.cb = cb; } * * *
0
import org.apache.ambari.server.security.authorization.ResourceType; EasyMock.expect(resourceTypeEntity.getName()).andReturn(ResourceType.AMBARI.name());
0
* @since 3.0
0
private static final long serialVersionUID = 7916641859064664263L;
0
* * @version $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
0
Assert.assertEquals(AccumuloConfiguration.getFixedMemoryAsBytes("64K"), plan.writeParameters.getBlockSize()); Assert.assertEquals(AccumuloConfiguration.getFixedMemoryAsBytes("256M"), plan.writeParameters.getHdfsBlockSize()); Assert.assertEquals(AccumuloConfiguration.getFixedMemoryAsBytes("32K"), plan.writeParameters.getIndexBlockSize());
1
interface Params { int cronSchedulerNumThreads(); String cronTimezone(); Amount<Long, Time> cronStartInitialBackoff(); Amount<Long, Time> cronStartMaxBackoff(); } private final Params params; public CronModule() { this.params = new Params() { @Override public int cronSchedulerNumThreads() { return NUM_THREADS.get(); } @Override public String cronTimezone() { return CRON_TIMEZONE.get(); } @Override public Amount<Long, Time> cronStartInitialBackoff() { return CRON_START_INITIAL_BACKOFF.get(); } @Override public Amount<Long, Time> cronStartMaxBackoff() { return CRON_START_MAX_BACKOFF.get(); } }; } new BackoffHelper(params.cronStartInitialBackoff(), params.cronStartMaxBackoff()))); TimeZone timeZone = TimeZone.getTimeZone(params.cronTimezone()); // Global per-JVM ID number generator for the provided Quartz Scheduler. private static final AtomicLong ID_GENERATOR = new AtomicLong(); Scheduler provideScheduler(AuroraCronJobFactory jobFactory) throws SchedulerException { props.setProperty( PROP_THREAD_POOL_PREFIX + ".threadCount", String.valueOf(params.cronSchedulerNumThreads()));
0
/* * $Header: /cvshome/build/ee.foundation/src/java/security/Key.java,v 1.6 2006/03/14 01:20:27 hargrave Exp $ * * (C) Copyright 2001 Sun Microsystems, Inc. * Copyright (c) OSGi Alliance (2001, 2005). All Rights Reserved. * * 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 java.security; public abstract interface Key extends java.io.Serializable { public abstract java.lang.String getAlgorithm(); public abstract byte[] getEncoded(); public abstract java.lang.String getFormat(); public final static long serialVersionUID = 6603384152749567654l; }
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableMap; import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Sets;
0
* Copyright 1999-2004 The Apache Software Foundation. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
public ColumnToClassMapping(Map<String,String> objectStrings, Class<? extends K> c) throws InstantiationException, IllegalAccessException, ClassNotFoundException, IOException { public ColumnToClassMapping(Map<String,String> objectStrings, Class<? extends K> c, String context) throws InstantiationException, IllegalAccessException, ClassNotFoundException, IOException { clazz = AccumuloVFSClassLoader.getContextManager().getClassLoader(context) .loadClass(className);
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.io.gcp.datastore; import org.apache.beam.sdk.io.gcp.datastore.V1Beta3.DatastoreReader; import org.apache.beam.sdk.io.gcp.datastore.V1Beta3.DatastoreSource; import org.apache.beam.sdk.io.gcp.datastore.V1Beta3.DatastoreWriter;
0
package aQute.bnd.service; import aQute.bnd.build.*; public interface LauncherPlugin { ProjectLauncher getLauncher(Project project) throws Exception; ProjectTester getTester(Project project); }
0
return WindowedValue::valueInGlobalWindow; return WindowedValue::getValue; return WindowedValue::valueInGlobalWindow; return WindowedValue::getValue;
0
package org.apache.accumulo.cloudtrace.instrument;
0
* This test reproduces the following race condition: * * A "Pojo" component depends on a required "MyDependency" service. * The Pojo also has a configuration dependency. * * Now, concurrently, the MyDependency is restarted and the configuration is updated. * This means that the Pojo is restarted and should also get notified for the configuration update. *
0
/** */ public class MethodUtilsTestCase extends TestCase { public MethodUtilsTestCase(String name) { public void setUp() { public static Test suite() { public void tearDown() { // ------------------------------------------------ Individual Test Methods public void testGetAccessibleMethod() { // test MethodUtils.getAccessibleMethod (TestBean.class, "setStringProperty", String.class); "setStringProperty", method.getName()); Modifier.isPublic(method.getModifiers())); (privateBeanFactory.create().getClass(), "methodBar", String.class); "methodBar", method.getName()); Modifier.isPublic(method.getModifiers())); (privateBeanFactory.createSubclass().getClass(), "methodBaz", String.class); "methodBaz", method.getName()); Modifier.isPublic(method.getModifiers())); public void testInvokeExactMethod() { // test MethodUtils.invokeExactMethod Object ret = MethodUtils.invokeExactMethod(bean, "setStringProperty", "TEST"); assertEquals("Method ONE was invoked", "TEST", bean.getStringProperty()); privateBeanFactory.create(), "methodBar", "ANOTHER TEST"); assertEquals("Method TWO was invoked correctly", "ANOTHER TEST", ret); privateBeanFactory.createSubclass(), "methodBaz", "YET ANOTHER TEST"); assertEquals("Method TWO was invoked correctly", "YET ANOTHER TEST", ret); }
0
/** Test UnboundedEventSource. */ return new GeneratorConfig(NexmarkConfiguration.DEFAULT, System.currentTimeMillis(), 0, n, 0); * Helper for tracking which ids we've seen (so we can detect dups) and confirming reading events * match the model events. * Check aggressively checkpointing and resuming a reader gives us exactly the same event stream * as reading directly.
1
* This class is Serializable from Commons Collections 3.1.</p> * Attempts to modify it will result in an UnsupportedOperationException.</p> * If the bag passed in is already unmodifiable, it is returned.</p> * @param <E> the type of the elements in the bag
0
Scope.Frame frame = script.createFrame(bean); throw xjexl.clean(); Scope.Frame frame = script.createFrame(bean, value); throw xjexl.clean(); throw xjexl.clean(); throw xjexl.clean(); protected Interpreter createInterpreter(JexlContext context, Scope.Frame frame) { throw new JexlException.Tokenization(jexlInfo, expression, xtme).clean(); throw new JexlException.Parsing(jexlInfo, expression, xparse).clean(); for (int s = 1; s < stack.length; ++s) {
0
import org.apache.accumulo.core.clientImpl.mapreduce.lib.OutputConfigurator; /** * This tests deprecated mapreduce code in core jar */ @Deprecated OutputConfigurator.setVisibilityCacheSize(job, JOB_VISIBILITY_CACHE_SIZE); AccumuloInputFormat.setZooKeeperInstance(job, ci.getInstanceName(), ci.getZooKeepers());
0
import static org.apache.ambari.server.controller.metrics.MetricsPaddingMethod.ZERO_PADDING_PARAM; import java.util.Map; import java.util.Set; import java.util.regex.Pattern;
0
public boolean isRegisterByteSizeObserverCheap(Instant value) { ORDER_PRESERVING_CONVERTER.convert(value)); Instant value, ElementByteSizeObserver observer) throws Exception { ORDER_PRESERVING_CONVERTER.convert(value), observer);
0
package org.apache.http.impl.execchain;
0
* <p>Returns the {@link Digester} that was set by the * {@link FactoryCreateRule} upon initialization. */ Digester getDigester(); /**
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
/* * List of fields of the implementation class. private Set<String> m_fields; public InnerClassAdapter(ClassVisitor arg0, String outerClass, Set<String> fields) { }
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
* 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
fail("should not get here"); fail("should not get here"); fail("should not get here");
0
import java.io.Serializable; public class OrderedDictionary extends Dictionary<String, Object> implements Map<String, Object>, Serializable { private static final long serialVersionUID = -525111601546803041L;
0
result.appendChild(super.getKeyInfo().getElement().cloneNode(true)); result.appendChild(super.getKeyInfo().getElement().cloneNode(true));
0
InputT, OutputT, RestrictionT, PositionT, TrackerT extends RestrictionTracker<RestrictionT, PositionT>>
0
import org.apache.commons.vfs.Capability; if (!isPreserveLastModified() && destFile.getFileSystem().hasCapability(Capability.SET_LAST_MODIFIED_FILE))
0
package aQute.bnd.osgi; import java.net.*; /** * Return a data uri from the JAR. The data must be less than 32k * * @param jar * The jar to load the data from * @param path * the path in the jar * @param mime * the mime type * @return a URI or null if conversion could not take place */ public URI getDataURI(String path, String mime, int max) throws Exception { Resource r = getResource(path); if (r.size() >= max || r.size() <= 0) return null; byte[] data = new byte[(int) r.size()]; DataInputStream din = new DataInputStream(r.openInputStream()); try { din.readFully(data); String encoded = Base64.encodeBase64(data); return new URI("data:" + mime + ";base64," + encoded); } finally { din.close(); } }
0
@ConsumerType @Deprecated
0
* ResponseDate is responsible for adding <code>Date<c/ode> header to the * outgoing responses. This interceptor is recommended for server side protocol * private static final HttpDateGenerator DATE_GENERATOR = new HttpDateGenerator(); public void process(final HttpResponse response, final HttpContext context) response.setHeader(HTTP.DATE_HEADER, httpdate);
0
.setJob(JobKeys.from("role", "test", job).newBuilder()) .setOwner(new Identity().setUser("owner"))
0
return propertyValue != null && compareValueTo(propertyValue) <= 0;
1
package org.apache.accumulo.tserver.mastermessage;
1
package org.apache.commons.jexl2; import org.apache.commons.jexl2.junit.Asserter;
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */
0
import org.apache.sshd.common.BaseBuilder; import org.apache.sshd.common.cipher.Cipher; import org.apache.sshd.common.mac.Mac; import org.apache.sshd.common.signature.Signature; List<? extends NamedResource> expected=BaseBuilder.DEFAULT_CIPHERS_PREFERENCE; List<? extends NamedResource> expected=BaseBuilder.DEFAULT_MAC_PREFERENCE; List<? extends NamedResource> expected=BaseBuilder.DEFAULT_SIGNATURE_PREFERENCE; List<? extends NamedResource> expected=BaseBuilder.DEFAULT_KEX_PREFERENCE;
0
ArgumentList alIn = upnpAct.getInputArgumentList(); ArgumentList alOut = upnpAct.getOutputArgumentList(); arg=alIn.getArgument(inArg[j]); arg = alOut.getArgument(outArg[j]);
0
* * * * * * * * * * * * * * * * * *
0
private Mark cachedMark = null; private AttributedCharacterIterator cachedACI = null; private TextHitInfo cachedHit = null; TextHitInfo textHit = layout.hitTestChar((float) (x+tx), (float) y, layout.getBounds()); if ((aci != cachedACI) || (textHit == null) || (textHit.getInsertionIndex() != cachedHit.getInsertionIndex())) { cachedMark = new BasicTextPainter.Mark(x, y, layout, textHit); cachedACI = aci; cachedHit = textHit; } // else old mark is still valid, return it. return cachedMark;
0
import java.util.concurrent.ExecutorService; import org.apache.sshd.git.AbstractGitCommandFactory; * Runs a GIT command locally using an embedded executor public class GitPgmCommandFactory extends AbstractGitCommandFactory { super(rootDir, delegate, GIT_COMMAND_PREFIX); } @Override public GitPgmCommandFactory withExecutorService(ExecutorService executorService) { return (GitPgmCommandFactory) super.withExecutorService(executorService); } @Override public GitPgmCommandFactory withShutdownOnExit(boolean shutdownOnExit) { return (GitPgmCommandFactory) super.withShutdownOnExit(shutdownOnExit); public GitPgmCommand createGitCommand(String command) { return new GitPgmCommand(getRootDir(), command.substring(GIT_COMMAND_PREFIX.length()), getExecutorService(), isShutdownOnExit());
0
import java.math.BigDecimal; import java.math.BigInteger; import org.apache.commons.collections.Predicate; import org.apache.commons.collections.iterators.FilterIterator; * @version $Id: AbstractConfiguration.java,v 1.7 2004/03/09 10:31:31 epugh Exp $ return new SubsetConfiguration(this, prefix, "."); public Iterator getKeys(final String prefix) { return new FilterIterator(getKeys(), new Predicate() { public boolean evaluate(Object obj) { boolean matching = false; if (obj instanceof String) { String key = (String) obj; matching = key.startsWith(prefix + ".") || key.equals(prefix); } return matching; });
0
if (utilizedAttributes == Collections.<XMLSecAttribute>emptyList()) { if (utilizedAttributes == Collections.<XMLSecAttribute>emptyList()) {
1
if (this.value == null) { } else { int len = this.name.length() + 1 + this.value.length();
0
import java.util.List; * @version CVS $Id$ } else { List list = (List) request.getAttribute("org.apache.cocoon.portal." + parameterName); if (list != null) { Event[] events = (Event[]) list.toArray(new Event[0]); final Publisher publisher = context.getEventPublisher(); for (int i = 0; i < events.length; i++) { publisher.publish(events[i]); } }
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.sshd.client; import java.net.InetSocketAddress; import java.net.SocketAddress; /** * A simple socket address holding the host name and port number. * * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> */ public class SshdSocketAddress extends SocketAddress { private final String hostName; private final int port; public SshdSocketAddress(String hostName, int port) { this.hostName = hostName; this.port = port; } public String getHostName() { return hostName; } public int getPort() { return port; } public InetSocketAddress toInetSocketAddress() { return new InetSocketAddress(hostName, port); } }
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 com.google.inject.Guice; import com.google.inject.Inject; import com.google.inject.Injector; import org.apache.ambari.server.orm.GuiceJpaInitializer; import org.apache.ambari.server.orm.InMemoryDefaultTestModule; import org.junit.Before; Injector injector; @Inject StageFactory stageFactory; @Before public void setup() throws Exception { injector = Guice.createInjector(new InMemoryDefaultTestModule()); injector.getInstance(GuiceJpaInitializer.class); injector.injectMembers(this); } final Stage stage = stageFactory.createNew((long) 1, "/tmp", "cluster1", (long) 978, "context", CLUSTER_HOST_INFO,
0
import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.persist.PersistService; import org.apache.ambari.server.AmbariException; import org.apache.ambari.server.orm.GuiceJpaInitializer; import org.apache.ambari.server.orm.InMemoryDefaultTestModule; import org.apache.ambari.server.state.*; import org.junit.After; import org.junit.Before; private Injector injector; private Clusters clusters; @Before public void setup() throws AmbariException{ injector = Guice.createInjector(new InMemoryDefaultTestModule()); injector.getInstance(GuiceJpaInitializer.class); clusters = injector.getInstance(Clusters.class); } @After public void teardown() throws AmbariException { injector.getInstance(PersistService.class).stop(); } public void testHostInfoImport() throws AmbariException{ clusters.addHost("foo"); Host host = clusters.getHost("foo"); private void registerHost(Host host) throws Exception { private void ensureHostUpdatesReceived(Host host) throws Exception { private void verifyHostState(Host host, HostState state) { private void sendHealthyHeartbeat(Host host, long counter) private void sendUnhealthyHeartbeat(Host host, long counter) private void timeoutHost(Host host) throws Exception { public void testHostFSMInit() throws AmbariException{ clusters.addHost("foo"); Host host = clusters.getHost("foo"); clusters.addHost("foo"); Host host = clusters.getHost("foo"); clusters.addHost("foo"); Host host = clusters.getHost("foo"); clusters.addHost("foo"); Host host = clusters.getHost("foo");;
0
private final ZooKeeperServer zks; private final LinkedBlockingQueue<Request> queuedRequests = new LinkedBlockingQueue<Request>(); private final RequestProcessor nextProcessor; private Thread snapInProcess = null; private final LinkedList<Request> toFlush = new LinkedList<Request>(); private final Random r = new Random(System.nanoTime()); private final Request requestOfDeath = Request.requestOfDeath; RequestProcessor nextProcessor) { * used by tests to check for changing int logCount = 0; // we do this in an attempt to ensure that not all of the servers // in the ensemble take a snapshot at the same time // track the number of records written to the log if (zks.getLogWriter().append(si)) { } else { public void run() { try { zks.takeSnapshot(); } catch(Exception e) { LOG.warn("Unexpected exception", e); } } }; } else if (toFlush.isEmpty()) { // optimization for read heavy workloads // iff this is a read, and there are no pending // flushes (writes), then just pass this to the next // processor nextProcessor.processRequest(si); if (nextProcessor instanceof Flushable) { ((Flushable)nextProcessor).flush(); } continue; } if (toFlush.isEmpty()) while (!toFlush.isEmpty()) {
0
return TabletLocator.getLocator((ClientContext) client, tableId); Scanner scanner = context.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
0
cacheDereferencedElement(input); XMLSignatureInput output = this.getContentsAfterTransformation(input, os); this.transformsOutput = output;
0
import java.util.Collection;
0
.into(TypeDescriptors.kvs(TypeDescriptors.strings(), TypeDescriptors.integers())) .via((GameActionInfo gInfo) -> KV.of(gInfo.getKey(field), gInfo.getScore())))
0
return SparkExecutor .newBuilder(EuphoriaSparkTrends.class.getSimpleName(), conf) .build();
0
@SuppressWarnings("serial") @SuppressWarnings("serial") @SuppressWarnings("serial")
0
@SuppressWarnings("rawtypes")
0
package org.apache.felix.bundleplugin;
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
final TabletGroupWatcher dependentWatcher; TabletGroupWatcher(TabletStateStore store, TabletGroupWatcher dependentWatcher) { this.dependentWatcher = dependentWatcher; // if we are shutting down all the tabletservers, we have to do it in order if (goal == TabletGoalState.UNASSIGNED && state == TabletState.HOSTED) { if (serversToShutdown.equals(currentTServers.keySet())) { if (dependentWatcher != null && dependentWatcher.assignedOrHosted() > 0) { goal = TabletGoalState.HOSTED; } } } private int assignedOrHosted() { int result = 0; for (TableCounts counts : stats.getLast().values()) { result += counts.assigned() + counts.hosted(); } return result; } watchers.add(new TabletGroupWatcher(stores[2], null)); watchers.add(new TabletGroupWatcher(stores[1], watchers.get(0))); watchers.add(new TabletGroupWatcher(stores[0], watchers.get(1)));
0
protected String configuration; /** The logging category. */ protected String category; String loggerConfig = this.configuration; String loggingCategory = this.category; if ( loggingCategory == null ) { loggingCategory = "cocoon"; } this.logger = loggerManager.getLoggerForCategory(loggingCategory); public void setConfiguration(String loggingConfiguration) { this.configuration = loggingConfiguration; public void setCategory(String category) { this.category = category; }
0
executorCore.executePendingTask(driver, taskInfo, task.getTaskId());
0
package org.apache.commons.digester3.examples.api.catalog;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/share/org/apache/commons/validator/Validator.java,v 1.18 2003/05/20 00:19:10 dgraham Exp $ * $Revision: 1.18 $ * $Date: 2003/05/20 00:19:10 $ * @version $Revision: 1.18 $ $Date: 2003/05/20 00:19:10 $ * Logger. * @param resources <code>ValidatorResources</code> to use during validation. * @param resources <code>ValidatorResources</code> to use during validation. * @param formName Key used for retrieving the set of validation rules. * @param key The full class name of the parameter of the validation method * that corresponds to the value/instance passed in with it. * @param value The instance that will be passed into the validation method. * @param key The full class name of the parameter of the validation method * that corresponds to the value/instance passed in with it. * Gets the form name which is the key to a set of validation rules. * Sets the form name which is the key to a set of validation rules. * Gets the page. This in conjunction with the page property of * a <code>Field<code> can control the processing of fields. If the field's * page is less than or equal to this page value, it will be processed. * Sets the page. This in conjunction with the page property of * a <code>Field<code> can control the processing of fields. If the field's page * is less than or equal to this page value, it will be processed. return this.getClass().getClassLoader(); * @return The <code>Map</code> returned uses the property of the * <code>Field</code> for the key and the value is the number of error the * field had. * object is <code>null</code> and <code>true</code> if it isn't.
0
log.debug("New tablet servers noticed: " + added); log.debug("Tablet servers removed: " + deleted);
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
// TODO: infer a fixed id from the name String.valueOf(ctx.getCurrentTopologicalId()), input.isBounded(), final RunnerApi.PCollection input = pipeline.getComponents().getPcollectionsOrThrow(inputId); final PCollection.IsBounded isBounded = SamzaPipelineTranslatorUtils.isBounded(input); // TODO: infer a fixed id from the name String.valueOf(ctx.getCurrentTopologicalId()), isBounded,
0
@Override @Override
0
import org.apache.ambari.server.audit.AuditLogger; bind(AuditLogger.class).toInstance(createNiceMock(AuditLogger.class));
1
package org.apache.commons.net.io; * @version $Id: CopyStreamListener.java,v 1.10 2004/06/29 04:54:31 dfs Exp $
0
import org.apache.hadoop.conf.Configuration; public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) {
0
ClientContext context = (ClientContext) client; log.debug("Created client with user: " + context.whoami()); scanner = context.createBatchScanner(baseSplit.getTableName(), authorizations, return InputConfigurator.binOffline(tableId, ranges, (ClientContext) client); ClientContext context = (ClientContext) client;
0
import com.google.common.base.Preconditions; private volatile boolean closed = false; Preconditions.checkState(!closed); Preconditions.checkState(!closed); Preconditions.checkState(!closed); Preconditions.checkState(!closed); public void close() { closed = true; } Preconditions.checkState(!closed); Preconditions.checkState(!closed);
0
number = parse(type, stringValue, format); String msg = toString(getClass()) + " cannot handle conversion to '" + toString(type) + "'"; if (log().isWarnEnabled()) { log().warn(" " + msg); } throw new ConversionException(msg); String msg = toString(getClass()) + " cannot handle conversion from String to '" + toString(type) + "'"; if (log().isWarnEnabled()) { log().warn(" " + msg); } throw new ConversionException(msg); * @param type The type to convert the value to private Number parse(Class type, String value, NumberFormat format) { String msg = "Error converting to '" + toString(type) + "'"; if (locale != null) { msg += " for locale=[" + locale + "]"; }
0
* $HeadURL$
0