Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
* Parses and XML Document for a property node for a <name> with the value propertyName if it finds one the function return that property's value for
* its <value> node. If not found the function will return null | 0 |
package org.apache.felix.connect; | 0 |
public void testEncodedSizeNested() throws Exception {
NullableCoder<String> varLenCoder = NullableCoder.of(StringUtf8Coder.of());
assertEquals(1, varLenCoder.getEncodedElementByteSize(null, Context.OUTER));
assertEquals(1, varLenCoder.getEncodedElementByteSize(null, Context.NESTED));
assertEquals(5... | 0 |
String opcodeName = Const.getOpcodeName(super.getOpcode());
StringBuilder sb = new StringBuilder(opcodeName);
if (tok.hasMoreTokens()) {
sb.append(" ");
sb.append(tok.nextToken().replace('.', '/'));
if (tok.hasMoreTokens()) {
sb.append(tok.ne... | 0 |
log.error(aBasePath + " is set to be replaced in " + Property.INSTANCE_VOLUMES_REPLACEMENTS + " and should not appear in " + Property.INSTANCE_VOLUMES
+ ". It is highly recommended that this property be removed as data could still be written to this volume."); | 0 |
private HostRoleStatus status = HostRoleStatus.PENDING;
private HostRoleStatus displayStatus = HostRoleStatus.PENDING;
this.displayStatus = entity.getDisplayStatus();
requestEntity.setStatus(status);
requestEntity.setDisplayStatus(displayStatus);
", status='" + status + '\'' +
", display... | 1 |
import org.apache.ambari.server.api.services.ResultStatus;
import org.apache.ambari.server.api.services.persistence.PersistenceManager;
RequestHandler readHandler = createStrictMock(RequestHandler.class);
ResultStatus resultStatus = createNiceMock(ResultStatus.class);
expect(readHandler.handleRequest(reques... | 0 |
handler.setPrincipalPassword(evaluatedPrincipal, "some password");
handler.createPrincipal(evaluatedPrincipal, "some password", true);
handler.setPrincipalPassword(evaluatedPrincipal, "some password");
handler.createPrincipal(evaluatedPrincipal, "some password", true);
handler.createPrincipa... | 0 |
throw new CascadingRuntimeException("Cannot create script scope", e); | 0 |
package org.apache.cocoon.core.container.spring.avalon; | 0 |
if (!tf.createNewFile()) {
throw new IOException("Couldn't create " + tf.getCanonicalPath());
}
} catch (IOException | InstantiationException | IllegalAccessException | ClassNotFoundException e) { | 0 |
private static class MockRemoveCompleteReplicationRecords
extends RemoveCompleteReplicationRecords {
conn.securityOperations().grantTablePermission(conn.whoami(), ReplicationTable.NAME,
TablePermission.READ);
conn.securityOperations().grantTablePermission(conn.whoami(), ReplicationTable.NAME,
... | 0 |
public class ErrorPageRegistryTest
{
assertEquals(1L, dto.errorPageDTOs[0].serviceId);
assertEquals(1, dto.errorPageDTOs[0].exceptions.length);
assertEquals("java.io.IOException", dto.errorPageDTOs[0].exceptions[0]);
// two entries in DTO
assertEquals(0, dto.errorPageDTOs[1].err... | 0 |
/**
* Test Converting a number
*/
public void testNumber() {
// ------------- Construct using specified Locale --------
converter = new IntegerLocaleConverter(localizedLocale);
Integer value = new Integer(1234);
assertEquals("Convert Integer", value, converter.convert... | 0 |
import java.io.ByteArrayInputStream;
//Test the readFrom(InputStream) method
baout.reset();
written = baout.write(new ByteArrayInputStream(ref.toByteArray()));
assertEquals(155, written);
checkStreams(baout, ref);
| 0 |
/*
* $Header: /cvshome/build/ee.foundation/src/java/io/PipedWriter.java,v 1.6 2006/03/14 01:20:24 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 thi... | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | 0 |
* @version $Revision$ | 1 |
* @version $Revision: 1.2 $ $Date: 2002/10/23 10:58:12 $
extends VfsTask
public void setFile( final String url )
final FileObject file = resolveFile( url ); | 0 |
import org.apache.beam.sdk.transforms.windowing.DefaultTrigger;
import org.apache.beam.sdk.transforms.windowing.FixedWindows;
.windowBy(FixedWindows.of(org.joda.time.Duration.standardSeconds(1)))
.triggeredBy(DefaultTrigger.of())
.discardingFiredPanes() | 0 |
package aQute.libg.cryptography;
import java.io.*;
import java.security.*;
import aQute.lib.io.*;
public abstract class Digester<T extends Digest> extends OutputStream {
protected MessageDigest md;
OutputStream out[];
public Digester(MessageDigest instance, OutputStream ... out) {
md = instance;
this.out = ... | 0 |
import java.io.FileInputStream;
return XMLUtils.newDocument(false);
Document doc = XMLUtils.parse(new FileInputStream(input), false, false);
data = in.clone(); | 0 |
in.apply("Keys", MapElements.via(new SimpleFunction<KV<K, ?>, K>() {
@Override
public K apply(KV<K, ?> kv) {
return kv.getKey(); | 0 |
* @since 2.0 | 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 requi... | 0 |
Set<SubResourceDefinition> setChildren = new HashSet<>(); | 0 |
* @param out the new out <code>Writer</code>.
* Returns the current locale or null if the locale currently used is
* the default one.
* Provides a way to the user to specify a locale which override the
* default one. If null is passed to this method, the used locale
* becomes the global on... | 0 |
public String toString() { | 0 |
* @version $Revision: 1.6 $ $Date: 2004/04/09 09:38:31 $
* Returns whether the sub map views are serializable.
* If the class being tested is based around a TreeMap then you should
* override and return false as TreeMap has a bug in deserialization.
*
* @return false
*/
public boolea... | 0 |
channel.open().await(); // TODO use verify + configurable timeout
channel.open().await(); // TODO use verify + configurable timeout
channel.open().await(); // TODO use verify + configurable timeout
channel.open().await(); // TODO use verify + configurable timeout | 0 |
import static org.junit.Assert.assertArrayEquals; | 0 |
private static final long serialVersionUID = 1L; | 0 |
import java.nio.charset.StandardCharsets;
import org.apache.hc.core5.http.NameValuePair;
import org.apache.hc.core5.http.message.BasicNameValuePair;
assertAddParameters(StandardCharsets.UTF_8);
assertAddParameters(StandardCharsets.ISO_8859_1);
assertSetParameters(StandardCharsets.UTF_8);
... | 0 |
package org.apache.commons.beanutils2.bugs;
import org.apache.commons.beanutils2.BeanUtils; | 1 |
Copyright 2001 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... | 0 |
import java.util.Optional; | 0 |
import org.apache.http.io.CharArrayBuffer; | 0 |
import javax.annotation.Nullable;
import org.apache.beam.runners.core.construction.PTransformTranslation;
String,
TRANSLATORS.put(PTransformTranslation.CREATE_VIEW_TRANSFORM_URN,
new CreatePCollectionViewTranslatorBatch());
TRANSLATORS.put(PTransformTranslation.COMBINE_TRANSFORM_URN,
new C... | 0 |
import java.util.Arrays;
import java.util.LinkedHashMap;
private final Map<String, Object> vars = new HashMap<>();
public void testSubscripts() throws Exception
{
Map<String, String> map = new LinkedHashMap<>();
map.put("a1", "baz");
map.put("a2", "bar");
map.put("b1", "foo")... | 0 |
import org.apache.beam.vendor.grpc.v1p13p1.com.google.protobuf.ByteString; | 0 |
import org.apache.accumulo.test.categories.MiniClusterOnlyTests;
@Category(MiniClusterOnlyTests.class) | 0 |
package org.apache.http.impl.execchain; | 0 |
public void parallelWriteSpeed() throws InterruptedException { | 0 |
* @version $Revision$ $Date$ | 0 |
* The property name used to specify whether the launcher should
* install a shutdown hook.
**/
public static final String SHUTDOWN_HOOK_PROP = "felix.shutdown.hook";
/**
// If enabled, register a shutdown hook to make sure the framework is
// cleanly shutdown when the VM exits.
... | 0 |
EasyMock.anyObject(),
EasyMock.anyObject(),
EasyMock.anyObject());
EasyMock.anyObject(),
eq(Optional.absent()),
EasyMock.anyObject(),
EasyMock.anyObject(),
EasyMock.anyObject()); | 0 |
sqlEnv.loadBeamBuiltinFunctions(); | 0 |
port, TCompactProtocol.Factory.class, prop); | 0 |
private static class SimpleService implements HttpRequestHandler { | 0 |
if (!"http://www.example.org/ns".equals(a.getValue())) { | 0 |
private final static String OS_FAMILY_UBUNTU = "ubuntu";
private final static String OS_FAMILY_SUSE = "suse";
private final static String OS_FAMILY_REDHAT = "redhat";
private Map<String, JsonOsFamilyEntry> osMap = null;
Type type = new TypeToken<Map<String, JsonOsFamilyEntry>>() {}.getType();
... | 0 |
FelixBundle exporter = (FelixBundle) ep.getExportingBundle();
// Get all importers and requirers for all revisions of the bundle.
// The spec says that require-bundle should be returned with importers.
IModule[] dependents = ((ModuleImpl) expModules[expIdx]).getDependentImporters();
... | 0 |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | 0 |
ContextHandler contextHandler = new ContextHandler(contextInfo, context, bundle);
PerContextEventListener eventListener = contextHandler.getListenerRegistry(); | 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... | 1 |
import org.apache.accumulo.core.client.impl.Credentials;
import org.apache.accumulo.core.data.impl.KeyExtent; | 1 |
package org.apache.atlas.typesystem.types;
import org.apache.atlas.MetadataException;
import org.apache.atlas.typesystem.Referenceable;
import org.apache.atlas.typesystem.Struct;
import org.apache.atlas.typesystem.types.utils.TypesUtil; | 1 |
package aQute.libg.cryptography;
import java.io.*;
import java.security.*;
public class SHA1 extends Digest {
public final static String ALGORITHM = "SHA1";
public static Digester<SHA1> getDigester(OutputStream ... out ) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance(ALGORIT... | 0 |
package org.apache.atlas.examples;
import org.apache.atlas.MetadataServiceClient;
import org.apache.atlas.typesystem.Referenceable;
import org.apache.atlas.typesystem.TypesDef;
import org.apache.atlas.typesystem.json.InstanceSerialization;
import org.apache.atlas.typesystem.json.TypesSerialization;
import org.apache.at... | 0 |
package org.apache.hc.core5.http.nio.reactor; | 0 |
import org.apache.beam.sdk.transforms.reflect.DoFnInvokers;
import org.apache.gearpump.streaming.dsl.javaapi.functions.FlatMapFunction;
public class DoFnFunction<InputT, OutputT> extends
FlatMapFunction<WindowedValue<InputT>, WindowedValue<OutputT>> implements
DoFnRunners.OutputManager {
private final DoFn<In... | 0 |
private final String testProperties = ConfigurationAssert.getTestFile("test.properties").getAbsolutePath(); | 0 |
import org.apache.beam.vendor.protobuf.v3.com.google.protobuf.ByteString;
import org.apache.beam.vendor.protobuf.v3.com.google.protobuf.InvalidProtocolBufferException;
import org.apache.beam.vendor.protobuf.v3.com.google.protobuf.util.Durations;
import org.apache.beam.vendor.protobuf.v3.com.google.protobuf.util.Timesta... | 0 |
return cacheConfiguration( internalCreateConfiguration( createPid( factoryPid ), factoryPid, location ) );
}
ConfigurationImpl createFactoryConfiguration(String pid, String factoryPid, String location ) throws IOException
{
return cacheConfiguration( internalCreateConfiguration( pid, factoryPi... | 0 |
package org.apache.hc.core5.reactor;
* for more advanced {@link IOReactor} | 1 |
import org.junit.Before; | 0 |
assertThat(underlyingValue.entries().read(), emptyIterable());
assertThat(underlyingValue.get("hello").read(), equalTo(1));
assertThat(copyOnAccessState.get("hello").read(), equalTo(1));
assertThat(copyOnAccessState.get("hello").read(), equalTo(1));
assertThat(copyOnAccessState.get("world").read(), ... | 0 |
private transient volatile Map<String,ShellExecutionThread> userShells = null;
private transient volatile ExecutorService service = null;
private synchronized Map<String,ShellExecutionThread> userShells() {
if (userShells == null) {
userShells = new HashMap<String,ShellExecutionThread>();
}
ret... | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/examples/api/catalog/BookFactory.java,v 1.3 2003/10/09 21:09:45 rdonkin Exp $
* $Revision: 1.3 $
* $Date: 2003/10/09 21:09:45 $
* Alternately, this acknowledgement may appear in the software itself,
* if and w... | 0 |
import org.apache.beam.sdk.schemas.Schema;
private static Schema schema =
Row.withRowType(schema).addValues(data1).build(),
Row.withRowType(schema).addValues(data2).build());
new BeamTextCSVTable(schema, readerSourceFile.getAbsolutePath())
new BeamTextCSVTable(schema, readerSourceFile.getAbsol... | 0 |
import org.apache.batik.util.ParsedURL;
* @param origURL The original URL, if any, for documentation
* purposes only. This may be null.
public Filter handleStream(InputStream inIS,
ParsedURL origURL,
boolean needRawData) ... | 0 |
private Map<String, String> namespaceMap =
| 1 |
* @version $Id$ | 0 |
* <ul>
* <li>callback(Dictionary)
* <li>callback(Component, Dictionary)
* <li>callback(Component, Configuration ... configTypes) // type safe configuration interface(s)
* <li>callback(Configuration ... configTypes) // type safe configuration interface(s)
* <li>callback(Dictionary, Configuration ... configTypes)... | 0 |
import org.apache.beam.sdk.transforms.display.DisplayData;
public void populateDisplayData(DisplayData.Builder builder) {
super.populateDisplayData(builder);
builder.add("tableId", tableId);
if (options != null) {
builder.add("bigtableOptions", options.toString());
}
if (fil... | 0 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(TxnLogSource.class); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/TestFixedSizeList.java,v 1.1 2003/11/16 00:05:44 scolebourne Exp $
package org.apache.commons.collections.list;
* @version $Revision: 1.1 $ $Date: 2003/11/16 00:05:44 $ | 0 |
* Provides a base class for hooking up Binding implementations that use the
*
* @version CVS $Id: JXPathBindingBase.java,v 1.10 2004/01/11 20:51:16 vgritsenko Exp $
/**
classes = new HashMap();
* Redefines the Binding action as working on a JXPathContext Type rather
* Executes the ac... | 0 |
* Copyright (c) 2001-2004 The Apache Software Foundation. All rights | 0 |
defaultValue = "ServiceInfo/service_name,ServiceInfo/cluster_name",
defaultValue = "ServiceInfo/service_name.asc,ServiceInfo/cluster_name.asc", | 0 |
import org.apache.accumulo.core.security.thrift.Credential;
private Credential credentials;
public Writer(Instance instance, Credential credentials, Text table) {
public Writer(Instance instance, Credential credentials, String table) {
private static void updateServer(Mutation m, KeyExtent extent, String server... | 1 |
public StepContext createStepContext(
StepContext context = | 0 |
throw new IOException(sourceDir + " is not in a volume configured for Accumulo");
throw new IOException(sourceDir + " is not in a volume configured for Accumulo");
throw new IOException("Dir exist when it should not " + newBulkDir); | 0 |
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* v... | 0 |
* Options that can be used to configure Pub/Sub topic in Dataflow examples. | 0 |
public String findLibrary(String libName) throws Exception
String result = BundleCache.getSecureAction().getAbsolutePath(new File(m_refDir, libName));
if (result == null)
{
throw new IOException("No such file: " + libName);
}
return result; | 0 |
import java.util.regex.Pattern;
* Compiled regex for hostgroup token.
*/
Pattern HOSTGROUP_REGEX = Pattern.compile("%HOSTGROUP::(\\S+?)%");
/** | 0 |
* @version CVS $Id: Cookie.java,v 1.2 2003/12/23 15:28:32 joerg Exp $
* @see #getComment()
* @see #setComment(String)
* @see #getDomain()
* @see #setDomain(String)
* @see #getMaxAge()
* @see #setMaxAge(int)
* @see #getPath()
* @see #setPath(String)
* @see #getSecure()
... | 0 |
try (BatchWriter bw = c.createBatchWriter(table)) {
for (int i = 0; i < ROW_LIMIT; i++) {
Mutation m = new Mutation(createRow(i));
for (int j = 0; j < CF_LIMIT; j++) {
for (int k = 0; k < CQ_LIMIT; k++) {
for (int t = 0; t < TS_LIMIT; t++) {
m.put(createCF(j... | 0 |
private boolean getCandidates(GarbageCollectionEnvironment gce, String lastCandidate, List<String> candidates) throws TableNotFoundException,
AccumuloException, AccumuloSecurityException { | 0 |
Assert.assertNotNull("No value for property " + PROPERTY_ID1, val);
Assert.assertNotNull("No value for property " + PROPERTY_ID1, val1);
Assert.assertNotNull("No value for property " + PROPERTY_ID2, val2);
resource.setProperty(HOST_NAME_PROPERTY_ID, "h1");// should be set?
Assert.assertNotNull("No v... | 0 |
m.put(new Text("cf1"), new Text("cq1"), new Value("foo".getBytes(Constants.UTF8)));
m.put(new Text("cf1"), new Text("cq1"), new Value("foo".getBytes(Constants.UTF8))); | 0 |
* @author Enver Haase | 0 |
* A general group for warning about configuration properties.
*/
CONFIGURATION_WARNING(7.0f),
/** | 0 |
* @since 2.0
* @since 2.0
* @since 2.0 | 1 |
public IModule createModule(String id, IModuleDefinition md); | 0 |
import org.apache.commons.jexl.JexlContext;
/**
* Handle assignment ( left = right )
*/
public Object value(JexlContext context) throws Exception
{
// left should be the variable (reference) to assign to
SimpleNode left = (SimpleNode)jjtGetChild(0);
// right should be the expression to ... | 0 |
* @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A> | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | 0 |
*
* A config type is valid if there are services related to except cluster-env and global.
* @param configType
* @return
*/
boolean isValidConfigType(String configType);
/** | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.