Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
NamedFactory<UserAuth> factory = NamedResource.findByName(pref, String.CASE_INSENSITIVE_ORDER, authFactories); userAuth = NamedFactory.create(authFactories, method);
0
assertNull("Got a refresh delay", params.getReloadingRefreshDelay()); final Long delay = 10000L; .setReloadingRefreshDelay(1000L);
0
package org.apache.felix.sigil.ui.eclipse.ui.editors.project; import org.apache.felix.sigil.ui.eclipse.ui.util.ModelLabelProvider; import org.apache.felix.sigil.ui.eclipse.ui.util.SingletonSelection;
0
XMLStreamReader xmlStreamReader = null; try (InputStream is = new ByteArrayInputStream(baos.toByteArray())) { xmlStreamReader = xmlInputFactory.createXMLStreamReader(is); } XMLStreamReader xmlStreamReader = null; try (InputStream is = new ByteArrayInputStream(baos.toByteArray())) { xmlStreamReader = xmlInputFactory.createXMLStreamReader(is); } XMLStreamReader xmlStreamReader = null; try (InputStream is = new ByteArrayInputStream(baos.toByteArray())) { xmlStreamReader = xmlInputFactory.createXMLStreamReader(is); } XMLStreamReader xmlStreamReader = null; try (InputStream is = new ByteArrayInputStream(baos.toByteArray())) { xmlStreamReader = xmlInputFactory.createXMLStreamReader(is); }
0
* Returns true if the XML parser must be in validation mode, false * otherwise. */ boolean isXMLParserValidating(); /**
0
import org.apache.http.nio.NHttpServerIOTarget; import org.apache.http.params.HttpConnectionParams; * <li>{@link org.apache.http.params.CoreConnectionPNames#SO_TIMEOUT}</li> public class SSLNHttpServerConnectionFactory implements NHttpConnectionFactory<NHttpServerIOTarget> { protected NHttpServerIOTarget createConnection( public NHttpServerIOTarget createConnection(final IOSession session) { SSLIOSession ssliosession = new SSLIOSession(session, SSLMode.SERVER, sslcontext, this.sslHandler); NHttpServerIOTarget conn = createConnection( ssliosession, this.requestFactory, this.allocator, this.params); int timeout = HttpConnectionParams.getSoTimeout(this.params); conn.setSocketTimeout(timeout); return conn;
0
import java.util.Iterator; import org.apache.sshd.common.keyprovider.KeyPairProviderHolder; provider = createTestHostKeyProvider(file); public static KeyPairProvider createTestHostKeyProvider(File file) { return createTestHostKeyProvider(ValidateUtils.checkNotNull(file, "No file").toPath()); } public static KeyPairProvider createTestHostKeyProvider(Path path) { SimpleGeneratorHostKeyProvider keyProvider = new SimpleGeneratorHostKeyProvider(); keyProvider.setPath(ValidateUtils.checkNotNull(path, "No path")); keyProvider.setAlgorithm(DEFAULT_TEST_HOST_KEY_PROVIDER_ALGORITHM); return validateKeyPairProvider(keyProvider); } public static KeyPair getFirstKeyPair(KeyPairProviderHolder holder) { return getFirstKeyPair(ValidateUtils.checkNotNull(holder, "No holder").getKeyPairProvider()); } public static KeyPair getFirstKeyPair(KeyPairProvider provider) { ValidateUtils.checkNotNull(provider, "No key pair provider"); Iterable<? extends KeyPair> pairs = ValidateUtils.checkNotNull(provider.loadKeys(), "No loaded keys"); Iterator<? extends KeyPair> iter = ValidateUtils.checkNotNull(pairs.iterator(), "No keys iterator"); ValidateUtils.checkTrue(iter.hasNext(), "Empty loaded kyes iterator"); return ValidateUtils.checkNotNull(iter.next(), "No key pair in iterator"); } client.setKeyPairProvider(KeyPairProvider.EMPTY_KEYPAIR_PROVIDER);
0
split.setSamplerConfiguration(tableConfig.getSamplerConfiguration());
1
return input.apply("Map", ParDo.of(new OldDoFn<InputT, OutputT>() {
0
public class UrlFileSystem extends AbstractFileSystem { protected UrlFileSystem(final FileName rootName, final FileSystemOptions fileSystemOptions) { protected FileObject createFile(final AbstractFileName name) { protected void addCapabilities(final Collection<Capability> caps) {
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.commons.collections4.properties; import java.util.Properties; /** * Creates and loads {@link Properties}. * * @see Properties * @since 4.4 */ public class PropertiesFactory extends AbstractPropertiesFactory<Properties> { /** * The singleton instance. */ public static final PropertiesFactory INSTANCE = new PropertiesFactory(); /** * Constructs an instance. */ private PropertiesFactory() { // There is only one instance. } /** * Subclasses override to provide customized properties instances. * * @return a new Properties instance. */ @Override protected Properties createProperties() { return new Properties(); } }
0
import java.util.Map; import org.apache.ambari.server.controller.utilities.PropertyHelper; import junit.framework.Assert;
0
import com.twitter.mesos.gen.Constraint; .setConstraints(ImmutableSet.<Constraint>of())
0
static QuickLinksProfile create(List<Filter> globalFilters, List<Service> services) { QuickLinksProfile profile = new QuickLinksProfile(); profile.setFilters(globalFilters); profile.setServices(services); return profile; }
0
import org.apache.beam.model.pipeline.v1.RunnerApi.StandardPTransforms; import org.apache.beam.runners.core.construction.BeamUrns; static final String URN = BeamUrns.getUrn(StandardPTransforms.Primitives.MAP_WINDOWS);
0
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; }
0
import java.util.ArrayList; import java.util.List; import org.apache.http.protocol.HTTP; public void testDefaultHeadersRedirect() throws Exception { String host = "localhost"; int port = this.localServer.getServicePort(); this.localServer.register("*", new BasicRedirectService(host, port)); DefaultHttpClient client = new DefaultHttpClient(); HttpContext context = client.getDefaultContext(); List defaultHeaders = new ArrayList(1); defaultHeaders.add(new BasicHeader(HTTP.USER_AGENT, "my-test-client")); client.getParams().setParameter(ClientPNames.DEFAULT_HEADERS, defaultHeaders); HttpGet httpget = new HttpGet("/oldlocation/"); RoutedRequest request = new RoutedRequest.Impl(httpget, getDefaultRoute()); HttpResponse response = client.execute(request, context); HttpEntity e = response.getEntity(); if (e != null) { e.consumeContent(); } HttpRequest reqWrapper = (HttpRequest) context.getAttribute( ExecutionContext.HTTP_REQUEST); assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode()); assertEquals("/newlocation/", reqWrapper.getRequestLine().getUri()); Header header = reqWrapper.getFirstHeader(HTTP.USER_AGENT); assertEquals("my-test-client", header.getValue()); }
0
* @version $Id: VMSFTPEntryParser.java,v 1.5 2002/08/06 20:32:04 brekke Exp $ "\\[([0-9$A-Za-z_]+),([0-9$a-zA-Z_]+)\\]\\s*" +
0
/* * Copyright 2001-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 $Revision: 1.7 $ $Date: 2004/02/18 01:20:35 $
0
import java.util.Dictionary; import org.apache.felix.dm.lambda.ConfigurationDependencyBuilder; * behind a dynamic proxy interface. * <p> Using such callback provides a way for creating type-safe configurations from the actual {@link Dictionary} that is * normally injected by Dependency Manager. * For more information about configuration types, please refer to {@link ConfigurationDependencyBuilder}. *
0
while (e != null && (!SVGConstants.SVG_NAMESPACE_URI.equals (e.getNamespaceURI()) || !SVGConstants.SVG_SVG_TAG.equals(e.getLocalName()))) {
1
import com.google.common.base.Preconditions; * * *
0
import java.util.concurrent.atomic.AtomicInteger; private AtomicInteger openStreams = new AtomicInteger(0); openStreams.incrementAndGet(); int count; do count = openStreams.get(); if (count < 1) return; } while(openStreams.compareAndSet(count, count - 1)); if (count == 1) { notifyAllStreamsClosed(); return openStreams.get() > 0;
0
import java.io.IOException; * @deprecated (4.3) use * {@link org.apache.http.client.config.RequestConfig}. * @deprecated (4.3) use * {@link org.apache.http.impl.client.HttpClientBuilder}.
0
constraintViolated(o, "Cannot consume "+consume+" stack slots: only "+stack().slotsUsed()+" slot(s) left on stack!\nStack:\n"+stack()); int produce = o.produceStack(cpg) - o.consumeStack(cpg); // Stack values are always consumed first; then produced. constraintViolated(o, "Cannot produce "+produce+" stack slots: only "+(stack().maxStack()-stack().slotsUsed())+" free stack slot(s) left.\nStack:\n"+stack()); constraintViolated(o, "Class '"+name+"' is referenced, but cannot be loaded and resolved: '"+vr+"'.");
0
import cz.seznam.euphoria.core.client.operator.Operator; static Set<Class<? extends Operator<?, ?, ?>>> getBasicOps() { return (Set) Sets.newHashSet(
0
import org.apache.beam.sdk.transforms.OldDoFn; * <li>State: The previous {@link PaneInfo} passed to the user's {@link OldDoFn#processElement},
0
package org.apache.ambari.common.rest.agent;
0
* http://www.apache.org/licenses/LICENSE-2.0
0
import org.apache.ambari.server.api.services.views.ViewExternalSubResourceService; import org.apache.ambari.server.api.services.views.ViewSubResourceService;
0
import org.apache.beam.sdk.transforms.OldDoFn; static class ExtractTimestamps extends OldDoFn<String, String> { public void processElement(OldDoFn<String, String>.ProcessContext c) throws Exception { static class ExtractStationSpeedFn extends OldDoFn<String, KV<String, StationSpeed>> { extends OldDoFn<KV<String, Iterable<StationSpeed>>, KV<String, RouteInfo>> { static class FormatStatsFn extends OldDoFn<KV<String, RouteInfo>, TableRow> {
0
tester = TriggerTester.nonCombining( windowFn, underTest, AccumulationMode.DISCARDING_FIRED_PANES);
0
try (final FutureRequestExecutionService requestExecService = new FutureRequestExecutionService(
0
requests.add(getRequest(Collections.emptyMap()));
0
SimpleStore<String> sstore = new SimpleStore<>(); AgeOffStore<String> aoStore = new AgeOffStore<>(sstore, 10, tts); Assert.assertEquals(new HashSet<>(Arrays.asList(txid1, txid2, txid3, txid4)), new HashSet<>(aoStore.list())); Assert.assertEquals(4, new HashSet<>(aoStore.list()).size()); Assert.assertEquals(new HashSet<>(Arrays.asList(txid1, txid3, txid4)), new HashSet<>(aoStore.list())); Assert.assertEquals(3, new HashSet<>(aoStore.list()).size()); Assert.assertEquals(new HashSet<>(Arrays.asList(txid1)), new HashSet<>(aoStore.list())); Assert.assertEquals(1, new HashSet<>(aoStore.list()).size()); SimpleStore<String> sstore = new SimpleStore<>(); AgeOffStore<String> aoStore = new AgeOffStore<>(sstore, 10, tts); Assert.assertEquals(new HashSet<>(Arrays.asList(txid1, txid2, txid3, txid4)), new HashSet<>(aoStore.list())); Assert.assertEquals(4, new HashSet<>(aoStore.list()).size()); Assert.assertEquals(new HashSet<>(Arrays.asList(txid1, txid2, txid3, txid4)), new HashSet<>(aoStore.list())); Assert.assertEquals(4, new HashSet<>(aoStore.list()).size()); Assert.assertEquals(new HashSet<>(Arrays.asList(txid1)), new HashSet<>(aoStore.list())); Assert.assertEquals(1, new HashSet<>(aoStore.list()).size()); Assert.assertEquals(new HashSet<>(Arrays.asList(txid1)), new HashSet<>(aoStore.list())); Assert.assertEquals(1, new HashSet<>(aoStore.list()).size()); Assert.assertEquals(new HashSet<>(Arrays.asList(txid1)), new HashSet<>(aoStore.list())); Assert.assertEquals(1, new HashSet<>(aoStore.list()).size()); Assert.assertEquals(0, new HashSet<>(aoStore.list()).size());
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/impl/Attic/BeanTagScript.java,v 1.14 2002/08/12 19:11:46 jstrachan Exp $ * $Revision: 1.14 $ * $Date: 2002/08/12 19:11:46 $ * $Id: BeanTagScript.java,v 1.14 2002/08/12 19:11:46 jstrachan Exp $ * @version $Revision: 1.14 $ finally { if ( ! context.isCacheTags() ) { clearTag(); } }
0
textIdx = caseSensitivity.checkIndexOf(filename, textIdx, wcs[wcsIdx]); int repeat = caseSensitivity.checkIndexOf(filename, textIdx + 1, wcs[wcsIdx]); if (!caseSensitivity.checkRegionMatches(filename, textIdx, wcs[wcsIdx])) {
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/jelly-tags/fmt/src/java/org/apache/commons/jelly/tags/fmt/SetTimeZoneTag.java,v 1.2 2003/01/26 02:02:08 morgand Exp $ * $Revision: 1.2 $ * $Date: 2003/01/26 02:02:08 $ * $Id: SetTimeZoneTag.java,v 1.2 2003/01/26 02:02:08 morgand Exp $ import org.apache.commons.jelly.JellyTagException; * @version $Revision: 1.2 $ public void doTag(XMLOutput output) throws JellyTagException {
0
@SuppressWarnings("rawtypes")
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions;
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: AbstractProfileManager.java,v 1.6 2004/03/05 13:02:16 bdelacretaz Exp $
1
private static final long serialVersionUID = -1348448090193107031L;
0
import org.apache.commons.jelly.util.TagUtils; * @version $Revision: 1.35 $ TagUtils.trimScript(body);
0
/** * @deprecated this method defaults the region to "us-central1". Prefer using the overload with * an explicit regionId parameter. */ @Deprecated return getJobMonitoringPageURL(projectName, "us-central1", jobId); } public static String getJobMonitoringPageURL(String projectName, String regionId, String jobId) { "https://console.cloud.google.com/dataflow/jobsDetail/locations/%s/jobs/%s?project=%s", URLEncoder.encode(regionId, "UTF-8"), URLEncoder.encode(jobId, "UTF-8"), URLEncoder.encode(projectName, "UTF-8"));
0
if (!isAllowNullKey()) { if (!isAllowNullKey()) { if (!isAllowNullKey()) { if (!isAllowNullKey()) {
0
@SuppressWarnings("deprecation")
0
import org.apache.http.conn.scheme.SchemeSocketFactory; SchemeSocketFactory sf = PlainSocketFactory.getSocketFactory(); supportedSchemes.register(new Scheme("http", 80, sf));
0
* An object to encode * An encoder exception is thrown if the encoder experiences a failure condition during the encoding * process.
0
import org.apache.http.client.CookieStore; import org.apache.http.client.CredentialsProvider; protected CookieStore createCookieStore() { return new BasicCookieStore(); } protected CredentialsProvider createCredentialsProvider() { return new BasicCredentialsProvider(); getCookieStore()); getCredentialsProvider());
0
private boolean isImportInProgress = false; public boolean isImportInProgress() { return isImportInProgress; } public void setImportInProgress(boolean importInProgress) { isImportInProgress = importInProgress; }
0
import org.apache.aurora.gen.JobUpdateQuery; import org.apache.aurora.gen.JobUpdateRequest; public Response startJobUpdate(JobUpdateRequest request, Lock lock, SessionKey session) return delegate.startJobUpdate(request, lock, session); public Response pauseJobUpdate(String updateId, Lock lock, SessionKey session) throws TException { return delegate.pauseJobUpdate(updateId, lock, session); public Response resumeJobUpdate(String updateId, Lock lock, SessionKey session) throws TException { return delegate.resumeJobUpdate(updateId, lock, session); public Response abortJobUpdate(String updateId, Lock lock, SessionKey session) throws TException { return delegate.abortJobUpdate(updateId, lock, session); public Response getJobUpdateSummaries(JobUpdateQuery updateQuery) throws TException { return delegate.getJobUpdateSummaries(updateQuery); public Response getJobUpdateDetails(String updateId) throws TException { return delegate.getJobUpdateDetails(updateId);
0
List<Cookie> cookies = new ArrayList<>(); cookies = new ArrayList<>(); cookies = new ArrayList<>(); cookies = new ArrayList<>(); final List<Cookie> cookies = new ArrayList<>();
0
package org.apache.commons.io.input;
0
private ExtractEventTime<T> eventTimeAssigner; windowBy(Windowing<T, W> windowing, ExtractEventTime<T> eventTimeAssigner) { @Nullable ExtractEventTime<IN> eventTimeAssigner,
0
private final InheritableThreadLocal<InputStream> m_streams = new InheritableThreadLocal<InputStream>();
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
1
* @version $Id$
0
import java.util.Collection; import java.util.List; import org.apache.atlas.AtlasException; * Represents a query against the graph within the context of the * current transaction. * Adds a predicate that the returned vertices must have the specified * * Adds a predicate that the returned vertices must have the specified * property and that one of the value of the property must be in * the specified list of values. * * @param propertyKey * @param value AtlasGraphQuery<V,E> in(String propertyKey, Collection<? extends Object> values); * Executes the query and returns the matching vertices. * @throws AtlasException Iterable<AtlasVertex<V, E>> vertices(); * Adds a predicate that the returned vertices must have the specified * AtlasGraphQuery<V,E> has(String propertyKey, ComparisionOperator compMethod, Object values); /** * Adds a predicate that the vertices returned must satisfy the * conditions in at least one of the child queries provided. * * @param childQueries * @return */ AtlasGraphQuery<V,E> or(List<AtlasGraphQuery<V,E>> childQueries); /** * Creates a child query that can be used to add "or" conditions * * @return */ AtlasGraphQuery<V,E> createChildQuery(); LESS_THAN_EQUAL, NOT_EQUAL /** * Adds all of the predicates that have been added to this query to the * specified query. * @param otherQuery * @return */ AtlasGraphQuery<V, E> addConditionsFrom(AtlasGraphQuery<V, E> otherQuery); /** * Whether or not this is a child query * * @return */ boolean isChildQuery();
0
boolean interrupted = false; do try { // Need to ensure that the other thread has obtained // the service. holder.m_latch.await(); if (interrupted) { Thread.currentThread().interrupt(); } interrupted = false; } catch (InterruptedException e) { interrupted = true; Thread.interrupted(); } while (interrupted);
0
package org.apache.ambari.metrics.core.timeline;
0
try (InputStream invOut = channel.getInvertedOut(); OutputStream invIn = channel.getInvertedIn()) { ScpHelper helper = new ScpHelper(session, invOut, invIn, new MockFileSystem(remote), listener); try (InputStream invOut = channel.getInvertedOut(); OutputStream invIn = channel.getInvertedIn()) { ScpHelper helper = new ScpHelper(session, invOut, invIn, fs, listener); try (InputStream invOut = channel.getInvertedOut(); OutputStream invIn = channel.getInvertedIn()) { // NOTE: we use a mock file system since we expect no invocations for it ScpHelper helper = new ScpHelper(session, invOut, invIn, new MockFileSystem(remote), listener); try (InputStream invOut = channel.getInvertedOut(); OutputStream invIn = channel.getInvertedIn()) { ScpHelper helper = new ScpHelper(session, invOut, invIn, fs, listener);
0
* http://www.apache.org/licenses/LICENSE-2.0
0
public static void main(final String[] args)throws Exception { final Registry<ConnectionSocketFactory> reg = RegistryBuilder.<ConnectionSocketFactory>create() final PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(reg); final InetSocketAddress socksaddr = new InetSocketAddress("mysockshost", 1234); final HttpClientContext context = HttpClientContext.create(); final HttpHost target = new HttpHost("httpbin.org", 80, "http"); final HttpGet request = new HttpGet("/get"); final InetSocketAddress socksaddr = (InetSocketAddress) context.getAttribute("socks.address"); final Proxy proxy = new Proxy(Proxy.Type.SOCKS, socksaddr); } catch (final SocketTimeoutException ex) {
0
* Returns <code>true</code> if the metadata declaration has used the * Declarative Services version 1.1 namespace or a later namespace. */ public boolean isDS11() { return getNamespaceCode() >= XmlHandler.DS_VERSION_1_1; } /**
0
import java.util.Objects; public int hashCode() { return Objects.hashCode(key); } @Override public boolean equals(Object obj) { return this == obj || (obj != null && obj instanceof Index && 0 == compareTo((Index) obj)); } @Override
0
* @param connStrategy the connection reuse strategy. If {@code null} * @param responseFactory the response factory. If {@code null} * @param connStrategy the connection reuse strategy. If {@code null} * @param responseFactory the response factory. If {@code null}
0
result.getAttributeValue(new InMemoryNodeModel() .getNodeHandler())); result.getAttributeValue(new InMemoryNodeModel().getNodeHandler());
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.forms.formmodel; /** * The {@link WidgetDefinition} corresponding to a {@link Struct} widget. * * @deprecated replaced by {@link GroupDefinition} * @version $Id$ */ public class StructDefinition extends GroupDefinition { public Widget createInstance() { Struct structWidget = new Struct(this); createWidgets(structWidget); return structWidget; } }
0
@Component @Property(name = "foo", value = "bar") @Property(name="type", value="SimpleAnnotations")
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.beam.runners.dataflow.worker.status; import java.io.PrintWriter; import java.util.concurrent.atomic.AtomicReference; /** Capture the last exception thrown during processing, and display that on the statusz page. */ public class LastExceptionDataProvider implements StatusDataProvider { private static final AtomicReference<Throwable> lastException = new AtomicReference<>(); /** Report an exception to the exception data provider. */ public static void reportException(Throwable t) { lastException.set(t); } @Override public void appendSummaryHtml(PrintWriter writer) { Throwable t = lastException.get(); if (t == null) { writer.println("None<br>"); } else { writer.println("<pre>"); t.printStackTrace(writer); writer.println("</pre>"); } } }
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
/** * 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.gremlin.optimizer; import org.apache.atlas.gremlin.GremlinExpressionFactory; import org.apache.atlas.groovy.AbstractFunctionExpression; import org.apache.atlas.groovy.GroovyExpression; /** * Finds order expression in the call hierarchy. * */ public class OrderFinder implements CallHierarchyVisitor { private boolean hasOrderExpression; private GremlinExpressionFactory gremlinFactory; public OrderFinder(GremlinExpressionFactory gremlinFactory) { this.gremlinFactory = gremlinFactory; } @Override public boolean preVisitFunctionCaller(AbstractFunctionExpression expr) { return true; } @Override public void visitNonFunctionCaller(GroovyExpression expr) { } @Override public void visitNullCaller() { } @Override public boolean postVisitFunctionCaller(AbstractFunctionExpression functionCall) { if (gremlinFactory.isOrderExpression(functionCall)) { hasOrderExpression = true; return false; } return true; } public boolean hasOrderExpression() { return hasOrderExpression; } }
0
"name2=\"\"; $Path=\"/\"; $Domain=\".domain.com\"",
0
zk.multi(Arrays.asList( public void testDeleteUpdateConflict() throws Exception { public void testGetResults() throws Exception {
0
final TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException { poolEntry = leaseFuture.get(timeout, timeUnit);
0
* @version $Revision$
0
if (null != cr.getProperties()) { // !!! empty property sets are supported, and need to be able to use // previously-defined configs (revert) Map<String, Config> all = cluster.getConfigsByType(cr.getType()); if (null == all || // none set !all.containsKey(cr.getVersionTag()) || // tag not set cr.getProperties().size() > 0) { // properties to set LOG.info(MessageFormat.format("Applying configuration with tag ''{0}'' to cluster ''{1}''", cr.getVersionTag(), request.getClusterName())); cr.setClusterName(cluster.getClusterName()); createConfiguration(cr); }
0
* {@link DataflowRunner} to add user defined hooks to be public class DataflowRunnerHooks {
0
private static final Configuration hadoopConf = new Configuration(); protected Configuration conf = new Configuration(); CachableBuilder cb = new CachableBuilder().input(in2).length(data.length).conf(hadoopConf)
0
public class InvalidStateTransitionException extends Exception { public InvalidStateTransitionException(Enum<?> currentState, Enum<?> event) {
0
Predicate toPredicate(String prop, String val) throws InvalidQueryException;
0
Iterator i = instructions.entrySet().iterator(); while (i.hasNext()) { Map.Entry e = (Map.Entry)i.next(); String key = (String)e.getKey(); if (key.startsWith("_")) { key = "-"+key.substring(1); } properties.put(key, e.getValue()); }
0
self.maxSessionTimeout, self.clientPortListenBacklog, zkDb, self);
0
import com.google.common.base.Strings; /** * Gets name of the default tier. * * @return Name for the default tier. */ String getDefaultTierName(); /** * Gets the map of tier name to {@link TierInfo} instance. * * @return A readonly view of all tiers. */ Map<String, TierInfo> getTiers(); private final String defaultTier; public TierConfig( @JsonProperty("default") String defaultTier, @JsonProperty("tiers") Map<String, TierInfo> tiers) { checkArgument(!Strings.isNullOrEmpty(defaultTier), "Default tier name cannot be empty."); checkArgument( tiers.containsKey(defaultTier), "Default tier name should match supplied tiers."); this.defaultTier = defaultTier; public String getDefault() { return defaultTier; } @VisibleForTesting @Override public String getDefaultTierName() { return tierConfig.defaultTier; } @Override public Map<String, TierInfo> getTiers() { return tierConfig.tiers; }
0
public void encode(List value, OutputStream outStream) public List decode(InputStream inStream) public void encode(MyValue value, OutputStream outStream) public MyValue decode(InputStream inStream)
0
import java.util.ArrayList; import java.util.Iterator; import org.apache.sshd.client.ClientFactoryManager; private Iterator<String> passwords; private String current; private int nbTrials; private int maxTrials; List<String> pwds = new ArrayList<String>(); pwds.add((String) o); this.passwords = pwds.iterator(); this.maxTrials = session.getIntProperty(ClientFactoryManager.PASSWORD_PROMPTS, 3); if (passwords.hasNext()) { current = passwords.next(); } else if (nbTrials++ < maxTrials) { current = null; } else { return false; } log.debug("Send SSH_MSG_USERAUTH_REQUEST for keyboard-interactive"); } else if (num == 1 && current != null && !echo[0] && prompt[0].toLowerCase().startsWith("password:")) { rep = new String[] { current };
0
* @see #copyFileToDirectory(File, File) * @see #copyFileToDirectory(File, File, boolean)
0
return getJobConfig().isSetCronSchedule();
0
@Path("/filters")
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. */ @org.osgi.annotation.bundle.Export @org.osgi.annotation.versioning.Version("1.0.0") package org.apache.felix.service.command;
0
* A partial implementation of the <code>GraphicsNode</code> interface.
0
import org.apache.commons.lang.StringUtils; @javax.persistence.Table(name = "servicedesiredstate") @Column(name = "cluster_id", nullable = false, insertable = false, updatable = false, length = 10) @Id @Column(name = "service_name", nullable = false, insertable = false, updatable = false) private String serviceName; @Column(name = "desired_state", nullable = false, insertable = true, updatable = true) @Enumerated(value = EnumType.STRING) private State desiredState = State.INIT; @Column(name = "desired_host_role_mapping", nullable = false, insertable = true, updatable = true, length = 10) @Basic private int desiredHostRoleMapping = 0; @Column(name = "desired_stack_version", insertable = true, updatable = true) @Basic private String desiredStackVersion = ""; @OneToOne @javax.persistence.JoinColumns( { @JoinColumn(name = "cluster_id", referencedColumnName = "cluster_id", nullable = false), @JoinColumn(name = "service_name", referencedColumnName = "service_name", nullable = false) }) private ClusterServiceEntity clusterServiceEntity; return StringUtils.defaultString(desiredStackVersion);
0
public static File getTestResourceFile(final String name) return getTestResourceFile(name, true); public static File getTestResourceFile(final String name, final boolean mustExist) File file = new File(getTestDirectory(), name); public static File getTestDirectory() final String baseDirProp = getTestDirectoryString(); /** * Returns the test directory as a String. * * @return the test directory as a String */ public static String getTestDirectoryString() public static String getResourceTestDirectoryString() File file = new File(getTestDirectory(), name);
0
import org.apache.accumulo.core.client.Accumulo; try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
0
private final Map<Long, String> configGroupOverrides = new ConcurrentHashMap<>();
0
suite.addTest( new TestSuite( IOUtilsCopyTestCase.class ) ); suite.addTest( new TestSuite( IOUtilsWriteTestCase.class ) );
0
long stamp = el.getTimestamp(); long start = stamp - (stamp + durationMillis) % durationMillis;
0
import org.apache.ambari.server.serveraction.kerberos.stageutils.ResolvedKerberosPrincipal; protected CommandReport processIdentity(ResolvedKerberosPrincipal resolvedPrincipal, KerberosOperationHandler operationHandler, Map<String, String> kerberosConfiguration, Map<String, Object> requestSharedDataContext) throws AmbariException { kerberosHelper.createResolvedKeytab(keytab);
0
List<HostEntity> hostEntities = new ArrayList<>(); List<ClusterServiceEntity> clusterServiceEntities = new ArrayList<>(); Set<UserEntity> users = new HashSet<>(); Map<String, String> hostAttributes = new HashMap<>();
1
/** * 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