Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import org.apache.accumulo.core.client.sample.RowSampler; import org.apache.accumulo.core.client.sample.SamplerConfiguration;
0
* @version $Revision: 1.14 $ $Date: 2004/03/04 01:01:27 $ Object parent = ((Element) node).getParent(); if (parent instanceof Element) { return (Element) parent; } Object parent = ((Element) node).getParent(); if (!(parent instanceof Element)) { List children = ((Element)parent).getContent();
0
BeamFnStateClient fakeStateClient = (requestBuilder, response) -> { ByteString continuationToken = requestBuilder.getGet().getContinuationToken(); StateGetResponse.Builder builder = StateGetResponse.newBuilder(); int requestedPosition = 0; // Default position is 0 if (!ByteString.EMPTY.equals(continuationToken)) { requestedPosition = Integer.parseInt(continuationToken.toStringUtf8()); } // Compute the new continuation token ByteString newContinuationToken = ByteString.EMPTY; if (requestedPosition != expected.length - 1) { newContinuationToken = ByteString.copyFromUtf8(Integer.toString(requestedPosition + 1)); } response.complete( StateResponse.newBuilder() .setId(requestBuilder.getId()) .setGet( StateGetResponse.newBuilder() .setData(expected[requestedPosition]) .setContinuationToken(newContinuationToken)) .build()); };
0
if (plainSocket != null) { plainSocket.close(); }
0
public KeeperException.Code handleAuthentication(ServerCnxn cnxn, byte[] authData) { return KeeperException.Code.OK;
0
.setUpdateOnlyTheseInstances(ImmutableSet.of())));
0
public class FileEntity extends AbstractHttpEntity {
0
import java.math.BigDecimal; public void testBacklogUnstarted() { OffsetRangeTracker tracker = new OffsetRangeTracker(new OffsetRange(0, 200)); assertEquals(BigDecimal.valueOf(200), tracker.getBacklog().backlog()); tracker = new OffsetRangeTracker(new OffsetRange(100, 200)); assertEquals(BigDecimal.valueOf(100), tracker.getBacklog().backlog()); } @Test public void testBacklogFinished() { OffsetRangeTracker tracker = new OffsetRangeTracker(new OffsetRange(0, 200)); tracker.tryClaim(300L); assertEquals(BigDecimal.ZERO, tracker.getBacklog().backlog()); tracker = new OffsetRangeTracker(new OffsetRange(100, 200)); tracker.tryClaim(300L); assertEquals(BigDecimal.ZERO, tracker.getBacklog().backlog()); } @Test public void testBacklogPartiallyCompleted() { OffsetRangeTracker tracker = new OffsetRangeTracker(new OffsetRange(0, 200)); tracker.tryClaim(150L); assertEquals(BigDecimal.valueOf(50), tracker.getBacklog().backlog()); tracker = new OffsetRangeTracker(new OffsetRange(100, 200)); tracker.tryClaim(150L); assertEquals(BigDecimal.valueOf(50), tracker.getBacklog().backlog());
0
@SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0
public final static short MAJOR_1_6 = 50; public final static short MINOR_1_6 = 0; public final static short ACC_SYPER = 0x0020; public static final byte ATTR_RUNTIME_VISIBLE_ANNOTATIONS = 12; public static final byte ATTR_RUNTIMEIN_VISIBLE_ANNOTATIONS = 13; public static final byte ATTR_RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS = 14; public static final byte ATTR_RUNTIMEIN_VISIBLE_PARAMETER_ANNOTATIONS = 15; public static final byte ATTR_LOCAL_VARIABLE_TYPE_TABLE = 17; public static final byte ATTR_ENCLOSING_METHOD = 18; public static final short KNOWN_ATTRIBUTES = 19; // TOFO: FIXXXXX "AnnotationDefault", "LocalVariableTypeTable", "EnclosingMethod"
0
import org.apache.atlas.model.instance.AtlasEntity.Status; private Status entityStatus = Status.ACTIVE; setEntityStatus(other.getEntityStatus()); public Status getEntityStatus() { return entityStatus; } public void setEntityStatus(Status entityStatus) { this.entityStatus = entityStatus; } entityStatus == that.entityStatus && return Objects.hash(super.hashCode(), entityGuid, entityStatus, propagate); sb.append(", entityStatus=").append(entityStatus);
0
* Gets all configs that match the specified type. Result is not the * DESIRED configuration for a cluster. * @param configType the config type to return * @return a map of configuration objects that have been set for the given type public Map<String, Config> getConfigsByType(String configType); * Gets the specific config that matches the specified type and tag. This not * necessarily a DESIRED configuration that applies to a cluster. * @param configType the config type to find * @param versionTag the config version to find * @return a {@link Config} object, or <code>null</code> if the specific type * and version have not been set. public Config getConfig(String configType, String versionTag); * Sets a specific config. NOTE: This is not a DESIRED configuration that * applies to a cluster. * @param config the config instance to add public void addConfig(Config config); * Gets all configurations defined for a cluster. * @return the collection of all configs that have been defined. /** * Adds and sets a DESIRED configuration to be applied to a cluster. There * can be only one selected config per type. * @param config the {@link Config} object to set as desired */ public void addDesiredConfig(Config config); /** * Gets the desired (and selected) config by type. * @param configType the type of configuration * @return the {@link Config} instance, or <code>null</code> if the type has * not been set. */ public Config getDesiredConfigByType(String configType);
0
import org.apache.ambari.server.controller.spi.NoSuchParentResourceException; import org.apache.ambari.server.controller.spi.NoSuchResourceException; import org.apache.ambari.server.controller.spi.Predicate; import org.apache.ambari.server.controller.spi.PropertyProvider; import org.apache.ambari.server.controller.spi.Request; import org.apache.ambari.server.controller.spi.RequestStatus; import org.apache.ambari.server.controller.spi.Resource; import org.apache.ambari.server.controller.spi.ResourceAlreadyExistsException; import org.apache.ambari.server.controller.spi.ResourceProvider; import org.apache.ambari.server.controller.spi.Schema; import org.apache.ambari.server.controller.spi.SystemException; import org.apache.ambari.server.controller.spi.UnsupportedPropertyException; import org.apache.ambari.server.controller.utilities.PropertyHelper; import org.junit.Test; import junit.framework.Assert;
0
assertEquals(5, outStages.size());
0
var builder = ImmutableSet.<DfsLogger>builder();
0
if (null == peer.clientAddr) { return ""; } return peer.clientAddr.getHostString() + ":" + peer.clientAddr.getPort();
0
import org.apache.aurora.scheduler.storage.db.DbUtil; * TODO(wfarner): Merge this with DbStorageTest. public class StorageTransactionTest extends TearDownTestCase { storage = DbUtil.createStorage();
0
import org.apache.beam.sdk.extensions.sql.impl.interpreter.BeamSqlExpressionEnvironment; Row inputRow, BoundedWindow window, BeamSqlExpressionEnvironment env) {
0
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ambari.server.topology; import org.apache.ambari.server.controller.internal.ProvisionAction; public class Component { private final String name; private final ProvisionAction provisionAction; public Component(String name) { this(name, null); } public Component(String name, ProvisionAction provisionAction) { this.name = name; this.provisionAction = provisionAction; } /** * Gets the name of this component * * @return component name */ public String getName() { return this.name; } /** * Gets the provision action associated with this component. * * @return the provision action for this component, which * may be null if the default action is to be used */ public ProvisionAction getProvisionAction() { return this.provisionAction; } }
0
/* * Copyright (C) 2014 Google Inc. * * 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. */ /** * Implementation of the harness that runs on each Google Compute Engine instance to coordinate * execution of Pipeline code. */ @ParametersAreNonnullByDefault package com.google.cloud.dataflow.sdk.runners.worker; import javax.annotation.ParametersAreNonnullByDefault;
0
import org.apache.beam.sdk.coders.StringUtf8Coder; import org.apache.beam.sdk.coders.VarIntCoder; p, WindowingStrategy.globalDefault(), IsBounded.BOUNDED, VarIntCoder.of()); p, WindowingStrategy.globalDefault(), IsBounded.BOUNDED, VarIntCoder.of()); p, WindowingStrategy.globalDefault(), IsBounded.BOUNDED, StringUtf8Coder.of()); p, WindowingStrategy.globalDefault(), IsBounded.BOUNDED, VarIntCoder.of()); p, WindowingStrategy.globalDefault(), IsBounded.BOUNDED, VarIntCoder.of()); p, WindowingStrategy.globalDefault(), IsBounded.BOUNDED, StringUtf8Coder.of());
0
import org.apache.sshd.util.test.CommonTestSupportUtils; Path scpRoot = CommonTestSupportUtils.resolve(targetPath, ScpHelper.SCP_COMMAND_PREFIX, getClass().getSimpleName(), getCurrentTestName()); CommonTestSupportUtils.deleteRecursive(scpRoot); String remotePath = CommonTestSupportUtils.resolveRelativeRemotePath(parentPath, remoteFile);
0
import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target;
0
import java.io.IOException; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.inject.Inject; import javax.inject.Provider; import javax.inject.Singleton; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
0
import org.apache.http.util.Args; Args.notNull(host, "Target host"); Args.notNull(request, "Request");
0
* @deprecated Use {@link DefaultConfigurationBuilder} instead; this class * provides the same features as ConfigurationFactory plus some more; it can * also process the same configuration definition files.
0
/** * 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.aurora.common.zookeeper; import java.util.concurrent.TimeUnit; /** * DistributedLock * * @author Florian Leibert */ public interface DistributedLock { void lock() throws LockingException; boolean tryLock(long timeout, TimeUnit unit); void unlock() throws LockingException; public static class LockingException extends RuntimeException { public LockingException(String msg, Exception e) { super(msg, e); } public LockingException(String msg) { super(msg); } } }
0
/** * @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a> */ private static final int BUFFSZ = 250; * Get the query string. * Get the path and query string e.g. /path/servlet?param1=true. StringBuffer sb = new StringBuffer(BUFFSZ); * Get the path encoded suitable for url like filesystem e.g. (http, webdav). * @return The encoded path. * @throws URIException If an error occurs encoding the URI. * @throws FileSystemException If some other error occurs. StringBuffer sb = new StringBuffer(BUFFSZ); /** * Create a FileName. * @param absPath The absolute path. * @param type The FileType. * @return The FileName */ * Append query string to the uri. StringBuffer sb = new StringBuffer(BUFFSZ); /** * Encode a URI. * @param charset The character set. * @return The encoded URI * @throws FileSystemException if some other exception occurs. * @throws URIException if an exception occurs encoding the URI. */ StringBuffer sb = new StringBuffer(BUFFSZ);
0
public class BasicBuilderParameters implements BuilderParameters, BasicBuilderProperties<BasicBuilderParameters>
0
private static final NamespacePermission[] mapping = new NamespacePermission[9];
0
fireGraphicsNodeChangeStarted(); fireGraphicsNodeChangeCompleted(); fireGraphicsNodeChangeStarted(); fireGraphicsNodeChangeCompleted();
0
throw new ReferenceNotInitializedException(ex); throw new XMLSignatureException(ex); throw new XMLSignatureException(ex); throw new XMLSignatureException(ex); throw new XMLSignatureException(ex); throw new XMLSignatureException(ex); throw new XMLSignatureException(ex); throw new XMLSignatureException(ex); throw new XMLSignatureException(ex); throw new XMLSignatureException(ex); throw new XMLSignatureException(ex); throw new XMLSignatureException(ex); throw new XMLSignatureException(ex); throw new XMLSignatureException(ex); throw new XMLSignatureException(ex); throw new ReferenceNotInitializedException(ex); throw new ReferenceNotInitializedException(ex); throw new ReferenceNotInitializedException(ex); throw new ReferenceNotInitializedException(ex); throw new ReferenceNotInitializedException(ex); throw new ReferenceNotInitializedException(ex);
0
} if (this.state == STREAMING) { if (this.state == CLOSING || this.state == CLOSED) { return; } while (this.state != CLOSED && !this.shutdown) {
0
public class SoftRefFilesCacheTestCase extends AbstractProviderTestConfig { public static Test suite() throws Exception { public FilesCache getFilesCache() { public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception {
1
final Iterator i = this.settings.getLoadClasses().iterator();
0
Objects.requireNonNull(listenerType, "No listener type specified"); Objects.requireNonNull(listeners, "No listeners container provided");
0
boolean hasPermission = WalkingSecurity.get(state).canCreateTable(WalkingSecurity.get(state).getSysCredentials());
0
@Override public void cleanup() {} DirectGroupAlsoByWindow<K, V>> application,
0
private static final String TOPIC = "kafka_beam_test_topic";
0
Map<String, Set<String>> componentHostGroupMap = new HashMap<>(); Set<String> components1 = new HashSet<>(); Set<String> components2 = new HashSet<>(); new HashMap<>(); Set<String> componentNames1 = new HashSet<>(); Set<String> componentNames2 = new HashSet<>();
1
import org.apache.avalon.framework.service.ServiceException; import org.apache.avalon.framework.activity.Initializable; import org.apache.avalon.framework.CascadingException; import org.apache.cocoon.woody.util.SimpleServiceSelector; public class DefaultDatatypeManager extends AbstractLogEnabled implements DatatypeManager, ThreadSafe, Composable, Configurable, Initializable { private SimpleServiceSelector typeBuilderSelector; private SimpleServiceSelector validationRuleBuilderSelector; private Configuration configuration; this.configuration = configuration; public void initialize() throws Exception { typeBuilderSelector = new SimpleServiceSelector("datatype", DatatypeBuilder.class); typeBuilderSelector.compose(componentManager); typeBuilderSelector.configure(configuration.getChild("datatypes")); validationRuleBuilderSelector = new SimpleServiceSelector("validation-rule", ValidationRuleBuilder.class); validationRuleBuilderSelector.compose(componentManager); validationRuleBuilderSelector.configure(configuration.getChild("validation-rules")); configuration = null; } DatatypeBuilder builder = null; try { builder = (DatatypeBuilder)typeBuilderSelector.select(typeName); } catch (ServiceException e) { throw new CascadingException("Unknown datatype '" + typeName + "' specified at " + DomHelper.getLocation(datatypeElement), e); } return builder.build(datatypeElement, arrayType, this); ValidationRuleBuilder builder = null; try { builder = (ValidationRuleBuilder)validationRuleBuilderSelector.select(name); } catch (ServiceException e) { throw new CascadingException("Unknown validation rule \"" + name + "\" specified at " + DomHelper.getLocation(validationRuleElement), e); } return builder.build(validationRuleElement);
0
// no need for non-default formatting in toString() return BasicLineFormatter.DEFAULT .formatStatusLine(null, this).toString();
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
this.clientConf = ClientConfiguration.fromFile(clientConfFile); if (clientConf.hasSasl()) {
0
/** Utility methods for translators. */ return new Window( TranslatorUtils.jodaTimeToJava8Time(BoundedWindow.TIMESTAMP_MIN_VALUE), end); for (Map.Entry<String, PCollectionView<?>> tagToSideInput : tagsToSideInputs.entrySet()) { JavaStream<WindowedValue<List<?>>> sideInputStream = context.getInputStream(tagToSideInput.getValue()); mainStream = mainStream.merge( sideInputStream.map( new ToRawUnionValue<>(tagToSideInput.getKey()), "map_to_RawUnionValue"), 1, "merge_to_MainStream"); for (PCollectionView<?> sideInput : sideInputs) { return stream.fold( new FoldFunction<RawUnionValue, List<RawUnionValue>>() { @Override public List<RawUnionValue> init() { return Lists.newArrayList(); } @Override public List<RawUnionValue> fold( List<RawUnionValue> accumulator, RawUnionValue rawUnionValue) { accumulator.add(rawUnionValue); return accumulator; } }, "fold_to_iterable"); /** Converts @link{RawUnionValue} to @link{WindowedValue}. */ public static class FromRawUnionValue<OutputT> extends MapFunction<RawUnionValue, WindowedValue<OutputT>> { private static class ToRawUnionValue<T> extends MapFunction<WindowedValue<T>, RawUnionValue> { /** This is copied from org.apache.beam.sdk.transforms.join.RawUnionValue. */ /** Constructs a partial union from the given union tag and value. */
1
* @version $Revision$ $Date$
0
* Tests for {@link TransformedSplitMap} public class TransformedSplitMapTest extends BulkTest { public TransformedSplitMapTest(final String testName) { final TransformedSplitMap<Integer, String, Object, Class<?>> map = TransformedSplitMap.transformingMap( final TransformedSplitMap<String, String, String, Integer> map2 = TransformedSplitMap.transformingMap( final TransformedSplitMap<String, String, String, Integer> map = TransformedSplitMap.transformingMap(new HashMap<String, Integer>(), NOPTransformer.<String> nopTransformer(), stringToInt); final TransformedSplitMap<String, String, String, String> map = TransformedSplitMap.transformingMap(new HashMap<String, String>(), NOPTransformer.<String>nopTransformer(), NOPTransformer.<String>nopTransformer() ); final ObjectInputStream in = new ObjectInputStream( new FileInputStream( TEST_DATA_PATH+"/TransformedSplitMap.emptyCollection.version4.obj" ) ); final TransformedSplitMap<?, ?, ?, ?> readMap = (TransformedSplitMap<?, ?, ?, ?>) readObject; final TransformedSplitMap<String, String, String, String> map = TransformedSplitMap.transformingMap( final ObjectInputStream in = new ObjectInputStream( new FileInputStream( TEST_DATA_PATH+"TransformedSplitMap.fullCollection.version4.obj" ) ); final TransformedSplitMap<?, ?, ?, ?> readMap = (TransformedSplitMap<?, ?, ?, ?>) readObject; // TransformedSplitMap<String, String, String, String> map = TransformedSplitMap.transformingMap(
0
private static final long serialVersionUID = 1123380491796734328L;
0
private static final class LazyVersionPropertiesHolder { Collections.unmodifiableNavigableMap(loadVersionProperties(LazyVersionPropertiesHolder.class)); private LazyVersionPropertiesHolder() { throw new UnsupportedOperationException("No instance allowed"); } return LazyVersionPropertiesHolder.PROPERTIES;
0
import org.junit.jupiter.api.BeforeEach; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; @BeforeEach
0
/** * A simple bean with primitive properties. At the moment only need a boolean property. Feel free to add others later. * public class PrimitiveBean { public PrimitiveBean() { } public boolean getBoolean() { public boolean getSetBooleanCalled() { public void setBoolean( boolean booleanValue ) { public void testSetBoolean( String ignored, boolean booleanValue ) { setBoolean( booleanValue );
1
@Override
0
* @cocoon.sitemap.component.documentation * A <code>Selector</code> that matches a string against a configurable * request header, e.g. "referer". *
0
public void testCompareSQLServer() throws Exception {
0
log.warn(DFS_DATANODE_SYNCONCLOSE + " set to false in" + " hdfs-site.xml: data loss is possible on hard system reset or" + " power loss"); + "', or one of its delegates returned a volume not in the set of" + " options provided; will continue by relying on a RandomVolumeChooser." + " You should investigate and correct the named chooser.");
0
import com.google.cloud.dataflow.sdk.util.TimeDomain; public void testAfterSynchronizedProcessingTimeIgnoresTimer() throws Exception { Duration windowDuration = Duration.millis(10); TriggerTester<Integer, Iterable<Integer>, IntervalWindow> tester = TriggerTester.nonCombining( FixedWindows.of(windowDuration), new AfterSynchronizedProcessingTime<IntervalWindow>(), AccumulationMode.DISCARDING_FIRED_PANES, Duration.millis(100)); tester.fireTimer(new IntervalWindow(new Instant(0), new Instant(10)), new Instant(15), TimeDomain.SYNCHRONIZED_PROCESSING_TIME); tester.advanceProcessingTime(new Instant(5)); tester.injectElement(1, new Instant(1)); tester.fireTimer(new IntervalWindow(new Instant(0), new Instant(10)), new Instant(0), TimeDomain.SYNCHRONIZED_PROCESSING_TIME); } @Test
0
private final int m_activationPolicy; m_activationPolicy = EAGER_ACTIVATION; m_activationPolicy = mp.getActivationPolicy(); public int getActivationPolicy() { return m_activationPolicy; }
0
public HttpDataReceiverMockup(final byte[] bytes, int buffersize) { super(); init(Channels.newChannel( new ByteArrayInputStream(bytes)), buffersize); } public HttpDataReceiverMockup(final String s, final String charset, int buffersize) throws UnsupportedEncodingException { this(s.getBytes(charset), buffersize); } }
0
public class Task {
0
{ adminTitle, getTitle(), appRoot, getLabel(), toUrl( brandingPlugin.getFavIcon(), appRoot ), toUrl( brandingPlugin.getMainStyleSheet(), appRoot ), brandingPlugin.getProductURL(), brandingPlugin.getProductName(), toUrl( brandingPlugin.getProductImage(), appRoot ), getCssLinks( appRoot ) } ); + " <link rel=\"icon\" href=\"{4}\">" + " <link href=\"{5}\" rel=\"stylesheet\" type=\"text/css\">" + " <a target=\"_blank\" href=\"{6}\" title=\"{7}\"><img src=\"{8}\" border=\"0\"></a>" buf.append( toUrl( cssRefs[i], appRoot ) ); buf.append( "' rel='stylesheet' type='text/css'>" ); /** * If the <code>url</code> starts with a slash, it is considered an absolute * path (relative URL) which must be prefixed with the Web Console * application root path. Otherwise the <code>url</code> is assumed to * either be a relative path or an absolute URL, both must not be prefixed. * * @param url The url path to optionally prefix with the application root * path * @param appRoot The application root path to optionally put in front of * the url. * @throws NullPointerException if <code>url</code> is <code>null</code>. */ private String toUrl( final String url, final String appRoot ) { if ( url.startsWith( "/" ) ) { return appRoot + url; } return url; }
0
System.out.println("addCreateDing: " + messages[i++]); System.out.println("addDang: " + messages[i++]); System.out.println("addConfiguredDong: " + messages[i++]); System.out.println("createHipHop: " + messages[i++]); System.out.println("addWontStop: " + messages[i++]); System.out.println("addConfiguredTillYouDrop: " + messages[i++]);
0
public abstract class Constants {
0
/** {@link org.apache.commons.logging} logging facility */ static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(IBMTest.class.getName()); log.error("Verification crashed for " + filename); log.error("Verification failed for " + filename); log.error("Verification crashed for " + filename); log.error("Verification failed for " + filename); log.error("Verification crashed for " + filename); log.error("Verification failed for " + filename); log.error("Verification crashed for " + filename); log.error("Verification failed for " + filename); log.error("Verification crashed for " + filename); log.error("Verification failed for " + filename); log.error("Verification crashed for " + filename); log.error("Verification failed for " + filename); log.error("Verification crashed for " + filename); log.error("Verification failed for " + filename); log.error("Verification crashed for " + filename); log.error("Verification failed for " + filename + ", had to be broken but was successful");
0
private Set<String> errorSet = new HashSet<>(); if (services == null) services = new ArrayList<>(); Collection<File> serviceDescriptorFiles = new HashSet<>();
1
package org.apache.beam.sdk.extensions.sql.impl.schema.kafka;
0
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AlertStateSummary that = (AlertStateSummary) o; if (Ok != null ? !Ok.equals(that.Ok) : that.Ok != null) return false; if (Warning != null ? !Warning.equals(that.Warning) : that.Warning != null) return false; if (Critical != null ? !Critical.equals(that.Critical) : that.Critical != null) return false; return Unknown != null ? Unknown.equals(that.Unknown) : that.Unknown == null; } @Override public int hashCode() { int result = Ok != null ? Ok.hashCode() : 0; result = 31 * result + (Warning != null ? Warning.hashCode() : 0); result = 31 * result + (Critical != null ? Critical.hashCode() : 0); result = 31 * result + (Unknown != null ? Unknown.hashCode() : 0); return result; }
1
@Retention(RetentionPolicy.CLASS)
0
CountSampler sampler = new CountSampler(10); Trace.on("masterReplicationDriver", sampler); Trace.off();
1
log.error("Could not join thread '" + thread.getName() + "'.", e); log.error("Could not join thread '" + thread.getName() + "'.", e); log.error("Could not join thread '" + thread.getName() + "'.", e);
0
* files and URLs as well. This implementation checks first whether the passed in * file name is absolute. If this is the case, it is returned. Otherwise * further checks are performed whether the base path and file name can be * combined to a valid URL or a valid file name. <em>Note:</em> The test * if the passed in file name is absolute is performed using * <code>java.io.File.isAbsolute()</code>. If the file name starts with a * slash, this method will return <b>true</b> on Unix, but <b>false</b> on * Windows. So to ensure correct behavior for relative file names on all * platforms you should never let relative paths start with a slash. E.g. * in a configuration definition file do not use something like that: * <pre> * &lt;properties fileName="/subdir/my.properties"/&gt; * </pre> * Under Windows this path would be resolved relative to the configuration * definition file. Under Unix this would be treated as an absolute path * name. // Check if the file name is absolute File f = new File(fileName); if (f.isAbsolute()) { return f; }
0
package org.apache.ambari.server.agent; public RegistrationStatus response; public RegistrationStatus getResponseStatus() { return response; public void setResponseStatus(RegistrationStatus response) { this.response = response;
0
* Copyright 2004-2005 The Apache Software Foundation. * <p>Note that the <code>load()</code> methods do not wipe out the configuration's * content before the new configuration file is loaded. Thus it is very easy to * construct a union configuration by simply loading multiple configuration * files, e.g.</p> * <p><pre> * config.load(configFile1); * config.load(configFile2); * </pre></p> * <p>After executing this code fragment, the resulting configuration will * contain both the properties of configFile1 and configFile2. On the other * hand, if the current configuration file is to be reloaded, <code>clear()</code> * should be called first. Otherwise the properties are doubled. This behavior * is analogous to the behavior of the <code>load(InputStream)</code> method * in <code>java.util.Properties</code>.</p>
0
public static final AngleHandler INSTANCE
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bag/TestTypedSortedBag.java,v 1.5 2003/12/24 22:38:32 scolebourne Exp $ * @version $Revision: 1.5 $ $Date: 2003/12/24 22:38:32 $ return decorateBag(new TreeBag(), objectClass); return decorateBag(new TreeBag(), stringClass); SortedBag bag = decorateBag(new TreeBag(), stringClass); SortedBag bag3 = decorateBag(new TreeBag(), null); SortedBag bag = decorateBag(new TreeBag(), stringClass); assertTrue("natural order, so comparator should be null", c == null);
0
PermissionEntity permission = getPermission(permissionName, resourceEntity); " for the resource."); entity.setResource(resourceEntity); // Get a permission with the given permission name for the given resource. protected PermissionEntity getPermission(String permissionName, ResourceEntity resourceEntity) throws AmbariException { return permissionDAO.findPermissionByNameAndType(permissionName, resourceEntity.getResourceType()); }
0
public NHttpMessageParser<HttpRequest> create(final MessageConstraints constraints) { return new DefaultHttpRequestParser(lineParser, requestFactory, constraints);
0
if (stats.tableMap.size() <= 2) { continue; }
0
protected AbstractSetDecorator(final Set<E> set) {
0
return false;
0
package org.apache.beam.learning.katas.coretransforms.map.pardo;
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
/** * Constructor XMLSignatureInput * * @param inputNodeSet * @param usedXPathAPI */ public XMLSignatureInput(Set inputNodeSet) { this._inputNodeSet = inputNodeSet; }
0
package cz.seznam.euphoria.core.client.dataset; import java.util.Set; public interface MergingWindowing<KEY, W extends Window<KEY>> { interface Merging<KEY, W extends Window<KEY>> { void onMerge(Set<W> mergedWindows, W mergeResult); } void mergeWindows(Set<W> actives, Merging<KEY, W> merging); }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ArrayUnsignedByteList.java,v 1.2 2003/04/13 22:30:57 rwaldhoff Exp $ * @version $Revision: 1.2 $ $Date: 2003/04/13 22:30:57 $ public class ArrayUnsignedByteList extends RandomAccessShortList implements ShortList, Serializable {
0
try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port).verify(7L, TimeUnit.SECONDS).getSession()) {
0
* limitations under the License.
0
import org.apache.maven.execution.MavenSession; /** * @parameter default-value="${session}" * @required * @readonly */ private MavenSession m_mavenSession; if ( m_mavenSession != null ) { properties.putAll( m_mavenSession.getExecutionProperties() ); }
0
import java.lang.reflect.Field; import java.lang.reflect.Method; import org.apache.xpath.objects.XObject; * {@link org.apache.xml.security.utils.EncryptionConstants#EncryptionSpecNS} and that the * @see org.apache.xml.security.utils.EncryptionConstants#EncryptionSpecNS * @see #getRandomNamespacePrefix
0
* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
/* * 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. */ @SuppressWarnings("all") public enum TableOperation implements org.apache.thrift.TEnum {
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.cauldron.sigil.ui.editors.project; public interface IElementDescriptor<E> { /** * Return the short identifying name of the element. */ String getName(E element); /** * Return a label for the element, including the name but possibly supplying * additional information. * * @param element * @return */ String getLabel(E element); }
0
import org.apache.accumulo.core.client.impl.TableNamespaces; String namespace = Tables.extractNamespace(cloneInfo.tableName); String namespaceId = TableNamespaces.getNamespaceId(instance, namespace); TableManager tm = TableManager.getInstance(); if (!TableNamespaces.getNameToIdMap(instance).containsKey(namespace)) { tm.addNamespace(namespaceId, namespace, NodeExistsPolicy.SKIP); } tm.addNamespaceToTable(cloneInfo.tableId, namespaceId);
0
package org.apache.felix.dm.lambda.callbacks; import java.util.Objects; import org.osgi.framework.ServiceReference; /** * Represents a callback(Service, ServiceReference) on an Object instance. * * <p> The type of the service passed in argument to the callback is defined by the "S" generic parameter. * * @author <a href="mailto:[email protected]">Felix Project Team</a> */ @FunctionalInterface public interface InstanceCbServiceRef<S> { /** * Handles the given arguments. * @param ref a Service Reference * @param service a Service */ void accept(S service, ServiceReference<S> ref); default InstanceCbServiceRef<S> andThen(InstanceCbServiceRef<S> after) { Objects.requireNonNull(after); return (S service, ServiceReference<S> ref) -> { accept(service, ref); after.accept(service, ref); }; } }
0
import org.apache.hadoop.util.ShutdownHookManager; private static final int LOGFEEDER_SHUTDOWN_HOOK_PRIORITY = 30; JVMShutdownHook logfeederJVMHook = new JVMShutdownHook(); ShutdownHookManager.get().addShutdownHook(logfeederJVMHook, LOGFEEDER_SHUTDOWN_HOOK_PRIORITY);
0
package org.apache.commons.jelly; import java.util.HashMap; import junit.framework.TestCase; /** * * @author <a href="[email protected]">peter royal</a> */ public class TestJellyContext extends TestCase { public TestJellyContext( String s ) { super( s ); } public void testSetVariablesAndRetainContextEntry() { final JellyContext jc = new JellyContext(); assertNotNull( "Initial variable of context", jc.getVariable( "context" ) ); jc.setVariables( new HashMap() ); assertNotNull( "Value after setVariables()", jc.getVariable( "context" ) ); } }
0
* @version $Id: AbstractConfiguration.java,v 1.27 2004/10/18 14:05:22 ebourg Exp $ public void clear() { Iterator it = getKeys(); while (it.hasNext()) { clearProperty((String) it.next()); } } /** * {@inheritDoc} */
0
package org.apache.beam.sdk.io.bigtable; import org.apache.beam.sdk.io.bigtable.BigtableIO.BigtableSource; import org.apache.beam.sdk.values.KV;
0
import org.apache.xml.security.utils.XMLUtils; Document doc = XMLUtils.createDocumentBuilder(false).parse(fis);
0
bundleJar = ObrUtils.getArtifactURI( localRepository, project.getArtifact() ); update = new ObrUpdate( repositoryXml, obrXmlFile, project, mavenRepository, userConfig, log ); update.parseRepositoryXml(); update.updateRepository( bundleJar, null ); update.writeRepositoryXml();
0
import org.apache.beam.sdk.AggregatorRetrievalException; import org.apache.beam.sdk.coders.StringUtf8Coder; import org.apache.beam.sdk.transforms.Aggregator; import org.apache.beam.sdk.transforms.Sum; import org.apache.beam.sdk.util.state.StateSpec; import org.apache.beam.sdk.util.state.StateSpecs; import org.apache.beam.sdk.util.state.ValueState; @Test public void testAggregatorNotPresentInGraph() throws AggregatorRetrievalException { Pipeline p = getPipeline(); IdentityDoFn identityDoFn = new IdentityDoFn(); p.apply(Create.of(KV.of("key", "element1"), KV.of("key", "element2"), KV.of("key", "element3"))) .apply(ParDo.of(identityDoFn)); PipelineResult pipelineResult = p.run(); pipelineResult.getAggregatorValues(identityDoFn.getCounter()).getValues(); } private static class IdentityDoFn extends DoFn<KV<String, String>, String> { private final Aggregator<Long, Long> counter = createAggregator("counter", Sum.ofLongs()); private static final String STATE_ID = "state"; @StateId(STATE_ID) private static final StateSpec<Object, ValueState<String>> stateSpec = StateSpecs.value(StringUtf8Coder.of()); @ProcessElement public void processElement(ProcessContext context, @StateId(STATE_ID) ValueState<String> state){ state.write("state content"); counter.addValue(1L); context.output(context.element().getValue()); } public Aggregator<Long, Long> getCounter() { return counter; } }
0