Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
public SingletonIterator2Test(final String testName) {
final SingletonIterator<E> iter = new SingletonIterator<E>((E) testValue);
final Iterator<E> iter = makeObject();
final E iterValue = iter.next();
} catch (final Exception e) {
final ResettableIterator<E> it = makeObject(); | 0 |
import static com.google.common.base.Charsets.UTF_8;
rowMatcher.reset(new String(m.getRow(), UTF_8)); | 0 |
import org.apache.http.HttpHeaders;
import org.apache.http.impl.io.EmptyInputStream;
} else if (len == 0L) {
return EmptyInputStream.INSTANCE;
final Header contentTypeHeader = message.getFirstHeader(HttpHeaders.CONTENT_TYPE);
final Header contentEncodingHeader = message.getFirstHeader(HttpHeaders.CONTENT_ENCODING); | 0 |
public String[] buildVariationURLs(String svgDir, String svgFile){
return new String[] {getVariationPrefix() + svgDir + getVariationSuffix() +
svgFile + '-' +textID+ '-' + start + '-' + end +PNG_EXTENSION}; | 0 |
import org.apache.atlas.services.MetadataService;
import org.apache.atlas.typesystem.json.InstanceSerialization;
import org.codehaus.jettison.json.JSONArray;
import java.util.List;
public static String createInstance(MetadataService metadataService, Referenceable entity) throws Exception {
RequestContext.createContext();
String entityjson = InstanceSerialization.toJson(entity, true);
JSONArray entitiesJson = new JSONArray();
entitiesJson.put(entityjson);
List<String> guids = metadataService.createEntities(entitiesJson.toString());
if (guids != null && guids.size() > 0) {
return guids.get(guids.size() - 1);
}
return null;
} | 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 |
* Basic implementation of an HTTP request that can be modified. Methods of the
* {@link AbortableHttpRequest) interface implemented by this class are thread safe.
private volatile boolean aborted;
if (this.aborted) {
throw new IOException("Request already aborted");
}
if (this.aborted) {
throw new IOException("Request already aborted");
}
private void cleanup() {
if (this.connRequest != null) {
this.connRequest.abortRequest();
this.connRequest = null;
}
if (this.releaseTrigger != null) {
try {
this.releaseTrigger.abortConnection();
} catch (IOException ex) {
}
this.releaseTrigger = null;
}
}
public void abort() {
if (this.aborted) {
return;
}
cleanup();
/**
* Resets internal state of the request making it reusable.
*
* @since 4.2
*/
public void reset() {
this.abortLock.lock();
try {
cleanup();
this.aborted = false;
} finally {
this.abortLock.unlock();
}
}
/**
* A convenience method to simplify migration from HttpClient 3.1 API. This method is
* equivalent to {@link #reset()}.
*
* @since 4.2
*/
public void releaseConnection() {
reset();
}
| 0 |
import org.apache.beam.runners.core.KeyedWorkItem;
import org.apache.beam.runners.core.KeyedWorkItems;
private TransformEvaluator<KeyedWorkItem<K, KV<K, InputT>>> createEvaluator(
PCollection<? extends KeyedWorkItem<K, KV<K, InputT>>>, PCollectionTuple,
CommittedBundle<KeyedWorkItem<K, KV<K, InputT>>> inputBundle)
PCollection<? extends KeyedWorkItem<K, KV<K, InputT>>>, PCollectionTuple,
PCollection<? extends KeyedWorkItem<K, KV<K, InputT>>>, PCollectionTuple,
implements TransformEvaluator<KeyedWorkItem<K, KV<K, InputT>>> {
public void processElement(WindowedValue<KeyedWorkItem<K, KV<K, InputT>>> gbkResult)
throws Exception {
for (WindowedValue<KV<K, InputT>> windowedValue : gbkResult.getValue().elementsIterable()) {
delegateEvaluator.processElement(windowedValue);
public TransformResult<KeyedWorkItem<K, KV<K, InputT>>> finishBundle() throws Exception {
StepTransformResult.Builder<KeyedWorkItem<K, KV<K, InputT>>> regroupedResult =
StepTransformResult.<KeyedWorkItem<K, KV<K, InputT>>>withHold(
WindowedValue<KeyedWorkItem<K, KV<K, InputT>>> pushedBack =
KeyedWorkItems.elementsWorkItem(
windowedKv.getValue().getKey(), Collections.singleton(windowedKv))); | 0 |
Element svgPolygon = domFactory.createElementNS(SVG_NAMESPACE_URI, TAG_POLYGON);
svgPolygon.setAttributeNS(null, ATTR_POINTS, points.substring(0, points.length() - 1)); | 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 | 1 |
final CharsetEncoder charencoder) {
super(buffersize);
this(buffersize, linebuffersize, charset != null ? charset.newEncoder() : null);
this(buffersize, linebuffersize, (CharsetEncoder) null);
}
/**
* @since 4.3
*/
public SessionOutputBufferImpl(final int buffersize) {
this(buffersize, 256); | 0 |
import org.apache.hadoop.metrics2.util.Servers; | 0 |
import org.apache.http.protocol.BasicHttpContext;
HttpContext context = new BasicHttpContext();
HttpContext context = new BasicHttpContext();
HttpContext context = new BasicHttpContext();
HttpContext context = new BasicHttpContext(); | 0 |
if (!cbuf.hasRemaining()) {
return;
} | 0 |
if (cc== null || cc.length() == 0) {
}
for (String recpt : ccList) {
} | 1 |
/* $Id$ | 0 |
dataset.computeIfAbsent(tableReference.getTableId(), k -> new TableContainer(table)); | 0 |
package org.apache.felix.dm.test.bundle.annotation.composite;
public interface C1Service
{
} | 0 |
PCollectionConsumerRegistry consumers =
new PCollectionConsumerRegistry(
metricsContainerRegistry, mock(ExecutionStateTracker.class));
PCollectionConsumerRegistry consumers =
new PCollectionConsumerRegistry(
metricsContainerRegistry, mock(ExecutionStateTracker.class));
PCollectionConsumerRegistry consumers =
new PCollectionConsumerRegistry(
metricsContainerRegistry, mock(ExecutionStateTracker.class));
PCollectionConsumerRegistry consumers =
new PCollectionConsumerRegistry(
metricsContainerRegistry, mock(ExecutionStateTracker.class)); | 0 |
import java.util.Collection;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonSerialize; | 0 |
throw Throwables.propagate(t); | 0 |
} catch (RuntimeException e) {
return false; | 0 |
try (BigQueryTableRowIterator ignored = iterator) {
List<TableRow> elems = new ArrayList<>();
iterator.open();
while (iterator.advance()) {
elems.add(iterator.getCurrent());
}
LOG.info("Number of records read from BigQuery: {}", elems.size());
context.setPCollection(context.getOutput(transform), elems);
} catch (IOException | InterruptedException e) {
throw new RuntimeException(e);
} | 0 |
/**
* @version $Id: ScriptableWidget.java,v 1.10 2004/02/11 10:43:32 antonio Exp $
*
*/ | 0 |
$Id: ConditionFactory.java,v 1.3 2004/03/01 11:24:11 andreas Exp $
* Factory to build conditions.
* @author <a href="mailto:[email protected]">Andreas Hartmann</a>
* @version $Id: ConditionFactory.java,v 1.3 2004/03/01 11:24:11 andreas Exp $ | 0 |
protected EnumerationUtils() {} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/decorators/Attic/LazyList.java,v 1.2 2003/05/07 11:20:21 scolebourne Exp $
* @version $Revision: 1.2 $ $Date: 2003/05/07 11:20:21 $
//----------------------------------------------------------------------- | 0 |
public void changed(@SuppressWarnings("unused") File file) {}
public void signal(@SuppressWarnings("unused") Reporter reporter) { | 0 |
package org.apache.zookeeper.server; | 0 |
this(headerIterator, BasicHeaderValueParser.INSTANCE); | 0 |
* @param <T> the type of the value stored in the broadcast variable
* @param <T> the type of the value stored in the broadcast variable | 0 |
PROPAGATED_CLASSIFICATION_NOT_ASSOCIATED_WITH_ENTITY(400, "ATLAS-400-00-070", "Propagated classification {0} is not associated with entity"), | 1 |
package org.apache.jcp.xml.dsig.internal.dom; | 0 |
import org.apache.ambari.server.state.HostComponentAdminState;
@Enumerated(value = EnumType.STRING)
@Column(name = "admin_state", nullable = true, insertable = true, updatable = true)
private HostComponentAdminState adminState;
public HostComponentAdminState getAdminState() {
return adminState;
}
public void setAdminState(HostComponentAdminState attribute) {
this.adminState = attribute;
}
| 0 |
import java.util.List;
import org.apache.beam.sdk.testutils.NamedTestResult;
static void handleFailure(
final PipelineResult pipelineResult, final List<NamedTestResult> testResults)
Optional<JobFailure> failure = lookForFailure(pipelineResult, testResults);
PipelineResult pipelineResult, List<NamedTestResult> testResults) {
return lookForMetricResultFailure(testResults);
private static Optional<JobFailure> lookForMetricResultFailure(
List<NamedTestResult> testResults) {
boolean isTestResultInvalid =
testResults.stream().anyMatch(namedTestResult -> namedTestResult.getValue() == -1D);
if (isTestResultInvalid) { | 0 |
import cz.seznam.euphoria.shaded.guava.com.google.common.base.Joiner; | 0 |
private boolean closed;
this.closed = false;
if (closed) {
throw new IllegalStateException("Already closed.");
}
closed = true;
if (closed) {
throw new IllegalStateException("Already closed.");
} | 0 |
throw new XmlStreamReaderException(msg, bomEnc, xmlGuessEnc, xmlEnc); | 0 |
import org.apache.beam.sdk.values.PCollectionList;
public List<RelNode> getPCollectionInputs() {
return ImmutableList.of(BeamSqlRelUtils.getBeamRelInput(left));
public PTransform<PCollectionList<Row>, PCollection<Row>> buildPTransform() {
private class Transform extends PTransform<PCollectionList<Row>, PCollection<Row>> {
public PCollection<Row> expand(PCollectionList<Row> pinput) {
PCollection<Row> outer = pinput.get(0); | 0 |
Configuration.class.getMethod( "getChangeCount", (Class<?>[]) null );
private ServiceRegistration<?> m_registration;
Dictionary<String, Object> props = new Hashtable<String, Object>();
public boolean configureComponentHolder(final ComponentHolder<?> holder)
Collection<ComponentHolder<?>> holders;
for ( ComponentHolder<?> componentHolder: holders )
componentHolder.configurationDeleted( pid, factoryPid );
final ConfigurationInfo configInfo = getConfigurationInfo( pid, targetedPid, componentHolder, bundleContext );
componentHolder.configurationDeleted( pid, factoryPid );
final ConfigurationInfo configInfo = getConfigurationInfo( pid, targetedPid, componentHolder, bundleContext );
componentHolder.configurationDeleted( pid, factoryPid );
final ConfigurationInfo configInfo = getConfigurationInfo( pid, targetedPid, componentHolder, bundleContext );
componentHolder.configurationDeleted( pid, factoryPid );
* @param targetedPid the targeted factory pid for a factory configuration or the pid for a singleton configuration
private ConfigurationInfo getConfigurationInfo(final TargetedPID pid, TargetedPID targetedPid,
ComponentHolder<?> componentHolder, final BundleContext bundleContext)
changeCounter.getChangeCount( config, true, componentHolder.getChangeCount( pid, targetedPid ) ) ); | 0 |
* @version $Revision: 561984 $ $Date: 2007-08-01 15:56:34 -0700 (Wed, 01 Aug 2007) $ | 0 |
import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AGENT_STACK_RETRY_ON_UNAVAILABILITY;
import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AGENT_STACK_RETRY_COUNT;
Map<String, String> hostLevelParams = execCmd.getHostLevelParams();
hostLevelParams.put(AGENT_STACK_RETRY_ON_UNAVAILABILITY, configs.isAgentStackRetryOnInstallEnabled());
hostLevelParams.put(AGENT_STACK_RETRY_COUNT, configs.getAgentStackRetryOnInstallCount());
addRepoInfoToHostLevelParams(cluster, hostLevelParams, hostName); | 0 |
return getDigester().from(data);
}
public static MD5 digest(File f) throws NoSuchAlgorithmException, Exception {
return getDigester().from(f);
}
public static MD5 digest(InputStream f) throws NoSuchAlgorithmException, Exception {
return getDigester().from(f); | 0 |
import org.apache.batik.util.gui.resource.ResourceManager;
* The resource manager to decode messages.
*/
protected static ResourceManager resourceManager =
new ResourceManager(localizableSupport.getResourceBundle());
/**
resourceManager = new ResourceManager(localizableSupport.getResourceBundle());
return resourceManager.getString(key);
return resourceManager.getInteger(key); | 0 |
private static org.slf4j.Logger log =
org.slf4j.LoggerFactory.getLogger(PrivateKeyResolver.class);
String alias = aliases.nextElement();
String alias = aliases.nextElement();
String alias = aliases.nextElement();
String alias = aliases.nextElement(); | 1 |
public int getFirst() { return 0; }
public int getLast() { return 0; }
| 0 |
* Copyright (c) OSGi Alliance (2004, 2008). All Rights Reserved.
* <code>ScheduledApplication</code> instances are registered as services. The
* {@link #APPLICATION_PID} service property contains the PID of the application
* being scheduled, the {@link #SCHEDULE_ID} service property contains the
* schedule identifier.
*
* @version $Revision: 5673 $ | 0 |
List<TabletMigration> result = new ArrayList<>(migrations.size()); | 1 |
if (exp >= 128) {
if (mant >= (1 << 26)) { | 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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.hc.core5.http.nio;
import org.apache.hc.core5.http.nio.reactor.IOSession;
/**
* Factory for {@link NHttpConnection} instances.
*
* @since 4.2
*/
public interface NHttpConnectionFactory<T extends NHttpConnection> {
T createConnection(IOSession session);
} | 1 |
package org.apache.http.nio.reactor; | 0 |
@Override
public void snapshot() {
// No-op.
} | 0 |
public interface IRepositoryType
{
String getType();
String getId();
Image getIcon();
boolean isDynamic(); | 0 |
WAL, RFILE | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/SetRootRule.java,v 1.6 2002/08/05 20:52:30 craigmcc Exp $
* $Revision: 1.6 $
* $Date: 2002/08/05 20:52:30 $
* @version $Revision: 1.6 $ $Date: 2002/08/05 20:52:30 $
* Should we use exact matching. Default is no.
* <p>Is exact matching being used.</p> | 0 |
int result = sendData(
int result = sendData(new String(Base64.encodeBase64(toEncode)));
if (sendData(
int result = sendData( | 0 |
public long getDataDirSize() {
return zks.getDataDirSize();
}
public long getLogDirSize() {
return zks.getLogDirSize();
} | 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.sshd.common.auth;
import org.apache.sshd.common.NamedFactory;
/**
* Represents a user authentication method
*
* @param <M> The authentication method factory type
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
*/
// CHECKSTYLE:OFF
public interface UserAuthMethodFactory<M> extends NamedFactory<M> {
/**
* Password authentication method name
*/
String PASSWORD = "password";
/**
* Public key authentication method name
*/
String PUBLIC_KEY = "publickey";
/**
* Keyboard interactive authentication method
*/
String KB_INTERACTIVE = "keyboard-interactive";
}
//CHECKSTYLE:ON | 0 |
/**
* Copyright 2016 Seznam a.s.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ | 0 |
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.gvt.event;
import java.util.EventListener;
/**
* The listener interface for receiving graphics node paint events.
*
* @author <a href="mailto:[email protected]">Thierry Kormann</a>
* @version $Id$
*/
public interface GraphicsNodePaintListener extends EventListener {
/**
* Invoked when a graphics node has been modified and need to be repainted.
* @param evt the graphics node paint event
*/
void graphicsNodeModified(GraphicsNodePaintEvent evt);
} | 0 |
private BulkInfo info;
public CompleteBulkImport(BulkInfo info) {
this.info = info;
return new CleanUpBulkImport(info); | 0 |
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList; | 0 |
import org.apache.cocoon.forms.event.*;
* @version CVS $Id: Field.java,v 1.10 2004/04/27 09:17:01 bruno Exp $
/** Overrides selection list defined in FieldDefinition, if any. */
/** Additional listeners to those defined as part of the widget definition (if any). */
private ValueChangedListener listener;
/**
* Adds a ValueChangedListener to this widget instance. Listeners defined
* on the widget instance will be executed in addtion to any listeners
* that might have been defined in the widget definition.
*/
public void addValueChangedListener(ValueChangedListener listener) {
this.listener = WidgetEventMulticaster.add(this.listener, listener);
}
public void removeValueChangedListener(ValueChangedListener listener) {
this.listener = WidgetEventMulticaster.remove(this.listener, listener);
}
private void fireValueChangedEvent(ValueChangedEvent event) {
if (this.listener != null) {
this.listener.valueChanged(event);
}
}
fireValueChangedEvent((ValueChangedEvent)event); | 0 |
*
*
*
@Parameter(names = "--num", required = true)
@Parameter(names = "--min")
@Parameter(names = "--max")
@Parameter(names = "--size", required = true, description = "size of the value to write")
@Parameter(names = "--vis", converter = VisibilityConverter.class)
@Parameter(names = "--seed", description = "seed for pseudo-random number generator")
System.err
.println(String
.format(
"You must specify a min and a max that allow for at least num possible values. For example, you requested %d rows, but a min of %d and a max of %d only allows for %d rows.",
opts.num, opts.min, opts.max, (opts.max - opts.min)));
| 0 |
import com.google.common.annotations.VisibleForTesting;
static boolean isLoaded() {
@VisibleForTesting
void mutate(List<Mutation> mutations, int mutationCount) {
@VisibleForTesting | 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 |
/*
* $Header: /cvshome/build/ee.foundation/src/java/security/spec/EncodedKeySpec.java,v 1.6 2006/03/14 01:20:30 hargrave Exp $
*
* (C) Copyright 2001 Sun Microsystems, Inc.
* Copyright (c) OSGi Alliance (2001, 2005). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package java.security.spec;
public abstract class EncodedKeySpec implements java.security.spec.KeySpec {
public EncodedKeySpec(byte[] var0) { }
public byte[] getEncoded() { return null; }
public abstract java.lang.String getFormat();
}
| 0 |
new String[]{"blueprint_name", "hostgroup_name"}, "hostgroup", new String[]{"blueprint_name", "name"}, true); | 0 |
package org.apache.atlas.typesystem.types;
import org.apache.atlas.MetadataException;
import org.apache.atlas.typesystem.IStruct;
import org.apache.atlas.typesystem.ITypedInstance;
import org.apache.atlas.typesystem.ITypedStruct;
import org.apache.atlas.typesystem.Struct;
import static org.apache.atlas.typesystem.types.utils.TypesUtil.createClassTypeDef;
import static org.apache.atlas.typesystem.types.utils.TypesUtil.createOptionalAttrDef;
import static org.apache.atlas.typesystem.types.utils.TypesUtil.createRequiredAttrDef;
import static org.apache.atlas.typesystem.types.utils.TypesUtil.createTraitTypeDef; | 0 |
* Tests if reloads are recognized by subset().
*/
public void testSubsetWithReload() throws ConfigurationException
{
XMLConfiguration c = setUpReloadTest();
Configuration sub = c.subset("test");
assertEquals("New value not read", "newValue", sub.getString("entity"));
}
/**
* Tests if reloads are recognized by configurationAt().
*/
public void testConfigurationAtWithReload() throws ConfigurationException
{
XMLConfiguration c = setUpReloadTest();
HierarchicalConfiguration sub = c.configurationAt("test(0)");
assertEquals("New value not read", "newValue", sub.getString("entity"));
}
/**
* Tests if reloads are recognized by configurationsAt().
*/
public void testConfigurationsAtWithReload() throws ConfigurationException
{
XMLConfiguration c = setUpReloadTest();
List configs = c.configurationsAt("test");
assertEquals("New value not read", "newValue",
((HierarchicalConfiguration) configs.get(0))
.getString("entity"));
}
/**
* Prepares a configuration object for testing a reload operation.
*
* @return the initialized configuration
* @throws ConfigurationException if an error occurs
*/
private XMLConfiguration setUpReloadTest() throws ConfigurationException
{
removeTestFile();
conf.save(testSaveConf);
XMLConfiguration c = new XMLConfiguration(testSaveConf);
c.setReloadingStrategy(new FileChangedReloadingStrategy()
{
// Report always a change
protected boolean hasChanged()
{
return true;
}
});
conf.setProperty("test(0).entity", "newValue");
conf.save(testSaveConf);
return c;
}
/** | 0 |
ClientContext context = new ClientContext(getClientInfo()); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/jelly-tags/jms/src/java/org/apache/commons/jelly/tags/jms/DestinationTag.java,v 1.3 2003/10/09 21:21:20 rdonkin Exp $
* $Revision: 1.3 $
* $Date: 2003/10/09 21:21:20 $
* 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.
* $Id: DestinationTag.java,v 1.3 2003/10/09 21:21:20 rdonkin Exp $
* @version $Revision: 1.3 $ | 0 |
import org.apache.commons.lang.StringUtils;
userName = StringUtils.lowerCase(userEntity.getUserName()); // normalize to lower case | 0 |
return Response.status(status).entity(errorEntity).type(JSON_MEDIA_TYPE).build(); | 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.accumulo.core.client.admin;
import java.util.SortedSet;
public class DiskUsage {
protected final SortedSet<String> tables;
protected Long usage;
public DiskUsage(SortedSet<String> tables, Long usage) {
this.tables = tables;
this.usage = usage;
}
public SortedSet<String> getTables() {
return tables;
}
public Long getUsage() {
return usage;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (!(o instanceof DiskUsage))
return false;
DiskUsage diskUsage = (DiskUsage) o;
if (tables != null ? !tables.equals(diskUsage.tables) : diskUsage.tables != null)
return false;
if (usage != null ? !usage.equals(diskUsage.usage) : diskUsage.usage != null)
return false;
return true;
}
@Override
public int hashCode() {
int result = tables != null ? tables.hashCode() : 0;
result = 31 * result + (usage != null ? usage.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "DiskUsage{" + "tables=" + tables + ", usage=" + usage + '}';
}
} | 0 |
* @version $Revision$ | 0 |
import org.apache.commons.vfs.*;
final FileObject[] children;
try
{
children = file.getChildren();
}
// VFS-210
catch (FileNotFolderException e)
{
throw new FileNotFolderException(getName(), e);
}
final String[] childNames = new String[children.length]; | 0 |
package org.apache.commons.jexl2;
import org.apache.commons.jexl2.parser.ASTJexlScript; | 0 |
Servers.parse(configuration.getProperty(configuration.getProperty(COLLECTOR_HOST_PROPERTY)), 6188); | 0 |
import com.fasterxml.jackson.annotation.JsonCreator;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream; | 0 |
* A scanner that presents a row isolated view of an accumulo table. Rows are buffered in memory on the client side. If you think your rows may not fit into | 0 |
public static final String KERBEROS_KEYTAB_CACHE_DIR_KEY = "kerberos.keytab.cache.dir";
public static final String KERBEROS_KEYTAB_CACHE_DIR_DEFAULT = "/var/lib/ambari-server/data/cache";
* Gets the directory where Ambari is to store cached keytab files.
*
* @return a File containing the path to the directory to use to store cached keytab files
*/
public File getKerberosKeytabCacheDir() {
String fileName = properties.getProperty(KERBEROS_KEYTAB_CACHE_DIR_KEY, KERBEROS_KEYTAB_CACHE_DIR_DEFAULT);
return new File(fileName);
}
/** | 0 |
*
*
*
*
*
} | 1 |
suite.addTest(TestTimeoutBuffer.suite()); | 0 |
import java.util.HashMap; | 0 |
import java.util.ArrayList;
import java.util.Collection;
import java.util.List; | 0 |
import org.apache.sshd.client.subsystem.sftp.impl.DefaultCloseableHandle; | 0 |
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.MoreObjects.firstNonNull;
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkArgument;
import org.apache.beam.vendor.guava.v20_0.com.google.common.annotations.VisibleForTesting;
import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions; | 0 |
import java.util.ArrayDeque;
import java.util.Deque;
Deque<Long> packetsCommitted = new ArrayDeque<>();
Deque<PacketInFlight> packetsNotCommitted = new ArrayDeque<>(); | 0 |
protected static class ForwardEventListener
implements UnwrappedEventListener { | 0 |
public static final String WALOG_ARCHIVE_DIR = "walogArchive";
public static final String FILE_ARCHIVE_DIR = "fileArchive";
return VolumeConfiguration.prefix(getBaseUris(), WALOG_ARCHIVE_DIR);
}
public static String[] getFileArchives() {
return VolumeConfiguration.prefix(getBaseUris(), FILE_ARCHIVE_DIR); | 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 |
in = new ContentLengthInputStream(new SessionInputBufferMockup(new byte[20]), 10L);
in.skip(5);
assertEquals(5, in.read(new byte[20])); | 0 |
BootstrapEnvironment env = new OSGiBootstrapEnvironment(this.classLoader, ctx);
env.log("OSGiBootstrapEnvironment created");
CoreUtil coreUtil = new CoreUtil(env);
env.log("CoreUtil created");
this.core = coreUtil.getCore();
this.processor = coreUtil.createCocoon();
manager.addInstance(Processor.ROLE, this.processor); | 0 |
assertEquals(char[].class, column.getType()); | 0 |
package org.apache.beam.sdk.extensions.sql.impl.interpreter.operator.comparison; | 0 |
Long getId();
String getClusterName();
Batch getBatch();
void setBatch(Batch batch);
Schedule getSchedule();
void setSchedule(Schedule schedule);
RequestScheduleResponse convertToResponse();
void persist();
void refresh();
void delete();
String getStatus();
void setDescription(String description);
String getDescription();
void setStatus(Status status);
void setLastExecutionStatus(String status);
void setAuthenticatedUserId(Integer username);
void setCreateUser(String username);
void setUpdateUser(String username);
String getCreateTime();
String getUpdateTime();
Integer getAuthenticatedUserId();
String getCreateUser();
String getUpdateUser();
String getLastExecutionStatus();
RequestScheduleResponse convertToResponseWithBody();
String getRequestBody(Long batchId);
void updateStatus(Status status);
enum Status { | 0 |
AtlasTypesDef toCreate = new AtlasTypesDef(Collections.<AtlasEnumDef>emptyList(),
Collections.<AtlasStructDef>emptyList(),
classificationDefs,
Collections.<AtlasEntityDef>emptyList());
toCreate = new AtlasTypesDef(Collections.<AtlasEnumDef>emptyList(),
Collections.<AtlasStructDef>emptyList(),
Collections.<AtlasClassificationDef>emptyList(),
entityDefs); | 0 |
*
*
* Takes a {@link CryptoModuleParameters} object containing an {@link OutputStream} to wrap within a {@link CipherOutputStream}. The various other parts of
* the {@link CryptoModuleParameters} object specify the details about the type of encryption to use. Callers should pay special attention to the
*
*
*
* That stream may be exactly the same stream as {@link CryptoModuleParameters#getPlaintextInputStream()} if the params object specifies no
* cryptography.
*
*
*
* That stream may be exactly the same stream as {@link CryptoModuleParameters#getEncryptedInputStream()} if the params object specifies no
* cryptography.
* Generates a random session key and sets it into the {@link CryptoModuleParameters#getPlaintextKey()} property. Saves callers from having to set up their
* own secure random provider. Also will set the {@link CryptoModuleParameters#getSecureRandom()} property if it has not already been set by some other
* function.
*
* @param params
* a {@link CryptoModuleParameters} object contained a correctly instantiated set of properties.
* {@link CryptoModuleParameters#getCipher()} property. Callers may choose to use this method if they want to get the initialization vector from the cipher
* before proceeding to create wrapped streams.
*
* @param params
* a {@link CryptoModuleParameters} object contained a correctly instantiated set of properties.
| 0 |
} else {
// If the stat is null, the node is now gone which is fine.
return; | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.