Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.primitives.UnsignedBytes;
| 0 |
Assert.assertEquals(5, definitionDao.findAll().size());
| 0 |
import org.apache.beam.sdk.values.BeamRecordType;
protected BeamRecordType beamRecordType;
public BeamTextCSVTableIOWriter(BeamRecordType beamRecordType,
String filePattern,
CSVFormat csvFormat) {
this.beamRecordType = beamRecordType;
@Override
public PDone expand(PCollection<BeamRecord> input) {
@ProcessElement
public void processElement(ProcessContext ctx) {
| 0 |
ServerContext context = new ServerContext(new SiteConfiguration());
IZooReaderWriter zk = context.getZooReaderWriter();
| 0 |
prepare(context, roles, components);
| 0 |
@ThreadSafe
| 0 |
public VirtualProcessingPipeline() {
this.resolver = (SourceResolver)this.manager.lookup(SourceResolver.ROLE + "/Local");
| 0 |
*
* An entity is an "instance" of a Type. Entities conform to the definition
* of the Type they correspond with.
| 0 |
package org.apache.aurora.scheduler;
import org.apache.aurora.scheduler.events.PubsubEvent.DriverRegistered;
import org.apache.aurora.scheduler.events.PubsubEvent.EventSubscriber;
import org.apache.aurora.scheduler.storage.Storage.MutableStoreProvider;
import org.apache.aurora.scheduler.storage.Storage.MutateWork;
import org.apache.aurora.scheduler.storage.Storage.NonVolatileStorage;
import org.apache.aurora.scheduler.storage.Storage.StoreProvider;
import org.apache.aurora.scheduler.storage.Storage.Work;
import org.apache.aurora.scheduler.storage.StorageBackfill;
import org.apache.mesos.Protos;
import org.apache.mesos.SchedulerDriver;
| 0 |
import javax.annotation.Nullable;
import java.util.List;
// Maps from the our unique job identifier (<owner>/<jobName>) to the unique identifier used
public Iterable<JobConfiguration> getState() {
return Iterables.transform(scheduledJobs.values(),
new Function<Pair<String, JobConfiguration>, JobConfiguration>() {
@Override public JobConfiguration apply(Pair<String, JobConfiguration> configPair) {
return configPair.getSecond();
}
});
}
@Override
| 0 |
import com.twitter.mesos.scheduler.storage.SnapshotStore;
private SnapshotStore<Snapshot> snapshotStore;
snapshotStore = createMock(new Clazz<SnapshotStore<Snapshot>>() {});
snapshotStore,
Entry entry1 = createMock(Entry.class);
Entry entry2 = createMock(Entry.class);
String frameworkId1 = "bob";
LogEntry recoveredEntry1 =
createTransaction(Op.saveFrameworkId(new SaveFrameworkId(frameworkId1)));
String frameworkId2 = "jim";
LogEntry recoveredEntry2 =
createTransaction(Op.saveFrameworkId(new SaveFrameworkId(frameworkId2)));
expect(entry1.contents()).andReturn(ThriftBinaryCodec.encodeNonNull(recoveredEntry1));
expect(entry2.contents()).andReturn(ThriftBinaryCodec.encodeNonNull(recoveredEntry2));
expect(stream.readAll()).andReturn(Iterators.<Entry>forArray(entry1, entry2));
schedulerStore.saveFrameworkId(frameworkId1);
schedulerStore.saveFrameworkId(frameworkId2);
Snapshot snapshotContents = new Snapshot(NOW, ByteBuffer.wrap("snapshot".getBytes()));
expect(snapshotStore.createSnapshot()).andReturn(snapshotContents);
LogEntry snapshot = LogEntry.snapshot(snapshotContents);
}).times(2);
expect(stream.readAll()).andReturn(Iterators.<Entry>emptyIterator());
// Schedule snapshots.
| 0 |
* @author $Id: 802ba8cc0fdbfbffc871e3232b822f43338eaaf0 $
@ProviderType
| 0 |
import org.apache.accumulo.core.security.thrift.Credential;
private static Credential credentials;
| 1 |
* Interface for handling null results from Chains. Object has the opportunity to substitute an object for the null and
* continue.
*
* Method called on target returned null.
public Object nullMethodResult( Map context, Object target, String methodName, Object[] args );
* Property in target evaluated to null. Property can be a constant String property name or a DynamicSubscript.
public Object nullPropertyValue( Map context, Object target, Object property );
| 0 |
} else {
throw new IllegalStateException("Work Item was neither a MapTask nor a SourceOperation");
| 0 |
protected static final String CONFIGURATIONS_PROPERTY_ID = "recommendations/blueprint/configurations/";
protected Map<String, Map<String, Map<String, String>>> calculateConfigurations(Request request) {
String value = properties.get(property).toString();
| 0 |
*
*
*
this.iterations = iterations;
| 0 |
else if (action == GET_DECLARED_CONSTRUCTOR_ACTION)
{
return ((Class) arg1).getDeclaredConstructor((Class[]) arg2);
}
| 0 |
buffer = session.createBuffer(SshConstants.SSH_MSG_KEX_DH_GEX_GROUP);
| 0 |
private final Configuration configuration;
private final String name;
private final Collection<String> atPath;
private final String at;
| 0 |
import org.apache.batik.anim.dom.AbstractSVGAnimatedLength;
import org.apache.batik.anim.dom.AnimatedLiveAttributeValue;
import org.apache.batik.anim.dom.SVGOMAnimatedEnumeration;
import org.apache.batik.anim.dom.SVGOMAnimatedLengthList;
import org.apache.batik.anim.dom.SVGOMAnimatedNumberList;
import org.apache.batik.anim.dom.SVGOMElement;
import org.apache.batik.anim.dom.SVGOMTextPositioningElement;
| 0 |
import org.apache.cocoon.util.AbstractLogEnabled;
implements Serviceable, Parameterizable, Initializable,
Disposable, JMSConnectionEventListener {
| 0 |
ConfigurableBeanFactory mainContext = BeanFactoryUtil.createBeanFactory(env, result, rootContext, true);
| 0 |
import java.util.HashMap;
import java.util.Map;
| 0 |
import org.apache.xml.security.c14n.implementations.Canonicalizer20010315OmitComments;
import org.apache.xml.security.c14n.implementations.Canonicalizer11_OmitComments;
| 0 |
public void test21WildcardURIMatch()
throws Exception {
Map result = WildcardMatcherHelper.match("*/**", "samples/blocks/");
assertNotNull(result);
assertEquals("", result.get("1"));
}
public void testEmptyPattern() throws Exception {
| 0 |
/*
* Copyright 2002, 2003,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
| 0 |
* http://www.apache.org/licenses/LICENSE-2.0
| 0 |
public boolean isMaintenanceModeIgnored() {
public void setMaintenanceModeIgnored(boolean ignore) {
| 0 |
log.debug("deep copying MapFile: {} -> {}", this, other);
| 0 |
/** A context that is passed to stateful operators when creating {@code State}. */
/** @return {@code StorageProvider} implementation. */
/** @return {@code SpillTools} for possible externalization of data to local storage. */
| 0 |
(String) anyObject(), (String) anyObject(), EasyMock.anyObject(),
EasyMock.anyObject())).andReturn(configGroup).anyTimes();
andReturn(new ConfigGroupResponse(1L, "", "", "", "", new HashSet<>(), new HashSet<>())).atLeastOnce();
| 0 |
import static org.junit.Assert.*;
import java.util.LinkedList;
import java.util.List;
import org.junit.Test;
public class TestConfigurablePluginAttributes {
@Test
Utils.getInputStream(this, "test7.xml"));
@Test
Utils.getInputStream(this, "test7.xml"));
@Test
Utils.getInputStream(this, "test7.xml"));
| 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 |
private volatile int defaultTransactionIsolation = PoolableConnectionFactory.UNKNOWN_TRANSACTION_ISOLATION;
| 0 |
new String[4], // 1xx
// Early Hints - see RFC 8297
setReason(HttpStatus.SC_EARLY_HINTS,
"Early Hints");
| 0 |
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.cocoon.components.elementprocessor.impl.poi.hssf.elements;
import org.apache.cocoon.components.elementprocessor.types.NumericConverter;
import org.apache.cocoon.components.elementprocessor.types.NumericResult;
import java.io.IOException;
/**
* No-op implementation of ElementProcessor to handle the "MaxRow" tag
*
* This element contains the maximum number of rows in the containing
* sheet. The value is contained in the data.
*
* @author Marc Johnson ([email protected])
* @version $Id$
*/
public class EPMaxRow extends BaseElementProcessor {
private NumericResult _max_row;
/**
* constructor
*/
public EPMaxRow() {
super(null);
_max_row = null;
}
/**
* get the maximum row for the containing sheet
* @return maximum row number
* @exception IOException if the data is malformed
*/
public int getMaxRow() throws IOException {
if (_max_row == null) {
_max_row = NumericConverter.extractPositiveInteger(getData());
}
return _max_row.intValue();
}
} // end public class EPMaxRow
| 0 |
* </p>
* </p>
| 0 |
* @throws IllegalArgumentException if no property name is specified
* @throws IllegalAccessException if the Class or the appropriate
* @throws InstantiationException if this Class represents an abstract
| 0 |
cfg.setProperty(Property.INSTANCE_ZK_TIMEOUT, "5s");
Text path = new Text();
for (String table : new String[]{RootTable.NAME, MetadataTable.NAME}) {
Scanner meta = conn.createScanner(table, Authorizations.EMPTY);
meta.setRange(MetadataSchema.CurrentLogsSection.getRange());
outer: for (Entry<Key,Value> entry : meta) {
MetadataSchema.CurrentLogsSection.getPath(entry.getKey(), path);
for (int i = 0; i < paths.length; i++) {
if (path.toString().startsWith(paths[i].toString())) {
continue outer;
}
}
Assert.fail("Unexpected volume " + path);
}
}
| 1 |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.felix.ipojo.manipulator.visitor;
import org.apache.felix.ipojo.manipulator.ManipulationResultVisitor;
import org.apache.felix.ipojo.metadata.Element;
/**
* Empty ManipulationResultVisitor visitor.
* It is useful to extends this class to keep a working visitor chain.
*
* @author <a href="mailto:[email protected]">Felix Project Team</a>
*/
public class ManipulationResultAdapter implements ManipulationResultVisitor {
private ManipulationResultVisitor m_delegate;
public ManipulationResultAdapter(ManipulationResultVisitor delegate) {
m_delegate = delegate;
}
public void visitClassStructure(Element structure) {
m_delegate.visitClassStructure(structure);
}
public void visitManipulatedResource(String type, byte[] resource) {
m_delegate.visitManipulatedResource(type, resource);
}
public void visitEnd() {
m_delegate.visitEnd();
}
}
| 0 |
import org.apache.beam.model.pipeline.v1.Endpoints;
| 0 |
import org.apache.commons.digester3.annotations.handlers.SetTopHandler;
@DigesterRule( reflectsRule = SetTopRule.class, handledBy = SetTopHandler.class )
| 0 |
Document testDocument = XMLUtils.newDocument();
| 0 |
* Default class resolution. Uses ClassLoader.loadClass() to look up classes by name. It also looks in the "java.lang" package
* Resolves a class for a given className
*
* @param className The name of the Class
* @return The resulting Class object
* @throws ClassNotFoundException If the class could not be found
*/
public Class<?> classForName( String className )
throws ClassNotFoundException
{
return classForName( className, null );
}
/**
public Class<?> classForName( String className, Map<String, Object> unused )
ClassLoader classLoader = ClassLoader.getSystemClassLoader();
result = classLoader.loadClass(className);
result = classLoader.loadClass( "java.lang." + className );
| 0 |
* <p>Example 1: get the mean of a {@code PCollection} of {@code Long}s.
* <p>Example 2: calculate the mean of the {@code Integer}s
* <p>See {@link Combine.PerKey} for how this affects timestamps and bucketing.
* <p>Returns {@code Double.NaN} if combining zero elements.
| 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 |
* <code>../../</code> etc) to the base of the current request or sitemap URI. For
* <code>{baselink:SitemapBaseLink}</code> would evaluate to <code>../../</code>.
final static Vector returnNames = new Vector() {
{
add("RequestBaseLink");
add("SitemapBaseLink");
}
};
public Object getAttribute(final String name, final Configuration modeConf, final Map objectModel ) throws ConfigurationException {
String uri;
if (name.equals("SitemapBaseLink"))
uri = ObjectModelHelper.getRequest(objectModel).getSitemapURI();
else if (name.equals("RequestBaseLink"))
uri = ObjectModelHelper.getRequest(objectModel).getRequestURI();
else uri = "";
result.append("../");
getLogger().debug ("Returns " + result + " for uri " + uri + " and attribute " + name);
public Iterator getAttributeNames(final Configuration modeConf, final Map objectModel) throws ConfigurationException {
public Object[] getAttributeValues(final String name, final Configuration modeConf, final Map objectModel )
return (new LinkedList() {
{
add(getAttribute(name, modeConf, objectModel) );
}
}).toArray();
| 0 |
@Override
| 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.
*/
/**
* The scr goal of the maven-scr-plugin looks for the annotations defined in the package when building component descriptors.
* The annotations are not interpreted in runtime.
*/
package org.apache.felix.scrplugin.annotations;
| 0 |
expect(conf.getInt(eq(METRICS_SEND_INTERVAL), anyInt())).andReturn(10).anyTimes();
expect(metric.value()).andReturn(6.0).once();
expect(record.timestamp()).andReturn(now + 100l).times(2);
// time = t4
sink.putMetrics(record);
Assert.assertEquals(new Double(1.0), values.next());
Assert.assertEquals(new Double(6.0), values.next());
| 0 |
/*
* Copyright 2013 Twitter, 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.
*/
| 0 |
return getIter2().hasNext();
| 0 |
* Copyright (C) 2015 Google Inc.
| 0 |
BufferedReader reader = (BufferedReader) pop3.retrieveMessageTop(msginfo.number, 0);
| 0 |
"Cluster100", "Service100", "Component100", "Host100", State.INSTALLED.toString(), stackId.getStackId(), State.STARTED.toString(),
"Cluster100", "Service100", "Component101", "Host100", State.INSTALLED.toString(), stackId.getStackId(), State.STARTED.toString(),
"Cluster100", "Service100", "Component102", "Host100", State.INSTALLED.toString(), stackId.getStackId(), State.STARTED.toString(),
"Cluster102", "Service100", "Component100", "Host100", "STARTED", "", "", ""));
| 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestObject.java,v 1.8 2002/02/26 18:08:58 morgand Exp $
* $Revision: 1.8 $
* $Date: 2002/02/26 18:08:58 $
* @version $Id: TestObject.java,v 1.8 2002/02/26 18:08:58 morgand Exp $
public String getCanonicalEmptyCollectionName(Object object) {
StringBuffer retval = new StringBuffer();
retval.append("data/test/");
String colName = object.getClass().getName();
colName = colName.substring(colName.lastIndexOf(".")+1,colName.length());
retval.append(colName);
retval.append(".emptyCollection.version");
retval.append(getCompatibilityVersion());
retval.append(".obj");
return retval.toString();
}
public String getCanonicalFullCollectionName(Object object) {
StringBuffer retval = new StringBuffer();
retval.append("data/test/");
String colName = object.getClass().getName();
colName = colName.substring(colName.lastIndexOf(".")+1,colName.length());
retval.append(colName);
retval.append(".fullCollection.version");
retval.append(getCompatibilityVersion());
retval.append(".obj");
return retval.toString();
}
| 0 |
package org.apache.commons.digester3.annotations;
| 1 |
this.fileFilters = new ArrayList<>();
this.fileFilters = new ArrayList<>();
this.fileFilters = new ArrayList<>(fileFilters);
this.fileFilters = new ArrayList<>(2);
| 0 |
package org.apache.commons.configuration.io;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.ConfigurationRuntimeException;
| 0 |
package org.ognl.test.objects;
/**
*
*/
public class GameGenericObject implements GenericObject {
public GameGenericObject()
{
super();
}
public int getId()
{
return 20;
}
public String getDisplayName()
{
return "Halo 3";
}
public String getHappy()
{
return "happy";
}
}
| 0 |
SimpleRequestProducer.create(request),
| 0 |
if (watermark.equals(BoundedWindow.TIMESTAMP_MAX_VALUE)) {
| 0 |
package org.apache.beam.sdk.extensions.euphoria.core.testkit;
import org.apache.beam.sdk.extensions.euphoria.core.testkit.junit.AbstractOperatorTest;
import org.apache.beam.sdk.extensions.euphoria.core.testkit.junit.Processing;
| 0 |
* @version $Id: TestBaseConfiguration.java,v 1.17 2004/10/18 21:38:45 epugh Exp $
| 0 |
import org.apache.accumulo.core.client.AccumuloSecurityException;
} catch (RuntimeException e) {
if (e.getCause() instanceof AccumuloSecurityException) {
log.debug("BatchScan " + tableName + " failed, permission error");
} else {
throw e;
}
| 1 |
import org.apache.beam.runners.dataflow.DataflowPipelineRunner;
| 0 |
import org.apache.commons.jexl3.internal.Debugger;
| 1 |
import static org.mockito.Mockito.never;
new ArrayList<Provider<EntityChangeListener>>(), typeSystem, configuration, null);
new ArrayList<Provider<EntityChangeListener>>(), typeSystem, configuration, null);
verify(typeSystem, never()).defineTypes(Matchers.<TypesDef>any());
new ArrayList<Provider<EntityChangeListener>>(), typeSystem, configuration, null);
new ArrayList<Provider<EntityChangeListener>>(), typeSystem, configuration, null);
| 0 |
@SuppressWarnings("synthetic-access")
@SuppressWarnings("synthetic-access")
try(SshClient client = SshClient.setUpDefaultClient()) {
client.start();
try(ClientSession session = client.connect("smx", "localhost", port).await().getSession()) {
session.addPublicKeyIdentity(pairRsaBad);
session.addPublicKeyIdentity(pairRsa);
assertTrue(session.auth().await().isSuccess());
assertEquals(2, count.size());
assertTrue(count.containsKey(KeyUtils.getFingerPrint(pairRsaBad.getPublic())));
assertTrue(count.containsKey(KeyUtils.getFingerPrint(pairRsa.getPublic())));
assertEquals(1, count.get(KeyUtils.getFingerPrint(pairRsaBad.getPublic())).get());
assertEquals(1, count.get(KeyUtils.getFingerPrint(pairRsa.getPublic())).get());
client.close(false).await();
} finally {
client.stop();
}
}
@SuppressWarnings("synthetic-access")
try(SshClient client = SshClient.setUpDefaultClient()) {
client.start();
try(ClientSession session = client.connect("smx", "localhost", port).await().getSession()) {
session.addPublicKeyIdentity(pairRsaBad);
session.addPublicKeyIdentity(pairRsa);
assertTrue(session.auth().await().isSuccess());
} finally {
client.stop();
}
}
}
| 0 |
import org.apache.ambari.server.controller.spi.ExtendedResourceProvider;
import org.apache.ambari.server.controller.spi.QueryResponse;
public class AlertHistoryResourceProvider extends AbstractResourceProvider implements ExtendedResourceProvider{
historyRequest.Predicate = predicate;
historyRequest.Pagination = request.getPageRequest();
historyRequest.Sort = request.getSortRequest();
@Override
public QueryResponse queryForResources(Request request, Predicate predicate)
throws SystemException, UnsupportedPropertyException,
NoSuchResourceException, NoSuchParentResourceException {
return new QueryResponseImpl(
getResources(request, predicate),
request.getSortRequest() != null,
request.getPageRequest() != null,
s_dao.getCount(predicate));
}
* @return the new {@link Resource}
| 0 |
import static org.junit.Assert.assertArrayEquals;
assertArrayEquals(digest, digest2);
assertArrayEquals(digest, digest2);
assertArrayEquals(digest, digest2);
assertArrayEquals(digest, digest2);
assertArrayEquals(digest, digest2);
assertArrayEquals(digest, digest2);
assertArrayEquals(digest, digest2);
assertArrayEquals(digest, digest2);
assertArrayEquals(digest, digest2);
assertArrayEquals(digest, digest2);
assertArrayEquals(digest, digest2);
assertArrayEquals(digest, digest2);
}
| 0 |
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked")
| 0 |
/**
* Wait and verify that the channel has been successfully opened.
*
* @param timeout The number of time units to wait
* @param unit The wait {@link TimeUnit}
* @throws IOException If failed to verify successfully on time
*/
/**
* Wait and verify that the channel has been successfully opened.
*
* @param timeoutMillis Wait timeout in milliseconds
* @throws IOException If failed to verify successfully on time
*/
* @return <code>null</code> if the connect operation is not finished yet,
* @return <code>true</code> if the connect operation is finished successfully.
* @return {@code true} if the connect operation has been canceled by
*
* @param exception The caught {@link Throwable}
| 0 |
/**
* Returns a DefaultFileSystemManager instance (or subclass instance).
*/
public DefaultFileSystemManager getDefaultFileSystemManager() {
return config.getDefaultFileSystemManager();
}
| 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
| 0 |
import java.util.Collections;
import java.util.HashMap;
transient protected Map temporaryAttributes = Collections.EMPTY_MAP;
if ( this.temporaryAttributes.size() == 0 ) {
this.temporaryAttributes = new HashMap();
}
* This includes copies of items and coplet instances.
if ( this.parameters.size() > 0 ) {
clone.parameters = new LinkedMap(this.parameters);
}
if ( this.temporaryAttributes.size() > 0 ) {
clone.temporaryAttributes = new HashMap(this.temporaryAttributes);
}
| 0 |
public interface StateSpec<StateT extends State> extends Serializable {
StateT bind(String id, StateBinder binder);
* Given {code coders} are inferred from type arguments defined for this class. Coders which are
* already set should take precedence over offered coders.
*
* @param coders Array of coders indexed by the type arguments order. Entries might be null if the
* coder could not be inferred.
| 0 |
TestIngest.ingest(c, opts, new BatchWriterOpts());
VerifyIngest.Opts vopts = new VerifyIngest.Opts();
vopts.tableName = tableName;
VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
getCluster().getClusterControl().stopAllServers(ServerType.TABLET_SERVER);
getCluster().getClusterControl().startAllServers(ServerType.TABLET_SERVER);
VerifyIngest.verifyIngest(c, vopts, new ScannerOpts());
| 0 |
* A MapReduce that computes a histogram of byte frequency for each file and stores the histogram alongside the file data. The {@link ChunkInputFormat} is used
* to read the file data from Accumulo. See docs/examples/README.filedata for instructions.
| 0 |
import org.apache.atlas.type.*;
import org.apache.atlas.type.AtlasBuiltInTypes.AtlasObjectIdType;
private void visitReference(AtlasObjectIdType type, Object val) throws AtlasBaseException {
switch (attrType.getTypeCategory()) {
case PRIMITIVE:
case ENUM:
return;
case ARRAY: {
AtlasArrayType arrayType = (AtlasArrayType) attrType;
AtlasType elemType = arrayType.getElementType();
visitCollectionReferences(elemType, val);
}
break;
case MAP: {
AtlasType keyType = ((AtlasMapType) attrType).getKeyType();
AtlasType valueType = ((AtlasMapType) attrType).getValueType();
visitMapReferences(keyType, valueType, val);
}
break;
case STRUCT:
visitStruct((AtlasStructType)attrType, val);
break;
case OBJECT_ID_TYPE:
visitReference((AtlasObjectIdType) attrType, val);
break;
default:
throw new AtlasBaseException(AtlasErrorCode.TYPE_CATEGORY_INVALID, attrType.getTypeCategory().name());
| 0 |
import org.apache.ambari.server.orm.entities.KerberosPrincipalEntity;
import org.apache.ambari.server.serveraction.ActionLog;
installAmbariIdentity(ambariServerIdentity, configurations);
/**
* Performs tasks needed to install the Kerberos identities created for the Ambari server.
*
* @param ambariServerIdentity the ambari server's {@link KerberosIdentityDescriptor}
* @param configurations a map of compiled configrations used for variable replacment
* @throws AmbariException
* @see ConfigureAmbariIndetityServerAction#installAmbariServerIdentity(String, String, String, ActionLog)
*/
private void installAmbariIdentity(KerberosIdentityDescriptor ambariServerIdentity,
Map<String, Map<String, String>> configurations) throws AmbariException {
KerberosPrincipalEntity ambariServerPrincipalEntity = kerberosPrincipalDAO.find(principal);
if(ambariServerPrincipalEntity != null) {
if(keytabDescriptor != null) {
String keytabFilePath = variableReplacementHelper.replaceVariables(keytabDescriptor.getFile(), configurations);
.installAmbariServerIdentity(principal, ambariServerPrincipalEntity.getCachedKeytabPath(), keytabFilePath, null);
| 0 |
private static final long serialVersionUID = -5668999920978520157L;
| 0 |
/** Create a new {@link RunnerPCollectionView} from the provided components. */
throw new UnsupportedOperationException(
String.format("A %s cannot be expanded", RunnerPCollectionView.class.getSimpleName()));
| 1 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestFastTreeMap.java,v 1.3 2001/04/21 12:22:30 craigmcc Exp $
* $Revision: 1.3 $
* $Date: 2001/04/21 12:22:30 $
import java.util.TreeMap;
* @version $Id: TestFastTreeMap.java,v 1.3 2001/04/21 12:22:30 craigmcc Exp $
public class TestFastTreeMap extends TestTreeMap
FastTreeMap ftm = new FastTreeMap();
ftm.setFast(false);
return (ftm);
map = (TreeMap) makeMap();
| 0 |
import org.apache.http.annotation.Immutable;
| 0 |
public static final String DEFAULT_SSH_VERSION_PREFIX="SSH-2.0-";
| 0 |
public void deleteLocks(IZooReaderWriter zk, String path, String txidStr)
| 0 |
/**
* Copyright 2013 Apache Software Foundation
| 0 |
if (painters == null)
Area paintedArea = new Area();
for (int i=0; i < count; ++i) {
Shape s = painters[i].getPaintedArea();
if (s != null) {
paintedArea.add(new Area(s));
}
return paintedArea;
if (painters == null)
Rectangle2D bounds = null;
for (int i=0; i < count; ++i) {
Rectangle2D pb = painters[i].getPaintedBounds2D();
if (pb == null) continue;
if (bounds == null) bounds = (Rectangle2D)pb.clone();
else bounds.add(pb);
return bounds;
* Returns the area covered by this shape painter (even if nothing
* is painted there).
*/
public Shape getSensitiveArea() {
if (painters == null)
return null;
Area paintedArea = new Area();
for (int i=0; i < count; ++i) {
Shape s = painters[i].getSensitiveArea();
if (s != null) {
paintedArea.add(new Area(s));
}
}
return paintedArea;
}
/**
* Returns the bounds of the area painted by this shape painter
*/
public Rectangle2D getSensitiveBounds2D() {
if (painters == null)
return null;
Rectangle2D bounds = null;
for (int i=0; i < count; ++i) {
Rectangle2D pb = painters[i].getSensitiveBounds2D();
if (bounds == null) bounds = (Rectangle2D)pb.clone();
else bounds.add(pb);
}
return bounds;
}
/**
| 0 |
final SSLContext sslcontext;
| 0 |
@Override
@Override
| 0 |
* than <code>invokeExactMethod()</code>.
* @return The value returned by the invoked method
* @return The value returned by the invoked method
* @return The value returned by the invoked method
* @return The value returned by the invoked method
* <code>getAccessibleMethod()</code>.</p>
* @return The value returned by the invoked method
* <code>getAccessibleMethod()</code>.</p>
* @return The value returned by the invoked method
* @return The accessible method
* @return The accessible method
* @return The accessible method
* @return The accessible method
* @param srcArgs The source arguments
* @param destArgs The destination arguments
* @return The total transformation cost
* @param srcClass The source class
* @param destClass The destination class
* @return The cost of transforming an object
| 0 |
private static final Logger LOG = LoggerFactory.getLogger(Users.class);
| 0 |
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
| 0 |
import org.apache.hc.core5.http.ClassicHttpRequest;
* Extracts request path from the given {@link ClassicHttpRequest}
protected String getRequestPath(final ClassicHttpRequest request) {
public HttpRequestHandler lookup(final ClassicHttpRequest request, final HttpContext context) {
| 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.security;
import java.util.HashSet;
import org.junit.Assert;
import org.junit.Test;
/**
*
*/
public class SecurityErrorCodeTest {
@SuppressWarnings("deprecation")
@Test
public void testEnumsSame() {
HashSet<String> secNames1 = new HashSet<String>();
HashSet<String> secNames2 = new HashSet<String>();
HashSet<String> secNames3 = new HashSet<String>();
for (SecurityErrorCode sec : SecurityErrorCode.values())
secNames1.add(sec.name());
for (org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode sec : org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode.values())
secNames2.add(sec.name());
for (org.apache.accumulo.core.security.thrift.SecurityErrorCode sec : org.apache.accumulo.core.security.thrift.SecurityErrorCode.values())
secNames3.add(sec.name());
Assert.assertEquals(secNames1, secNames2);
Assert.assertEquals(secNames1, secNames3);
}
}
| 0 |
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap;
| 0 |
import org.apache.cocoon.util.ClassUtils;
* @version CVS $Id: AbstractTextSerializer.java,v 1.3 2003/03/19 17:37:12 sylvain Exp $
Configuration tFactoryConf = conf.getChild("transformer-factory", false);
if (tFactoryConf != null) {
String tFactoryClass = tFactoryConf.getValue();
try {
this.tfactory = (SAXTransformerFactory)ClassUtils.newInstance(tFactoryClass);
if (getLogger().isDebugEnabled()) {
getLogger().debug("Using transformer factory " + tFactoryClass);
}
} catch(Exception e) {
throw new ConfigurationException("Cannot load transformer factory " + tFactoryClass, e);
}
} else {
// Standard TrAX behaviour
this.tfactory = (SAXTransformerFactory)TransformerFactory.newInstance();
}
tfactory.setErrorListener(new TraxErrorHandler(getLogger()));
| 0 |
.setSlaveId(
Protos.SlaveID.newBuilder().setValue(t.getAssignedTask().getSlaveId()).build())
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.