Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
/* * Copyright 2016-2018 Seznam.cz, a.s.
0
package org.apache.batik.anim.dom; import org.apache.batik.dom.svg.SVGTestsSupport;
0
.setEnvironmentId(components.getOnlyEnvironmentId()) .getDefaultJavaEnvironmentUrl())); .setEnvironmentId(components.getOnlyEnvironmentId()) .getDefaultJavaEnvironmentUrl()));
0
package org.apache.beam.sdk.extensions.sql.interpreter.operator.logical; import org.apache.beam.sdk.extensions.sql.interpreter.BeamSqlFnExecutorTestBase; import org.apache.beam.sdk.extensions.sql.interpreter.operator.BeamSqlExpression; import org.apache.beam.sdk.extensions.sql.interpreter.operator.BeamSqlPrimitive;
0
ComponentDef definition = AnnotationReader.getDefinition(c, analyzer); if (definition != null) { definition.sortReferences(); definition.prepare(analyzer); String name = "OSGI-INF/" + definition.name + ".xml"; names.add(name); analyzer.getJar().putResource(name, new TagResource(definition.getTag()));
0
* method based on the schema.
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
@FunctionalInterface
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. */ * @version CVS $Id: ValueJXPathBinding.java,v 1.14 2004/03/05 13:02:27 bdelacretaz Exp $
1
package org.apache.accumulo.server.test.randomwalk.bulk; import org.apache.accumulo.core.data.Value; import org.apache.accumulo.server.test.randomwalk.State; public class BulkMinusOne extends BulkTest { private static final Value negOne = new Value("-1".getBytes()); @Override protected void runLater(State state) throws Exception { log.info("Decrementing"); BulkPlusOne.bulkLoadLots(log, state, negOne); } }
1
import org.slf4j.Logger;
0
/** BeamRelNode to replace a {@code Project} node. */ /** projects: {@link RexLiteral}, {@link RexInputRef}, {@link RexCall}. */ public BeamProjectRel( RelOptCluster cluster, RelTraitSet traits, RelNode input, List<? extends RexNode> projects, RelDataType rowType) { public Project copy( RelTraitSet traitSet, RelNode input, List<RexNode> projects, RelDataType rowType) {
0
package org.apache.bcel.generic;
1
* import org.apache.commons.ognl.Ognl; * import org.apache.commons.ognl.OgnlException; * ... * try * { * result = Ognl.getValue( expression, root ); * } * catch ( OgnlException ex ) * { * // Report error or recover * } * private Map&lt;String, Object&gt; context = new HashMap&lt;String, Object&gt;(); * ... * public void setUserName( String value ) * { * context.put("userName", value); * } * ... * try * { * // get value using our own custom context map * result = Ognl.getValue( "documentName + \" (\" + ((#userName == null) ? \"&lt;nobody&gt;\" : #userName ) + * \")\"", context, root ); * } * catch ( OgnlException ex ) * { * // Report error or recover * }
0
public void testTableGet() throws InterruptedException, IOException { BigQueryServicesImpl.DatasetServiceImpl services = new BigQueryServicesImpl.DatasetServiceImpl(mockClient, options); services.getTable("project", "dataset", "table");
0
import com.twitter.common.quantity.Amount; import com.twitter.common.quantity.Time; import com.twitter.mesos.gen.TaskEvent; // Add a grace period to prevent race condition where newly-scheduled tasks are not // yet reported by the slave. long taskAgeMillis = System.currentTimeMillis() - Iterables.getLast(task.getTaskEvents()).getTimestamp(); return !taskInfoMap.containsKey(task.getTaskId()) && taskAgeMillis > Amount.of(10, Time.MINUTES).as(Time.MILLISECONDS); TrackedTask trackedTask = changeTaskStatus(new TrackedTask() .setTask(task), ScheduleStatus.PENDING); newTasks.add(trackedTask); task = taskStore.mutate(task, new ExceptionalClosure<TrackedTask, RuntimeException>() { @Override public void execute(TrackedTask mutable) { mutable.setSlaveId(slaveId).setSlaveHost(slaveHost); changeTaskStatus(mutable, ScheduleStatus.STARTING); } task.unsetTaskEvents(); task.setTaskId(generateTaskId()); changeTaskStatus(task, ScheduleStatus.PENDING); /** * Sets the current status for a task, and records the status change into the task events * audit log. * * @param task Task whose status is changing. * @param status New status for the task. * @return A reference to the task. */ private TrackedTask changeTaskStatus(TrackedTask task, ScheduleStatus status) { task.setStatus(status); task.addToTaskEvents(new TaskEvent() .setTimestamp(System.currentTimeMillis()) .setStatus(status)); return task; } changeTaskStatus(mutable, status); changeTaskStatus(mutable, ScheduleStatus.FINISHED); changeTaskStatus(mutable, ScheduleStatus.FAILED); changeTaskStatus(mutable, ScheduleStatus.KILLED); changeTaskStatus(mutable, status);
0
import javax.servlet.http.HttpServletRequest; import java.util.Date; import java.util.Set; // Spring Security 4 Change => request.getServletPath() -> request.getPathInfo() this(AtlasAuthorizationUtils.getAtlasResourceType(request.getPathInfo()), "*", AtlasAuthorizationUtils
0
* @param resourceURL url for the resource, as defined in * the resource's xlink:href attribute. If that * resource was found.
1
* @version $Revision$
0
public boolean isBound() { return this.outstream != null; } if (this.outstream != null) { this.outstream.flush(); }
0
buffer.append("interest ops: ");
0
import org.apache.hc.core5.concurrent.CancellableDependency; private final CancellableDependency cancellableDependency; public ExecutionCommand( final AsyncClientExchangeHandler exchangeHandler, final CancellableDependency cancellableDependency, final HttpContext context) { this.cancellableDependency = cancellableDependency; public ExecutionCommand( final AsyncClientExchangeHandler exchangeHandler, final HttpContext context) { this(exchangeHandler, null, context); public CancellableDependency getCancellableDependency() { return cancellableDependency; } public HttpContext getContext() { return context; }
0
StateTag<? super K, WatermarkHoldState> address) { Map<W, WatermarkHoldState> map = context.accessInEachMergingWindow(address); WatermarkHoldState result = context.access(address); && result.getTimestampCombiner().dependsOnlyOnEarliestTimestamp()) { if (result.getTimestampCombiner().dependsOnlyOnWindow()) { for (WatermarkHoldState source : map.values()) { StateTag<? super K, WatermarkHoldState> address, Collection<WatermarkHoldState> sources, WatermarkHoldState result, && result.getTimestampCombiner().dependsOnlyOnEarliestTimestamp()) { if (result.getTimestampCombiner().dependsOnlyOnWindow()) { for (WatermarkHoldState source : sources) { Instant hold = result.getTimestampCombiner().assign(resultWindow, BoundedWindow.TIMESTAMP_MIN_VALUE); for (WatermarkHoldState source : sources) { for (WatermarkHoldState source : sources) { result.add(result.getTimestampCombiner().merge(resultWindow, outputTimesToMerge));
0
Map<Resource.Type, String> mapIds = new HashMap<>(); Map<Resource.Type, String> mapIds = new HashMap<>(); Map<Resource.Type, String> mapIds = new HashMap<>(); Set<String> expected = new HashSet<>(); Map<Resource.Type, String> mapIds = new HashMap<>(); Set<String> expected = new HashSet<>();
1
* any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * permission of the Apache Software Foundation.
0
* @version $Id$
0
* <p>Concepts: The batch and streaming runners, GroupByKey, sliding windows. * <p>The pipeline reads traffic sensor data from {@literal --inputFile}. * <p>The example is configured to use the default BigQuery table from the example common package * (there are no defaults for a general Dataflow pipeline). * You can override them by using the {@literal --bigQueryDataset}, and {@literal --bigQueryTable} * options. If the BigQuery table do not exist, the example will try to create them. ExampleBigQueryTableOptions { @Description("Path of the file to read from") pipeline .apply("ReadLines", new ReadFileAndExtractTimestamps(options.getInputFile()))
0
import com.google.common.base.Function; import com.google.common.collect.FluentIterable; import java.io.IOException; import java.nio.channels.ReadableByteChannel; import java.nio.channels.WritableByteChannel; import java.util.Collection; import java.util.List; import org.apache.beam.sdk.io.fs.CreateOptions; class GcsFileSystem extends FileSystem<GcsResourceId> { @Override protected WritableByteChannel create(GcsResourceId resourceId, CreateOptions createOptions) throws IOException { return options.getGcsUtil().create(resourceId.getGcsPath(), createOptions.mimeType()); } @Override protected ReadableByteChannel open(GcsResourceId resourceId) throws IOException { return options.getGcsUtil().open(resourceId.getGcsPath()); } @Override protected void rename( List<GcsResourceId> srcResourceIds, List<GcsResourceId> destResourceIds) throws IOException { copy(srcResourceIds, destResourceIds); delete(srcResourceIds); } @Override protected void delete(Collection<GcsResourceId> resourceIds) throws IOException { options.getGcsUtil().remove(toFilenames(resourceIds)); } @Override protected void copy(List<GcsResourceId> srcResourceIds, List<GcsResourceId> destResourceIds) throws IOException { options.getGcsUtil().copy(toFilenames(srcResourceIds), toFilenames(destResourceIds)); } private List<String> toFilenames(Collection<GcsResourceId> resources) { return FluentIterable.from(resources) .transform( new Function<GcsResourceId, String>() { @Override public String apply(GcsResourceId resource) { return resource.getGcsPath().toString(); }}) .toList(); }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/pointers/Attic/VariablePointer.java,v 1.5 2002/04/12 02:28:06 dmitri Exp $ * $Revision: 1.5 $ * $Date: 2002/04/12 02:28:06 $ * @version $Revision: 1.5 $ $Date: 2002/04/12 02:28:06 $
0
* @version $Revision$ $Date$
0
package org.apache.cocoon.forms.datatype; import org.apache.cocoon.forms.Constants; * @version CVS $Id: DynamicSelectionListTestCase.java,v 1.1 2004/03/09 13:03:10 cziegeler Exp $ Element datatypeElement = (Element) sourceDoc.getElementsByTagNameNS(Constants.FD_NS, "convertor").item(0); actual.getDocumentElement().setAttribute(Constants.FI_PREFIX, Constants.FI_NS);
0
// add ambari classes as system classes webAppContext.addSystemClass("org.apache.ambari.server."); webAppContext.addSystemClass("org.apache.ambari.view."); // add as system classes to avoid conflicts and linkage errors webAppContext.addSystemClass("com.sun.jersey.");
0
* Tests whether getKeys(String prefix) is correctly synchronized. */ @Test public void testGetKeysPrefixSynchronized() { config.getKeys("test"); sync.verify(Methods.BEGIN_READ, Methods.END_READ); } /**
0
@Test public void testMergeServices_BothConfigTypesAreNull() throws Exception { File stackRoot = new File(stackRootStr); StackExtensionHelper helper = new StackExtensionHelper(injector, stackRoot); ServiceInfo child = new ServiceInfo(); ServiceInfo parent = new ServiceInfo(); child.setConfigTypes(null); child.setConfigDependencies(null); parent.setConfigTypes(null); parent.setConfigDependencies(null); ServiceInfo merged = helper.mergeServices(parent, child); assertNotNull(merged.getConfigDependencies()); assertEquals(0, merged.getConfigDependencies().size()); assertNotNull(merged.getConfigTypes()); assertEquals(0, merged.getConfigTypes().size()); }
0
private static final String OSCAR_HTTPS_ENABLE = "org.ungoverned.osgi.bundle.https.enable"; public static final String FELIX_HTTP_NIO = "org.apache.felix.http.nio"; public static final String FELIX_HTTPS_NIO = "org.apache.felix.https.nio"; * Returns <code>true</code> if HTTP is configured to be used ( {@link #FELIX_HTTP_ENABLE}) and @Deprecated * Returns <code>true</code> if HTTPS is configured to be used ( {@link #FELIX_HTTPS_ENABLE}) and @Deprecated this.keyPassword = getProperty(props, FELIX_KEYSTORE_KEY_PASSWORD, this.context.getProperty(OSCAR_KEYSTORE_KEY_PASSWORD)); this.useHttps = getBooleanProperty(props, FELIX_HTTPS_ENABLE, getBooleanProperty(props, OSCAR_HTTPS_ENABLE, false)); } catch (Exception e) { { (String) value }; } catch (Exception e) {
0
import org.apache.htrace.Trace; import org.apache.htrace.TraceScope; try (TraceScope candidatesSpan = Trace.startSpan("getCandidates")) { try (TraceScope confirmDeletesSpan = Trace.startSpan("confirmDeletes")) { try (TraceScope deleteSpan = Trace.startSpan("deleteFiles")) {
0
* * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * - Redistributions of source code must retain the above copyright * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * nor the names of its contributors may be used to endorse or * promote products derived from this software without specific prior * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * * * * * * * * * *
0
import java.util.List; import org.osgi.framework.Bundle; import org.osgi.service.coordinator.Coordination; import org.osgi.service.coordinator.CoordinationException; import org.osgi.service.coordinator.Participant; public CoordinationImpl(final CoordinatorImpl owner, final long id, final String name, final long timeOutInMs) public List<Participant> getParticipants() public Map<Class<?>, Object> getVariables() public Bundle getBundle() { // TODO Auto-generated method stub return null; } public Coordination getEnclosingCoordination() { // TODO Auto-generated method stub return null; }
0
/** * REST interface for data discovery using dsl or full text search */ /** * Retrieve data for the specified DSL * @param query DSL query * @param limit limit the result set to only include the specified number of entries * @param offset start offset of the result set (useful for pagination) * @return Search results * @throws AtlasBaseException * @HTTP 200 On successful DSL execution with some results, might return an empty list if execution succeeded * without any results * @HTTP 400 Invalid DSL or query parameters */ /** * Retrieve data for the specified fulltext query * @param query Fulltext query * @param limit limit the result set to only include the specified number of entries * @param offset start offset of the result set (useful for pagination) * @return Search results * @throws AtlasBaseException * @HTTP 200 On successful FullText lookup with some results, might return an empty list if execution succeeded * without any results * @HTTP 400 Invalid fulltext or query parameters */
0
private final int connectTimeout; private final TimeUnit tunit; /** * @deprecated (4.3) use {@link BasicNIOConnPool#BasicNIOConnPool(ConnectingIOReactor, * NIOConnFactory, int, TimeUnit)} */ @Deprecated this.connectTimeout = Config.getInt(params, CoreConnectionPNames.CONNECTION_TIMEOUT, 0); this.tunit = TimeUnit.MILLISECONDS; /** * @deprecated (4.3) use {@link BasicNIOConnPool#BasicNIOConnPool(ConnectingIOReactor, * int, TimeUnit)} */ @Deprecated /** * @since 4.3 */ public BasicNIOConnPool( final ConnectingIOReactor ioreactor, final NIOConnFactory<HttpHost, NHttpClientConnection> connFactory, int connectTimeout, final TimeUnit tunit) { super(ioreactor, connFactory, 2, 20); this.connectTimeout = connectTimeout; this.tunit = tunit != null ? tunit : TimeUnit.MILLISECONDS; } /** * @since 4.3 */ public BasicNIOConnPool( final ConnectingIOReactor ioreactor, final NIOConnFactory<HttpHost, NHttpClientConnection> connFactory) { this(ioreactor, connFactory, 0, TimeUnit.MILLISECONDS); } /** * @since 4.3 */ public BasicNIOConnPool( final ConnectingIOReactor ioreactor, int connectTimeout, final TimeUnit tunit) { this(ioreactor, new BasicNIOConnFactory(), connectTimeout, tunit); } /** * @since 4.3 */ public BasicNIOConnPool(final ConnectingIOReactor ioreactor) { this(ioreactor, new BasicNIOConnFactory(), 0, TimeUnit.MILLISECONDS); } return super.lease(route, state, this.connectTimeout, this.tunit, callback); return super.lease(route, state, this.connectTimeout, this.tunit, null);
0
dbAccessor.executeQuery("UPDATE clusterconfig " + if (Configuration.MYSQL_DB_NAME.equals(dbType)) { dbAccessor.executeQuery("ALTER TABLE clusterconfig MODIFY version BIGINT NOT NULL"); } else { dbAccessor.setNullable("clusterconfig", "version", false); } dbAccessor.executeQuery("ALTER TABLE ambari_sequences CHANGE value sequence_value DECIMAL(38) NOT NULL");
0
ns.addMappingAndRender("generated-command", "http://foo.com/command",node1); ns.addMappingAndRender("directory", "http://foo.com/io/directory", node1);
0
import java.util.function.Function; import javax.servlet.ServletContext; protected Function<ServletContext, Module> getChildServletModule() { return (servletContext) -> Modules.EMPTY_MODULE;
0
properties.setProperty("softMinEvictableIdleTimeMillis", "3000"); assertEquals(3000, ds.getSoftMinEvictableIdleTimeMillis());
0
*{@inheritDoc}
0
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
1
public final void setLocalVariableTable(LocalVariable[] local_variable_table) { this.local_variable_type_table = local_variable_table; }
0
* @version $Revision$
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/tags/core/JellyTag.java,v 1.10 2002/12/11 12:40:54 jstrachan Exp $ * $Revision: 1.10 $ * $Date: 2002/12/11 12:40:54 $ * $Id: JellyTag.java,v 1.10 2002/12/11 12:40:54 jstrachan Exp $ * @version $Revision: 1.10 $
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/model/NodePointerFactory.java,v 1.5 2003/10/09 21:31:40 rdonkin Exp $ * $Revision: 1.5 $ * $Date: 2003/10/09 21:31:40 $ * any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * permission of the Apache Software Foundation. * @version $Revision: 1.5 $ $Date: 2003/10/09 21:31:40 $
0
import org.apache.calcite.jdbc.CalciteConnection; final CalciteConnection connection; final SchemaPlus defaultSchema; connection = JdbcDriver.connect(tableProvider); defaultSchema = JdbcDriver.getDefaultSchema(connection); planner = new BeamQueryPlanner(connection); defaultSchema.add(functionName, ScalarFunctionImpl.create(clazz, method)); defaultSchema.add(functionName, new UdafImpl(combineFn)); return connection.createPrepareContext();
0
final boolean isConfigured = mt.isConfigured(); TestCase.assertTrue( "Last update call must have been with configuration", isConfigured); final boolean isConfigured = mt.isConfigured(); TestCase.assertTrue( "Last update call must have been with configuration", isConfigured);
0
final Integer max = this.maxPerHostMap.get(route);
0
public final class HttpHost implements Cloneable { public Object clone() throws CloneNotSupportedException { return super.clone(); }
0
private static final Amount<Long, Time> MAX_REGISTRATION_DELAY = Amount.of(1L, Time.MINUTES);
0
import static java.util.Objects.requireNonNull; boolean launchFirst(Function<HostOffer, Optional<TaskInfo>> acceptor) throws LaunchException; Iterable<HostOffer> getOffers(); /** * Encapsulate an offer from a host, and the host's maintenance mode. */ class HostOffer { private final Offer offer; // TODO(wfarner): Replace this with HostAttributes for more use of this caching. private final MaintenanceMode mode; public HostOffer(Offer offer, MaintenanceMode mode) { this.offer = requireNonNull(offer); this.mode = requireNonNull(mode); } public Offer getOffer() { return offer; } public MaintenanceMode getMode() { return mode; } @Override public boolean equals(Object o) { if (!(o instanceof HostOffer)) { return false; } HostOffer other = (HostOffer) o; return Objects.equals(offer, other.offer) && mode == other.mode; } @Override public int hashCode() { return Objects.hash(offer, mode); } @Override public String toString() { return com.google.common.base.Objects.toStringHelper(this) .add("offer", offer) .add("mode", mode) .toString(); } } requireNonNull(offerId); public Iterable<HostOffer> getOffers() { return hostOffers.getWeaklyConsistentOffers(); public boolean launchFirst(Function<HostOffer, Optional<TaskInfo>> acceptor) Optional<TaskInfo> assignment = acceptor.apply(hostOffer);
0
import org.codehaus.jackson.annotate.JsonAnySetter; @JsonAnySetter public void setOption(String key, String value) { if (null == options) { options = new HashMap<>(); } options.put(key, value); }}
0
/* * Copyright 2016-2018 Seznam.cz, a.s.
0
import org.apache.hc.core5.http.entity.EntityUtils;
0
if (value == null && getParentInterpolator() != null) { } if (value == null && getParentInterpolator() != null) { * public void registerLocalLookups(ConfigurationInterpolator interpolator) { * Sets the parent interpolator. This object is used if the interpolation is nested * hierarchically and the current interpolation object cannot resolve a variable. * public void setParentInterpolator(ConfigurationInterpolator parentInterpolator) { * Requests the parent interpolator. This object is used if the interpolation is nested * hierarchically and the current interpolation * public ConfigurationInterpolator getParentInterpolator() {
0
* @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A>
0
* @version CVS $Id: LinkSamplingEnvironment.java,v 1.2 2003/05/12 13:26:17 stephan Exp $ CommandLineContext cliContext,
0
Random random = Utils.getRandomizerInstance();
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.ambari.logfeeder.output; import java.util.Map; import org.apache.ambari.logfeeder.input.InputMarker; /** * This contains the output json object and InputMarker. */ public class OutputData { Map<String, Object> jsonObj; InputMarker inputMarker; /** * @param jsonObj * @param inputMarker */ public OutputData(Map<String, Object> jsonObj, InputMarker inputMarker) { super(); this.jsonObj = jsonObj; this.inputMarker = inputMarker; } @Override public String toString() { return "OutputData [jsonObj=" + jsonObj + ", inputMarker=" + inputMarker + "]"; } }
0
byte[] data = (getClass().getName() + "#" + getCurrentTestName()).getBytes(StandardCharsets.UTF_8); byte[] bytes = data.getBytes(StandardCharsets.UTF_8); os.write(data.getBytes(StandardCharsets.UTF_8)); os.write((command + "\n").getBytes(StandardCharsets.UTF_8)); os.write((command + "\n").getBytes(StandardCharsets.UTF_8)); os.write(data.getBytes(StandardCharsets.UTF_8)); os.write("E\n".getBytes(StandardCharsets.UTF_8));
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.ambari.server.api.services; import org.springframework.security.core.context.SecurityContextHolder; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Response; /** * Service performing logout of current user */ @Path("/logout") public class LogoutService { @GET @Produces("text/plain") public Response performLogout() { SecurityContextHolder.clearContext(); return Response.status(Response.Status.OK).build(); } }
1
/** The connection manager, to get at the scheme registry. */ protected ClientConnectionManager connectionManager; /** The proxy selector to use, or <code>null</code> for system default. */ protected ProxySelector proxySelector; /** * Obtains the proxy selector to use. * * @return the proxy selector, or <code>null</code> for the system default */ public ProxySelector getProxySelector() { return this.proxySelector; } /** * Sets the proxy selector to use. * * @param psel the proxy selector, or * <code>null</code> to use the system default */ public void setProxySelector(ProxySelector psel) { this.proxySelector = psel; } ProxySelector psel = this.proxySelector; if (psel == null) psel = ProxySelector.getDefault();
0
import org.apache.hc.core5.http.nio.AsyncClientExchangeHandler; private void failPendingCommands(final Exception cause) { for (;;) { final Command command = ioSession.getCommand(); if (command != null) { if (command instanceof ExecutionCommand) { final ExecutionCommand executionCommand = (ExecutionCommand) command; final AsyncClientExchangeHandler exchangeHandler = executionCommand.getExchangeHandler(); exchangeHandler.failed(cause); } else { command.cancel(); } } else { break; } } } failPendingCommands(cause);
0
package org.apache.beam.sdk.extensions.sql.interpreter.operator.arithmetic; import org.apache.beam.sdk.extensions.sql.interpreter.operator.BeamSqlExpression;
0
import java.io.IOException; ByteArrayOutputStream baos = getByteArrayOutputStream(numWrites); @Test public void defaultConstructor() throws IOException { final AtomicInteger numWrites = new AtomicInteger(); ByteArrayOutputStream baos = getByteArrayOutputStream(numWrites); ChunkedOutputStream chunked = new ChunkedOutputStream(baos); chunked.write(new byte[1024 * 4 + 1]); assertEquals(2, numWrites.get()); } private ByteArrayOutputStream getByteArrayOutputStream(final AtomicInteger numWrites) { return new ByteArrayOutputStream() { @Override public void write(byte[] b, int off, int len) { numWrites.incrementAndGet(); super.write(b, off, len); } }; }
0
* Constrast this with {@link #decorateTransform}. /** * Factory method to create a transforming sorted bag that will transform * existing contents of the specified sorted bag. * <p> * If there are any elements already in the bag being decorated, they * will be transformed by this method. * Constrast this with {@link #decorate}. * * @param bag the bag to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null * @return a new transformed SortedBag * @throws IllegalArgumentException if bag or transformer is null * @since Commons Collections 3.3 */ public static SortedBag decorateTransform(SortedBag bag, Transformer transformer) { TransformedSortedBag decorated = new TransformedSortedBag(bag, transformer); if (transformer != null && bag != null && bag.size() > 0) { Object[] values = bag.toArray(); bag.clear(); for(int i=0; i<values.length; i++) { decorated.getCollection().add(transformer.transform(values[i])); } } return decorated; }
0
* Copyright (c) 2004 The Apache Software Foundation. All rights * @version $Id: EnterpriseUnixFTPEntryParser.java,v 1.3 2004/01/01 21:04:18 scohen Exp $
0
// Clean up the bundle context, if necessary. if (info.getContext() != null) { ((BundleContextImpl) info.getContext()).invalidate(); info.setContext(null); } // Clean up the bundle context, if necessary. if (info.getContext() != null) { ((BundleContextImpl) info.getContext()).invalidate(); info.setContext(null); }
0
import org.apache.accumulo.core.util.UtilWaitThread; while (!dfs.recoverLease(source)) { log.info("Waiting for file to be closed " + source.toString()); UtilWaitThread.sleep(1000); }
0
* @deprecated (4.0) use {@link #writeTo(OutputStream)}
0
import static java.nio.charset.StandardCharsets.UTF_8; public int hashCode() { return super.hashCode(); } @Override throw new IllegalArgumentException("ConditionalMutation had no conditions " + new String(mut.getRow(), UTF_8));
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.jet; import org.apache.beam.sdk.options.Default; import org.apache.beam.sdk.options.Description; import org.apache.beam.sdk.options.PipelineOptions; import org.apache.beam.sdk.options.Validation; /** Pipeline options specific to the Jet runner. */ public interface JetPipelineOptions extends PipelineOptions { @Description("Name of Jet group") @Validation.Required String getJetGroupName(); void setJetGroupName(String jetGroupName); @Description("Local parallelism of Jet nodes") @Validation.Required @Default.Integer(-1) Integer getJetLocalParallelism(); void setJetLocalParallelism(Integer localParallelism); @Description( "Specifies if the Runner should start its own Jet cluster") // todo: this is a hack, we will // need to use a real, stand-alone // cluster and submit the runner // code in a Jar to it + connect // via network @Validation.Required @Default.Boolean(true) Boolean getJetStartOwnCluster(); void setJetStartOwnCluster(Boolean startOwnCluser); }
0
handler = this.getComponentHandler( componentClass, final AbstractComponentHandler handler = this.getComponentHandler( component,
0
@Deprecated
0
", \"firewallRunning\": \"true\", \"firewallName\": \"iptables\", \"transparentHugePage\": \"never\", \"hasUnlimitedJcePolicy\" : true}"; Assert.assertTrue(agentEnv.getHasUnlimitedJcePolicy());
0
* @version $Revision: 1.10 $ $Date: 2004/04/16 23:53:59 $ if (size >= maxSize && removeLRU(header.after)) {
0
* server side action directory path */ protected File serverActionsDir; /** * Server actions directory name */ protected static final String SERVER_ACTIONS_FOLDER_NAME = "server_actions"; /** * Obtain the server side actions directory path. * * @return server side actions directory path */ public File getServerActionsDir() { return serverActionsDir; } /** calculateServerActionsDirectory(stack, service); * Sets the serverActionsDir if the dir exists and is not empty * @param stack * @param service */ protected void calculateServerActionsDirectory(String stack, String service) { serverActionsDir = resolveDirectory(SERVER_ACTIONS_FOLDER_NAME, stack, service); } /**
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/xml/JDOMParser.java,v 1.2 2003/01/11 05:41:27 dmitri Exp $ * $Revision: 1.2 $ * $Date: 2003/01/11 05:41:27 $ * @version $Revision: 1.2 $ $Date: 2003/01/11 05:41:27 $ public Object parseXML(InputStream stream) { catch (Exception ex) {
1
/** * The text of the override style declaration for this element has been * modified. */ void overrideStyleTextChanged(CSSStylableElement e, String text); /** * A property in the override style declaration has been removed. */ void overrideStylePropertyRemoved(CSSStylableElement e, String name); /** * A property in the override style declaration has been changed. */ void overrideStylePropertyChanged(CSSStylableElement e, String name, String val, String prio);
0
* * * * * * Returns the byte array containing the field of row key from the given DataInputStream din. Assumes that din first has the length of the field, followed by * the field itself. throw new IOException(String.format("Expected to read %d bytes but read %d", len, readLen));
0
* * * * * that can be retrieved from the specified URI. * can be created quickly. Form createForm(String uri) throws Exception; * that can be read from the specified source. * * <p>To avoid having to resolve the Source object yourself, * use the {@link #createForm(String)} method. * can be created quickly. Form createForm(Source source) throws Exception; * <p>The Form Definition will <b>not</b> be cached. * Creates a form definition based on the XML form definition * that can be retrieved from the specified URI. * <p>The root element must be a &lt;fd:form&gt; element. * * <p>The form definition will be cached, so that future form instances * can be created quickly. FormDefinition createFormDefinition(String uri) throws Exception; * that can be retrieved from the specified source. * <p>To avoid having to resolve the Source object yourself, * use the {@link #createFormDefinition(String)} method. * * <p>The root element must be a &lt;fd:form&gt; element. * * <p>The form definition will be cached, so that future form instances * can be created quickly. */ FormDefinition createFormDefinition(Source source) throws Exception; /** * Creates a form definition based on the XML form definition that is * supplied as a DOM tree. * * <p>The specified element must be a &lt;fd:form&gt; element. * * <p>The Form Definition will <b>not</b> be cached. FormDefinition createFormDefinition(Element formElement) throws Exception;
0
WindowedStream<StreamingWindowedElement<LABEL, Pair<KEY, VALUE>>, DataStream<StreamingWindowedElement<LABEL, Pair<KEY, VALUE>>> mapped return new StreamingWindowedElement<>(wid, Pair.of(key, val)) final KeyedStream<StreamingWindowedElement<LABEL, Pair<KEY, VALUE>>, KEY> keyed; KeySelector<StreamingWindowedElement<LABEL, Pair<KEY, VALUE>>, KEY> public KEY getKey(StreamingWindowedElement<LABEL, Pair<KEY, VALUE>> value)
0
String handle = (String) properties.get(CLUSTER_HANDLE_PROPERTY_ID); if (handle != null) { viewInstanceEntity.setClusterHandle(Long.valueOf(handle)); } else { viewInstanceEntity.setClusterHandle(null);
0
@Override public void close() { consumerConnector.shutdown(); }
0
public class C14N11Test extends org.junit.Assert { public C14N11Test() throws Exception { dir = new File(base + fs + "data" + fs + "interop" + fs + "xmldsig" + fs + "c14n11"); sks = new KeySelectors.SecretKeySelector("secret".getBytes("ASCII")); @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test @org.junit.Test String[] vendors = {"IAIK", "IBM", "ORCL", "SUN", "UPC"}; @org.junit.Test String[] vendors = {"IAIK", "IBM", "ORCL", "SUN"}; @org.junit.Test String[] vendors = {"IAIK", "IBM", "ORCL", "SUN", "UPC"}; for (int i = 0; i < vendors.length; i++) { String file = test + "-" + vendors[i] + ".xml"; // System.out.println("Validating " + file); } for (int i = 0; i < vendors.length; i++) { String file = test + "-" + vendors[i] + ".xml"; // System.out.println("Validating " + file); }
0
package org.apache.beam.sdk.io.range;
0
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; SourceUtil.toSAX(this.manager, source, null, annotationsFilter); EnvironmentHelper.enterProcessor(this, env); /** * @see org.apache.cocoon.Processor#getBeanFactory() */ public ConfigurableListableBeanFactory getBeanFactory() { if ( this.concreteProcessor != null ) { return this.concreteProcessor.getBeanFactory(); } if ( parent != null ) { return this.parent.getBeanFactory(); } return null; } /** * @see org.apache.cocoon.Processor#getParent() */ public Processor getParent() { return this.parent; }
0
* @throws IllegalArgumentException if the initial capacity is negative * @throws IllegalArgumentException if the initial capacity is negative
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.annotations.VisibleForTesting;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/java/org/apache/commons/beanutils/converters/BigIntegerConverter.java,v 1.3 2002/07/13 02:22:08 craigmcc Exp $ * $Revision: 1.3 $ * $Date: 2002/07/13 02:22:08 $ * @version $Revision: 1.3 $ $Date: 2002/07/13 02:22:08 $ if (value instanceof BigInteger) { return (value); } return (new BigInteger(value.toString()));
0
package org.apache.xml.security.stax.test; import org.apache.xml.security.stax.impl.util.IVSplittingOutputStream; import org.apache.xml.security.stax.impl.util.ReplaceableOuputStream;
0
package org.apache.hc.core5.testing.nio; import org.apache.hc.core5.function.Callback; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class LoggingExceptionCallback implements Callback<Exception> { public final static LoggingExceptionCallback INSTANCE = new LoggingExceptionCallback(); private final Logger log = LoggerFactory.getLogger("org.apache.hc.core5.reactor"); private LoggingExceptionCallback() { @Override public void execute(final Exception ex) { log.error(ex.getMessage(), ex);
0
import org.apache.accumulo.fate.zookeeper.ZooUtil;
0
import org.apache.http.impl.conn.DefaultClientConnectionOperator;
0
import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; private NotificationConsumer<EntityNotification> notificationConsumer; notificationConsumer = consumers.iterator().next(); waitForNotification(notificationConsumer, MAX_WAIT_TIME, newNotificationPredicate(EntityNotification.OperationType.ENTITY_CREATE, HIVE_TABLE_TYPE, guid)); waitForNotification(notificationConsumer, MAX_WAIT_TIME, newNotificationPredicate(EntityNotification.OperationType.ENTITY_UPDATE, HIVE_TABLE_TYPE, guid)); EntityNotification entityNotification = waitForNotification(notificationConsumer, MAX_WAIT_TIME, newNotificationPredicate(EntityNotification.OperationType.TRAIT_ADD, HIVE_TABLE_TYPE, guid)); entityNotification = waitForNotification(notificationConsumer, MAX_WAIT_TIME, newNotificationPredicate(EntityNotification.OperationType.TRAIT_ADD, HIVE_TABLE_TYPE, guid)); EntityNotification entityNotification = waitForNotification(notificationConsumer, MAX_WAIT_TIME, newNotificationPredicate(EntityNotification.OperationType.TRAIT_DELETE, HIVE_TABLE_TYPE, guid)); assertFalse(entityNotification.getEntity().getTraits().contains(traitName));
0