Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
package com.twitter.mesos;
import com.google.common.collect.Maps;
import com.twitter.common.base.Closure;
import com.twitter.mesos.gen.LiveTaskInfo;
import com.twitter.mesos.gen.RegisteredTaskUpdate;
import com.twitter.mesos.gen.ScheduleStatus;
import com.twitter.mesos.gen.SchedulerMessage;
import com.twitter.mesos.ge... | 0 |
/*
* Copyright 2000-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 applic... | 0 |
package org.apache.aurora.scheduler.http;
import org.apache.aurora.scheduler.async.OfferQueue;
| 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 ... | 0 |
private static final Logger LOG = LoggerFactory.getLogger(ActionDBAccessorImpl.class);
LOG.info("Aborted {} commands", result);
List<HostRoleStatus> statuses = new ArrayList<HostRoleStatus>();
statuses.add(HostRoleStatus.PENDING);
statuses.add(HostRoleStatus.QUEUED);
statuses.add(HostRoleStatus.IN... | 1 |
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;
public class AddressUtilTest {
@Test
@Test
// expected | 0 |
ASSIGN('='), PIPE('|'), SEMICOLON(';'), NEWLINE, ARRAY, CLOSURE, EXPR, EXECUTION, WORD, EOT;
case '(':
final String special = "%$\\\"'";
case '%':
Object exp = expandExp();
if (EOT == ch && buf.length() == 0)
{
... | 0 |
package org.apache.beam.sdk.extensions.gcp.util.gcsfs; | 0 |
* Force the use of a max. packet length for {@link #doRead(Buffer, int)} protection
* against malicious packets
* @see #DEFAULT_MAX_READDATA_PACKET_LENGTH
public static final String MAX_READDATA_PACKET_LENGTH_PROP = "sftp-max-readdata-packet-length";
public static final int DEFAULT_MAX_READDATA_P... | 0 |
import org.apache.commons.vfs.provider.AbstractVfsComponent;
import org.apache.commons.vfs.provider.VfsComponent;
* @version $Revision: 1.2 $ $Date: 2004/05/17 20:13:20 $
public final class GlobalConfiguration extends AbstractVfsComponent
public void init() throws FileSystemException
super.init();
... | 0 |
public ReloadingCombinedConfigurationBuilder(final Map<String, Object> params,
final boolean allowFailOnInit)
public ReloadingCombinedConfigurationBuilder(final Map<String, Object> params)
public ReloadingCombinedConfigurationBuilder configure(final BuilderParameters... params)
final Com... | 0 |
for (final FileSystem fs : FileSystem.values()) {
final char[] chars = fs.getIllegalFileNameChars();
for (int i = 0; i < chars.length - 1; i++) {
Assert.assertTrue(fs.name(), chars[i] < chars[i + 1]);
}
final FileSystem fs = FileSystem.WINDOWS;
final c... | 0 |
package org.apache.hc.core5.http.impl.nio.entity;
import org.apache.hc.core5.http.nio.CapacityChannel;
import org.apache.hc.core5.http.nio.entity.ContentInputBuffer;
public SharedInputBuffer(final ReentrantLock lock, final int initialBufferSize) {
super(lock, initialBufferSize);
public int fill(final By... | 1 |
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
| 0 |
import org.apache.beam.sdk.transforms.OldDoFn;
OldDoFn<KV<K, Iterable<WindowedValue<V>>>, KV<K, Iterable<V>>> gabwDoFn =
OldDoFn<T, T> addWindowsDoFn = new AssignWindowsDoFn<>(windowFn); | 0 |
/** @since 2.0 */
/** @since 2.0 */
/** @since 2.0 */
/** @since 2.0 */
/** @since 2.0 */
/** @since 2.0 */
/** @since 2.0 */
/** @since 2.0 */
/** @since 2.0 */
/** @since 2.0 */ | 0 |
/**
* Checks if optional sign and all others are '0'-'9'
* @param cs The {@link CharSequence} to check
* @return {@code true} if valid integer number
*/
public static boolean isIntegerNumber(CharSequence cs) {
if (GenericUtils.isEmpty(cs)) {
return false;
}
... | 0 |
Map<Object, Object> map = MapUtils.predicatedMap(new HashMap<>(), p, p);
Map<String, String> map = MapUtils.orderedMap(inMap); | 0 |
Object[] values = {
};
for (int index = 0; index < values.length; index += 2) {
String s = (String) values[index];
Number expected = (Number) values[index + 1];
long actual = TimeValueConfig.durationOf(s); | 1 |
import org.apache.sshd.common.session.SessionContext;
public Iterable<KeyPair> loadKeys(SessionContext session) {
* @param session The {@link SessionContext} for invoking this load command - may
* be {@code null} if not invoked within a session context (e.g., offline tool or session unknown).
Iter... | 0 |
import org.apache.cocoon.portal.om.CopletAdapter; | 0 |
import org.apache.commons.jelly.impl.TagScript;
if (script instanceof TagScript) {
Tag tag = ((TagScript) script).getTag(); | 0 |
package org.apache.commons.vfs2.provider.mime;
import org.apache.commons.vfs2.Capability;
import org.apache.commons.vfs2.FileName;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystem;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.commons.vfs2.FileSystemOptions;
i... | 1 |
import org.apache.accumulo.monitor.Monitor;
public final TabletServerInformation server;
public TabletServer() {
server = new TabletServerInformation();
}
public TabletServer(Monitor monitor, TabletServerStatus status) {
server = new TabletServerInformation(monitor, status); | 0 |
Object[] objects = new Object[]{str, null, prefixResolver, Integer.valueOf(XPath.SELECT), null, funcTable}; | 0 |
import org.osgi.framework.wiring.BundleRevision;
private final WeakReference m_revision;
// TODO: SECURITY - This should probably take a revision, not a bundle.
m_revision = new WeakReference(bundle.getCurrentRevision());
BundleRevision getRevision()
return (BundleRevision) m_revision.get()... | 0 |
Assert.assertEquals(SourceType.METRIC, entity.getSourceType());
entity.setSourceType(SourceType.METRIC); | 0 |
import com.twitter.mesos.scheduler.events.TaskPubsubEvent;
private Closure<TaskPubsubEvent> eventSink;
eventSink = createMock(new Clazz<Closure<TaskPubsubEvent>>() { });
eventSink.execute(EasyMock.<TaskPubsubEvent>anyObject());
expectLastCall().anyTimes();
stateManager = new StateManagerImpl(storage, ... | 0 |
* @version $Revision$ | 0 |
public RamFileData(final FileName name)
void setBuffer(final byte[] buffer)
void setLastModified(final long lastModified)
void setType(final FileType type)
void addChild(final RamFileData data) throws FileSystemException
void removeChild(final RamFileData data) throws FileSystemException
pub... | 1 |
import org.apache.beam.vendor.guava.v20_0.com.google.common.io.Files; | 0 |
package org.w3c.dom.svg;
public interface SVGFEFuncRElement extends
SVGComponentTransferFunctionElement {
} | 1 |
implements TransformEvaluator<KeyedWorkItem<byte[], KV<InputT, RestrictionT>>> {
WindowedValue<KeyedWorkItem<byte[], KV<InputT, RestrictionT>>> windowedWorkItem)
KeyedWorkItem<byte[], KV<InputT, RestrictionT>> kwi = windowedWorkItem.getValue();
public TransformResult<KeyedWorkItem<byte[], KV<Inp... | 0 |
if (!b.exists() && !b.mkdirs()) {
throw new IOException("Could not create directory " + b);
} | 0 |
import org.apache.sshd.common.FactoryManager;
import org.apache.sshd.common.session.Session;
import org.apache.sshd.common.util.ValidateUtils;
super(discriminator, false);
Session s = getSession();
FactoryManager manager = ValidateUtils.checkNotNull(s.getFactoryManager(), "No factory manager");... | 0 |
* @version $Revision$ | 1 |
* Copyright 2000-2009 The Apache Software Foundation | 0 |
import org.apache.commons.configuration.tree.DefaultConfigurationNode;
setRootNode(config.getRootNode());
printNode(writer, 0, getRootNode());
printNode(out, indentLevel, ((HierarchicalConfiguration) value).getRootNode());
ConfigurationNode node = new DefaultConfiguration... | 0 |
private final Log log = LogFactory.getLog(getClass()); | 0 |
addLocalPackages( currentProject.getCompileSourceRoots(), builder );
private static void addLocalPackages( List sourceDirectories, Analyzer analyzer )
for ( Iterator d = sourceDirectories.iterator(); d.hasNext(); )
String sourceDirectory = (String) d.next();
if ( sourceDi... | 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 ... | 0 |
cause = new AmbariAuthenticationException(username, authException.getMessage(), false, authException); | 0 |
* @version CVS $Id: MillisDateConvertor.java,v 1.3 2004/05/06 14:59:44 bruno Exp $
public ConversionResult convertFromString(String value, Locale locale, Convertor.FormatCache formatCache) {
return new ConversionResult(new Date(date));
return ConversionResult.create("date"); | 0 |
managedConn.markReusable();
} | 0 |
* nor may "Apache" appear in their name, without | 0 |
import javax.script.ScriptContext;
//Do not cache script compilations due to memory implications
engine.getContext().setAttribute("#jsr223.groovy.engine.keep.globals", "phantom", ScriptContext.ENGINE_SCOPE); | 0 |
public String getCollectorPort(String clusterName, MetricsService service) throws SystemException { | 0 |
/**
* Sets the size of the memory buffer in megabytes. Must be greater than zero and less than
* 2048.
*/
// Hadoop's external sort stores the number of available memory bytes in an int, this prevents
// integer overflow
checkArgument(memoryMB < 2048, "memoryMB must be less than 204... | 0 |
/**
* Executes the query and returns the matching edges.
* @return
*/
Iterable<AtlasEdge<V, E>> edges();
| 1 |
package org.apache.accumulo.test.functional; | 0 |
import org.apache.ambari.server.configuration.Configuration;
import org.apache.ambari.server.security.authorization.jwt.JwtAuthenticationProperties;
/**
* Custom error handler for Jetty to return response as JSON instead of stub http page
*/
private Configuration configuration;
public AmbariErrorHandler(@Named("p... | 0 |
import org.apache.log4j.Logger;
import org.apache.zookeeper.server.util.SerializeUtils;
txn = SerializeUtils.deserializeTxn(ia, hdr);
leader.zk.serializeSnapshot(oa); | 0 |
wirelog("<< " + line + "[\\r][\\n]");
wirelog("<< " + line + "[\\r][\\n]");
wirelog("<< [\\r][\\n]"); | 0 |
import org.apache.beam.vendor.grpc.v1p21p0.io.grpc.BindableService;
* org.apache.beam.vendor.grpc.v1p21p0.io.grpc.Server} that this service is bound to should have
* completed a call to the {@link org.apache.beam.vendor.grpc.v1p21p0.io.grpc.Server#shutdown()} | 0 |
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
private static final Set<String> pkPropertyIds = ImmutableSet.<String>builder()
.add(WIDGETLAYOUT_ID_PROPERTY_ID)
.build();
private static final ReadWriteLock lock = new ReentrantReadWriteLock();
public static fi... | 0 |
* Copyright 2002,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 ap... | 0 |
$Id: TransitionImpl.java,v 1.1 2004/03/01 12:30:49 cziegeler Exp $
package org.apache.cocoon.workflow.impl;
import org.apache.cocoon.workflow.Action;
import org.apache.cocoon.workflow.Condition;
import org.apache.cocoon.workflow.Event;
import org.apache.cocoon.workflow.Situation;
import org.apache.cocoon.workflow.Tran... | 0 |
return FileSystem.getDefaultFileSystem().getURL(basePath, file);
File file;
return locate(FileSystem.getDefaultFileSystem(), base, name);
}
/**
* Return the location of the specified resource by searching the user home
* directory, the current classpath and the system classpat... | 0 |
import java.util.Set;
import java.util.Map;
public interface GVTAttributedCharacterIterator extends AttributedCharacterIterator {
public static class TextAttribute extends AttributedCharacterIterator.Attribute {
/** Overline flag for character.*/
public final static TextAttribute OVERLINE =
... | 0 |
private HttpParams params = null;
protected int socketTimeout = 60000;
protected boolean useHttp1_0 = false;
// prepare http params
params = getHttpParams(socketTimeout, useHttp1_0);
private HttpParams getHttpParams(int socketTimeout, boolean useHttp1_0) {
params.setParameter(Ht... | 0 |
Map<String,Variant> variantEntries = new HashMap<String,Variant>();
variantEntries.put(etag1, new Variant("A","B",HttpTestUtils.makeCacheEntry(new Header[] { new BasicHeader("ETag", etag1) })));
variantEntries.put(etag2, new Variant("C","D",HttpTestUtils.makeCacheEntry(new Header[] { new BasicHe... | 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 ... | 0 |
import static java.util.Objects.requireNonNull;
requireNonNull(context);
requireNonNull(context);
requireNonNull(server); | 0 |
/*
* Copyright 1999-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 ap... | 0 |
try
{
return (((Comparable) lhs).compareTo(rhs) == 0);
}
catch (Exception ex)
{
return false;
}
try
{
... | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//dbcp/src/java/org/apache/commons/dbcp/jdbc2pool/Attic/PoolKey.java,v 1.5 2003/06/29 12:42:16 mpoeschl Exp $
* $Revision: 1.5 $
* $Date: 2003/06/29 12:42:16 $
class PoolKey implements Serializable {
PoolKey(String datasourceNam... | 1 |
public static final String PID = "org.apache.felix.http";
/** Endpoint service registration property from RFC 189 */
private static final String REG_PROPERTY_ENDPOINTS = "osgi.http.service.endpoints";
props.put(REG_PROPERTY_ENDPOINTS, | 0 |
import org.apache.accumulo.core.data.TableId;
SortedMap<TableId,TableInfo> tableStats = new TreeMap<>();
tableStats.put(TableId.of(te.getKey()), te.getValue());
for (Map.Entry<String,TableId> entry : Tables.getNameToIdMap(Monitor.getContext()).entrySet()) {
TableId tableId = entry.getValue();
... | 0 |
import java.util.Map.Entry;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.minicluster.ProcessReference;
import org.apache.accumulo.minicluster.ServerType;
@Test(timeout = 2 * 60 * 1000)
pu... | 0 |
import java.util.LinkedList;
import java.util.List;
import org.apache.ambari.server.controller.AmbariServer;
import org.apache.ambari.server.controller.spi.ProviderModule;
import org.apache.ambari.server.controller.utilities.PropertyHelper;
PropertyHelper.getKeyPropertyIds(type), AmbariServer.getController()... | 0 |
package org.apache.cocoon;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
} | 0 |
public static void copy(URI source, OutputStream out) throws IOException
{
try
{
}
finally
{
public static void copy(InputStream in, OutputStream out) throws IOException
{
while ((len = in.read(buf)) > 0)
{ | 0 |
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/> | 1 |
subCtx = ctx.createSubBridgeContext((SVGOMDocument)imgDocument);
if ((eng == null) && ctx.isInteractive()) {
// If we "created" this document then add listerns.
} | 0 |
* @since 2.0 | 1 |
@Override
@Override
@Override
@Override
@Override
@Override | 0 |
package org.apache.sling.felix.webconsole.internal.compendium;
import org.apache.sling.felix.webconsole.Action;
import org.apache.sling.felix.webconsole.Render;
import org.apache.sling.felix.webconsole.internal.Util;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
T... | 0 |
* @throws NullPointerException if classToInstantiate is null
* @throws IllegalArgumentException if paramTypes does not match args
throw new NullPointerException("Class to instantiate must not be null"); | 0 |
out = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_DATA);
err = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_EXTENDED_DATA); | 0 |
import org.apache.beam.sdk.annotations.Experimental;
import org.apache.beam.sdk.annotations.Experimental.Kind;
@Experimental(Kind.FILESYSTEM)
@Experimental(Kind.FILESYSTEM) | 0 |
public class BasicClientCookie2 extends BasicClientCookie implements SetCookie2 { | 0 |
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* @param priority
* The priority for the iterator (see {@link #setPriority(int)})
* @param name
* The distinguishing name for the iterator
* @param iteratorClass
* The class for the iterator
* @pa... | 0 |
* This can be used to zoom in (scale > 1) and out (scale <1).
* element or both. <br>
* is the algorithm used to build the tool tip:<br>
* Poor way of replacing '<', '>' and '&' in content.
* modify the JSVGCanvas tooltip on mouseover and on mouseout.<br> | 0 |
AtlasClientV2 atlasClientV2 = null;
} finally {
if (atlasClientV2 != null) {
atlasClientV2.close();
} | 0 |
import com.google.inject.AbstractModule;
* NOTE: These stores are being phased out in favor of database-backed stores.
public final class InMemStoresModule extends AbstractModule {
public InMemStoresModule(KeyFactory keyFactory) { | 0 |
private static class IntPosition implements Position { | 0 |
public static <E> Comparator<E> chainedComparator(final Comparator<E>... comparators) {
public static <E> Comparator<E> chainedComparator(final Collection<Comparator<E>> comparators) { | 0 |
import org.apache.aurora.common.zookeeper.ZooKeeperClient.Credentials;
import org.apache.aurora.gen.ServerInfo;
import org.apache.aurora.scheduler.storage.entities.IServerInfo;
import static org.apache.aurora.gen.apiConstants.THRIFT_API_VERSION;
bind(IServerInfo.class).toInstance(
IServerInfo.build... | 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 ap... | 1 |
do {
} while (timeouts < __maxTimeouts); // __maxTimeouts >=1 so will always do loop at least once
do {
while (timeouts < __maxTimeouts); // __maxTimeouts >=1 so will always do loop at least once
// answering host address (for hosts with m... | 0 |
import org.apache.felix.service.command.CommandSession; | 0 |
serviceNames.put("NODEMANAGER", "nodemanager");
serviceNames.put("RESOURCEMANAGER", "resourcemanager");
serviceNames.put("JOURNALNODE", "journalnode"); | 0 |
public interface LoggerMBean{
public void sendOldLog();
} | 0 |
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.cocoon.core.container.CocoonServiceManager;
* given by the initialization parameter in JNDI, use it to configure an CocoonServiceManager
* @version CVS $Id$
public class ParentServ... | 0 |
import java.net.MalformedURLException;
* @param viewsAdditionalClasspath: list of additional paths to be added to every view's classpath
public ClassLoader extractViewArchive(ViewEntity view, File viewArchive, File archiveDir, List<File> viewsAdditionalClasspath)
return getArchiveClassLoader(viewConfig, arch... | 0 |
import org.apache.ambari.server.security.credential.PrincipalKeyCredential;
import org.apache.commons.lang.StringUtils;
* @param administratorCredential a PrincipalKeyCredential containing the administrative credential
* for the relevant KDC
* @param realm a Str... | 0 |
public class SchedulerMain extends GuicedProcess<SchedulerMain.TwitterSchedulerOptions, Exception> { | 0 |
public static int hashCode(final int seed, final boolean b) {
return hashCode(seed, b ? 1 : 0);
}
| 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... | 0 |
TransformTranslator<CreateStreamingGearpumpView.CreateGearpumpPCollectionView<ElemT, ViewT>> {
CreateStreamingGearpumpView.CreateGearpumpPCollectionView<ElemT, ViewT> transform,
PCollectionView<ViewT> view = transform.getView();
context.setOutputStream(view, inputStream); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.