Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
sig.sign(getSecretKey("secret".getBytes("ASCII"))); SecretKey sk = signature.createSecretKey("secret".getBytes("ASCII"));
0
.apply("ProcessAndFilter", ParDo .apply("ParseGameEvent", ParDo.of(new ParseEventFn())); .apply("FilterOutSpammers", ParDo
0
import org.apache.http.HttpResponse; * Updates entity in a response by first consuming an existing entity, then setting the new one. * * @param response the response with an entity to update. * @param entity the entity to set in the response. * @throws IOException if an error occurs while reading the input stream on the existing * entity. * * @since 4.3 */ public static void updateEntity( final HttpResponse response, final HttpEntity entity) throws IOException { consume(response.getEntity()); response.setEntity(entity); } /**
0
Method m = service.getClass().getMethod("getComponent", String.class, HttpHeaders.class, UriInfo.class, String.class); Object[] args = new Object[] {null, getHttpHeaders(), getUriInfo(), "componentName"}; m = service.getClass().getMethod("getComponents", String.class, HttpHeaders.class, UriInfo.class); args = new Object[] {null, getHttpHeaders(), getUriInfo()};
0
import org.apache.cocoon.portal.factory.impl.AbstractProducible; * @version CVS $Id: AbstractParameters.java,v 1.2 2003/05/20 14:06:43 cziegeler Exp $ public abstract class AbstractParameters extends AbstractProducible implements Parameters {
0
wals.retainAll(fileToStatus.keySet()); Assert.assertEquals(1, wals.size());
0
LOG.info("Already progressed to offset {}, which is after the requested split offset {}",
0
import org.apache.ambari.annotations.ApiIgnore; @GET @ApiIgnore // until documented @GET @ApiIgnore // until documented
0
@Override public JarEntry getJarEntry() throws IOException { return getJarFile().getJarEntry(getEntryName()); }
0
import java.util.Properties; private static TitanGraph graphInstance; Properties sysProperties = System.getProperties(); LOG.info("System properties: "); LOG.info(sysProperties.toString()); if(graphInstance == null) { synchronized (TitanGraphProvider.class) { if(graphInstance == null) { Configuration config; try { config = getConfiguration(); } catch (AtlasException e) { throw new RuntimeException(e); } graphInstance = TitanFactory.open(config); } } } return graphInstance;
0
loadProcess("loadSalesDaily" + randomString(), "John ETL", ImmutableList.of(salesFact, timeDim), loadProcess("loadSalesMonthly" + randomString(), "John ETL", ImmutableList.of(salesFactDaily),
0
import javax.xml.datatype.DatatypeConfigurationException; public static XMLGregorianCalendar getXMLGregorianCalendar (Date date) { try { return DatatypeFactory.newInstance().newXMLGregorianCalendar(cal); } catch (NullPointerException ne) { } catch (DatatypeConfigurationException de) { } return null;
0
authstate.update(authscheme, creds); authstate.update(authscheme, creds); authstate.update(authscheme, creds); authstate.update(authscheme, creds);
0
* Returns all Element children of an Element that belong to the given namespace and have the given local name. */ public static Element[] getChildElements(Element element, String namespace, String localName) { ArrayList elements = new ArrayList(); NodeList nodeList = element.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); if (node instanceof Element && namespace.equals(node.getNamespaceURI()) && localName.equals(node.getLocalName())) elements.add(node); } return (Element[])elements.toArray(new Element[0]); } /** // note: instead of calling getChildElement(element, namespace, localName, false), // the code is duplicated here because this method does not throw an exception public static Element getChildElement(Element element, String namespace, String localName, boolean required) throws Exception { NodeList nodeList = element.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); if (node instanceof Element && namespace.equals(node.getNamespaceURI()) && localName.equals(node.getLocalName())) return (Element)node; } if (required) throw new Exception("Missing element \"" + localName + "\" as child of element \"" + element.getTagName() + "\" at " + DomHelper.getLocation(element)); else return null; }
0
* @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
0
void accept( Visitor obj );
0
import org.apache.beam.sdk.transforms.windowing.WindowMappingFn; public WindowMappingFn<BoundedWindow> getDefaultWindowMappingFn() {
0
import org.junit.After; import org.junit.Before; public abstract class AbstractParserTest { @Before public void setUp() throws Exception { @After public void tearDown() throws Exception {
0
* Copyright 1999-2002,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * @version CVS $Id: LayoutDescription.java,v 1.4 2004/03/05 13:02:13 bdelacretaz Exp $
1
new HashSet<>(Arrays.asList(new String[]{ TASK_ID_PROPERTY_ID})); static final Set<String> PROPERTY_IDS = new HashSet<>(); Set<Resource> results = new LinkedHashSet<>();
0
return desiredTids;
0
assertTrue(message, file.exists());
0
* Copyright 2002-2005 The Apache Software Foundation.
0
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl; private MiniAccumuloConfigImpl impl; MiniAccumuloConfig(MiniAccumuloConfigImpl config) { this.impl = config; } MiniAccumuloConfigImpl getImpl() { return impl; } this.impl = new MiniAccumuloConfigImpl(dir, rootPassword); impl.setNumTservers(numTservers); impl.setInstanceName(instanceName); impl.setSiteConfig(siteConfig); impl.setZooKeeperPort(zooKeeperPort); impl.setMemory(serverType, memory, memoryUnit); impl.setDefaultMemory(memory, memoryUnit); return impl.getSiteConfig(); return impl.getInstanceName(); return impl.getZooKeeperPort(); return impl.getMemory(serverType); return impl.getDefaultMemory(); return impl.getDir(); return impl.getRootPassword(); return impl.getNumTservers(); return impl.isJDWPEnabled(); impl.setJDWPEnabled(jdwpEnabled); return impl.getNativeLibPaths(); public MiniAccumuloConfig setNativeLibPaths(String... nativePathItems) { impl.setNativeLibPaths(nativePathItems); return this;
0
package org.apache.ambari.server.api.handlers; import org.apache.ambari.server.api.resources.ResourceDefinition; import org.apache.ambari.server.api.services.PersistenceManager; import org.apache.ambari.server.api.services.Request;
0
* <br></br>
0
import javax.servlet.http.HttpSession; HttpSession session = getRequest().getSession(true); HttpSession session = getRequest().getSession(true);
0
/* * $Header: /cvshome/build/ee.foundation/src/java/io/FileNotFoundException.java,v 1.6 2006/03/14 01:20:23 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.io; public class FileNotFoundException extends java.io.IOException { public FileNotFoundException() { } public FileNotFoundException(java.lang.String var0) { } }
0
* Repaints the associated GVT tree under the list of <code>areas</code>.
0
@java.lang.Deprecated
0
// Since revising a bundle adds a revision to the global // state, we must remove it from the global state on rollback. getFramework().getResolver().removeRevision(br); /// Now that the revision is added to the bundle, we can update // the resolver's state to be aware of any new capabilities. getFramework().getResolver().addRevision(revision);
0
import org.apache.hc.core5.reactor.ProtocolIOSession; public IOEventHandler createHandler(final ProtocolIOSession ioSession, final Object attachment) {
0
KerberosCredential kc = new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD.toCharArray(), null); KerberosCredential kc = new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD.toCharArray(), null); KerberosCredential kc = new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, "wrong".toCharArray(), null); KerberosCredential kc = new KerberosCredential("wrong", DEFAULT_ADMIN_PASSWORD.toCharArray(), null); KerberosCredential kc = new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD.toCharArray(), null); KerberosCredential kc = new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD.toCharArray(), null); KerberosCredential kc = new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD.toCharArray(), null); KerberosCredential kc = new KerberosCredential(DEFAULT_ADMIN_PRINCIPAL, DEFAULT_ADMIN_PASSWORD.toCharArray(), null); KerberosCredential credentials = new KerberosCredential(principal, password.toCharArray(), null);
0
log.debug("Cloning table " + srcTableName + " " + newTableName + " " + flush);
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
public static final String ENABLE_CLIENT_SASL_KEY = "zookeeper.sasl.client"; public static final String ENABLE_CLIENT_SASL_DEFAULT = "true"; /** * Returns true if the SASL client is enabled. By default, the client * is enabled but can be disabled by setting the system property * <code>zookeeper.sasl.client</code> to <code>false</code>. See * ZOOKEEPER-1657 for more information. * * @return If the SASL client is enabled. */ public static boolean isEnabled() { return Boolean.valueOf(System.getProperty(ENABLE_CLIENT_SASL_KEY, ENABLE_CLIENT_SASL_DEFAULT)); }
0
public void startBundle(StartBundleContext c) throws Exception { public void finishBundle() throws Exception {
0
final File file = new File(getTestDirectory(), "tailer-eof-test.txt");
0
import org.apache.beam.vendor.protobuf.v3.com.google.protobuf.InvalidProtocolBufferException;
0
if (FileInstall.getStartLevel().getStartLevel() >= activeLevel && context.getBundle(0).getState() == Bundle.ACTIVE) protected void checkRemovedListener() { List/*<ArtifactListener>*/ listeners = FileInstall.getListeners(); for (Iterator it = currentManagedArtifacts.values().iterator(); it.hasNext(); ) { Artifact artifact = (Artifact) it.next(); File file = artifact.getPath(); ArtifactListener listener = findListener(file, listeners); // If no listener can handle this artifact, we need to defer the // processing for this artifact until one is found if (listener == null) { processingFailures.add(file); artifact.setListener(null); } } }
0
* @version $Revision$ $Date$
0
import org.apache.batik.dom.events.NodeEventTarget; * Implements {@link * org.apache.batik.dom.events.NodeEventTarget#getParentNodeEventTarget()}. */ public NodeEventTarget getParentNodeEventTarget() { return (NodeEventTarget) getCSSParentNode(); } /**
0
/** * @since 2.6.0 */ public DataSource getDataSource() { return dataSource; } /** * @since 2.6.0 */ public String getUserName() { return userName; } /** * @since 2.6.0 */ public char[] getUserPassword() { return userPassword; }
0
import org.apache.hc.core5.http.impl.ConnectionListener; import org.apache.hc.core5.http.impl.Http1StreamListener;
0
org.apache.log4j.Category.getInstance(ResolverXPointer.class.getName()); NodeList resultNodes = null;
0
// All other cases go through FileIO + ReadFiles .apply("Match All", FileIO.matchAll().withConfiguration(getMatchConfiguration())) "Read Matches", FileIO.readMatches() .withDirectoryTreatment(DirectoryTreatment.PROHIBIT)) .apply("Via ReadFiles", readFiles().withDelimiter(getDelimiter())); @Override public void populateDisplayData(DisplayData.Builder builder) { super.populateDisplayData(builder); builder.addIfNotNull( DisplayData.item("delimiter", Arrays.toString(getDelimiter())) .withLabel("Custom delimiter to split records")); }
0
* --runner=BlockingDataflowRunner
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. */ /** Load test suite. */ package org.apache.beam.sdk.loadtests;
0
package com.twitter.nexus.scheduler.persistence; import com.google.common.base.Preconditions; import com.google.common.io.Files; import java.io.File; import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; /** * Persistence layer that stores data on the local file system. * * @author wfarner */ public class FileSystemPersistence implements PersistenceLayer { private final static Logger LOG = Logger.getLogger(FileSystemPersistence.class.getName()); private final File file; public FileSystemPersistence(File file) { this.file = Preconditions.checkNotNull(file); } @Override public byte[] fetch() throws PersistenceException { try { return Files.toByteArray(file); } catch (IOException e) { logAndThrow("Failed to read file " + file.getAbsolutePath(), e); } return null; } @Override public void commit(byte[] data) throws PersistenceException { try { Files.write(data, file); } catch (IOException e) { logAndThrow("Failed to write to file " + file.getAbsolutePath(), e); } } private static void logAndThrow(String msg, Throwable t) throws PersistenceException { LOG.log(Level.SEVERE, msg, t); throw new PersistenceException(msg, t); } }
0
private static final Logger logger = Logger.getLogger(LogFeederAMSClient.class); private String collectorHosts = null;
0
private static final StateTag<CombiningState<Long, long[], Long>>
0
package org.apache.beam.runners.flink.translation.wrappers.streaming; import org.apache.beam.runners.flink.translation.types.CoderTypeInformation; import org.apache.beam.runners.flink.translation.wrappers.SerializableFnAggregatorWrapper; import org.apache.beam.runners.flink.translation.wrappers.streaming.state.*;
0
@Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override @Override
1
private static final String URI_TYPES = "types"; private static final String URI_ENTITIES = "entities"; private static final String URI_TRAITS = "traits"; private static final String URI_SEARCH = "discovery/search"; CREATE_TYPE(BASE_URI + URI_TYPES, HttpMethod.POST), GET_TYPE(BASE_URI + URI_TYPES, HttpMethod.GET), LIST_TYPES(BASE_URI + URI_TYPES, HttpMethod.GET), LIST_TRAIT_TYPES(BASE_URI + URI_TYPES + "?type=trait", HttpMethod.GET), CREATE_ENTITY(BASE_URI + URI_ENTITIES, HttpMethod.POST), GET_ENTITY(BASE_URI + URI_ENTITIES, HttpMethod.GET), UPDATE_ENTITY(BASE_URI + URI_ENTITIES, HttpMethod.PUT), LIST_ENTITY(BASE_URI + URI_ENTITIES, HttpMethod.GET), ADD_TRAITS(BASE_URI + URI_TRAITS, HttpMethod.POST), DELETE_TRAITS(BASE_URI + URI_TRAITS, HttpMethod.DELETE), LIST_TRAITS(BASE_URI + URI_TRAITS, HttpMethod.GET), SEARCH(BASE_URI + URI_SEARCH, HttpMethod.GET), SEARCH_DSL(BASE_URI + URI_SEARCH + "/dsl", HttpMethod.GET), SEARCH_GREMLIN(BASE_URI + URI_SEARCH + "/gremlin", HttpMethod.GET), SEARCH_FULL_TEXT(BASE_URI + URI_SEARCH + "/fulltext", HttpMethod.GET);
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
EntityResult entityResult = atlasClientV1.updateEntityAttribute(guid, "db", newDBId); assertEquals(entityResult.getUpdateEntities().size(), 2); assertEquals(entityResult.getUpdateEntities().get(0), newDBId); assertEquals(entityResult.getUpdateEntities().get(1), guid);
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.io.Files.fileTraverser; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Predicates; 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.Lists; Iterable<File> files = fileTraverser().depthFirstPreOrder(parent); org.apache.beam.vendor.guava.v26_0_jre.com.google.common.io.Files.isFile(),
0
import java.util.Vector; Vector document = new Vector(); document.add(new Byte((byte) c)); assertiondocument = new byte[document.size()]; for (i = 0; i < document.size(); i++) { assertiondocument[i] = ((Byte)document.get(i)).byteValue(); }
0
import static java.nio.charset.StandardCharsets.UTF_8; import static org.apache.calcite.avatica.util.DateTimeUtils.MILLIS_PER_DAY; import java.util.Arrays; import org.apache.beam.sdk.extensions.sql.impl.utils.CalciteUtils; if (Arrays.equals(type.getMetadata(), CalciteUtils.TIMESTAMP.getMetadata())) { return ((ReadableInstant) beamValue).getMillis(); } else if (Arrays.equals(type.getMetadata(), CalciteUtils.TIME.getMetadata())) { return (int) ((ReadableInstant) beamValue).getMillis(); } else if (Arrays.equals(type.getMetadata(), CalciteUtils.DATE.getMetadata())) { return (int) (((ReadableInstant) beamValue).getMillis() / MILLIS_PER_DAY); } else { throw new IllegalArgumentException( "Unknown DateTime type " + new String(type.getMetadata(), UTF_8)); }
0
dashArrayBuf.append(COMMA);
0
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.util.ArrayList; import java.util.Collections; import java.util.List; import com.google.inject.Guice; import com.google.inject.Inject; import com.google.inject.Injector; import com.google.inject.persist.PersistService; import com.google.inject.persist.UnitOfWork; import junit.framework.Assert; injector = Guice.createInjector(new InMemoryDefaultTestModule());
0
@Test public void skipReturnValueWithBom() throws IOException { byte[] baseData = new byte[]{(byte) 0x31, (byte) 0x32, (byte) 0x33}; BOMInputStream is1 = new BOMInputStream(createUtf8DataStream(baseData, true)); assertEquals(2, is1.skip(2)); assertEquals((byte) 0x33, is1.read()); } @Test public void skipReturnValueWithoutBom() throws IOException { byte[] baseData = new byte[]{(byte) 0x31, (byte) 0x32, (byte) 0x33}; BOMInputStream is2 = new BOMInputStream(createUtf8DataStream(baseData, false)); assertEquals(2, is2.skip(2)); // IO-428 assertEquals((byte) 0x33, is2.read()); }
0
* @return Transformer&lt;Class&lt;? extends T&gt;, T&gt;
0
String failok = builder.getProperty( "-failok" ); includeMavenResources( currentProject, builder, getLog() ); if ( builder.getProperty( Analyzer.EXPORT_PACKAGE ) == null && builder.getProperty( Analyzer.PRIVATE_PACKAGE ) == null ) if ( builder.getProperty( Analyzer.EXPORT_CONTENTS ) != null ) builder.setProperty( Analyzer.PRIVATE_PACKAGE, "!*" ); String bsn = builder.getProperty( Analyzer.BUNDLE_SYMBOLICNAME ); builder.setProperty( Analyzer.EXPORT_PACKAGE, namespace + ".*" ); Collection embeddableArtifacts = getEmbeddableArtifacts( currentProject, builder ); new DependencyEmbedder( embeddableArtifacts ).processHeaders( builder ); String[] removeHeaders = builder.getProperty( Analyzer.REMOVE_HEADERS, "" ).split( "," ); protected static void includeMavenResources( MavenProject currentProject, Analyzer analyzer, Log log ) final String includeResource = ( String ) analyzer.getProperty( Analyzer.INCLUDE_RESOURCE ); analyzer.setProperty( Analyzer.INCLUDE_RESOURCE, cleanedResource ); analyzer.unsetProperty( Analyzer.INCLUDE_RESOURCE ); analyzer.setProperty( Analyzer.INCLUDE_RESOURCE, combinedResource ); analyzer.setProperty( Analyzer.INCLUDE_RESOURCE, mavenResourcePaths ); protected static Collection getEmbeddableArtifacts( MavenProject project, Analyzer analyzer ) String embedTransitive = analyzer.getProperty( DependencyEmbedder.EMBED_TRANSITIVE );
0
if (LOG.isTraceEnabled()) { ZooTrace.logQuorumPacket(LOG, traceMask, 'o', p); } if (LOG.isTraceEnabled()) { ZooTrace.logQuorumPacket(LOG, traceMask, 'i', qp); } if (LOG.isTraceEnabled()) { ZooTrace.logTraceMessage(LOG, ZooTrace.SESSION_TRACE_MASK, "Session 0x" + Long.toHexString(id) + " is valid: "+ valid); }
0
assertThat(p.getFullNameForTesting(min), Matchers.startsWith("Min")); assertThat(p.getFullNameForTesting(max), Matchers.startsWith("Max")); assertThat(p.getFullNameForTesting(mean), Matchers.startsWith("Mean")); assertThat(p.getFullNameForTesting(sum), Matchers.startsWith("Sum"));
0
if (!shellState.getConnector().instanceOperations().testClassLoad(classname, SortedKeyValueIterator.class.getName())) { throw new ShellCommandException(ErrorCode.INITIALIZATION_FAILURE, "Servers are unable to load " + classname + " as type " + SortedKeyValueIterator.class.getName()); // instead of setting table properties, just put the options in a list to use at scan time
0
final String redirectURL = res.getRedirectURL(); HttpServletResponse response = (HttpServletResponse) objectModel.get(HttpEnvironment.HTTP_RESPONSE_OBJECT); response.sendRedirect(redirectURL);
0
throw new HttpCacheUpdateException("Failed to processChallenge");
0
bos.close(); } catch (IOException e) { //Imposible } if (!sa.verify(sigBytes)) { return false; } return si.verify(this._followManifestsDuringValidation);
0
* @deprecated Use {@link #ofMicroseconds(long)} @Deprecated * @param milliseconds the duration in milliseconds and the given {@code timeUnit}. * @return a Timeout */ public static Timeout ofMilliseconds(final long milliseconds) { return of(milliseconds, TimeUnit.MILLISECONDS); } /** * Creates a Timeout. *
0
tabletAssignedToServer1 = new TabletLocationState(extent, null, server1, null, null, walogs, false); tabletAssignedToServer2 = new TabletLocationState(extent, null, server2, null, null, walogs, false);
0
FileSystem fs; if (arg.contains(":")) fs = path.getFileSystem(conf); else fs = hadoopFs.exists(path) ? hadoopFs : localFs; // fall back to local
0
} catch (ParseException pEx) { pEx, ERR_ATTRIBUTE_VALUE_MALFORMED, } catch (NumberFormatException nfEx ) { (ctx, glyphElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED, } catch (NumberFormatException nfEx ) { (ctx, glyphElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED, } catch (NumberFormatException nfEx ) { (ctx, glyphElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED, } catch (NumberFormatException nfEx ) { (ctx, glyphElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED, } catch (NumberFormatException nfEx ) { (ctx, parentFontElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED, } catch (NumberFormatException nfEx ) { (ctx, glyphElement, nfEx, ERR_ATTRIBUTE_VALUE_MALFORMED,
0
// Blueprint Config columns.clear(); columns.add(new DBColumnInfo("blueprint_name", String.class, 255, null, false)); columns.add(new DBColumnInfo("type_name", String.class, 255, null, false)); columns.add(new DBColumnInfo("config_data", String.class, 32000, null, false)); dbAccessor.createTable("blueprint_configuration", columns, "blueprint_name", "type_name"); dbAccessor.addFKConstraint("hostgroup", "FK_hostgroup_blueprint_name", "blueprint_name", "blueprint", "blueprint_name", true); dbAccessor.addFKConstraint("hostgroup_component", "FK_component_blueprint_name", "blueprint_name", "hostgroup", "blueprint_name", true); dbAccessor.addFKConstraint("hostgroup_component", "FK_component_hostgroup_name", "hostgroup_name", "hostgroup", "name", true); dbAccessor.addFKConstraint("blueprint_configuration", "FK_configuration_blueprint_name", "blueprint_name", "blueprint", "blueprint_name", true);
0
public final class SqlTimestampConverter implements Converter {
0
* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at
0
/** * This interface marks an event as targetted at a * {@link org.apache.cocoon.portal.om.Layout} object. * * @version $Id$ */ import org.apache.cocoon.portal.event.Event; /** * This interface marks an event as targetted at a * {@link org.apache.cocoon.portal.om.Layout} object. * * @version $Id$ */ public abstract class LayoutEvent implements Event { public LayoutEvent(Layout target) {
0
(doFn1, sideInputs1, context1, tagsToOutputTags, tagsToCoders, tagsToIds, inputCoder, keyCoder, transformedSideInputs) -> new DoFnOperator<>( doFn1, stepName, inputCoder, mainOutputTag1, additionalOutputTags1, new DoFnOperator.MultiOutputOutputManagerFactory<>( mainOutputTag1, tagsToOutputTags, tagsToCoders, tagsToIds), windowingStrategy, transformedSideInputs, sideInputs1, context1.getPipelineOptions(), keyCoder)); (doFn, sideInputs, context1, tagsToOutputTags, tagsToCoders, tagsToIds, inputCoder, keyCoder, transformedSideInputs) -> new SplittableDoFnOperator<>( doFn, stepName, inputCoder, mainOutputTag, additionalOutputTags, new DoFnOperator.MultiOutputOutputManagerFactory<>( mainOutputTag, tagsToOutputTags, tagsToCoders, tagsToIds), windowingStrategy, transformedSideInputs, sideInputs, context1.getPipelineOptions(), keyCoder)); DataStream<WindowedValue<T>> result = dummySource .<WindowedValue<T>>flatMap( (s, collector) -> { // never return anything }) .returns( new CoderTypeInformation<>( WindowedValue.getFullCoder( (Coder<T>) VoidCoder.of(), GlobalWindow.Coder.INSTANCE)));
0
protected abstract void sessionCreated(SelectionKey key, IOSession session); protected abstract IOSession getSession(SelectionKey key); IOSession session = getSession(key); queueClosedSession(session); protected void queueClosedSession(final IOSession session) { if (session != null) { this.closedSessions.add(session); } } sessionCreated(key, session); try { sessionClosed(session); } catch (CancelledKeyException ex) { // ignore and move on }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/JXPathContextReferenceImpl.java,v 1.4 2001/09/21 23:22:43 dmitri Exp $ * $Revision: 1.4 $ * $Date: 2001/09/21 23:22:43 $ * @version $Revision: 1.4 $ $Date: 2001/09/21 23:22:43 $ if (result instanceof EvalContext){ result = ctx.getContextNodePointer(); } if (result instanceof Pointer){ result = ((Pointer)result).getValue(); if (result instanceof EvalContext){ result = ((EvalContext)result).getContextNodePointer(); } String varName = name.toString(); throw new RuntimeException("Undefined function: " + functionName.toString());
0
import java.util.NoSuchElementException; static class BigQueryReaderIterator extends NativeReaderIterator<WindowedValue<TableRow>> { private WindowedValue<TableRow> current; public boolean start() throws IOException { try { rowIterator.open(); } catch (InterruptedException e) { throw new IOException(e); } return advance(); public boolean advance() throws IOException { try { if (!rowIterator.advance()) { return false; } } catch (InterruptedException e) { throw new IOException(e); } current = WindowedValue.valueInGlobalWindow(rowIterator.getCurrent()); return true; } @Override public WindowedValue<TableRow> getCurrent() throws NoSuchElementException { if (current == null) { throw new NoSuchElementException(); } return current;
0
import static org.junit.Assert.assertFalse; assertFalse(pd.isFeatureSupported("not supported"));
0
* A {@code ListCoder} encodes {@code List}s.
0
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
0
IPath spath = e.getSourceAttachmentPath(); if (spath != null) { spath = JavaCore.getResolvedVariablePath(spath); } spath, e.getSourceAttachmentRootPath(),
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//dbcp/src/java/org/apache/commons/dbcp/PoolablePreparedStatement.java,v 1.5 2003/08/11 16:01:25 dirkv Exp $ * $Revision: 1.5 $ * $Date: 2003/08/11 16:01:25 $ * @version $Id: PoolablePreparedStatement.java,v 1.5 2003/08/11 16:01:25 dirkv Exp $ throw new SQLNestedException("Cannot close preparedstatement (return to pool failed)", e);
0
* Creates a <tt>FilterRegion</tt> for the input mask * element. */ public static FilterRegion convertPatternRegion(Element maskElement, Element maskedElement, GraphicsNode node, UnitProcessor.Context uctx){ return convertRegion(maskElement, maskedElement, node, uctx, ATTR_PATTERN_UNITS); } /**
0
* Copyright (C) 2015 Google Inc.
0
final byte[] beginning = "beginning; ".getBytes(Consts.ASCII);
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
package org.apache.hc.core5.reactor;
1
public void sendActions(List<Stage> stages, String clusterHostInfo, ExecuteActionRequest actionRequest) throws AmbariException { Request request = requestFactory.createNewFromStages(stages, clusterHostInfo, actionRequest);
0
+ "name varchar COMMENT 'name', \n" + "name varchar COMMENT 'name', \n" + "name varchar COMMENT 'name', \n" + "name varchar COMMENT 'name', \n"
0
// niallp 2010-10-06 - remove following 2 tests - I reinstated // checks for non-UTF-16 encodings (18 tests) and these failed //_testHttpValid("application/xml", "no-bom", "US-ASCII", null); //_testHttpValid("application/xml", "UTF-8-bom", "US-ASCII", null); // (niallp 2010-10-06 - I re-instated the check below - the tests(6) passed) String enc = (alternateEnc != null) ? alternateEnc : streamEnc; assertEquals(xmlReader.getEncoding(), enc); // (niallp 2010-10-06 - I re-instated the check below and removed the 2 tests that failed) assertEquals(xmlReader.getEncoding(), streamEnc);
0
* Property minThreadProperty, Property timeBetweenThreadChecksProperty,
0
import org.apache.commons.configuration.resolver.EntityResolverSupport; import org.xml.sax.EntityResolver; implements ConfigurationListener, ConfigurationErrorListener, EntityResolverSupport /** The EntityResolver */ private EntityResolver entityResolver; public void setEntityResolver(EntityResolver entityResolver) { this.entityResolver = entityResolver; } public EntityResolver getEntityResolver() { return this.entityResolver; } configuration.setEntityResolver(entityResolver);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//fileupload/src/java/org/apache/commons/fileupload/MultipartStream.java,v 1.5 2002/07/22 07:21:54 martinc Exp $ * $Revision: 1.5 $ * $Date: 2002/07/22 07:21:54 $ * @version $Id: MultipartStream.java,v 1.5 2002/07/22 07:21:54 martinc Exp $ * processed (10 kilobytes = 10240 bytes.).
0
/** A custom, bounded source of event records. */ * Event source we purporting to be reading from. (We can't use Java's capture-outer-class * pointer since we must update this field on calls to splitAtFraction.) @Nullable private TimestampedValue<Event> currentEvent; public List<BoundedEventSource> split(long desiredBundleSizeBytes, PipelineOptions options) {
1
@Test(timeout = 10 * 1000) @SuppressWarnings("FutureReturnValueIgnored") // failure will cause test to timeout.
0