Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
DoFnProcessContext<TimerOrElement<KV<K, VI>>, KV<K, VO>> context, DoFnProcessContext<TimerOrElement<KV<K, VI>>, KV<K, Iterable<VI>>> context, DoFnProcessContext<TimerOrElement<KV<K, VI>>, KV<K, VO>> context, @SuppressWarnings("unchecked") DoFnProcessContext<TimerOrElement<KV<K, VI>>, KV<K, VO>> doFnContext = (DoFnProcessContext<TimerOrElement<KV<K, VI>>, KV<K, VO>>) context; key, doFnContext, new StreamingActiveWindowManager<>(windowFn, doFnContext)); for (BoundedWindow window : doFnContext.windows()) { doFnContext, new StreamingActiveWindowManager<>(windowFn, doFnContext)); DoFnProcessContext<?, ?> context; DoFnProcessContext<?, ?> context) { context.context.stepContext.getExecutionContext().setTimer( context.context.stepContext.getExecutionContext().deleteTimer(
0
* Extension of {@link PredicatedMapTest} for exercising the public class PredicatedSortedMapTest<K, V> extends AbstractSortedMapTest<K, V> { public PredicatedSortedMapTest(String testName) {
0
import org.apache.http.message.BasicStatusLine; StatusLine statusline = new BasicStatusLine(HttpVersion.HTTP_1_0, 200, "OK"); StatusLine statusline = new BasicStatusLine(HttpVersion.HTTP_1_1, 200, "OK"); StatusLine statusline = new BasicStatusLine(HttpVersion.HTTP_1_1, 200, "OK"); StatusLine statusline = new BasicStatusLine(HttpVersion.HTTP_1_0, 200, "OK"); StatusLine statusline = new BasicStatusLine(HttpVersion.HTTP_1_1, 200, "OK"); StatusLine statusline = new BasicStatusLine(HttpVersion.HTTP_1_0, 200, "OK"); StatusLine statusline = new BasicStatusLine(HttpVersion.HTTP_1_0, 200, "OK"); StatusLine statusline = new BasicStatusLine(HttpVersion.HTTP_1_1, 200, "OK"); StatusLine statusline = new BasicStatusLine(new HttpVersion(3, 45), 200, "OK"); StatusLine statusline = new BasicStatusLine(HttpVersion.HTTP_1_0, 200, "OK"); StatusLine statusline = new BasicStatusLine(HttpVersion.HTTP_1_0, 200, "OK");
0
import org.apache.xml.security.exceptions.XMLSecurityException; OutputStream outputStream = new FileOutputStream(signedFile); OutputStream outputStream = new FileOutputStream(signedFile);
0
cm.setConfigurationPid( "configurationPid" ); cm.setConfigurationPid( "configurationPid" );
0
import org.apache.atlas.ocf.properties.Connection; import org.apache.atlas.ocf.properties.Endpoint; import java.util.List; * Initialize the connector. * * @param connectorInstanceId - unique id for the connector instance - useful for messages etc * @param connection - POJO for the configuration used to create the connector. */ @Override public void initialize(String connectorInstanceId, Connection connection) { super.initialize(connectorInstanceId, connection); Endpoint endpoint = connection.getEndpoint(); if (endpoint != null) { registryStoreName = endpoint.getAddress(); if (registryStoreName == null) { registryStoreName = defaultFilename; } } } /** private int findRemoteRegistration(String metadataCollectionId, List<MemberRegistration> members) List<MemberRegistration> remotePropertiesList = registryStoreProperties.getRemoteRegistrations(); public List<MemberRegistration> retrieveRemoteRegistrations() List<MemberRegistration> remoteRegistrations = null; List<MemberRegistration> remotePropertiesList = registryStoreProperties.getRemoteRegistrations(); List<MemberRegistration> remoteRegistrationArray = new ArrayList<>(); if (remotePropertiesList != null) for (MemberRegistration remoteRegistration : remotePropertiesList) { MemberRegistration member = new MemberRegistration(remoteRegistration); remoteRegistrationArray.add(member); } List<MemberRegistration> remotePropertiesList = registryStoreProperties.getRemoteRegistrations(); List<MemberRegistration> remotePropertiesList = registryStoreProperties.getRemoteRegistrations();
0
package org.apache.commons.codec.language.bm;
1
import org.apache.ambari.server.orm.OrmTestHelper; @Inject OrmTestHelper helper; helper.getOrCreateRepositoryVersion(stackId.getStackName(), stackId.getStackVersion());
0
BridgeUpdateEvent be = new BridgeUpdateEvent(this);
0
public class ConfigurationDynaBean implements DynaBean { if(log.isTraceEnabled()) log.trace("ConfigurationDynaBean("+configuration+")");
0
if (usePooledConnection)
0
Copyright 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 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
import org.apache.beam.sdk.coders.ByteArrayCoder; import org.apache.beam.sdk.io.Read.Unbounded; import org.apache.beam.sdk.transforms.PTransform; import org.joda.time.Duration;
0
/** * Tests whether an addNodes() operation works on a tracked node. */ @Test public void testAddNodesOnTrackedNode() { NodeKeyResolver<ImmutableNode> resolver = createResolver(false); prepareResolverForAddKeys(resolver); EasyMock.replay(resolver); model.trackNode(selector, resolver); model.addNodes("fields", selector, Collections .singleton(NodeStructureHelper.createFieldNode(NEW_FIELD)), resolver); checkForAddedField(fieldsNodeFromModel()); checkForAddedField(fieldsNodeFromTrackedNode()); } /** * Tests an addNodes() operation on a tracked node that is detached. */ @Test public void testAddNodesOnDetachedNode() { NodeKeyResolver<ImmutableNode> resolver = createResolver(false); prepareResolverForAddKeys(resolver); EasyMock.replay(resolver); model.trackNode(selector, resolver); initDetachedNode(resolver); ImmutableNode rootNode = model.getRootNode(); model.addNodes("fields", selector, Collections .singleton(NodeStructureHelper.createFieldNode(NEW_FIELD)), resolver); assertSame("Root node was changed", rootNode, model.getRootNode()); checkForAddedField(fieldsNodeFromTrackedNode()); }
0
import javax.annotation.Nullable; @Nullable public TranslateAcceptor(Class<O> type, @Nullable UnaryPredicate<O> accept) {
0
import org.apache.cocoon.util.AbstractLogEnabled; public class JMSConnectionManagerImpl extends AbstractLogEnabled implements JMSConnectionManager, Serviceable, Configurable, Initializable, Startable, Disposable, ThreadSafe, JMSConnectionEventNotifier { static final class ReconnectionJob extends AbstractLogEnabled implements CronJob { if (getLogger().isInfoEnabled()) { getLogger().info("Reconnecting JMS connection: " + m_configuration.getName()); if (getLogger().isInfoEnabled()) { getLogger().info("Successfully reconnected JMS connection: " + m_configuration.getName()); if (getLogger().isWarnEnabled()) { getLogger().warn("Failed to reconnect.",e); if (getLogger().isWarnEnabled()) { getLogger().warn("Failed to reconnect.",e);
0
private boolean isBackgroundCommand = false; isBackgroundCommand = hostRoleCommandEntity.isBackgroundCommand(); hostRoleCommandEntity.setBackgroundCommand(isBackgroundCommand); * Gets whether this command runs in the background and does not block other * commands. * * @return {@code true} if this command runs in the background, {@code false} * otherise. */ public boolean isBackgroundCommand() { return isBackgroundCommand; } /** * Sets whether this command runs in the background and does not block other * commands. * * @param isBackgroundCommand * {@code true} if this command runs in the background, {@code false} * otherise. */ public void setBackgroundCommand(boolean isBackgroundCommand) { this.isBackgroundCommand = isBackgroundCommand; } /**
0
/* * Copyright 2006 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. */ package org.apache.cocoon.maven.deployer.monolithic; /** * Use it to indicate that a file has already been deployed. * * @version $Id$ */ public class FileAlreadyDeployedException extends DeploymentException { public FileAlreadyDeployedException(String message) { super(message); } }
0
public abstract class Command { public abstract void run () throws Exception;
0
/* * Copyright 2013 Twitter, Inc. * * 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
yarnSiteProperties.put("yarn.resourcemanager.address.rm1", expectedHostName + ":" + expectedPortNum); yarnSiteProperties.put("yarn.resourcemanager.address.rm2", expectedHostNameTwo + ":" + expectedPortNum); yarnSiteProperties.put("yarn.resourcemanager.admin.address.rm1", expectedHostName + ":" + expectedPortNum); yarnSiteProperties.put("yarn.resourcemanager.admin.address.rm2", expectedHostNameTwo + ":" + expectedPortNum); yarnSiteProperties.put("yarn.resourcemanager.resource-tracker.address.rm1", expectedHostName + ":" + expectedPortNum); yarnSiteProperties.put("yarn.resourcemanager.resource-tracker.address.rm2", expectedHostNameTwo + ":" + expectedPortNum); yarnSiteProperties.put("yarn.resourcemanager.scheduler.address.rm1", expectedHostName + ":" + expectedPortNum); yarnSiteProperties.put("yarn.resourcemanager.scheduler.address.rm2", expectedHostNameTwo + ":" + expectedPortNum); List<String> properties = Arrays.asList( "yarn.resourcemanager.address", "yarn.resourcemanager.admin.address", "yarn.resourcemanager.resource-tracker.address", "yarn.resourcemanager.scheduler.address", "yarn.resourcemanager.webapp.address", "yarn.resourcemanager.webapp.https.address" ); for (String property : properties) { String propertyWithID = property + ".rm1"; assertEquals(propertyWithID, createExportedHostName(expectedHostGroupName, expectedPortNum), yarnSiteProperties.get(propertyWithID)); propertyWithID = property + ".rm2"; assertEquals(propertyWithID, createExportedHostName(expectedHostGroupNameTwo, expectedPortNum), yarnSiteProperties.get(propertyWithID)); }
0
if (depth == d.depth) return d;
1
try (final OutputStream outstream = createContentOutputStream(len, this.outbuffer, socketHolder.getOutputStream(), entity.getTrailers())) { entity.writeTo(outstream); } try (final OutputStream outstream = createContentOutputStream(len, this.outbuffer, socketHolder.getOutputStream(), null)) { entity.writeTo(outstream); }
0
import junit.framework.Test;
0
private static final long serialVersionUID = -2160020248508943620L;
0
static final String KEY_IDENTITIES = Type.IDENTITY.getDescriptorPluralName(); static final String KEY_CONFIGURATIONS = Type.CONFIGURATION.getDescriptorPluralName(); static final String KEY_AUTH_TO_LOCAL_PROPERTIES = Type.AUTH_TO_LOCAL_PROPERTY.getDescriptorPluralName(); list = data.get(KEY_IDENTITIES); list = data.get(KEY_CONFIGURATIONS); list = data.get(KEY_AUTH_TO_LOCAL_PROPERTIES); map.put(KEY_IDENTITIES, list.values()); map.put(KEY_CONFIGURATIONS, list.values()); map.put(KEY_AUTH_TO_LOCAL_PROPERTIES, authToLocalProperties);
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
package org.apache.commons.dbcp2; import org.apache.commons.jocl2.JOCLContentHandler; * @see org.apache.commons.dbcp2.DelegatingConnection#getDelegate() * @see org.apache.commons.dbcp2.DelegatingConnection#getInnermostDelegate()
1
* <p>Temporary files, which are created for file items, should be * deleted later on. The best way to do this is using a * {@link FileCleaningTracker}, which you can set on the * {@link DiskFileItemFactory}. However, if you do use such a tracker, * then you must consider the following: Temporary files are automatically * deleted as soon as they are no longer needed. (More precisely, when the * This is done by the so-called reaper thread, which is started * automatically when the class {@link org.apache.commons.io.FileCleaner} * is loaded. * It might make sense to terminate that thread, for example, if * your web application ends. See the section on "Resource cleanup" * @return An instance of {@link FileCleaningTracker}, or null * (default), if temporary files aren't tracked. * Sets the tracker, which is responsible for deleting temporary * which will from now on track the created files, or null * (default), to disable tracking.
0
int shownLength) {
0
* Returns the concatenated transform of this node. That is, this * @param newComposite the composite of this node * taking any of its rendering attribute into account. That is, * taking any of its rendering attribute into accoun. That is,
1
import org.apache.commons.lang.StringUtils; return StringUtils.replace(path, "/./", "/*/");
0
* @version CVS $Id: FlowJXPathSelectionList.java,v 1.4 2003/12/10 23:34:11 ugo Exp $ String stringValue = ""; String stringLabel = null; if (ptr.getValue() != null) { JXPathContext itemCtx = ctx.getRelativeContext(ptr); // Get the value as a string Object value = itemCtx.getValue(this.valuePath); stringValue = this.datatype.convertToString(value, locale); // Get the label (can be ommitted) itemCtx.setLenient(true); Object label = itemCtx.getValue(this.labelPath); stringLabel = (label == null) ? stringValue : label.toString(); } if (stringLabel != null) { contentHandler.startElement(Constants.WI_NS, LABEL_EL, Constants.WI_PREFIX_COLON + LABEL_EL, Constants.EMPTY_ATTRS); contentHandler.characters(stringLabel.toCharArray(), 0, stringLabel.length()); contentHandler.endElement(Constants.WI_NS, LABEL_EL, Constants.WI_PREFIX_COLON + LABEL_EL); }
0
public static boolean isEntityVertex(AtlasVertex vertex) { return StringUtils.isNotEmpty(getIdFromVertex(vertex)) && StringUtils.isNotEmpty(getTypeName(vertex)); }
0
* {@link #processRecord(Map, String, KerberosOperationHandler, Map, Map)}. Map<String, String> kerberosConfiguration = getConfiguration("kerberos-env"); handler.open(administratorCredential, defaultRealm, kerberosConfiguration); commandReport = processRecord(record, defaultRealm, handler, kerberosConfiguration, requestSharedDataContext); * @param kerberosConfiguration a Map of configuration properties from kerberos-env * to a given request @return a CommandReport, indicating an error * condition; or null, indicating a success condition Map<String, String> kerberosConfiguration, * {@link #processIdentity(Map, String, KerberosOperationHandler, Map, Map)} * @param kerberosConfiguration a Map of configuration properties from kerberos-env * to a given request @return a CommandReport, indicating an error * condition; or null, indicating a success condition Map<String, String> kerberosConfiguration, Map<String, Object> requestSharedDataContext) commandReport = processIdentity(record, evaluatedPrincipal, operationHandler, kerberosConfiguration, requestSharedDataContext);
0
return from(() -> staticExecutorService);
0
String fontSize = "" + font.getSize(); textElement.setAttributeNS(SVG_NAMESPACE_URI, attrName, attrValue); textElement.setAttributeNS(SVG_NAMESPACE_URI, SVG_FONT_SIZE_ATTRIBUTE, "30"); textElement.setAttributeNS(SVG_NAMESPACE_URI, SVG_X_ATTRIBUTE, "30"); textElement.setAttributeNS(SVG_NAMESPACE_URI, SVG_Y_ATTRIBUTE, "" + (40*(i+1)));
0
* @version $Revision$ $Date$
0
// If credential decides it can handle it, the return code or message indicated // something specific to authentication, and no backoff is desired. // Otherwise, we defer to the judgement of our internal backoff handler.
0
public AlertCluster handleUpdate(AlertDefinitionEventType eventType, AlertCluster update) { AlertCluster mergedCluster = null; Map<Long, AlertDefinition> mergedDefinitions = new HashMap<>(); Integer mergedStaleIntervalMultiplier = null; for (Map.Entry<Long, AlertDefinition> alertDefinitionEntry : alertDefinitions.entrySet()) { Long definitionId = alertDefinitionEntry.getKey(); if (!update.alertDefinitions.containsKey(definitionId)) { mergedDefinitions.put(definitionId, alertDefinitionEntry.getValue()); } else { AlertDefinition newDefinition = update.alertDefinitions.get(definitionId); AlertDefinition oldDefinition = alertDefinitionEntry.getValue(); if (!oldDefinition.deeplyEquals(newDefinition)) { changed = true; } mergedDefinitions.put(definitionId, oldDefinition); mergedStaleIntervalMultiplier = update.getStaleIntervalMultiplier(); } else { mergedStaleIntervalMultiplier = staleIntervalMultiplier; for (Map.Entry<Long, AlertDefinition> alertDefinitionEntry : alertDefinitions.entrySet()) { Long definitionId = alertDefinitionEntry.getKey(); if (!update.alertDefinitions.containsKey(definitionId)) { mergedDefinitions.put(definitionId, alertDefinitionEntry.getValue()); } else { changed = true; } } mergedStaleIntervalMultiplier = staleIntervalMultiplier; if (changed) { mergedCluster = new AlertCluster(mergedDefinitions, hostName, mergedStaleIntervalMultiplier); } return mergedCluster;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/CharListList.java,v 1.3 2003/11/07 20:09:15 rwaldhoff Exp $ * * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) * @version $Revision: 1.3 $ $Date: 2003/11/07 20:09:15 $
0
public void resubmitTasks(List<Long> taskIds) { db.resubmitTasks(taskIds); }
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 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.atlas.model; public enum TypeCategory { PRIMITIVE, ARRAY, MAP, ENTITY, STRUCT, CLASSIFICATION, OBJECT_ID_TYPE }
0
import org.apache.http.Header; import org.apache.http.protocol.HTTP; byte[] body) { Header ct = response.getFirstHeader(HTTP.CONTENT_TYPE); Header ce = response.getFirstHeader(HTTP.CONTENT_ENCODING); CacheEntity entity = new CacheEntity( body, ct != null ? ct.getValue() : null, ce != null ? ce.getValue() : null); entity,
0
import org.apache.beam.sdk.util.DoFnInfo; * overridden to be what the Dataflow service expects.
0
package org.apache.commons.beanutils2.locale;
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 use this file except in compliance with * the License. You may obtain a copy of the License at
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Iterables;
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 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.cocoon.components.elementprocessor.impl.poi.hssf.elements; import org.apache.cocoon.components.elementprocessor.types.NumericConverter; import org.apache.cocoon.components.elementprocessor.types.NumericResult; import java.io.IOException; /** * No-op implementation of ElementProcessor to handle the "UIData" tag * * This element contains no data and has an attribute, SelectedTab, * that indicates which sheet is currently selected * * This element is not used in HSSFSerializer 1.0 * * @author Marc Johnson ([email protected]) * @version $Id$ */ public class EPUIData extends BaseElementProcessor { private NumericResult _selected_tab; private static final String _selected_tab_attribute = "SelectedTab"; /** * constructor */ public EPUIData() { super(null); _selected_tab = null; } /** * Get the selected tab * @return the number of the currently selected sheet (tab) * @exception IOException if the value is missing or incorrectly written */ public int getSelectedTab() throws IOException { if (_selected_tab == null) { _selected_tab = NumericConverter.extractNonNegativeInteger( getValue(_selected_tab_attribute)); } return _selected_tab.intValue(); } } // end public class EPUIData
0
import org.apache.cocoon.el.impl.DefaultExpressionFactory; import org.apache.cocoon.el.impl.javascript.JavaScriptCompiler; import org.apache.cocoon.el.impl.jexl.JexlCompiler; import org.apache.cocoon.el.impl.jxpath.JXPathCompiler;
0
this.rootBeanFactory = BeanFactoryUtil.createRootBeanFactory(avalonEnv, new MockContext());
0
// Pick a random host. if (null != et.hosts && "any".equals(et.hosts) && !hosts.hosts.isEmpty()) { realHosts = Collections.singleton(hosts.hosts.iterator().next()); }
0
public int compare(final String o1, final String o2) {
0
* @version CVS $Id: ComponentsSelector.java,v 1.5 2003/08/12 15:48:02 sylvain Exp $ // Who are we ? // Not a component that has mime types if (this.hasDeclaredComponent(hint)) { return (String)this.hintMimeTypes.get(hint); String[] labels = this.getLabels(hint); // If this hint is declared locally, use its labels (if any), otherwise inherit // those of the parent. if (this.hasDeclaredComponent(hint)) { return (String[])this.hintLabels.get(hint); } else if (this.parentSitemapSelector != null) { } else { return null; // If this hint is declared locally, use its hints (if any), otherwise inherit // those of the parent. if (this.hasDeclaredComponent(hint)) { return (String)this.pipelineHints.get(hint); } else if (this.parentSitemapSelector != null) { return this.parentSitemapSelector.getPipelineHint(hint); } else { return null;
0
COUNTER_COMMITTER.submit( () -> { synchronized (attemptedLock) { finishedAttempted = aggregation.combine(asList(finishedAttempted, finalCumulative)); inflightAttempted.remove(bundle); } }); new MetricsMap<>(unusedKey -> new DirectMetric<>(DISTRIBUTION)); new MetricsMap<>(unusedKey -> new DirectMetric<>(GAUGE));
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestByteListList.java,v 1.2 2003/08/31 17:28:38 scolebourne Exp $ * any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:38 $
0
final String exchangeId = String.format("ex-%08X", ExecSupport.getNextExecNumber()); final ExecChain.Scope scope = new ExecChain.Scope(exchangeId, route, request, execRuntime, localcontext); final ClassicHttpResponse response = this.execChain.execute(ClassicRequestCopier.INSTANCE.copy(request), scope);
0
int aciEnd = aci.getEndIndex(); if ((aciIdx > runLimit) && (aciIdx < aciEnd)) {
0
maxMessageSize = config.getAsBytes(maxMessageSizeProperty);
1
SplittableParDo.forAppliedParDo(appliedTransform));
0
import java.io.InputStream; import java.io.OutputStream; import java.io.PrintStream; import java.util.ArrayList; import sqlline.SqlLine.Status; runSqlLine(args, null, System.out, System.err); } private static String[] checkConnectionArgs(String[] args) { List<String> argsList = new ArrayList<String>(Arrays.asList(args)); if (!argsList.contains("-nn")) { argsList.add("-nn"); argsList.add(NICKNAME); if (!argsList.contains("-u")) { argsList.add("-u"); argsList.add(CONNECT_STRING_PREFIX); return argsList.toArray(new String[argsList.size()]); } static Status runSqlLine( String[] args, InputStream inputStream, @Nullable OutputStream outputStream, @Nullable OutputStream errorStream) throws IOException { String[] modifiedArgs = checkConnectionArgs(args); SqlLine sqlLine = new SqlLine(); if (outputStream != null) { sqlLine.setOutputStream(new PrintStream(outputStream)); } if (errorStream != null) { sqlLine.setErrorStream(new PrintStream(errorStream)); return sqlLine.begin(modifiedArgs, inputStream, true);
0
import akka.actor.ActorRef; import akka.actor.ActorSystem; import akka.actor.Inbox; import com.google.common.base.Function; import com.google.common.base.Joiner; import com.google.common.base.Optional; import com.google.common.collect.FluentIterable; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import org.apache.ambari.view.hive20.actor.message.GetDatabaseMetadataJob; import org.apache.ambari.view.hive20.exceptions.ServiceException; import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; @Override public DatabaseMetadataWrapper getDatabaseMetadata(ConnectionConfig config) throws ServiceException { Connect connect = config.createConnectMessage(); HiveJob job = new GetDatabaseMetadataJob(config.getUsername()); ExecuteJob execute = new ExecuteJob(connect, job); LOG.info("Fetching databaseMetadata."); Optional<Result> resultOptional = getResultFromDB(execute); if(resultOptional.isPresent()){ Result result = resultOptional.get(); DatabaseMetadataWrapper databaseMetadata = result.getDatabaseMetadata(); return databaseMetadata; }else{ throw new ServiceException("Cannot fetch database version."); } } if (submitResult instanceof DatabaseMetadataWrapper) { LOG.info("Query returned with no result."); return Optional.of(new Result((DatabaseMetadataWrapper)submitResult)); }
0
final String names = this.getString(opts, KEY_CONFIG_NAMES); final String previousNames = this.getString(opts, KEY_CONFIG_NAMES); final String pathNames = this.getString(opts, KEY_CONFIG_PATHS); final String[] paths = pathNames.split(","); final Path[] realPaths = new Path[paths.length]; final String previousPathNames = this.getString(opts, KEY_CONFIG_PATHS); final String urlNames = this.getString(opts, KEY_CONFIG_URLS); final String[] urls = urlNames.split(","); final URL[] realURLs = new URL[urls.length]; catch (final MalformedURLException mue) final String previousURLNames = this.getString(opts, KEY_CONFIG_URLS);
0
import org.apache.felix.scrplugin.annotations.ScannedAnnotation;
0
import org.apache.commons.vfs2.FileSystemException; import org.apache.commons.vfs2.provider.AbstractRandomAccessStreamContent; import org.apache.commons.vfs2.util.RandomAccessMode;
0
package org.apache.accumulo.trace.instrument; import org.apache.accumulo.trace.instrument.Span; import org.apache.accumulo.trace.instrument.Trace;
0
* returns {@code null}.
0
if (!fs.getConf().getBoolean(DFS_SUPPORT_APPEND, false)) {
0
import org.apache.commons.digester3.spi.Rules; * Invokes the bound providers, then create the rule and associate it to the related pattern, * storing them in the proper {@link Rules} implementation data structure. * * @param rules The {@link Rules} implementation to store the produced {@link Rule}s */ public void populateRules(Rules rules) { for (RegisteredProvider registeredProvider : this.providers) { rules.add(registeredProvider.getPattern(), registeredProvider.getProvider().get()); } } /**
0
import java.awt.AlphaComposite; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Composite; import java.awt.Font; import java.awt.Paint; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.Shape; import java.awt.Stroke; import java.awt.font.FontRenderContext; import java.awt.geom.AffineTransform; import java.awt.geom.Area; import java.awt.geom.GeneralPath; import java.awt.geom.NoninvertibleTransformException; import java.util.Map; import java.util.Vector;
0
import java.util.HashSet; if(m_validated) { return; } // nothing to do if already validated if (m_validated) { return; } HashSet refs = new HashSet(); ReferenceMetadata refMeta = ( ReferenceMetadata ) referenceIterator.next(); refMeta.validate( this ); // flag duplicates if ( !refs.add( refMeta.getName() ) ) { throw validationFailure( "Detected duplicate reference name: \"" + refMeta.getName() + "\"" ); }
0
import org.apache.aurora.scheduler.ResourceAggregates;
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
* @since 2.1 * @since 2.1 * @since 2.1 * @since 2.1 * @since 2.1 * @since 2.1 * @since 2.1
0
import java.io.File; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.w3c.dom.Element; * @version CVS $Id: CocoonTask.java,v 1.2 2003/10/14 22:27:16 joerg Exp $
0
updateRuntimeChangeCount(); updateRuntimeChangeCount(); updateRuntimeChangeCount(); updateRuntimeChangeCount(); final FilterChain chain = new FilterChain() throws IOException, ServletException private void updateRuntimeChangeCount() { this.serviceRuntime.updateChangeCount(this.runtimeServiceReg); }
0
/** * provides a reference to the metadata table for updates by tablet servers */
0
CharArrayBuffer buffer = new CharArrayBuffer(32); buffer.append(this.hostname); buffer.append(":"); return buffer.toString(); } else { return this.hostname;
0
getLog().warn( "Ignoring project type " + projectType + " - supportedProjectTypes = " + supportedProjectTypes ); Document doc = parseFile( new File( repositoryXml ), initConstructor() ); Node finalDocument = cleanDocument( doc.getDocumentElement() ); getLog().info( "Nothing to clean in " + repositoryName ); try { url = new URL( new URL( prefixUrl + '/' ), value ); } catch ( MalformedURLException e ) { getLog().error( "Malformed URL when creating the resource absolute URI : " + e.getMessage() ); try { } catch ( IOException e ) { "The bundle " + n.getAttribute( "presentationname" ) + " - " + n.getAttribute( "version" ) + " will be removed : " + e.getMessage() ); toRemove.add( n ); System.out.println( "Do you want to remove these bundles from the repository file [y/N]:" ); BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) ); try { answer = br.readLine(); } catch ( IOException ioe ) { getLog().error( "IO error trying to read the user confirmation" ); return null; if ( answer != null && answer.trim().equalsIgnoreCase( "y" ) ) { } else {
0
import org.apache.cocoon.portal.coplet.CopletDefinition; import org.apache.cocoon.portal.event.CopletDefinitionEvent; public class AbstractCopletDefinitionEvent implements CopletDefinitionEvent { protected CopletDefinition target; public AbstractCopletDefinitionEvent(CopletDefinition target) { * @see org.apache.cocoon.portal.event.CopletDefinitionEvent#getTarget() public CopletDefinition getTarget() {
0
return true; }
0
private boolean isAlphaNum(byte[] bytes) {
0
package org.apache.accumulo.core.util.shell.commands; import org.apache.accumulo.core.util.shell.Shell; import org.apache.accumulo.core.util.shell.Shell.Command;
0
import org.apache.zookeeper.Watcher.Event.EventType; import org.apache.zookeeper.data.StatPersisted; private DataNode root = new DataNode(null, new byte[0], null, new StatPersisted()); static public void copyStatPersisted(StatPersisted from, StatPersisted to) { to.setAversion(from.getAversion()); to.setCtime(from.getCtime()); to.setCversion(from.getCversion()); to.setCzxid(from.getCzxid()); to.setMtime(from.getMtime()); to.setMzxid(from.getMzxid()); to.setVersion(from.getVersion()); to.setEphemeralOwner(from.getEphemeralOwner()); } to.setDataLength(from.getDataLength()); to.setNumChildren(from.getNumChildren()); StatPersisted stat = new StatPersisted(); n.copyStat(s); n.copyStat(stat); n.copyStat(stat); n.copyStat(stat); n.copyStat(stat);
0
* @throws IOException If an error occurs while reading the underlying * @throws IOException If an error occurs in reading the underlying * @throws IOException If an error occurs while reading the underlying
0
package org.apache.felix.dependencymanager.test2.integration.api; import org.ops4j.pax.exam.junit.PaxExam; import org.apache.felix.dependencymanager.test2.components.Ensure; import org.apache.felix.dependencymanager.test2.integration.common.TestBase; @RunWith(PaxExam.class) public class BundleDependencyTest extends TestBase { public void testBundleDependencies() { public void testRequiredBundleDependency() {
0
elementCoder.encode(elem, dataOutStream); elementCoder.encode(elem, countingOutputStream); elements.add(elementCoder.decode(dataInStream)); elements.add(elementCoder.decode(dataInStream));
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//dbcp/src/java/org/apache/commons/dbcp/PoolableConnectionFactory.java,v 1.7 2003/04/09 00:19:37 dgraham Exp $ * $Revision: 1.7 $ * $Date: 2003/04/09 00:19:37 $ * Copyright (c) 1999-2003 The Apache Software Foundation. All rights * @version $Id: PoolableConnectionFactory.java,v 1.7 2003/04/09 00:19:37 dgraham Exp $ * @deprecated AbandonedConfig is now deprecated. public PoolableConnectionFactory( ConnectionFactory connFactory, ObjectPool pool, KeyedObjectPoolFactory stmtPoolFactory, String validationQuery, boolean defaultReadOnly, boolean defaultAutoCommit, AbandonedConfig config) { /** * @deprecated AbandonedConfig is now deprecated. */
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/compiler/Constant.java,v 1.4 2003/01/11 05:41:23 dmitri Exp $ * $Revision: 1.4 $ * $Date: 2003/01/11 05:41:23 $ * @version $Revision: 1.4 $ $Date: 2003/01/11 05:41:23 $ public Constant(Number number) { public Constant(String string) { public Object compute(EvalContext context) { public Object computeValue(EvalContext context) { public boolean isContextDependent() { public boolean computeContextDependent() { public String toString() {
1
* $HeadURL:$ * $Revision:$ * $Date:$ package org.apache.http; public class OoopsieRuntimeException extends RuntimeException { private static final long serialVersionUID = 662807254163212266L; public OoopsieRuntimeException() { super("Ooopsie!!!");
0
return SlaUtil.percentile(waitTimes, 50.0); private static final Function<Collection<IScheduledTask>, List<ITaskEvent>> TO_SORTED_EVENTS = new Function<Collection<IScheduledTask>, List<ITaskEvent>>() { @Override public List<ITaskEvent> apply(Collection<IScheduledTask> tasks) { List<ITaskEvent> result = Lists.newLinkedList(); for (IScheduledTask task : tasks) { result.addAll(task.getTaskEvents()); } return Ordering.natural() .onResultOf(TASK_EVENT_TO_TIMESTAMP).immutableSortedCopy(result); } }; Functions.compose(TASK_EVENTS_TO_INTERVALS, TO_SORTED_EVENTS));
0
* @version $Id: ExpressionContextImpl.java,v 1.3 2004/05/07 16:43:42 mpo Exp $ widget = ((ContainerWidget)this.widget.getParent()).lookupWidget(name); widget = ((ContainerWidget)this.widget).lookupWidget(name);
0
iterators = new ArrayList<>(); ranges = new ArrayList<>(); columns = new HashSet<>(); columns.add(new Pair<>(colFam, colQual));
1
import org.junit.Ignore; /** Unit tests for UDFs. */ @Ignore /** UdfProvider to help UDF registration. */
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
import org.apache.accumulo.core.conf.AccumuloConfiguration; public long close(AccumuloConfiguration conf, VolumeManager fs, Path source) throws IOException { return conf.getTimeInMillis(Property.MASTER_LEASE_RECOVERY_WAITING_PERIOD);
1
FileUtils.write(file, "Hello /u1234", (String) null); FileUtils.writeStringToFile(file, "this is brand new data", (String) null, true); FileUtils.writeStringToFile(file, "this is brand new data", (String) null, false); FileUtils.write(file, "this is brand new data", (String) null, true); FileUtils.write(file, "this is brand new data", (String) null, false);
0
* @version $Revision: 1.4 $, $Date: 2004/10/18 11:12:08 $ public void setAutoSave(boolean autoSave) { delegate.setAutoSave(autoSave); } public boolean isAutoSave() { return delegate.isAutoSave(); }
0
import org.apache.beam.sdk.transforms.OldDoFn; static class ParseEventFn extends OldDoFn<String, GameActionInfo> {
0
import static org.junit.Assert.assertTrue; assertTrue(shell.getInstance() instanceof org.apache.accumulo.core.client.mock.MockInstance);
0