Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
package org.apache.beam.sdk.coders; import org.apache.beam.sdk.values.TypeDescriptor;
0
package org.w3c.dom.svg; public interface SVGAnimateTransformElement extends SVGAnimationElement { }
1
private void validateLockForTasks(Optional<ILock> lock, Iterable<IScheduledTask> tasks) throws LockException { ImmutableSet<IJobKey> uniqueKeys = FluentIterable.from(tasks) .transform(Tasks.SCHEDULED_TO_JOB_KEY) .toSet(); // Validate lock against every unique job key derived from the tasks. for (IJobKey key : uniqueKeys) { lockManager.validateIfLocked(ILockKey.build(LockKey.job(key.newBuilder())), lock); } } private SessionContext validateSessionKeyForTasks( SessionKey session, TaskQuery taskQuery, Iterable<IScheduledTask> tasks) throws AuthFailedException { public Response killTasks(final TaskQuery query, Lock mutablelock, SessionKey session) { Set<IScheduledTask> tasks = Storage.Util.consistentFetchTasks(storage, Query.arbitrary(query)); context = Optional.of(validateSessionKeyForTasks(session, query, tasks)); validateLockForTasks(Optional.fromNullable(mutablelock).transform(ILock.FROM_BUILDER), tasks); } catch (LockException e) { return response.setResponseCode(INVALID_REQUEST).setMessage(e.getMessage());
0
* @version $Revision: 1.7 $ $Date: 2004/06/02 22:12:14 $ public String getCompatibilityVersion() { return "3.1"; } // public void testCreate() throws Exception { // resetEmpty(); // writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/UnmodifiableSortedSet.emptyCollection.version3.1.obj"); // resetFull(); // writeExternalFormToDisk((java.io.Serializable) collection, "D:/dev/collections/data/test/UnmodifiableSortedSet.fullCollection.version3.1.obj"); // } }
0
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
0
import org.apache.cocoon.xml.AttributesImpl; /** The Cocoon core. */ protected Core core; } this.core = (Core)this.manager.lookup(Core.ROLE); this.manager.release(this.core); this.core = null; atts.addCDATAAttribute(namespace, "date", dateTime); atts.addCDATAAttribute(namespace, "host", localHost); atts.addCDATAAttribute(namespace, "cocoon-version", Constants.VERSION); dateTime = DateFormat.getDateTimeInstance().format(new Date(this.core.getSettings().getCreationTime())); atts.addCDATAAttribute(namespace, "creation-time", dateTime);
0
* Copyright (c) 2001-2006 The Apache Software Foundation. All rights * @author rwinston <rwinston@apache.org> return (String[]) list.toArray(new String[list.size()]);
0
log.debug("Initializing input split: " + baseSplit); throw new IllegalArgumentException("Can not initialize from " + baseSplit.getClass());
0
* <code>ResultSetHandler</code> implementation that converts the first * * The RowProcessor implementation to use when converting rows /** * /** * * @param convert The <code>RowProcessor</code> implementation * @return An initialized JavaBean or <code>null</code> if there were no *
0
public ClientParamsStack(final HttpParams aparams, final HttpParams cparams, final HttpParams rparams, final HttpParams oparams) { public ClientParamsStack(final ClientParamsStack stack) { public ClientParamsStack(final ClientParamsStack stack, final HttpParams aparams, final HttpParams cparams, final HttpParams rparams, final HttpParams oparams) { public Object getParameter(final String name) { public HttpParams setParameter(final String name, final Object value) public boolean removeParameter(final String name) {
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
* @version CVS $Id: CellType.java,v 1.3 2003/08/20 17:29:07 joerg Exp $ public class CellType { public static final int CELL_TYPE_FORMULA = -1; private CellType() { public static boolean isValid(final int val) { switch (val) { case CELL_TYPE_FORMULA : static int convertCellType(final int val) { switch (val) { case CELL_TYPE_FORMULA : return HSSFCell.CELL_TYPE_FORMULA;
0
public final static short MAX_ACC_FLAG = ACC_STRICT; "volatile", "transient", "native", "interface", "abstract", "strictfp"
0
* Obtains a non <b>null</b> {@code FileLocationStrategy} object from the * passed in {@code FileLocator}. If the {@code FileLocator} is not * <b>null</b> and has a {@code FileLocationStrategy} defined, this strategy * is returned. Otherwise, result is the default * {@code FileLocationStrategy}. * * @param locator the {@code FileLocator} * @return the {@code FileLocationStrategy} for this {@code FileLocator} */ static FileLocationStrategy obtainLocationStrategy(FileLocator locator) { return (locator != null) ? ObjectUtils.defaultIfNull( locator.getLocationStrategy(), DEFAULT_LOCATION_STRATEGY) : DEFAULT_LOCATION_STRATEGY; } /**
0
dm.add(createComponent()
0
/** * Mark the sub-trigger at {@code index} as never-started. If the sub-trigger wasn't finished, * clears any associated state. * * @param compositeContext the context that the parent trigger was executing in. * @param index the index of the sub-trigger to affect. * @param window the window that the trigger is operating in. */ public void reset(TriggerContext<W> compositeContext, int index, W window) throws Exception { // If it wasn't finished, the trigger may have state associated with it. Clear that up. if (!isFinished.get(index)) { subTriggers.get(index).clear(compositeContext.forChild(index), window); } isFinished.clear(index); flush(); }
0
Random random = Utils.getRandomizerInstance();
0
/* * Copyright 2016-2018 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. */ public void setScanIterators(int priority, String iteratorClass, String iteratorName) {} public void addScanIterator(IteratorSetting cfg) {} public void setScanIteratorOption(String iteratorName, String key, String value) {} public void updateScanIteratorOption(String iteratorName, String key, String value) {} public void setupRegex(String iteratorName, int iteratorPriority) throws IOException {} public void setRowRegex(String regex) {} public void setColumnFamilyRegex(String regex) {} public void setColumnQualifierRegex(String regex) {} public void setValueRegex(String regex) {} public void fetchColumnFamily(Text col) {} public void fetchColumn(Text colFam, Text colQual) {} public void clearColumns() {} public void clearScanIterators() {} public void setTimeOut(int timeOut) {} public void setRange(Range range) {} public Iterator<Entry<Key,Value>> iterator() {
0
public void execute(Storage.MutableStoreProvider storeProvider) { public void execute(Storage.MutableStoreProvider storeProvider) {
0
import org.apache.accumulo.test.functional.FunctionalTestUtils; import org.junit.After; @After public void checkForDanglingFateLocks() { FunctionalTestUtils.assertNoDanglingFateLocks(getConnector().getInstance(), getCluster()); }
0
package org.apache.felix.obr.plugin;
0
StringBuilder w = new StringBuilder(command.size() * Integer.SIZE);
0
lock.notifyAll();
0
import java.util.ArrayList; import org.apache.accumulo.server.cli.ClientOpts; import com.beust.jcommander.Parameter; static class Opts extends ClientOpts { @Parameter(description="<logfile> { <logfile> ...}") List<String> logFiles = new ArrayList<String>(); } Opts opts = new Opts(); opts.parseArgs(IndexMeta.class.getName(), args); AccumuloOutputFormat.setZooKeeperInstance(job.getConfiguration(), opts.instance, opts.zookeepers); AccumuloOutputFormat.setOutputInfo(job.getConfiguration(), opts.user, opts.getPassword(), false, null); Connector conn = opts.getConnector();
0
import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.everyItem; import static org.hamcrest.Matchers.isIn; import org.apache.beam.sdk.testing.CombineFnTester; import org.hamcrest.Matchers; @Test public void testCombineFn() { CombineFnTester.testCombineFn( Sample.<String>combineFn(limit), lines, allOf( Matchers.<String>iterableWithSize(Math.min(lines.size(), limit)), everyItem(isIn(lines)))); }
0
private final PipelineOptions pipelineOptions; public Provider(PipelineOptions pipelineOptions) { this.pipelineOptions = pipelineOptions; } pipelineOptions, loggingServer, controlServer, clientPool.getSource());
0
package org.apache.ambari.resource.statemachine; public interface Role extends LifeCycle { public RoleState getRoleState(); public String getRoleName(); public Service getAssociatedService(); }
0
package org.apache.http.entity.mime.content; import org.apache.http.entity.mime.MIME;
0
expectNew(ZooKeeperInstance.class, new Class<?>[] {ClientConfiguration.class}, clientConf).andReturn(theInstance); expectNew(ZooKeeperInstance.class, new Class<?>[] {ClientConfiguration.class}, clientConf).andReturn(theInstance);
0
import org.apache.sshd.common.PtyMode; import org.apache.sshd.util.BaseTest; import org.junit.Test;
0
import org.apache.cocoon.deployer.applicationserver.MonolithicServer23; MonolithicServer23 zipExtractor = new MonolithicServer23(basedir, logger); zipExtractor.addRule("**legacy**.xconf", new SingleFileDeployer("WEB-INF/xconf")); zipExtractor.addRule("**legacy**.xmap", new SingleFileDeployer("WEB-INF/sitemap-additions")); for(Iterator it = libraries.keySet().iterator(); it.hasNext();) { File lib = (File) libraries.get(it.next());
0
public void testReductionType0() { public void testEventTime() { public void testReduceWithWindowing() { public void testReduceWithoutWindowing() { public void testMergingAndTriggering() { public void testSessionWindowing() { public void testElementTimestamp() { public void testElementTimestampEarlyTriggeredStreaming() {
0
props.put("instance.name","empty-1"); props.put("instance.name","client"); props2.put("instance.name","provider"); props.put("instance.name","client"); props2.put("instance.name","provider"); props.put("instance.name","client"); props2.put("instance.name","provider"); p.put("instance.name","empty2"); props.put("instance.name","client"); props2.put("instance.name","provider"); p.put("instance.name","empty2"); props.put("instance.name","client"); props2.put("instance.name","provider"); p.put("instance.name","empty2"); props.put("instance.name","client"); props2.put("instance.name","provider"); p.put("instance.name","empty2"); props.put("instance.name","client"); props2.put("instance.name","provider");
0
int localPort = server.getConnectors()[0].getLocalPort();
0
throws JellyException {
0
import org.apache.http.HttpRequestInterceptor; import org.apache.http.HttpResponseInterceptor; import org.apache.http.protocol.HttpProcessor; import org.apache.http.protocol.ImmutableHttpProcessor; HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] { new ResponseDate(), new ResponseServer(), new ResponseContent(), new ResponseConnControl() }); HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] { new RequestContent(), new RequestTargetHost(), new RequestConnControl(), new RequestUserAgent(), new RequestExpectContinue()});
0
import java.nio.file.Files; import java.nio.file.LinkOption; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.GroupPrincipal; import java.nio.file.attribute.PosixFileAttributeView; import java.nio.file.attribute.PosixFileAttributes; import java.nio.file.attribute.PosixFilePermission; import java.nio.file.attribute.UserPrincipal; import java.util.Map; import java.util.Set;
0
import javax.xml.bind.JAXBException; import javax.xml.bind.UnmarshalException; import org.xml.sax.SAXParseException; String configType = ConfigHelper.fileNameToConfigType(configFile.getName()); ConfigurationXml config = null; config = unmarshaller.unmarshal(ConfigurationXml.class, configFile); String error = null; if (e instanceof JAXBException || e instanceof UnmarshalException || e instanceof SAXParseException) { error = "Could not parse XML " + configFile + ": " + e; } else { error = "Could not load configuration for " + configFile; } config = new ConfigurationXml(); config.setValid(false); config.setErrors(error); ConfigurationInfo configInfo = new ConfigurationInfo(parseProperties(config, configFile.getName()), parseAttributes(config)); configInfo.setValid(false); configInfo.setErrors(error); ConfigurationModule module = new ConfigurationModule(configType, configInfo); configurationModules.put(configType, module);
0
.setShardId(2) .setName(MesosTaskFactoryImpl.EXECUTOR_NAME) .setSource(MesosTaskFactoryImpl.getSourceName(TASK.getTask()))
0
import java.io.Serializable; public interface FieldValueSetter<ObjectT, ValueT> extends Serializable {
0
else if ( dto.state == ComponentConfigurationDTO.ACTIVE ) { dto.service = serviceReferenceToDTO(manager.getRegisteredServiceReference()); }
0
public void accept( final Visitor v ) {
0
import java.util.Iterator; import java.util.concurrent.atomic.AtomicBoolean; /** * Tests an append operation with a system configuration while system * properties are modified from another thread. This is related to * CONFIGURATION-570. */ @Test public void testAppendWhileConcurrentAccess() throws InterruptedException { final AtomicBoolean stop = new AtomicBoolean(); final String property = SystemConfiguration.class.getName() + ".testProperty"; Thread t = new Thread() { @Override public void run() { boolean setValue = true; while (!stop.get()) { if (setValue) { System.setProperty(property, "true"); } else { System.clearProperty(property); } setValue = !setValue; } } }; try { t.start(); SystemConfiguration config = new SystemConfiguration(); PropertiesConfiguration props = new PropertiesConfiguration(); props.append(config); stop.set(true); t.join(); for (Iterator<String> keys = config.getKeys(); keys.hasNext();) { String key = keys.next(); if (!property.equals(key)) { assertEquals("Wrong value for " + key, config.getString(key), props.getString(key)); } } } finally { System.clearProperty(property); } }
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. */ package org.apache.cocoon.forms.event; import org.apache.cocoon.forms.formmodel.Widget; import org.apache.cocoon.forms.formmodel.ImageMap; /** * Currently this event originates from a {@link org.apache.cocoon.forms.formmodel.ImageMap} * widget. * */ public class ImageMapEvent extends ActionEvent { public ImageMapEvent(Widget source, String actionCommand) { super(source, actionCommand); } public int getX() { return ((ImageMap)(source)).getX(); } public int getY() { return ((ImageMap)(source)).getY(); } }
0
private EnumerationUtils() {}
0
// otherwise acquire the service try { service = m_componentManager.getActivator().getBundleContext().getService( serviceReference ); } catch ( IllegalStateException ise ) { // caused by getService() called on invalid bundle context // or if there is a service reference cycle involving service // factories ! m_componentManager.log( LogService.LOG_ERROR, "Failed getting service {0} ({1}/{2,number,#})", new Object[] { m_dependencyMetadata.getName(), m_dependencyMetadata.getInterface(), serviceReference.getProperty( Constants.SERVICE_ID ) }, ise ); service = null; } // keep the service for latter ungetting // return the acquired service (may be null of course)
0
import org.apache.accumulo.core.replication.ReplicationTable; import org.apache.accumulo.server.replication.ReplicationUtil; String expectedQueueKey = p.getName() + DistributedWorkQueueWorkAssignerHelper.KEY_SEPARATOR + target.getPeerName() + DistributedWorkQueueWorkAssignerHelper.KEY_SEPARATOR + target.getRemoteIdentifier() + DistributedWorkQueueWorkAssignerHelper.KEY_SEPARATOR + target.getSourceTableId(); ReplicationUtil.createReplicationTable(conn); ReplicationUtil.createReplicationTable(conn); ReplicationUtil.createReplicationTable(conn);
0
import org.apache.aurora.scheduler.cron.CronException; import org.apache.aurora.scheduler.cron.CronJobManager; import org.apache.aurora.scheduler.cron.CrontabEntry; import org.apache.aurora.scheduler.cron.SanitizedCronJob; private static final JobConfiguration CRON_JOB = makeJob().setCronSchedule("* * * * *"); cronJobManager.updateJob(anyObject(SanitizedCronJob.class)); cronJobManager.updateJob(anyObject(SanitizedCronJob.class)); expectLastCall().andThrow(new CronException("Nope")); expect(cronPredictor.predictNextRun(CrontabEntry.parse(CRON_SCHEDULE)))
0
import org.apache.hc.core5.http.Header; import org.apache.hc.core5.http.HttpHost; import org.apache.hc.core5.http.HttpRequest; import org.apache.hc.core5.http.HttpVersion; import org.apache.hc.core5.http.message.BasicHeader; import org.apache.hc.core5.http.message.BasicHttpRequest;
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 java.util.ArrayList; import org.osgi.resource.Capability; import org.osgi.service.resolver.HostedCapability; import org.osgi.service.resolver.ResolveContext; public class ShadowList extends CandidateSelector public static ShadowList createShadowList(CandidateSelector original) { return new ShadowList(original); } private final List<Capability> m_original; private ShadowList(CandidateSelector original) m_original = new ArrayList<Capability>(original.getRemainingCandidates()); private ShadowList(CandidateSelector shadow, List<Capability> original) super(shadow); m_original = original; public ShadowList copy() { return new ShadowList(this, m_original); } public void insertHostedCapability(ResolveContext context, HostedCapability wrappedCapability, HostedCapability toInsertCapability) { checkModifiable(); int removeIdx = m_original.indexOf(toInsertCapability.getDeclaredCapability()); if (removeIdx != -1) { m_original.remove(removeIdx); unmodifiable.remove(removeIdx); } int insertIdx = context.insertHostedCapability(m_original, toInsertCapability); unmodifiable.add(insertIdx, wrappedCapability); } public void replace(Capability origCap, Capability c) { checkModifiable(); int idx = unmodifiable.indexOf(origCap); unmodifiable.set(idx, c); }
0
package org.apache.beam.sdk.extensions.sql.interpreter.operator.math; import org.apache.beam.sdk.extensions.sql.interpreter.operator.BeamSqlExpression; import org.apache.beam.sdk.extensions.sql.interpreter.operator.BeamSqlPrimitive;
0
timelineMetrics = requestHelper.fetchTimelineMetrics(uriBuilder, temporalInfo.getStartTimeMillis(), temporalInfo.getEndTimeMillis());
0
* @version $Revision: 1.38 $ $Date: 2004/07/11 16:51:34 $ * * <p><strong>BasicDataSource does NOT support this method.</strong></p> // This method isn't supported by the PoolingDataSource returned by // the createDataSource throw new UnsupportedOperationException("Not supported by BasicDataSource"); // return createDataSource().getConnection(username, password);
0
* any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * permission of the Apache Software Foundation.
0
DefaultTrigger.of(), DefaultTrigger.of(), DefaultTrigger.of(),
0
/** * Returns a transform for writing to text files that adds a header string to the files * it writes. * *<p> A <code>null</code> value will clear any previously configured header.</p> * * @param header the string to be added as file header */ /** * Returns a transform for writing to text files that adds a footer string to the files * it writes. * *<p> A <code>null</code> value will clear any previously configured footer.</p> * * @param footer the string to be added as file footer */
0
import org.apache.accumulo.test.constraints.AlphaNumKeyConstraint;
0
this._constructionElement.setAttributeNS(null, Constants._ATT_ID, Id); return this._constructionElement.getAttributeNS(null, Constants._ATT_ID); this._constructionElement.setAttributeNS(null, Constants._ATT_MIMETYPE, return this._constructionElement.getAttributeNS(null, Constants._ATT_MIMETYPE); this._constructionElement.setAttributeNS(null, Constants._ATT_ENCODING, return this._constructionElement.getAttributeNS(null, Constants._ATT_ENCODING);
0
import java.util.Objects; this.redirector = Objects.requireNonNull(redirector);
0
@SuppressWarnings("all") public enum TableOperation implements org.apache.thrift.TEnum {
0
import org.apache.ambari.server.api.services.AmbariMetaInfo; servicesUpCheck.ambariMetaInfo = new Provider<AmbariMetaInfo>() { @Override public AmbariMetaInfo get() { return Mockito.mock(AmbariMetaInfo.class); } }; PrerequisiteCheck check = new PrerequisiteCheck(null, null); check = new PrerequisiteCheck(null, null);
0
workerPool.setKind(options.getWorkerPoolType()); disk.setDiskType(options.getWorkerDiskType());
0
* </p> * </p> * </p>
0
/* * Copyright 2002-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.vfs.impl; import org.apache.commons.vfs.FileName; import org.apache.commons.vfs.provider.AbstractFileName; /** * A simple Filename to hold the scheme for to be created virtual filesytsem. * * @author imario@apache.org * @version $Revision$ $Date$ */ public class VirtualFileName extends AbstractFileName { public VirtualFileName(final String rootUri, final String scheme, final String absPath) { super(rootUri, scheme, absPath); } public FileName createName(String rootURI, String absPath) { return new VirtualFileName(rootURI, getScheme(), absPath); } protected void appendRootUri(StringBuffer buffer) { buffer.append(getScheme()); } }
0
import org.apache.hc.client5.http.utils.ByteArrayBuilder;
0
PCollection<KV<String, Iterable<Integer>>> grouped = input.apply(GroupByKey.create());
0
} catch (IOException | HttpException ex) {
0
* Autogenerated by Thrift Compiler (0.12.0) @javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") @org.apache.thrift.annotation.Nullable
0
headerTableSize, pushEnabled, maxConcurrentStreams, initialWindowSize > 0 ? initialWindowSize : 65535, maxFrameSize, maxHeaderListSize);
0
DelayedProvider dp = new DelayedProvider(provider, 1000);
0
package com.twitter.mesos.scheduler; import com.twitter.mesos.gen.JobConfiguration; /** * Stores job configuration data. * * @author jsirois */ public interface JobStore { /** * Fetches all {@code JobConfiguration}s for jobs owned th the {@link JobManager} identified by * {@code managerId}; if there are none then an empty set is returned. * * @param managerId The unique identifier of the {@link JobManager} to find registered jobs for. * @return the set of job configurations owned by the specififed job manager */ Iterable<JobConfiguration> fetchJobs(String managerId); /** * Saves the job configuration for a job that has been accepted by the scheduler. * * @param managerId The unique id of the {@link JobManager} that accepted the job. * @param jobConfig The configuration of the accepted job. */ void saveAcceptedJob(String managerId, JobConfiguration jobConfig); /** * Deletes the job configuration for the job identified by {@code jobKey}. If there is no stored * configuration for the identified job, this method returns silently. * * @param jobKey the key identifying the job to delete. */ void deleteJob(String jobKey); }
0
import org.apache.ambari.view.commons.exceptions.NotFoundFormattedException; import org.apache.ambari.view.commons.exceptions.ServiceFormattedException; import org.apache.ambari.view.commons.hdfs.HdfsService; public class FilePreviewService extends HdfsService {
0
import java.io.BufferedInputStream; import org.apache.sshd.client.channel.ChannelShell; import org.fusesource.jansi.AnsiConsole; import org.slf4j.impl.SimpleLogger; int level = 1; } else if (args[i].equals("-v")) { level++; System.out.println(" -v raise verbosity"); SimpleLogger.setLevel(level); channel.setIn(System.in); ((ChannelShell) channel).setupSensibleDefaultPty(); } channel.setOut(AnsiConsole.wrapOutputStream(System.out)); channel.setErr(AnsiConsole.wrapOutputStream(System.err));
0
final ResourcePatternResolver resolver = (ResourcePatternResolver) resourceLoader;
0
// discard 100-continue response = null;
0
import com.google.common.collect.ContiguousSet; import com.google.common.collect.DiscreteDomain; import com.google.common.collect.Range; import com.google.gson.Gson; import com.google.inject.Guice; import com.google.inject.Injector; import org.apache.ambari.server.security.encryption.CredentialStoreService; import javax.persistence.EntityManager; import javax.xml.bind.JAXBException; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.InetAddress; import java.net.UnknownHostException; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; import static org.easymock.EasyMock.anyObject; import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.expectLastCall; import static org.easymock.EasyMock.getCurrentArguments; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; bind(CredentialStoreService.class).toInstance(createNiceMock(CredentialStoreService.class));
0
package org.apache.commons.ognl.test.objects;
0
throw new IllegalStateException("telnetd is already running on port " + port); InetAddress addr = "".equals(ip) ? null : InetAddress.getByName(ip); server = new ServerSocket(port, 0, addr); thread = new Thread(this, "Gogo telnet");
0
import com.google.common.collect.Multimap; Map<String, Collection<ServiceConfigVersionResponse>> activeServiceConfigVersions = activeServiceConfigVersions.get("MAPREDUCE").iterator().next(); mapredResponse = activeServiceConfigVersions.get("MAPREDUCE").iterator().next(); mapredResponse = activeServiceConfigVersions.get("MAPREDUCE").iterator().next(); Map<String, Collection<ServiceConfigVersionResponse>> activeServiceConfigVersions = }
0
/** * Set the page request information for this query. * * @param pageRequest the page request information */ public void setPageRequest(PageRequest pageRequest);
0
if ( ref.getParameterIndex() != null && !parIndexSet.add(ref.getParameterIndex()) ) throw validationFailure( "Duplicate reference for argument " + ref.getParameterIndex() + " in constructor" ); if ( ref.getParameterIndex() != null )
0
import com.google.api.services.bigquery.model.TableRow; import java.util.Arrays; import java.util.List;
0
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkArgument;
0
import org.apache.ambari.logsearch.common.PropertiesHelper; import org.apache.ambari.logsearch.util.JSONUtil; String solrUrl = PropertiesHelper.getProperty("logsearch.solr.url"); String zkConnectString = PropertiesHelper.getProperty("logsearch.solr.zk_connect_string"); String collection = PropertiesHelper.getProperty("logsearch.solr.collection.history", "history"); String configName = PropertiesHelper.getProperty("logsearch.solr.history.config.name", "history"); int replicationFactor = PropertiesHelper.getIntProperty("logsearch.collection.history.replication.factor", 2); String json = JSONUtil.objToJson(logfeederFilterWrapper); String configJson = JSONUtil.objToJson(configDoc); HashMap<String, Object> configMap = (HashMap<String, Object>) JSONUtil.jsonToMapObject(configJson); logfeederFilterWrapper = (VLogfeederFilterWrapper) JSONUtil.jsonToObj(json, VLogfeederFilterWrapper.class); String logfeederDefaultLevels = PropertiesHelper.getProperty("logsearch.logfeeder.include.default.level", DEFAULT_LEVELS); logfeederFilterWrapper = (VLogfeederFilterWrapper) JSONUtil.jsonToObj(jsonValue.toString(), VLogfeederFilterWrapper.class); if (JSONUtil.isJSONValid(hadoopServiceConfig)) {
0
* * * /** // force the Swing converters to be loaded //-------------------------------------------------------------------------
1
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.felix.karaf.shell.dev.util; import java.util.List; import static junit.framework.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; import org.osgi.framework.Version; /** * Test cases for {@link org.apache.felix.karaf.shell.dev.util.Import} */ public class ImportTest { @Test public void createWithPackageName() { Import i = new Import("org.wip.foo"); assertEquals("org.wip.foo", i.getPackage()); } @Test public void createWithPackageNameAndVersion() { Import i = new Import("org.wip.bar;version=\"2.0.0\""); assertEquals("org.wip.bar", i.getPackage()); assertEquals(new Version("2.0.0"), i.getVersion()); } @Test public void createListOfImports() { List<Import> imports = Import.parse("org.wip.bar;version=\"2.0.0\",org.wip.foo"); assertNotNull(imports); assertEquals(2, imports.size()); assertEquals("org.wip.bar", imports.get(0).getPackage()); assertEquals("org.wip.foo", imports.get(1).getPackage()); } }
0
assertEquals(9, stages.size()); assertEquals(9, tasks.size());
0
"SUPPORTS_AGGREGATION BOOLEAN, " + "IS_WHITELISTED BOOLEAN " + public static final String ALTER_METRICS_METADATA_TABLE = "ALTER TABLE METRICS_METADATA ADD IF NOT EXISTS IS_WHITELISTED BOOLEAN"; "START_TIME, SUPPORTS_AGGREGATION, IS_WHITELISTED) " + "VALUES (?, ?, ?, ?, ?, ?, ?)"; "SUPPORTS_AGGREGATION, IS_WHITELISTED FROM METRICS_METADATA";
0
SimpleTimer.getInstance().schedule(new Runnable() {
0
for (String source : sources) { if (source != null) { this.sources.add(source); for (Object source : sources) { SVGConverterSource src = (SVGConverterSource) source; getDestinationFile(src.getName())); for (Object source : sources) { SVGConverterSource src = (SVGConverterSource) source; new Object[]{src}); SVGConverterFileSource fs = (SVGConverterFileSource) src; getDestinationFile(src.getName())); for (Object source : this.sources) { String sourceString = (String) source; if (file.exists()) { } else {
0
import java.io.OutputStream; import java.util.Map; import org.apache.javaflow.Continuable; import org.apache.javaflow.Continuation; import org.apache.javaflow.ContinuationContext; * @version CVS $Id: AbstractContinuable.java 30941 2004-07-29 19:56:58Z vgritsenko $ private static CocoonContinuationContext getContext() { if (Continuation.currentContinuation() == null) return (CocoonContinuationContext) Continuation.currentContinuation().getContext(); public AbstractContinuable() { System.out.println("flow inside " + this.getClass().getClassLoader().getClass().getName()); } FlowHelper.setContextObject(ContextHelper.getObjectModel(getContext().getAvalonContext()), bizdata); getContext().getRedirector().redirect(false, uri); System.out.println("continuation suspended"); if (getContext().getLogger() != null) getContext().getLogger().debug("send page '" + uri + "'"); FlowHelper.setContextObject(ContextHelper.getObjectModel(getContext().getAvalonContext()), bizdata); getContext().getRedirector().redirect(false, uri); pipeUtil.contextualize(getContext().getAvalonContext()); pipeUtil.service(getContext().getServiceManager());
0
/** * A factory interface for creating {@link org.apache.beam.sdk.schemas.FieldValueSetter} objects * corresponding to a class. */ * Returns a list of {@link org.apache.beam.sdk.schemas.FieldValueGetter}s for the target class.
0
/** Holds the mount prefix of the current request accessible by {@link DispatcherServlet.getDispatcherMountPrefix} */ private static ThreadLocal prefix = new ThreadLocal(); // getPathInfo methods to provide reasonable values in the called servlet prefix.set(req.getServletPath()); try { servlet.service(request, res); } finally { prefix.remove(); } public Map getBlockServletMap() { public static String getDispatcherMountPrefix() { return prefix.get().toString(); }
0
if (!clusters.getClustersForHost(request.getHostname()).contains(cluster)) { cluster.getClusterName(), null, request.getComponentName(), request.getHostname()); boolean filterBasedConfigStaleness = false; boolean staleConfig = true; if (request.getStaleConfig() != null) { filterBasedConfigStaleness = true; staleConfig = "true".equals(request.getStaleConfig().toLowerCase()); } for (ServiceComponent sc : components) { request.getServiceName(), request.getComponentName(), request.getHostname()); if (filterBasedConfigStaleness && r.isStaleConfig() != staleConfig) { continue; }
0
* {@code null} indicates that the default should be used. * {@code null} for the default * {@code null} for a direct route * @param secure {@code true} if the route is (to be) secure, * {@code false} otherwise * {@code null} for the default * {@code null} for a direct route * @param secure {@code true} if the route is (to be) secure, * {@code false} otherwise * @param tunnelled {@code true} if the route is (to be) tunnelled * {@code false} otherwise * @param layered {@code true} if the route includes a * {@code false} otherwise * {@code null} for the default * @param secure {@code true} if the route is (to be) secure, * {@code false} otherwise * When using this constructor, the {@code proxy} MUST be given. * {@code null} for the default * @param secure {@code true} if the route is (to be) secure, * {@code false} otherwise * @return {@code true} if the argument is the same route, * {@code false}
0
if (entity != null && !context.isMetastoreHook()) { AtlasEntity ddlEntity = createHiveDDLEntity(entity); if (ddlEntity != null) { ret.addEntity(ddlEntity); } } if (!skipProcess && !context.isMetastoreHook()) {
0
* public final class SetPropertiesLoaderHandler implements DigesterLoaderHandler<SetProperty, Field> { public void handle( SetProperty annotation, Field element, FromAnnotationsRuleSet ruleSet ) { ruleSet.getProvider( annotation.pattern(), SetPropertiesRuleProvider.class ); if ( ruleProvider == null ) { ruleSet.addRuleProvider( annotation.pattern(), ruleProvider ); ruleProvider.addAlias( annotation, element );
1
try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port).verify(7L, TimeUnit.SECONDS).getSession()) {
0