Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
import java.util.Optional; | 0 |
try (Writer out = new OutputStreamWriter(new FileOutputStream(file), charsetUTF8);
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(origin), charsetUTF8))) {
} finally{
try (final BufferedOutputStream output =
new BufferedOutputStr... | 0 |
public class EventAwareCacheImpl extends CacheImpl implements EventAware { | 0 |
public static final Integer WRITING_MODE_LTR = 0x1;
public static final Integer WRITING_MODE_RTL = 0x2;
public static final Integer WRITING_MODE_TTB = 0x3;
public static final Integer ORIENTATION_ANGLE = 0x1;
public static final Integer ORIENTATION_AUTO = 0x2;
public stat... | 0 |
Copyright 2000-2001,2003 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 applica... | 0 |
/**
* @see org.apache.accumulo.core.volume.VolumeConfiguration#getVolumeUris(AccumuloConfiguration)
*/
*
*
* @param fs
* A FileSystem to write to
* @return A Volume instance writing to the given FileSystem in the default path
| 0 |
final InterpolatorSpecification spec)
public void registerLookup(final String prefix, final Lookup lookup)
public void registerLookups(final Map<String, ? extends Lookup> lookups)
public boolean deregisterLookup(final String prefix)
public void addDefaultLookup(final Lookup defaultLookup)
... | 0 |
final int maxHeaderCount,
final int maxLineLen,
final int maxHeaderCount,
final int maxLineLen, | 0 |
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*
* @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch... | 0 |
* http://www.apache.org/licenses/LICENSE-2.0 | 0 |
final Header[] headers = new Header[]{
final Header[] headers = new Header[]{
final Header[] headers = new Header[]{
} catch (final IllegalArgumentException iax) {
} catch (final NoSuchElementException nsx) {
final Header[] headers = new Header[]{
} catch (final U... | 0 |
@Category({ category.KerberosTest.class}) | 0 |
* An interface used with the Java {@link ServiceLoader} to auto-discover classes executable with a
* convenient keyword on the command-line.
* All implementing classes who have an entry in
* META-INF/services/{@link org.apache.accumulo.start.spi.KeywordExecutable} on the classpath will
* be constructed by the {@li... | 0 |
in.apply("Values", MapElements.via(new SimpleFunction<KV<?, V>, V>() {
@Override
public V apply(KV<?, V> kv) {
return kv.getValue(); | 0 |
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.apache.sshd.common.FactoryManager;
import org.apache.sshd.common.util.buffer.Buf... | 0 |
import java.util.ArrayList;
List<String> fieldNames = new ArrayList<>();
List<Integer> fieldTypes = new ArrayList<>();
fieldNames.add(inputRecordType.getFieldsName().get(i));
fieldTypes.add(inputRecordType.getFieldsType().get(i));
return BeamSqlRecordType.create(fieldNames, fieldTypes);
... | 0 |
import java.util.stream.Collectors;
private Map<String, Operator> operators = new HashMap<>();
private Map<String, Function> functions = new HashMap<>();
private Map<String, Object> constants = new HashMap<>();
List<BigDecimal> numericParameters = parameters.stream()
.map(o -... | 0 |
for (String requiredScheme : requiredSchemes)
for (String requiredClass : requiredClasses) | 0 |
final UnaryFunction valueExtractor;
(Pair p) -> CompositeKey.of(
p.getFirst(),
reduceKeyExtractor.apply(p.getSecond()));
UnaryFunction vfn = reduceStateByKey.getValueExtractor();
valueExtractor = (UnaryFunction<Pair, Object>)
(Pair p) -> vfn.apply(p.getSec... | 0 |
serviceName, null, null, null, null);
serviceName, null, null, null, null); | 0 |
// making sure setdata works on /
zk.setData("/", "some".getBytes(), -1); | 0 |
/*
* $Id$
* 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... | 0 |
import java.io.FileInputStream;
Document doc = XMLUtils.read(new FileInputStream(new File(dir, file)), false, false); | 0 |
import org.apache.beam.sdk.values.BeamRecord;
@Override public BeamSqlPrimitive evaluate(BeamRecord inputRow) { | 0 |
import com.google.cloud.dataflow.sdk.transforms.windowing.PaneInfo;
import com.google.cloud.dataflow.sdk.util.TimerInternals;
import com.google.cloud.dataflow.sdk.util.state.StateInternals;
public PaneInfo pane() {
return PaneInfo.DEFAULT;
}
@Override
extends BoundedWindow> windows, PaneInfo paneIn... | 0 |
throw new SQLNestedException("Cannot close connection pool", e); | 0 |
package org.apache.commons.ognl.test.objects; | 0 |
package org.apache.commons.ognl.test.objects; | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/ArrayIterator.java,v 1.5 2003/08/31 17:25:49 scolebourne Exp $
* any, must include the following acknowledgement:
* Alternately, this acknowledgement may appear i... | 0 |
* or more contributor license agreements. See the NOTICE file
* regarding copyright ownership. The ASF licenses this file
* with the License. You may obtain a copy of the License at
* KIND, either express or implied. See the License for the | 0 |
import org.apache.accumulo.core.data.ArrayByteSequence;
import org.apache.accumulo.core.data.ByteSequence;
* Authorizations in column visibility expression are in escaped form. Column visibility parsing does not unescape. This class wraps an AuthorizationContainer
* and unescapes auths before checking the wrapped... | 0 |
* limitations under the License. | 0 |
package org.apache.beam.runners.core.triggers;
* <p>The time at which to fire the timer can be adjusted via the methods in {@link
* AfterDelayFromFirstElementStateMachine}, such as {@link
* AfterDelayFromFirstElementStateMachine#plusDelayOf} or {@link
* AfterDelayFromFirstElementStateMachine#alignedTo}.
public clas... | 0 |
import org.apache.sshd.server.SshServer; | 0 |
.setExtendedErrorInfo(false)
abstract boolean getExtendedErrorInfo();
abstract Builder<T> setExtendedErrorInfo(boolean extendedErrorInfo);
/**
* Enables extended error information by enabling {@link WriteResult#getFailedInsertsWithErr()}
*
* <p>ATM this only works if using {@link ... | 0 |
if ("team".equals(keyname)) { | 0 |
} else { | 0 |
import org.apache.ambari.view.commons.hdfs.UserService;
/**
* Checks connection to User HomeDirectory
* @param context View Context
*/
public static void userhomeSmokeTest(ViewContext context) {
try {
UserService userservice = new UserService(context);
userservice.homeDir();
} catch ... | 0 |
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
private int statusCode;
private Map headers;
/**
* format definied by RFC 822, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3
*/
final SimpleD... | 0 |
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
static DateTime str2DateTime(String dateStr) {
DateTimeFormatter format = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss").withZoneUTC();
return format.parseDateTime(dateStr); | 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 |
/**
* 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 |
import org.apache.accumulo.core.clientImpl.BaseIteratorEnvironment; | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/ExtendedBaseRules.java,v 1.3 2002/07/10 18:12:33 rdonkin Exp $
* $Revision: 1.3 $
* $Date: 2002/07/10 18:12:33 $
* @version $Revision: 1.3 $ $Date: 2002/07/10 18:12:33 $
retur... | 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 |
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
* 4. The names "The Jakarta Project", "Commons", ... | 0 |
import java.util.ArrayList;
import java.util.Arrays;
plotData(sb, title, points, new ArrayList<String>(), data);
}
private static void plotData(StringBuilder sb, String title, boolean points, List<String> labels, @SuppressWarnings("rawtypes") List... series) {
for (int i = 0; i < series.length; i++) {
... | 1 |
log.error(MultiTableBatchWriterImpl.class.getSimpleName() + " internal error.", mre); | 0 |
pi.close(); | 0 |
Repartition.of(dataset) | 0 |
import com.google.common.collect.ImmutableMap;
.evaluate(BeamSqlFnExecutorTestBase.row, null, ImmutableMap.of()) | 0 |
import java.nio.channels.ReadableByteChannel;
void write(ByteBuffer src);
void write(ReadableByteChannel src)
throws IOException;
void writeLine(String s)
throws IOException; | 0 |
context.getContextRuntime(),
context.getListeners());
private ServletContextDTO createContextDTO(final ServletContextHelperRuntime context,
final ContextRuntime contextRuntime,
final Collection<ServiceReference<?>> listenerRuntimes)
final long ... | 0 |
* Constructs a new <code>ImageTranscoder</code>. | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/ArrayStack.java,v 1.6 2002/07/03 02:09:06 mas Exp $
* $Revision: 1.6 $
* $Date: 2002/07/03 02:09:06 $
* The removal order of an <Code>ArrayStack</Code> is based on insertion
*... | 0 |
import org.junit.Before;
import org.junit.Test;
public class Santuario191Test extends org.junit.Assert {
@Before | 0 |
if (name.length() == 0) return false; // must not be empty, reported by <francis.andre@easynet.fr>, thanks!
| 0 |
* data distribution using approximate {@code N}-tiles (e.g. quartiles,
* percentiles, etc.), either globally or per-key.
private ApproximateQuantiles() {
// do not instantiate
} | 0 |
import net.jcip.annotations.NotThreadSafe;
@NotThreadSafe | 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 ... | 1 |
// Hint to GC to collect bundle; not sure why this
// is necessary, but it appears to help.
bundles[i] = null;
} | 0 |
import org.apache.beam.dsls.sql.schema.BeamSqlRow;
@Override public BeamSqlPrimitive evaluate(BeamSqlRow inputRecord) { | 0 |
if (tableId == null)
throw new TableNotFoundException(tableId, tableName, null);
if (Tables.getTableState(instance, tableId) == TableState.OFFLINE)
throw new TableOfflineException(instance, tableId); | 1 |
if (options.getAutoscalingAlgorithm() != null
&& !options.getAutoscalingAlgorithm().equals(AutoscalingAlgorithmType.NONE)) { | 0 |
return ClientConfiguration.create().with(ClientProperty.INSTANCE_ZK_HOST, "firstZkHosts").with(ClientProperty.INSTANCE_NAME, "secondInstanceName")
.with(ClientProperty.INSTANCE_ZK_TIMEOUT, "123s"); | 0 |
return FileSystemException.requireNonNull(fileReplicator, "vfs.impl/no-replicator.error");
return FileSystemException.requireNonNull(tempFileStore, "vfs.impl/no-temp-file-store.error");
FileSystemException.requireNonNull(base, "Invalid base FileName.");
FileSystemException.requireNonNull... | 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 ap... | 0 |
if (extension == null || extension.isEmpty())
extension = RFile.EXTENSION;
if (conf.getBoolean(INSTANCE_HAS_BEEN_SET, false))
throw new IllegalStateException("Instance info can only be set once per job"); | 1 |
import javax.validation.constraints.NotNull;
@NotNull
public LSServerMapDate() {}
| 0 |
/* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//dbcp/src/java/org/apache/commons/dbcp/BasicDataSource.java,v 1.14 2003/04/09 02:39:16 dgraham Exp $
* $Revision: 1.14 $
* $Date: 2003/04/09 02:39:16 $
* @version $Revision: 1.14 $ $Date: 2003/04/09 02:39:16 $
this.log... | 0 |
*
*
*
"iso-ir-148",
"latin5",
"l5",
"ISO_8859-9",
"ISO_8859-9:1989",
"csISOLatin5",
"iso8859_9", | 0 |
@Override
@Override
@Override
@Override | 0 |
* Gets the privilege service
*/
@Path("{clusterName}/privileges")
public PrivilegeService getPrivilegeService(@PathParam ("clusterName") String clusterName) {
return new ClusterPrivilegeService(clusterName);
}
/** | 0 |
/*
* The following two tests assert that no exception is thrown after calling hashCode or equals on a Mutation. These guard against the condition noted in
* ACCUMULO-3718.
m.put("cf", "cq", "v");
} catch (IllegalStateException e) {
m.put("cf", "cq", "v");
m2.put("cf", "cq", "v");
} cat... | 0 |
addDependency(Role.ZOOKEEPER_SERVICE_CHECK, RoleCommand.EXECUTE,
Role.ZOOKEEPER_SERVER, RoleCommand.START);
addDependency(Role.ZOOKEEPER_QUORUM_SERVICE_CHECK, RoleCommand.EXECUTE,
Role.ZOOKEEPER_SERVER, RoleCommand.START); | 0 |
import org.apache.xml.security.utils.XMLUtils;
Document doc = XMLUtils.createDocumentBuilder(false).newDocument(); | 0 |
rands[i] = (r.nextLong() & 0x7fffffffffffffffL) % 10000000000L; | 0 |
package org.apache.commons.vfs2.provider.mime;
import org.apache.commons.vfs2.FileContentInfoFactory;
import org.apache.commons.vfs2.FileName;
import org.apache.commons.vfs2.FileObject;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.commons.vfs2.FileType;
import org.apache.commons.vfs2.NameScope;... | 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... | 0 |
import org.apache.http.mockup.SimpleEventListener; | 0 |
assertTrue(e.getMessage().contains("Could not access base url"));
assertTrue(exceptionMsg.contains("Could not access base url")); | 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
... | 0 |
* @version $Revision: 155419 $ $Date$
/**
* Provide a String representaion of this file filter.
*
* @return a String representaion
*/
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append(super.toString());
buffer.append("(");
if ... | 0 |
Assert.assertEquals("HDP-0.2", resp.getDesiredStackId());
Assert.assertEquals("HDP-0.2", svc.getDesiredStackId());
Assert.assertEquals(s1.getCluster().getClusterName(), resp1.getClusterName());
Assert.assertEquals("HDP-0.1", s1.getDesiredStackId().getStackId());
Assert.assertEquals(s1.getDesiredSt... | 0 |
@Override
public ServiceInstance apply(HostAndPort endpoint) {
@Override
public LocalService launch() { | 0 |
import org.mockito.Matchers;
Matchers.eq(this.request), Matchers.eq(this.response), Matchers.eq(this.context)); | 0 |
private String serviceName; // GET/CREATE/UPDATE/DELETE
private String componentName; // GET/CREATE/UPDATE/DELETE
// Config type -> version mapping
private Map<String, String> configVersions; // CREATE/UPDATE
private String desiredState; // CREATE/UPDATE
String serviceNam... | 1 |
import java.util.Objects;
Objects.requireNonNull(userHomeDir, "No home dir")); | 0 |
import java.util.Map;
import org.apache.cocoon.webapps.authentication.context.AuthenticationContext;
import org.apache.cocoon.webapps.authentication.user.RequestState;
import org.apache.cocoon.webapps.authentication.user.UserHandler;
* @version CVS $Id: ConfigurationGenerator.java,v 1.2 2003/05/04 20:19:42 cziegeler E... | 0 |
* This spring factory bean adds the configuration info to the bean factory.
public class ConfigurationInfoFactoryBean
implements FactoryBean {
protected ConfigurationInfo info;
return this.info;
public ConfigurationInfo getInfo() {
return info;
public void setInfo(ConfigurationInfo info... | 0 |
(new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI(), 1);
("DOM", new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI()); | 0 |
@XmlAttribute(required = true)
protected boolean markForDeletionWhenInAttic = false;
/**
* @return the markForDeletionWhenInAttic
*/
public boolean isMarkForDeletionWhenInAttic() {
return markForDeletionWhenInAttic;
}
/**
* @param markForDeletionWhenInAttic the markF... | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//codec/src/java/org/apache/commons/codec/binary/Base64.java,v 1.5 2003/07/25 22:40:36 ggregory Exp $
* $Revision: 1.5 $
* $Date: 2003/07/25 22:40:36 $
result = decodeBase64(pArray); | 0 |
BigQueryTableInserter inserter = new BigQueryTableInserter(mockClient);
inserter.getOrCreateTable(ref, BigQueryIO.Write.WriteDisposition.WRITE_APPEND,
BigQueryTableInserter inserter = new BigQueryTableInserter(mockClient);
inserter.getOrCreateTable(ref, BigQueryIO.Write.WriteDisposition.WRITE_EMPTY,
... | 0 |
if (type.equals(Resource.Type.Cluster)) {
return new ClusterProvider(clusterDefinition);
} else if (type.equals(Resource.Type.Service)) {
return new ServiceProvider(clusterDefinition);
} else if (type.equals(Resource.Type.Component)) {
return new ComponentProvider(clusterDefinition);
}... | 0 |
asserter = new Asserter(JEXL); | 0 |
import com.mongodb.MongoBulkWriteException;
import com.mongodb.client.model.InsertManyOptions;
.setOrdered(true)
abstract boolean ordered();
abstract Builder setOrdered(boolean value);
/**
* Enables ordered bulk insertion (default: true).
*
* @see <a href=
* "https://gith... | 0 |
* Autogenerated by Thrift Compiler (0.9.3)
import javax.annotation.Generated;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2015-12-16")
public class TAuthenticationKey implements org.apache.thrift.TBase<TAuthenticationKe... | 0 |
import java.util.Set;
| 0 |
import org.apache.felix.service.command.CommandSession;
import org.apache.felix.service.command.Descriptor; | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.