Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
* @version $Id$
* @since 2.2 | 0 |
* Autogenerated by Thrift Compiler (0.12.0)
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)")
public @org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> tables; // required
@org.apache.thrift.annotation.Nullable
@org.apache.thrift.annotation.Nullable
@org.apache.thrift.annotation.Nullable
@org.apache.thrift.annotation.Nullable
public DiskUsage setTables(@org.apache.thrift.annotation.Nullable java.util.List<java.lang.String> tables) {
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
@org.apache.thrift.annotation.Nullable
@org.apache.thrift.annotation.Nullable
@org.apache.thrift.annotation.Nullable java.lang.String _elem1;
@org.apache.thrift.annotation.Nullable java.lang.String _elem6; | 0 |
import com.google.gson.Gson;
import org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
private static final String KERBEROS_DESCRIPTOR_PROPERTY_ID = PropertyHelper.getPropertyId(
"StackServices", "kerberos_descriptor");
// TODO (rlevas): Convert this to an official resource
File kerberosDescriptorFile = response.getKerberosDescriptorFile();
if (kerberosDescriptorFile != null) {
KerberosServiceDescriptor[] descriptors;
try {
descriptors = KerberosServiceDescriptor.fromFile(kerberosDescriptorFile);
} catch (IOException e) {
throw new SystemException("Failed to parse the service's Kerberos descriptor", e);
}
if (descriptors != null) {
String serviceName = response.getServiceName();
// Iterate over the KerberosServiceDescriptors to find the one for this service since
// Kerberos descriptor files can contain details about more than one service
for(KerberosServiceDescriptor descriptor:descriptors) {
if(serviceName.equals(descriptor.getName())) {
setResourceProperty(resource, KERBEROS_DESCRIPTOR_PROPERTY_ID,
descriptor.toMap(), requestedIds);
break; // Stop looping, this was the service we are looking for.
}
}
}
}
| 0 |
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override | 0 |
public class WhileTest extends JexlTestCase { | 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 |
public static final String NS_XOP = "http://www.w3.org/2004/08/xop/include";
public static final QName TAG_XOP_INCLUDE = new QName(NS_XOP, "Include", "xop");
| 0 |
int divisor = self.getQuorumSize() > 2 ? self.getQuorumSize() - 1 : 1;
globalOutstandingLimit = Integer.getInteger(GLOBAL_OUTSTANDING_LIMIT, 1000) / divisor;
LOG.info("Override {} to {}", GLOBAL_OUTSTANDING_LIMIT, globalOutstandingLimit); | 0 |
* @version $Revision$ $Date$ | 0 |
// After authentication
ftp.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out))); | 0 |
private final int min;
private final int max;
max = from;
min = to;
min = from;
max = to;
/**
* Gets the interval minimum value.
* @return the low boundary
*/
public int getMin() {
return min;
}
/**
* Gets the interval maximum value.
* @return the high boundary
*/
public int getMax() {
return max;
}
hash = 13 * hash + this.min;
hash = 13 * hash + this.max;
if (this.min != other.min) {
if (this.max != other.max) {
return new IntegerIterator(min, max);
return max - min + 1;
return min <= v && v <= max;
array[a] = min + a;
Array.set(copy, a, min + a);
private final int min;
private final int max;
min = l;
max = h;
cursor = min;
return cursor <= max;
if (cursor <= max) {
return cursor++;
throw new NoSuchElementException(); | 0 |
/** Optional service property: tags for categorizing the health check services. The value of this property must be of type String or
* String array. */
String TAGS = "hc.tags";
/** Optional service property: If given, non-ok results from past executions will be taken into account as well for the given seconds
* (use Long.MAX_VALUE for indefinitely). Useful for unhealthy system states that disappear but might leave the system at an
* inconsistent state (e.g. an event queue overflow where somebody needs to intervene manually) or for checks that should only go back
* to OK with a delay (can be useful for load balancers). */
String KEEP_NON_OK_RESULTS_STICKY_FOR_SEC = "hc.keepNonOkResultsStickyForSec";
| 0 |
public static final Role GLUSTERFS_CLIENT = valueOf("GLUSTERFS_CLIENT");
public static final Role GLUSTERFS_SERVICE_CHECK = valueOf("GLUSTERFS_SERVICE_CHECK"); | 0 |
* @version $Id: LockableFileWriter.java,v 1.4 2003/11/27 20:50:03 bayard Exp $ | 0 |
/** {@inheritDoc} */
/** {@inheritDoc} */ | 0 |
package org.apache.accumulo.server.test.randomwalk.concurrent;
import java.util.List;
import java.util.Properties;
import java.util.Random;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.TableExistsException;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.server.test.randomwalk.State;
import org.apache.accumulo.server.test.randomwalk.Test;
public class RenameTable extends Test {
@Override
public void visit(State state, Properties props) throws Exception {
Connector conn = state.getConnector();
Random rand = (Random) state.get("rand");
@SuppressWarnings("unchecked")
List<String> tableNames = (List<String>) state.get("tables");
String srcTableName = tableNames.get(rand.nextInt(tableNames.size()));
String newTableName = tableNames.get(rand.nextInt(tableNames.size()));
try {
conn.tableOperations().rename(srcTableName, newTableName);
log.debug("Renamed table "+srcTableName+" "+newTableName);
}catch (TableExistsException e){
log.debug("Rename "+srcTableName+" failed, "+newTableName+" exist");
}catch (TableNotFoundException e) {
log.debug("Rename "+srcTableName+" failed, doesnt exist");
}
}
}
| 1 |
* A token is a word in a command in the shell. The tree that this builds is used for tab-completion
* of tables, users, commands and certain other parts of the shell that can be realistically and
* quickly gathered. Tokens can have multiple commands grouped together and many possible
* subcommands, although they are stored in a set so duplicates aren't allowed. | 0 |
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
@Column(name = "description", nullable = false)
@Column(name = "target_type", nullable = false) | 1 |
public static String send4LetterWord(String hp, String cmd)
throws IOException
{
Socket sock = new Socket(host, port);
BufferedReader reader = null;
try {
OutputStream outstream = sock.getOutputStream();
outstream.write(cmd.getBytes());
outstream.flush();
reader =
new BufferedReader(
new InputStreamReader(sock.getInputStream()));
StringBuffer sb = new StringBuffer();
String line;
while((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
return sb.toString();
} finally {
sock.close();
if (reader != null) {
reader.close();
}
}
}
public static boolean waitForServerUp(String hp, long timeout) {
long start = System.currentTimeMillis();
String result = send4LetterWord(hp, "stat");
if (result.startsWith("Zookeeper version:")) {
return true;
send4LetterWord(hp, "stat"); | 0 |
opts.put(Combiner.COLUMNS_OPTION, "2");
opts.put(Combiner.COLUMNS_OPTION, "cf001");
opts.put(Combiner.COLUMNS_OPTION, "cf001");
opts.put(Combiner.COLUMNS_OPTION, "cf001");
opts.put(Combiner.COLUMNS_OPTION, "cf001");
opts.put(Combiner.COLUMNS_OPTION, "cf001");
opts.put(Combiner.COLUMNS_OPTION, "cf001");
opts.put(Combiner.COLUMNS_OPTION, "cf001");
opts.put(Combiner.COLUMNS_OPTION, "cf001"); | 0 |
* @version $Revision$ | 0 |
} catch (ThreadDeath td) {
exception = new Exception(td.getMessage());
fireEvent(failedDispatcher, evt);
throw td; | 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 |
public interface WorkflowFetcher {
Set<Resource> fetchWorkflows(Set<String> requestedIds,
String clusterName, String workflowId);
enum WorkflowFields { | 0 |
import org.apache.sshd.common.util.KeyUtils;
sig.putString(KeyUtils.getKeyType(key)); | 0 |
package org.apache.beam.sdk.extensions.sql.utils;
import org.apache.beam.sdk.extensions.sql.schema.BeamSqlRowType; | 0 |
import java.util.List;
import org.apache.felix.gogo.commands.Option;
import org.apache.felix.karaf.shell.admin.InstanceSettings;
@Option(name = "-p", aliases = {"--port"}, description = "Port number for remote shell connection", required = false, multiValued = false)
@Option(name = "-l", aliases = {"--location"}, description = "Location of the new container instance in the file system", required = false, multiValued = false)
@Option(name = "-f", aliases = {"--feature"},
description = "Initial features. This option can be specified multiple times to enable multiple initial features", required = false, multiValued = true)
List<String> features;
@Option(name = "-furl", aliases = {"--featureURL"},
description = "Additional feature descriptor URLs. This option can be specified multiple times to add multiple URLs", required = false, multiValued = true)
List<String> featureURLs;
InstanceSettings settings = new InstanceSettings(port, location, featureURLs, features);
getAdminService().createInstance(instance, settings); | 0 |
* @param msgID
public TransformationException(Exception originalException, String msgID) {
super(originalException, msgID);
* @param originalException
public TransformationException(Exception originalException, String msgID, Object exArgs[]) {
super(originalException, msgID, exArgs); | 0 |
m_name = (String) configuration.get("instance.name"); | 0 |
BundleImpl originatingBundle = mockBundleImpl(4L, "xyz", "1.0.0");
if ((target.getBundleId() == 4L) && (operationType == CollisionHook.INSTALLING)) {
BundleImpl bi = new BundleImpl(felixMock, originatingBundle, archive);
BundleImpl bi = new BundleImpl(felixMock, null, archive);
new BundleImpl(felixMock, null, archive);
BundleImpl bi = new BundleImpl(felixMock, null, archive);
new BundleImpl(felixMock, null, archive); | 1 |
"dn/_HOST@_REALM", "service", "hdfs-site/dfs.namenode.kerberos.principal", | 0 |
public static final short SVG_COLORTYPE_CURRENTCOLOR = 3;
public RGBColor getRGBColor( );
public void setColor ( short colorType, String rgbColor, String iccColor )
throws SVGException; | 0 |
/* $Id$ | 0 |
* The configuration included in a Stack. | 0 |
return dumpEntity("Task " + taskId, storeProvider -> {
// Deep copy the struct to sidestep any subclass trickery inside the storage system.
return Optional.fromNullable(Iterables.getOnlyElement(
storeProvider.getTaskStore().fetchTasks(Query.taskScoped(taskId)),
null)
.newBuilder());
storeProvider -> storeProvider.getCronJobStore().fetchJob(jobKey)
.transform(IJobConfiguration::newBuilder));
return fillTemplate(template -> {
template.setAttribute("id", id);
Optional<? extends TBase<?, ?>> struct = storage.read(work);
if (struct.isPresent()) {
template.setAttribute("structPretty", Util.prettyPrint(struct.get()));
template.setAttribute("exception", null);
} else {
template.setAttribute("exception", "Entity not found"); | 0 |
import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
* @param extraSize Extra size - besides the extension name
* @return A {@link Buffer} with the extension name set
*/
protected Buffer getCommandBuffer(int extraSize) {
String opcode = getName();
Buffer buffer = new ByteArrayBuffer((Integer.SIZE / Byte.SIZE) + GenericUtils.length(opcode) + extraSize + Byte.SIZE);
buffer.putString(opcode);
return buffer;
}
/** | 0 |
@Override
public CombineFn<InputT, AccumT, OutputT> forKey(K key, Coder<K> keyCoder) {
return CombineFn.this;
}
* Returns the a regular {@link CombineFn} that operates on a specific key.
*/
public CombineFn<InputT, AccumT, OutputT> forKey(final K key, final Coder<K> keyCoder) {
return new CombineFn<InputT, AccumT, OutputT>() {
@Override
public AccumT createAccumulator() {
return KeyedCombineFn.this.createAccumulator(key);
}
@Override
public AccumT addInput(AccumT accumulator, InputT input) {
return KeyedCombineFn.this.addInput(key, accumulator, input);
}
@Override
public AccumT mergeAccumulators(Iterable<AccumT> accumulators) {
return KeyedCombineFn.this.mergeAccumulators(key, accumulators);
}
@Override
public OutputT extractOutput(AccumT accumulator) {
return KeyedCombineFn.this.extractOutput(key, accumulator);
}
@Override
public Coder<AccumT> getAccumulatorCoder(CoderRegistry registry, Coder<InputT> inputCoder)
throws CannotProvideCoderException {
return KeyedCombineFn.this.getAccumulatorCoder(registry, keyCoder, inputCoder);
}
@Override
public Coder<OutputT> getDefaultOutputCoder(
CoderRegistry registry, Coder<InputT> inputCoder) throws CannotProvideCoderException {
return KeyedCombineFn.this.getDefaultOutputCoder(registry, keyCoder, inputCoder);
}
};
}
/** | 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.felix.schematizer.impl;
import org.osgi.dto.DTO;
public class MyDTO extends DTO {
public enum Count { ONE, TWO, THREE }
public Count count;
public String ping;
public long pong;
public MyEmbeddedDTO embedded;
}
| 0 |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) { | 0 |
int weight = (int)v.getFloatValue();
//Note: the mapping from CSS2 to TextAttribute's weights is somewhat arbitrary.
//Important is to map 400/normal to REGULAR and 700/bold to BOLD.
switch (weight) {
switch (weight) {
case 600:
return TextAttribute.WEIGHT_MEDIUM;
return TextAttribute.WEIGHT_BOLD;
return TextAttribute.WEIGHT_HEAVY;
return TextAttribute.WEIGHT_REGULAR; //No matching CSS value (probably illegal) | 0 |
result.setStatus(UpgradeCheckStatus.WARNING);
result.getFailedDetail().addAll(failedPluginSimpleClasses);
result.setFailReason(getFailReason(result, request));
result.getFailedOn().addAll(failedPluginSimpleClasses.stream()
.map(detail -> detail.toSimpleString())
.collect(Collectors.toSet())); | 0 |
final String classFile = className.replace('.', '/');
final ClassParser parser = new ClassParser(is, className);
} catch (final IOException e) { | 1 |
private final InternalConverter converter;
ConvertingImpl converting, InternalConverter c) {
return new SetDelegate<T>((Set<T>) collection, converting, c);
converting, c);
SetDelegate(Set<T> collection, ConvertingImpl converting, InternalConverter c) {
converter = c;
return (T) convertingImpl.convertCollectionValue(obj, converter); | 0 |
// VFS-487 significantly wait to avoid failure
// VFS-487 significantly wait to avoid failure
// VFS-487 significantly wait to avoid failure | 0 |
import com.google.common.collect.ImmutableList;
import org.apache.hadoop.metadata.typesystem.TypesDef;
import scala.collection.JavaConversions;
public static TypesDef getTypesDef(ImmutableList<EnumTypeDefinition> enums, ImmutableList<StructTypeDefinition> structs,
ImmutableList<HierarchicalTypeDefinition<TraitType>> traits,
ImmutableList<HierarchicalTypeDefinition<ClassType>> classes) {
return new TypesDef(JavaConversions.asScalaBuffer(enums), JavaConversions.asScalaBuffer(structs),
JavaConversions.asScalaBuffer(traits), JavaConversions.asScalaBuffer(classes));
} | 0 |
Assert.assertTrue("Sample size is " + sampleSizeInMB + ", expected to be" +
"greater that 10 MB", sampleSizeInMB > 10);
Assert.assertTrue("Discrepancy in values is " + discrepancyInKB + ", " +
"expected to be less than 10K", discrepancyInKB < 10); | 0 |
public void registerService() {
* Withdraws the service from the service registry.
public void unregisterService() { | 0 |
package org.apache.commons.digester3;
/*
* 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 |
*
if (this.wire.enabled() && l != -1) { | 0 |
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Component
@Order(4) | 0 |
import java.io.Closeable;
import java.net.ServerSocket;
import java.net.Socket;
public void testCloseableCloseQuietlyOnException() {
IOUtils.closeQuietly(new Closeable() {
public void close() throws IOException {
throw new IOException();
}
});
}
public void testSocketCloseQuietlyOnException() {
IOUtils.closeQuietly(new Socket() {
public void close() throws IOException {
throw new IOException();
}
});
}
public void testServerSocketCloseQuietlyOnException() throws IOException {
IOUtils.closeQuietly(new ServerSocket() {
public void close() throws IOException {
throw new IOException();
}
});
}
public void testSocketCloseQuietly() {
IOUtils.closeQuietly((Socket) null);
IOUtils.closeQuietly(new Socket());
}
public void testServerSocketCloseQuietly() throws IOException {
IOUtils.closeQuietly((ServerSocket) null);
IOUtils.closeQuietly(new ServerSocket());
}
| 0 |
*
* @return The default query timeout
*
* @param defaultQueryTimeout
* The default query timeout. | 0 |
public void setFunctions(Map<String, Object> prefixes) {
throw new UnsupportedOperationException("Not supported yet.");
}
public Map<String, Object> getFunctions() {
throw new UnsupportedOperationException("Not supported yet.");
}
| 0 |
import org.apache.cocoon.portal.profile.impl.ProfileHolder;
protected ProfileHolder loadProfile()
final ProfileHolder profile = new ProfileHolder(); | 0 |
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkNotNull;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.MoreObjects;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList; | 0 |
import org.apache.commons.net.tftp.TFTPServer.ServerMode;
tftpS = new TFTPServer(serverDirectory, serverDirectory, 6900, ServerMode.GET_AND_PUT, | 0 |
public URLConverter(final Object defaultValue) {
protected <T> T convertToType(final Class<T> type, final Object value) throws Throwable { | 0 |
* @version $Id$ | 0 |
import com.twitter.common.application.http.Registration;
Registration.registerHttpAsset(binder, "/js/mootools-core.js", HttpAssets.class,
Registration.registerHttpAsset(binder, "/js/mootools-more.js", HttpAssets.class,
Registration.registerHttpAsset(binder, "/js/tit.js", HttpAssets.class,
Registration.registerHttpAsset(binder, "/css/global.css", HttpAssets.class, | 0 |
import com.google.cloud.dataflow.sdk.options.CloudDebuggerOptions.DebuggerConfig;
// Config Cloud Debugger
if (!Strings.isNullOrEmpty(options.getCdbgVersion())) {
String cdbgVersion = options.getCdbgVersion();
DebuggerConfig debuggerConfig = new DebuggerConfig();
debuggerConfig.setVersion(cdbgVersion);
Map<String, String> metadata = workerPool.getMetadata();
if (metadata == null) {
metadata = new HashMap<String, String>();
}
try {
metadata.put("debugger", debuggerConfig.computeMetadataString());
} catch (JsonProcessingException e) {
throw new IllegalArgumentException("Cannot format Debugger version.", e);
}
workerPool.setMetadata(metadata);
}
| 0 |
private static final long serialVersionUID = 1L;
public ByteArraySet() {
super(new ByteArrayComparator());
}
public ByteArraySet(Collection<? extends byte[]> c) {
this();
addAll(c);
}
public static ByteArraySet fromStrings(Collection<String> c) {
List<byte[]> lst = new ArrayList<byte[]>();
for (String s : c)
lst.add(s.getBytes());
return new ByteArraySet(lst);
}
public static ByteArraySet fromStrings(String... c) {
return ByteArraySet.fromStrings(Arrays.asList(c));
}
public List<byte[]> toList() {
return new ArrayList<byte[]>(this);
}
| 1 |
ValueManager[] a2) {
ShorthandManager[] a2) { | 0 |
String pkgName = ((Requirement) importReqs[reqIdx]).getTargetName();
String pkgName = ((Requirement) m_dynamicRequirements[reqIdx]).getTargetName();
if (headerMap.get(Constants.BUNDLE_NATIVECODE) != null)
"Fragments with native code are not currently supported.");
"Fragments native code are not currently supported.");
((Requirement) m_requirements[i]).getTargetName(),
+ ((Requirement) m_requirements[i]).getTargetName();
throws BundleException
// See if there is the "extension" directive.
for (int i = 0;
(result == null) && (i < clauses[0][CLAUSE_DIRECTIVES_INDEX].length);
i++)
if (Constants.EXTENSION_DIRECTIVE.equals(((R4Directive)
clauses[0][CLAUSE_DIRECTIVES_INDEX][i]).getName()))
// If the extension directive is specified, make sure
// the target is the system bundle.
if (FelixConstants.SYSTEM_BUNDLE_SYMBOLICNAME.equals(clauses[0][CLAUSE_PATHS_INDEX][0]) ||
Constants.SYSTEM_BUNDLE_SYMBOLICNAME.equals(clauses[0][CLAUSE_PATHS_INDEX][0]))
{
result = (R4Directive) clauses[0][CLAUSE_DIRECTIVES_INDEX][i];
}
else
throw new BundleException(
"Only the system bundle can have extension bundles."); | 1 |
import java.util.Collection;
import java.util.List;
if (bean instanceof Collection)
Collection coll = (Collection) bean;
if (nestedBeans.size() == 1)
{
Map.Entry e = (Map.Entry) nestedBeans.entrySet().iterator().next();
String propName = (String) e.getKey();
Class defaultClass = getDefaultClass(bean, propName);
if (e.getValue() instanceof List)
{
Iterator iter = ((List) e.getValue()).iterator();
while (iter.hasNext())
{
coll.add(createBean((BeanDeclaration) iter.next(), defaultClass));
}
}
else
{
BeanDeclaration decl = (BeanDeclaration) e.getValue();
coll.add(createBean(decl, defaultClass));
}
}
}
else
{
for (Iterator it = nestedBeans.entrySet().iterator(); it.hasNext();)
{
Map.Entry e = (Map.Entry) it.next();
String propName = (String) e.getKey();
Class defaultClass = getDefaultClass(bean, propName);
initProperty(bean, propName, createBean(
} | 0 |
timeout = outputChannel.getSocketTimeoutMillis();
outputChannel.setSocketTimeoutMillis(h1Config.getWaitForContinueTimeoutMillis());
outputChannel.setSocketTimeoutMillis(timeout);
outputChannel.setSocketTimeoutMillis(timeout); | 0 |
Object exprResult = exp.evaluate(createContext());
result = (exprResult != null) ? String.valueOf(exprResult) : null; | 0 |
public short six$_$prop;
public double seven$$_$prop; | 0 |
package org.apache.cocoon.databases.bridge.spring.avalon; | 0 |
import org.apache.beam.runners.core.SplittableParDo;
SplittableParDo.GBKIntoKeyedWorkItems.class,
ImmutableSet.of(
SplittableParDo.GBKIntoKeyedWorkItems.class, | 0 |
* Marks this Option as required.
*
* @return this builder, to allow method chaining
*/
public Builder required()
{
return required(true);
}
/**
* The Option will use '=' as a means to separate argument value.
*
* @return this builder, to allow method chaining
*/
public Builder valueSeparator()
{
return valueSeparator('=');
}
/**
* The Option will use <code>sep</code> as a means to
* separate argument values.
* <p>
* <b>Example:</b>
* <pre>
* Option opt = Option.builder("D").valueSeparator('=')
* .build();
*
* String args = "-Dkey=value";
* CommandLine line = parser.parse(args);
* String propertyName = opt.getValue(0); // will be "key"
* String propertyValue = opt.getValue(1); // will be "value"
* </pre> | 0 |
List<byte[]> uuids = metricMetadataManager.getUuidsForGetMetricQuery(new ArrayList<String>(), notAggregatedHostnames, "", ""); | 0 |
import org.apache.aurora.scheduler.zookeeper.guice.client.ZooKeeperClientModule;
import org.apache.aurora.scheduler.zookeeper.guice.client.ZooKeeperClientModule.ClientConfig;
import org.apache.aurora.scheduler.zookeeper.guice.client.flagged.FlaggedClientConfig; | 0 |
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception {
} else {
}
return "accvmvlo"; | 0 |
try {
httpclient.getCredentialsProvider().setCredentials(
new AuthScope("localhost", 443),
new UsernamePasswordCredentials("username", "password"));
HttpGet httpget = new HttpGet("https://localhost/protected");
System.out.println("executing request" + httpget.getRequestLine());
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
System.out.println("----------------------------------------");
System.out.println(response.getStatusLine());
if (entity != null) {
System.out.println("Response content length: " + entity.getContentLength());
}
EntityUtils.consume(entity);
} finally {
// When HttpClient instance is no longer needed,
// shut down the connection manager to ensure
// immediate deallocation of all system resources
httpclient.getConnectionManager().shutdown(); | 0 |
setupDefinition(widgetElement, definition, true); | 0 |
import org.apache.http.util.Asserts;
Asserts.check(servicedSocket == null, "Already running");
Asserts.check(ssock != null, "Not running"); | 0 |
@Default.String("gs://apache-beam-samples/shakespeare/kinglear.txt") | 0 |
* {@link org.apache.cocoon.forms.binding.RepeaterJXPathBinding}
* @version CVS $Id: SimpleRepeaterJXPathBinding.java,v 1.2 2004/03/09 11:31:12 joerg Exp $ | 0 |
import org.apache.hadoop.metadata.discovery.graph.GraphBackedDiscoveryService;
import org.apache.hadoop.metadata.typesystem.ITypedReferenceableInstance;
import org.apache.hadoop.metadata.typesystem.Referenceable;
import org.apache.hadoop.metadata.typesystem.types.ClassType;
import org.apache.hadoop.metadata.typesystem.types.Multiplicity;
import org.apache.hadoop.metadata.typesystem.types.TypeSystem;
@Test(expectedExceptions = Throwable.class)
r = discoveryService
.searchByGremlin("g.V.filter{it.typeName == 'Person'}.'Person.name'.toList()"); | 0 |
import org.apache.hc.core5.http.config.CharCodingConfig;
import org.apache.hc.core5.util.TimeValue;
final CharCodingConfig connectionConfig = CharCodingConfig.custom()
connManager.setValidateAfterInactivity(TimeValue.ofSeconds(10));
.setSocketTimeout(TimeValue.ofSeconds(5))
.setConnectTimeout(TimeValue.ofSeconds(5))
.setConnectionRequestTimeout(TimeValue.ofSeconds(5)) | 1 |
import org.apache.ambari.spi.upgrade.UpgradeType; | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ArrayUnsignedShortList.java,v 1.5 2003/04/11 21:50:15 rwaldhoff Exp $
* @version $Revision: 1.5 $ $Date: 2003/04/11 21:50:15 $
int oldval = toInt(_data[index]); | 0 |
import java.util.Collection;
import java.util.Iterator;
import javax.jdo.Extent;
import javax.jdo.Query;
public Employee load(int id, JdoPMF pmf) {
String filter = "employee.id ==" + id;
/* 1. Get the PersistenceManager */
PersistenceManager persistenceManager = pmf.getPersistenceManager();
Extent extent = persistenceManager.getExtent(Employee.class, true);
Query query = persistenceManager.newQuery(extent, filter);
query.setOrdering("employee.id ascending");
Collection result = (Collection)query.execute();
Iterator iter = result.iterator();
while(iter.hasNext()) {
Employee e = (Employee) iter.next();
if (id == e.getId())
return e;
}
return null;
// public Employee load(int id, JdoPMF pmf) {
//
// /* 1. Get the PersistenceManager */
// PersistenceManager persistenceManager = pmf.getPersistenceManager();
//
// Employee e = new Employee();
// e.setId(id);
// PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
// Identity oid = new Identity(e, broker);
//
// Employee toBeReturned = new Employee();
// // 2. start transaction
// persistenceManager.currentTransaction().begin();
// // 3. Get the Object based on the primary key
// toBeReturned = (Employee) persistenceManager.getObjectById(oid, false);
// // 4. End transaction
// persistenceManager.currentTransaction().commit();
// return toBeReturned;
// }
public void save(Employee e, JdoPMF pmf) { | 0 |
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap; | 0 |
* @return true iff all servers show no indication of being registered in zookeeper, otherwise
* false | 0 |
import java.util.Set;
import javax.annotation.Nullable; | 0 |
x = SVGUtilities.svgToUserSpace(svgElement,
ATTR_X, s,
uctx,
UnitProcessor.HORIZONTAL_LENGTH);
y = SVGUtilities.svgToUserSpace(svgElement,
ATTR_Y, s,
uctx,
UnitProcessor.VERTICAL_LENGTH);
w = SVGUtilities.svgToUserSpace(svgElement,
ATTR_WIDTH, s,
uctx,
UnitProcessor.HORIZONTAL_LENGTH);
h = SVGUtilities.svgToUserSpace(svgElement,
ATTR_HEIGHT, s,
uctx,
UnitProcessor.VERTICAL_LENGTH); | 0 |
private static final String STACK_METAINFO_FILE_NAME = "metainfo.xml";
private static final String STACK_XML_MAIN_BLOCK_NAME = "metainfo";
private static final String STACK_XML_PROPERTY_UPGRADE = "upgrade";
StackInfo stackInfo = getStackInfo(stack);
private StackInfo getStackInfo(File stackVersionFolder) {
StackInfo stackInfo = new StackInfo();
stackInfo.setName(stackVersionFolder.getParentFile().getName());
stackInfo.setVersion(stackVersionFolder.getName());
// Get metainfo from file
File stackMetainfoFile = new File(stackVersionFolder.getAbsolutePath()
+ File.separator + STACK_METAINFO_FILE_NAME);
if (stackMetainfoFile.exists()) {
if (LOG.isDebugEnabled()) {
LOG.debug("Reading stack version metainfo from file "
+ stackMetainfoFile.getAbsolutePath());
}
try {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(stackMetainfoFile);
doc.getDocumentElement().normalize();
NodeList stackNodes = doc
.getElementsByTagName(STACK_XML_MAIN_BLOCK_NAME);
for (int index = 0; index < stackNodes.getLength(); index++) {
Node node = stackNodes.item(index);
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element property = (Element) node;
stackInfo.setMinUpgradeVersion(getTagValue(
STACK_XML_PROPERTY_UPGRADE, property));
}
}
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
return stackInfo;
}
| 0 |
/*
* $Header: /cvshome/build/ee.foundation/src/java/util/BitSet.java,v 1.6 2006/03/14 01:20:25 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.util;
public class BitSet implements java.io.Serializable, java.lang.Cloneable {
public BitSet() { }
public BitSet(int var0) { }
public void and(java.util.BitSet var0) { }
public void clear(int var0) { }
public java.lang.Object clone() { return null; }
public boolean equals(java.lang.Object var0) { return false; }
public boolean get(int var0) { return false; }
public int hashCode() { return 0; }
public void or(java.util.BitSet var0) { }
public void set(int var0) { }
public int size() { return 0; }
public java.lang.String toString() { return null; }
public void xor(java.util.BitSet var0) { }
public int length() { return 0; }
public void andNot(java.util.BitSet var0) { }
}
| 0 |
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableMap;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableTable;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Iterables; | 0 |
import org.apache.accumulo.core.security.tokens.AccumuloToken;
private AccumuloToken<?,?> token = new UserPassToken("", "");
protected void setToken(AccumuloToken<?,?> token) {
this.token = token;
protected AccumuloToken<?,?> getToken() {
return token;
return getInstance().getConnector(getToken());
return new InstanceTokenWrapper(getToken(), getInstance().getInstanceID());
fTest.setToken(opts.getAccumuloToken()); | 1 |
import org.apache.beam.runners.flink.FlinkPipelineOptions;
p.getOptions().as(FlinkPipelineOptions.class).setParallelism(1); | 0 |
* @version $Revision$, $Date$ | 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.sshd.common.io;
import org.apache.sshd.common.FactoryManager;
/**
*/
public interface IoServiceFactory {
IoConnector createConnector(FactoryManager manager, IoHandler handler);
IoAcceptor createAcceptor(FactoryManager manager, IoHandler handler);
} | 1 |
/**
* Create the node given an id.
*
* @param id node id.
*/
/**
* Create a node with the given parser and id.
*
* @param p a parser.
* @param id node id.
*/
/** {@inheritDoc} */
/** {@inheritDoc} */ | 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.monitor.rest.api;
import javax.xml.bind.annotation.XmlAttribute;
public class DeadLoggerInformation {
@XmlAttribute
public String server;
@XmlAttribute
public long lastStatus;
@XmlAttribute
public String status;
public DeadLoggerInformation() {}
public DeadLoggerInformation(String server, long lastStatus, String status) {
this.server = server;
this.lastStatus = lastStatus;
this.status = status;
}
} | 0 |
public class NexmarkSqlQuery<T extends KnownSize> extends NexmarkQuery {
private PTransform<PCollection<Event>, PCollection<T>> queryTransform;
PTransform<PCollection<Event>, PCollection<T>> queryTransform) {
PCollection<? extends KnownSize> resultRecordsSizes = events.apply(queryTransform); | 0 |
$Id: ConditionFactory.java,v 1.2 2004/03/01 10:36:22 andreas Exp $ | 0 |
import java.util.Collection;
public static Map<Long,? extends Collection<FileRef>> getBulkFilesLoaded(ClientContext context, KeyExtent extent) throws IOException {
Map<Long,List<FileRef>> result = new HashMap<>();
List<FileRef> lst = result.get(tid);
if (lst == null) {
result.put(tid, lst = new ArrayList<>());
}
lst.add(new FileRef(fs, entry.getKey()));
return result; | 0 |
import org.apache.beam.portability.v1.Endpoints.ApiServiceDescriptor;
ApiServiceDescriptor.getDefaultInstance())); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.