Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.fail;
@org.junit.jupiter.ap... | 0 |
import java.io.IOException;
import static org.mockito.Matchers.anyString;
// Simulate a resource not found exception
when(store.read(anyString()))
.thenThrow(new IOException()); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/share/org/apache/commons/validator/GenericValidator.java,v 1.25 2003/08/21 19:40:13 rleland Exp $
* $Revision: 1.25 $
* $Date: 2003/08/21 19:40:13 $
* Copyright (c) 2001-2003 The Apache Software Foundation. All rig... | 0 |
import org.apache.beam.sdk.extensions.kryo.KryoOptions;
import org.apache.beam.sdk.transforms.windowing.TimestampCombiner;
import org.apache.beam.sdk.transforms.windowing.Window.OnTimeBehavior;
public void codersAndTypesSection() {
final PipelineOptions options = PipelineOptionsFactory.create();
Pipeline pipe... | 0 |
this.reader = MapFileUtil.openMapFile(fs, dir, conf); | 0 |
* Simple update operation on table
*
* @param tableName
* @param columnNameSrc
* @param columnNameTgt
* @return
* @throws SQLException
*/
public void updateTable(String tableName, DBColumnInfo columnNameSrc,
DBColumnInfo columnNameTgt) throws SQLException;
/**
* ... | 0 |
import org.apache.hc.core5.annotation.NotThreadSafe;
import org.apache.hc.core5.util.Args; | 1 |
* <p>TODO: (BEAM-3811) Replace with some cancellable collection, to ensure that new clients of a | 0 |
public abstract class AbstractSessionDataTransmitter implements HttpDataTransmitter {
public AbstractSessionDataTransmitter(final SessionOutputBuffer buffer) { | 0 |
ATSRequestsDelegateImpl atsimpl = new ATSRequestsDelegateImpl(context, new ATSParserFactory(context).getATSUrl()); | 0 |
import java.util.Base64;
sb.append(new String(Base64.getEncoder().encode(TextUtil.getBytes(columns[i])), UTF_8));
return new String(Base64.getEncoder().encode(bytes), UTF_8);
columnTexts[i] = new Text(Base64.getDecoder().decode(columnStrings[i].getBytes(UTF_8)));
byte[] bytes = Base64.getDecoder().d... | 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 |
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;... | 0 |
/**
super.setLength(4); // Including the wide byte | 0 |
.apply(Filter.by(i -> true));
.apply(Filter.by(i -> false));
.apply(Filter.by(i -> i % 2 == 0));
.apply(Filter.by(new EvenFilter()::isEven)); | 0 |
URL classPathResource = this.targetRulesBinder.getContextClassLoader().getResource(path);
if (classPathResource == null) {
this.targetRulesBinder.addError("Resource '%s' not found, please make sure it is in the classpath",
path);
... | 0 |
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.net.MalformedURLException;
import org.apache.excalibur.source.Source;
import org.apache.cocoon.util.AbstractLogEnabled;
implements ProgramGenerator, Contextualizable, Servic... | 0 |
/** Tests for PipelineResources. */
URLClassLoader classLoader =
new URLClassLoader(new URL[] {file.toURI().toURL(), file2.toURI().toURL()});
assertEquals(
ImmutableList.of(file.getAbsolutePath(), file2.getAbsolutePath()),
URLClassLoader classLoader = new URLClassLoader(new URL[] {new URL(ur... | 1 |
import org.apache.accumulo.core.Constants;
public ImportExecutorOptions from(String directory) {
log.debug("Failed to close " + mapFile, e);
FileStatus[] files = fs.listStatus(dirPath,
p -> !p.getName().equals(Constants.BULK_LOAD_MAPPING));
throw new RuntimeException("TODO handle merges"... | 0 |
import org.apache.sshd.common.config.keys.AuthorizedKeyEntry; | 0 |
private Option negateOpt;
boolean negate = false;
if (cl.hasOption(negateOpt.getOpt())) {
negate = true;
}
scanner, cl, negate);
final BatchScanner scanner, CommandLine cl, boolean negate) throws IOException {
GrepIterator.setNegate(grep, negate);
negateOpt = new O... | 0 |
import org.apache.accumulo.core.clientImpl.ClientContext;
import org.apache.accumulo.core.clientImpl.Table;
import org.apache.accumulo.core.clientImpl.Tables; | 0 |
import java.util.LinkedHashSet;
import java.util.Set;
static final short NON_ALPHA_NUM_ROW = 1;
static final short NON_ALPHA_NUM_COLF = 2;
static final short NON_ALPHA_NUM_COLQ = 3;
static final String ROW_VIOLATION_MESSAGE = "Row was not alpha numeric";
static final String COLF_VIOLATION_MESSAGE = "Column f... | 0 |
EOSWrite.ensureEOSSupport();
static void ensureEOSSupport() {
checkArgument(
ProducerSpEL.supportsTransactions(), "%s %s",
"This version of Kafka client does not support transactions required to support",
"exactly-once semantics. Please use Kafka client version 0.11 or newer.");
... | 0 |
import org.apache.sshd.common.util.Int2IntFunction;
if (log.isDebugEnabled()) {
log.debug("Received SSH_MSG_GLOBAL_REQUEST {} want-reply={}", req, Boolean.valueOf(wantReply));
}
if (GenericUtils.size(handlers) > 0) {
// if Unsupported then check the next handler in ... | 0 |
result.put(osType, new LinkedList<>()); | 0 |
@Override
public void removeShardUpdateConfigs(JobKey jobKey) {
// TODO(ksweeney): Remove this delegation as part of MESOS-2403.
removeShardUpdateConfigs(jobKey.getRole(), jobKey.getName());
}
| 0 |
private Boolean isFirstRowHeader = Boolean.FALSE;
return new StringBuilder("UploadFromHdfsInput{" )
.append("isFirstRowHeader=").append( isFirstRowHeader )
.append(", inputFileType='" ).append(inputFileType)
.append(", hdfsPath='").append(hdfsPath)
.append(", tableN... | 0 |
*
* @version $Id: Event.java,v 1.3 2004/03/01 11:00:43 andreas Exp $ | 0 |
System.out.println("Document load started...");
System.out.print("Document load completed in ");
System.out.println("Document load cancelled");
System.out.println("Document load failed");
System.out.println("GVT build started...");
System.out.print... | 0 |
* </p>
* See {@link FilenameUtils#wildcardMatchOnSystem(String,String)} for more information.
* </p>
* </p> | 0 |
implements Builders.WindowBy<IN, WindowByBuilder<IN, K, V, S>>,
Builders.Output<Triple<K, V, S>>
final String name;
final Dataset<IN> input;
final UnaryFunction<IN, K> keyFn;
final UnaryFunction<IN, V> valueFn;
final UnaryFunction<IN, S> scoreFn;
WindowByBuilder(
String name... | 0 |
@Override
@Override | 0 |
httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
// When HttpClient instance is no longer needed,
// shut down the connection manager to ensure
// immediate deallocation of all system resources
httpclient.getConnectionManager().shutdown(); ... | 0 |
builder.addKeyPart(tableName, columnName, "DESC".equals(ordering.toUpperCase())); | 0 |
* @author <a href="mailto:deweese@apache.org">l449433</a> | 0 |
private static final String DSA_Y =
"07066284216756577193658833512863439617178933165631848358445549382240081120085333137303066923542492834619027404463194956043802393462371310375123430985057160";
private static final String DSA_P =
"01323237689519861240754793071826743575772852702962340887224515... | 0 |
return PCollection.<T>createPrimitiveOutputInternal(
input.getPipeline(),
WindowingStrategy.globalDefault()); | 0 |
import org.apache.atlas.TestOnlyModule;
import javax.inject.Inject;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import static org.testng.Assert.*;
@Guice(modules =... | 0 |
package org.apache.felix.karaf.shell.commands;
import org.apache.felix.karaf.shell.console.OsgiCommandSupport; | 0 |
package org.apache.commons.vfs2;
* {@link org.apache.commons.vfs2.FileObject#getChildren()} on a file. | 1 |
sshd.getProperties().put(SshServer.WELCOME_BANNER, "Welcome to SSHD"); | 0 |
* @param src The (<U>remote</U>) file source path
* @param dst The (<U>remote</U>) file destination path | 1 |
package org.apache.cocoon.el.impl; | 0 |
import org.apache.aurora.scheduler.storage.entities.IScheduledTask;
return dumpEntity(
"Task " + taskId,
storeProvider ->
storeProvider.getTaskStore().fetchTask(taskId).transform(IScheduledTask::newBuilder)); | 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... | 1 |
package aQute.lib.io;
import java.io.*;
public class LimitedInputStream extends InputStream {
final InputStream in;
final int size;
int left;
public LimitedInputStream(InputStream in, int size) {
this.in = in;
this.left = size;
this.size = size;
}
@Override public int read() throws IOException {
... | 0 |
* <p>In pictures: | 0 |
@SuppressWarnings({"unchecked", "serial", "rawtypes", "unused"}) public class TestService {
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
public enum _Fields implements org.apache.thrift.TFieldIdEnum { | 0 |
* @version $Revision$ $Date$ | 0 |
import javax.xml.parsers.DocumentBuilder;
DocumentBuilder db = XMLUtils.createDocumentBuilder(false);
Document doc = db.newDocument();
Document document = XMLUtils.createDocumentBuilder(false).newDocument(); | 0 |
package cz.seznam.euphoria.operator.test.inmem;
import cz.seznam.euphoria.operator.test.ng.tests.AllOperatorsSuite;
public class NgInMemOperatorTest
extends AllOperatorsSuite
implements NgInMemExecutorProvider {} | 0 |
import static com.google.cloud.dataflow.sdk.util.WindowedValue.valueInGlobalWindow;
public Reader<Integer> createReader(
PipelineOptions options, @Nullable ExecutionContext executionContext) throws IOException {
assertEquals(valueInGlobalWindow(10 + i), elems.get(i));
assertThat(xs, contains... | 0 |
sources.put(sourceCap, pkgCaps); | 0 |
import org.hamcrest.Matchers;
public void emptyKeysNotEqual() {
StructuralKey<?> empty = StructuralKey.empty();
assertThat(empty, not(Matchers.<StructuralKey<?>>equalTo(StructuralKey.empty())));
assertThat(empty, Matchers.<StructuralKey<?>>equalTo(empty));
}
@Test | 0 |
*
private boolean throwExceptionOnMissing;
*
*
* Allows to set the <code>throwExceptionOnMissing</code> flag. This
* flag controls the behavior of property getter methods that return
* objects if the requested property is missing. If the flag is set to
* <b>false</b> (which is the def... | 0 |
conn.tableOperations().setProperty(tableName, Property.TABLE_COMPACTION_STRATEGY.getKey(),
TestCompactionStrategy.class.getName()); | 0 |
Long getClusterId();
void setClusterId(Long clusterId);
Blueprint getBlueprint();
Configuration getConfiguration();
Map<String, HostGroupInfo> getHostGroupInfo();
Collection<String> getHostGroupsForComponent(String component);
String getHostGroupForHost(String hostname);
Collection<String> getHostAssign... | 0 |
NodeList fontFaceElements = doc.getElementsByTagNameNS
(SVG_NAMESPACE_URI, SVG_FONT_FACE_TAG);
NodeList fontFaceSrcNodes =
fontFaceElement.getElementsByTagNameNS
(SVG_NAMESPACE_URI, SVG_FONT_FACE_SRC_TAG);
NodeList fontFaceUriNodes = fontFaceSrcElement.get... | 0 |
* @version CVS $Id: RequestState.java,v 1.4 2003/05/22 14:09:34 cziegeler Exp $
protected static void setState(RequestState status) {
setState(this); | 0 |
return new TagScript( | 0 |
* @version CVS $Id: CannotCreateElementProcessorException.java,v 1.3 2004/01/31 08:50:43 antonio Exp $
_reason = (reason == null) ? "" : reason;
if (_reason.length() != 0) { | 0 |
public final class CatalogTestCase
extends AbstractAnnotatedPojoTestCase
{
public void testCatalog()
throws Exception
{
Book book = new Book( "0-596-00184-3" );
book.setTitle( "Ant, The Definitive Guide" );
book.setAuthor( "Jesse Tilly & Eric M. Burke" );
book.setDesc... | 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... | 0 |
import org.apache.beam.sdk.transforms.Reshuffle;
return inputQuery
.apply("Split", ParDo.of(new SplitQueryFn(v1Options, getNumQuerySplits())))
.apply("Reshuffle", Reshuffle.<Query>viaRandomKey())
.apply("Read", ParDo.of(new ReadFn(v1Options)));
static class SplitQueryFn extends D... | 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 |
// Event History Constants History | 0 |
import org.apache.accumulo.cloudtrace.thrift.RemoteSpan;
| 0 |
* Copyright 2016 Seznam.cz, a.s. | 0 |
* This implementation caches every file using {@link LRUMap}.
* <p>
/** The logger to use. */ | 0 |
final String name = getName();
final String signature = Utility.signatureToString(getSignature(), false);
final String label = "LocalVariable" + (typeTable ? "Types" : "" );
} catch (final CloneNotSupportedException e) { | 1 |
* Returns the footer comment. This is a comment at the very end of the
* file.
*
* @return the footer comment
* @since 2.0
*/
public String getFooter()
{
return getLayout().getFooterComment();
}
/**
* Sets the footer comment. If set, this comment is written af... | 0 |
hgMap.put("hg2", hostGroup);
hgMap.put("hg3", hostGroup); | 0 |
*/
public void validate(final Cookie cookie, final CookieOrigin origin)
+ domain
+ domain
} | 0 |
* limitations under the License. | 0 |
import com.google.api.services.dataflow.model.Source;
import com.google.cloud.dataflow.sdk.util.common.worker.Reader;
public static Object readSideInput(PipelineOptions options, SideInputInfo sideInputInfo,
ExecutionContext executionContext) throws Exception {
static Iterable<Object> readSideInputSources(Pipe... | 0 |
if (userListModel.getSize() > 0) {
result.append(userListModel.getElementAt(0));
for (int i = 1; i < userListModel.getSize(); i++) {
result.append("," + userListModel.getElementAt(i));
} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/SetNextRule.java,v 1.3 2001/07/19 20:55:52 sanders Exp $
* $Revision: 1.3 $
* $Date: 2001/07/19 20:55:52 $
* @version $Revision: 1.3 $ $Date: 2001/07/19 20:55:52 $
// Check to... | 0 |
final HttpContext context = conn.getContext();
final HttpAsyncClientExchangeHandler handler;
synchronized (context) {
handler = getHandler(conn);
if (handler == null || handler.isDone()) {
conn.suspendOutput();
return;
} | 0 |
import java.util.Set;
tableOpt = new Option(Shell.tableOption, "table", true, "table to fetch locality groups from"); | 0 |
private Repository m_repo;
public Repository getRepository() {
return m_repo;
}
public void setRepository(Repository repository) {
this.m_repo = repository;
}
public boolean isLocal()
return false;
else if (key.equals(JAVADOC_URL))
m_map.put(... | 0 |
import org.apache.hadoop.metadata.MetadataServiceClient;
serve("/" + MetadataServiceClient.BASE_URI + "*").with(GuiceContainer.class, params); | 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... | 0 |
final ExpressionEngine engine = new XPathExpressionEngine();
final BasicBuilderParameters params =
final ReloadingMultiFileConfigurationBuilder<XMLConfiguration> builder =
final XMLConfiguration config = builder.getConfiguration();
final ReloadingMultiFileConfigurationBuilder<XML... | 0 |
private static final String SSO_INTEGRATION_REQUIRES_KERBEROS_PROPERTY_ID = PropertyHelper.getPropertyId(
"StackServices", "sso_integration_requires_kerberos");
SSO_INTEGRATION_SUPPORTED_PROPERTY_ID,
SSO_INTEGRATION_REQUIRES_KERBEROS_PROPERTY_ID);
setResourceProperty(resource, SSO_INTEGRATION_REQ... | 0 |
final Header[] headers = { new BasicHeader("foo", "fooValue"),
final Header[] headers = { new BasicHeader("foo", "fooValue"),
final Header[] headers = { new BasicHeader("foo", "fooValue"),
final Header[] headers = { new BasicHeader("foo", "fooValue"),
final Header[] headers = new... | 0 |
public Object interpolate(final Object value)
private void checkSingleValue(final Integer expResult)
final Integer result = handler.to(VAR, Integer.class, createInterpolator());
final Integer result = handler.to(REPLACEMENT, Integer.class, null);
final Object[] src = {
fi... | 0 |
* Root URL for use with the Pubsub API.
*/
@Description("Root URL for use with the Pubsub API")
@Default.String("https://pubsub.googleapis.com")
String getPubsubRootUrl();
void setPubsubRootUrl(String value);
/** | 0 |
import org.apache.cocoon.jnet.URLHandlerFactoryCollector;
private URLHandlerFactoryCollector urlHandlerFactoryCollector;
try {
//manual call to pushUrlHandlerFactories is needed due to issue COCOON-2236
urlHandlerFactoryCollector.pushUrlHandlerFactories();
this.embed... | 0 |
import javax.persistence.EntityManager;
import junit.framework.Assert;
return target;
return target;
return group; | 0 |
// disable spits, so that splits can be compared later w/o worrying one table splitting and the
// other not
env.getConnector().tableOperations().setProperty(indexTableName,
Property.TABLE_SPLIT_THRESHOLD.getKey(), "20G");
BufferedReader reader = new BufferedReader(
new InputStreamReader... | 0 |
if (v instanceof VisitorSupportsInvokeDynamic) {
} | 0 |
* A graphics node which provides a placeholder for another graphics node. This
* node is self defined except that it delegates to the enclosed (proxied)
* graphics node, its paint routine and bounds computation.
* @version $Id$
*
*
* Returns the bounds of the area covered by this node's primitive pa... | 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... | 0 |
/** '/' operator. */
@Override
protected BigDecimal calc(BigDecimal left, BigDecimal right) { | 0 |
// an LDAP filter, that is used to search services
private static final String FILTER_PARAM = "filter";
private final ServiceReference[] getServices(String filter)
// empty filter string will return nothing, must set it to null to return all services
if (filter != null && filter.trim().leng... | 0 |
println(Ansi.ansi().a("Creating new instance on port ").a(sshPort).a(" at: ").a(Ansi.Attribute.INTENSITY_BOLD).a(serviceMixBase).a(Ansi.Attribute.RESET).toString()); | 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... | 0 |
// if (false) { // ctx.isDynamic()){
//ctx.putBridge(new SVGRectElementBridge.Dynamic());
//} else {
ctx.putBridge(new SVGRectElementBridge());
//} | 0 |
/** Generate CRC-32 lookup tables */
public static void main(final String[] args) throws FileNotFoundException {
if (args.length != 1) {
System.err.println("Usage: " + Table.class.getName() + " <polynomial>");
System.exit(1);
}
final lo... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.