Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
ClusterInformation clusterInformation = cluster.buildClusterInformation();
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: UniqueFieldJXPathBindingBuilder.java,v 1.2 2004/03/05 13:02:27 bdelacretaz Exp $
1
* The units values. */ protected final static String[] UNITS_VALUES = { "", SVG_USER_SPACE_ON_USE_VALUE, SVG_STROKE_WIDTH_ATTRIBUTE }; /** return getAnimatedLengthAttribute (null, SVG_REF_X_ATTRIBUTE, SVG_MARKER_REF_X_DEFAULT_VALUE, SVGOMAnimatedLength.HORIZONTAL_LENGTH); return getAnimatedLengthAttribute (null, SVG_REF_Y_ATTRIBUTE, SVG_MARKER_REF_Y_DEFAULT_VALUE, SVGOMAnimatedLength.VERTICAL_LENGTH); return getAnimatedEnumerationAttribute (null, SVG_MARKER_UNITS_ATTRIBUTE, UNITS_VALUES, (short)2); return getAnimatedLengthAttribute (null, SVG_MARKER_WIDTH_ATTRIBUTE, SVG_MARKER_MARKER_WIDTH_DEFAULT_VALUE, SVGOMAnimatedLength.HORIZONTAL_LENGTH); return getAnimatedLengthAttribute (null, SVG_MARKER_HEIGHT_ATTRIBUTE, SVG_MARKER_MARKER_HEIGHT_DEFAULT_VALUE, SVGOMAnimatedLength.VERTICAL_LENGTH); * <b>DOM</b>: Implements {@link * SVGMarkerElement#setOrientToAngle(SVGAngle)}.
0
public List<ServiceInfo> getSupportedServices(String stackName, String version) throws AmbariException { public List<String> getMonitoringServiceNames(String stackName, String version) throws AmbariException{ List<String> monitoringServices = new ArrayList<String>(); for (ServiceInfo service : getSupportedServices(stackName, version)) { if (service.isMonitoringService()) { monitoringServices.add(service.getName()); } } return monitoringServices; }
0
public void testHiveWithoutAtlas() throws Exception { Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>(); Map<String, String> hiveProperties = new HashMap<String, String>(); hiveProperties.put("hive.exec.post.hooks", ""); hiveProperties.put("atlas.cluster.name", "primary"); hiveProperties.put("atlas.rest.address", "http://localhost:21000"); properties.put("hive-site", hiveProperties); Map<String, Map<String, String>> parentProperties = new HashMap<String, Map<String, String>>(); Configuration parentClusterConfig = new Configuration(parentProperties, Collections.<String, Map<String, Map<String, String>>>emptyMap()); Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap(), parentClusterConfig); Collection<String> hgComponents1 = new HashSet<String>(); hgComponents1.add("HIVE_SERVER"); TestHostGroup group1 = new TestHostGroup("group1", hgComponents1, Collections.singleton("host1")); Collection<TestHostGroup> hostGroups = Collections.singletonList(group1); ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups); BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology); configProcessor.doUpdateForClusterCreate(); assertEquals("http://localhost:21000", clusterConfig.getPropertyValue("hive-site", "atlas.rest.address")); } @Test
0
BulkIT.runTest(getConnector(), cluster.getFileSystem(), new Path(getCluster().getConfig().getDir().getAbsolutePath(), "tmp"), "root", getUniqueNames(1)[0], this.getClass().getName(), testName.getMethodName());
0
if (viewEntity.isDeployed()) { if (viewEntity.getResourceType().equals(resourceTypeEntity)) { return viewEntity; }
0
return EdDSASecurityProvider.recoverEDDSAPublicKey(prvKey);
0
public class ResourceDependencyTest extends Base {
0
* <p>The caller of {@code ParDo} uses {@link ParDo.SingleOutput#withOutputTags} to * @see ParDo.SingleOutput#withOutputTags * @see ParDo.SingleOutput#withOutputTags * @see ParDo.SingleOutput#withSideInputs
0
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
0
/* * I/O operations may not be performed if this flag is set to false * All methods must call #assertOpen() to ensure the connection * is open prior to performing any I/O */ protected volatile boolean open; protected Socket socket = null; protected HttpDataTransmitter datatransmitter = null; protected HttpDataReceiver datareceiver = null; if (this.open) { if (!this.open) { this.open = true; return this.open; this.open = false; synchronized (this) { HttpDataTransmitter tmptransmitter = this.datatransmitter; Socket tmpsocket = this.socket; this.datareceiver = null; this.datatransmitter = null; this.socket = null; if (tmptransmitter != null) { tmptransmitter.flush(); } if (tmpsocket != null) { try { tmpsocket.shutdownOutput(); } catch (IOException ignore) { } try { tmpsocket.shutdownInput(); } catch (IOException ignore) { } tmpsocket.close(); }
0
import org.apache.sshd.server.forward.AcceptAllForwardingFilter; import org.apache.sshd.server.forward.RejectAllForwardingFilter; import org.apache.sshd.server.forward.StaticDecisionForwardingFilter; testStaticDecisionForwardingFilter(AcceptAllForwardingFilter.INSTANCE, true); testStaticDecisionForwardingFilter(RejectAllForwardingFilter.INSTANCE, false);
0
import org.apache.accumulo.core.client.impl.ClientConfConverter; instance = new ZooKeeperInstance(ClientConfConverter.toClientConf(props));
0
Step[] steps) boolean firstMatch) // This is an optimization. We can avoid iterating through a
0
* inside some block, function or iteration. It operates an input object.</p> * {@link ClosureUtils}. These include method invocation and for/while loops.</p>
0
* if 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 $Id: TestNullComparator.java,v 1.5 2003/08/31 17:28:46 scolebourne Exp $
0
public static String getWarPath() { return System.getProperty("projectBaseDir") + String.format("/webapp/target/atlas-webapp-%s", System.getProperty("project.version")); }
0
private static final String WATERMARK_METRIC_SUFFIX = "windmill-data-watermark"; private static final long MAX_WATERMARK_VALUE = -2L; result = checkMaxWatermark(job); if (result.isPresent()) { return result; } if (!job.getState().isTerminal()) { LOG.info("Cancelling Dataflow job {}", job.getJobId()); job.cancel(); } if (metric.getName() == null || metric.getName().getContext() == null } else if (successes > 0 && successes >= expectedNumberOfAssertions) { Optional<Boolean> checkMaxWatermark(DataflowPipelineJob job) throws IOException { State state = job.getState(); if (state == State.FAILED || state == State.CANCELLED) { LOG.info("The pipeline {}", state); return Optional.of(false); } JobMetrics metrics = options.getDataflowClient().projects().jobs() .getMetrics(job.getProjectId(), job.getJobId()).execute(); if (metrics == null || metrics.getMetrics() == null) { LOG.warn("Metrics not present for Dataflow job {}.", job.getJobId()); } else { boolean hasMaxWatermark = false; for (MetricUpdate metric : metrics.getMetrics()) { if (metric.getName() == null || metric.getName().getName() == null || !metric.getName().getName().endsWith(WATERMARK_METRIC_SUFFIX) || metric.getScalar() == null) { continue; } BigDecimal watermark = (BigDecimal) metric.getScalar(); hasMaxWatermark = watermark.longValue() == MAX_WATERMARK_VALUE; if (!hasMaxWatermark) { break; } } if (hasMaxWatermark) { LOG.info("All watermarks of job {} reach to max value.", job.getJobId()); return Optional.of(true); } } return Optional.absent(); }
0
import org.apache.aurora.scheduler.storage.entities.IConfigRewrite; import org.apache.aurora.scheduler.storage.entities.IInstanceConfigRewrite; import org.apache.aurora.scheduler.storage.entities.IInstanceKey; import org.apache.aurora.scheduler.storage.entities.IJobConfigRewrite; Optional<String> error = rewriteConfig(IConfigRewrite.build(command), storeProvider); private Optional<String> rewriteJob(IJobConfigRewrite jobRewrite, CronJobStore.Mutable jobStore) { IJobConfiguration existingJob = jobRewrite.getOldJob(); rewrittenJob = ConfigurationManager.validateAndPopulate(jobRewrite.getRewrittenJob()); IInstanceConfigRewrite instanceRewrite, IInstanceKey instanceKey = instanceRewrite.getInstanceKey(); Query.instanceScoped(instanceKey.getJobKey(), if (task.get().getTask().equals(instanceRewrite.getOldTask())) { ITaskConfig newConfiguration = instanceRewrite.getRewrittenTask(); IConfigRewrite command, if (settings.getBlockIfNoPulsesAfterMs() < 0) {
0
import org.apache.ambari.server.AmbariException; public void testAuthenticateMatchingDN() throws Exception { testAuthenticate("uid=the allowedUser,ou=the people,dc=ambari,dc=the apache,dc=org"); } @Test public void testAuthenticateNullDN() throws Exception { testAuthenticate(null); } @Test(expected = InvalidUsernamePasswordCombinationException.class) public void testAuthenticateNonMatchingDN() throws Exception { testAuthenticate("This is not a matching DN"); } private void testAuthenticate(String dn) throws AmbariException { users.addLdapAuthentication(userEntity, dn);
0
/* ==================================================================== * Copyright (c) 2003-2004 The Apache Software Foundation. All rights * @version $Revision: 1.5 $ $Date: 2004/01/14 21:34:35 $
0
import java.util.LinkedHashMap; private Map<String, String> env = new LinkedHashMap<String, String>(); public void setEnv(String key, String value) { env.put(key, value); } if (!env.isEmpty()) { log.info("Send SSH_MSG_CHANNEL_REQUEST env"); for (Map.Entry<String, String> entry : env.entrySet()) { buffer = session.createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_REQUEST, 0); buffer.putInt(recipient); buffer.putString("env"); buffer.putBoolean(false); buffer.putString(entry.getKey()); buffer.putString(entry.getValue()); session.writePacket(buffer); } }
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: AttributesImpl.java,v 1.4 2004/03/05 13:03:01 bdelacretaz Exp $
1
public UnboundedFifoBuffer(final int initialSize) { private void writeObject(final ObjectOutputStream out) throws IOException { for (final E e : this) { private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { final int size = in.readInt(); final int length = in.readInt(); final E[] tmp = (E[]) new Object[(buffer.length - 1) * 2 + 1]; final E element = buffer[head];
0
this(doc, XMLSignature.ALGO_ID_SIGNATURE_DSA, Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS); Document doc, String SignatureMethodURI, String CanonicalizationMethodURI) this(doc, SignatureMethodURI, 0, CanonicalizationMethodURI); Document doc, String SignatureMethodURI, int HMACOutputLength, String CanonicalizationMethodURI)
0
if (_socket_ != null) _socket_.close(); if (_input_ != null) _input_.close(); if (_output_ != null) _output_.close(); if (_socket_ != null) _socket_ = null;
0
@Component(name="factory", publicFactory=true)
0
if (zks == null || !zks.isRunning()) {
1
private static final Arg<Class<? extends Filter>> SHIRO_AFTER_AUTH_FILTER = Arg.create(null); interface Params { Set<Module> shiroRealmModule(); Optional<Class<? extends Filter>> shiroAfterAuthFilter(); HttpAuthenticationMechanism httpAuthenticationMechanism(); } this(new Params() { @Override public Set<Module> shiroRealmModule() { return SHIRO_REALM_MODULE.get(); } @Override public Optional<Class<? extends Filter>> shiroAfterAuthFilter() { return Optional.ofNullable(SHIRO_AFTER_AUTH_FILTER.get()); } @Override public HttpAuthenticationMechanism httpAuthenticationMechanism() { return HTTP_AUTHENTICATION_MECHANISM.get(); } }); } public HttpSecurityModule(Params params) { params.httpAuthenticationMechanism(), params.shiroRealmModule(), params.shiroAfterAuthFilter().map(Key::get)); Optional<Key<? extends Filter>> shiroAfterAuthFilterKey) { Optional<Key<? extends Filter>> shiroAfterAuthFilterKey) { this.shiroAfterAuthFilterKey = requireNonNull(shiroAfterAuthFilterKey);
0
Copyright 2001 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
return new LinkedList<>(); final List<T> list = new LinkedList<>();
1
* @since 1.0.0
0
private static final int SLEEP_MILLIS = 100; private static final int EXEC_BUFFER_SIZE = 128; * * @throws FileSystemException if a session cannot be created. * @throws IOException if an I/O error is detected. * Ensures that the session link is established. * * @throws FileSystemException if a session cannot be created. * Last modification time is only an int and in seconds, thus can be off by 999. * @throws JSchException If a problem occurs while retrieving the group IDs. * @throws IOException if an I/O error is detected. * @since 2.1 * @throws JSchException If a problem occurs while retrieving the group ID. * @throws IOException if an I/O error is detected. * @since 2.1 throw new FileSystemException("Could not get the user id of the current user (error code: " + code + ")"); * @throws JSchException if a JSch error is detected. * @throws FileSystemException if a session cannot be created. * @throws IOException if an I/O error is detected. char[] buffer = new char[EXEC_BUFFER_SIZE]; Thread.sleep(SLEEP_MILLIS);
0
import org.easymock.EasyMockSupport; public class UpdateKerberosConfigsServerActionTest extends EasyMockSupport{ final AmbariManagementController controller = createNiceMock(AmbariManagementController.class); final Clusters clusters = createNiceMock(Clusters.class); final Cluster cluster = createNiceMock(Cluster.class); bind(ConfigHelper.class).toInstance(createNiceMock(ConfigHelper.class)); setupConfigDat(); action = injector.getInstance(UpdateKerberosConfigsServerAction.class); File configFile = new File(dataDir, KerberosConfigDataFileWriter.DATA_FILE_NAME); KerberosConfigDataFileWriterFactory factory = injector.getInstance(KerberosConfigDataFileWriterFactory.class); KerberosConfigDataFileWriter writer = factory.createKerberosConfigDataFileWriter(configFile); writer.addRecord("hdfs-site", "hadoop.security.authentication", "kerberos", KerberosConfigDataFileWriter.OPERATION_TYPE_SET); writer.addRecord("hdfs-site", "remove.me", null, KerberosConfigDataFileWriter.OPERATION_TYPE_REMOVE); writer.close(); ExecutionCommand executionCommand = new ExecutionCommand(); ConfigHelper configHelper = injector.getInstance(ConfigHelper.class); configHelper.updateConfigType(anyObject(Cluster.class), anyObject(AmbariManagementController.class), anyObject(String.class), anyObject(Map.class), anyObject(Collection.class), anyObject(String.class), anyObject(String.class)); expectLastCall().atLeastOnce(); replayAll(); action.setExecutionCommand(executionCommand); action.execute(null); verifyAll(); replayAll(); verifyAll(); replayAll(); verifyAll();
0
import org.apache.batik.ext.awt.image.renderable.TileRable; TileRable tileRable = new TileRable8Bit(tile, EVERYTHING, patternRegion, overflow); ColorSpace destCS = destCM.getColorSpace(); if (destCS == ColorSpace.getInstance(ColorSpace.CS_sRGB)) tileRable.setColorSpaceLinear(false); else if (destCS == ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB)) tileRable.setColorSpaceLinear(true); RenderContext rc = new RenderContext(usr2dev, EVERYTHING, hints); if(tiled == null) { return; rasterCM = tiled.getColorModel(); if (rasterCM.hasAlpha()) { if (destCM.hasAlpha()) rasterCM = GraphicsUtil.coerceColorModel (rasterCM, destCM.isAlphaPremultiplied()); else rasterCM = GraphicsUtil.coerceColorModel(rasterCM, false); }
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
@Command(scope = "config", name = "propset", description = "Sets a property in the currently edited configuration.") @Argument(index = 0, name = "property", description = "The name of the property to set", required = true, multiValued = false) @Argument(index = 1, name = "value", description = "The value of the property", required = true, multiValued = false)
0
String table = getUniqueNames(1)[0]; String table = getUniqueNames(1)[0];
0
package org.apache.ambari.metrics.core.timeline.uuid; import org.apache.ambari.metrics.core.timeline.aggregators.TimelineClusterMetric;
0
import com.google.cloud.dataflow.sdk.runners.PipelineRunner; * <p>To use {@link XmlSource}: * <ol> * <li>Explicitly declare a dependency on org.codehaus.woodstox:stax2-api</li> * <li>Include a compatible implementation on the classpath at run-time, * such as org.codehaus.woodstox:woodstox-core-asl</li> * </ol> * * <p>These dependencies have been declared as optional in Maven sdk/pom.xml file of * Google Cloud Dataflow. * {@link PipelineRunner PipelineRunners} for more details.
0
* Get latest (including inactive ones) configurations with any of the given types. * This method does not take into account the configuration being enabled. * @return the list of configurations with the given types */ List<Config> getLatestConfigsWithTypes(Collection<String> types); /**
0
package org.apache.accumulo.monitor.servlets; import org.apache.accumulo.monitor.Monitor; import org.apache.accumulo.monitor.util.Table; import org.apache.accumulo.monitor.util.celltypes.DateTimeType; import org.apache.accumulo.monitor.util.celltypes.DurationType; import org.apache.accumulo.monitor.util.celltypes.NumberType; @Override @Override
1
import java.io.ByteArrayInputStream; import java.io.DataInputStream; import org.apache.accumulo.server.master.tableOps.CompactRange.CompactionIterators; CompactionIterators iters = new CompactionIterators(); if (tokens.length > 1) { ByteArrayInputStream bais = new ByteArrayInputStream(hex.decode(tokens[1].split("=")[1].getBytes())); DataInputStream dis = new DataInputStream(bais); try { iters.readFields(dis); } catch (IOException e) { throw new RuntimeException(e); } KeyExtent ke = new KeyExtent(extent.getTableId(), iters.getEndRow(), iters.getStartRow()); if (!ke.overlaps(extent)) { // only use iterators if compaction range overlaps iters = new CompactionIterators(); } return new Pair<Long,List<IteratorSetting>>(compactID, iters.getIterators()); + datafileManager.abs2rel(new Path(compactTmpName)) + " " + compactionIterators);
0
import java.security.SecureRandom; Random rand = new SecureRandom();
0
* HTTP entity serializer. * This entity serializer currently supports "chunked" and "identitiy" * transfer-coding and content length delimited content. * <p> * This class relies on a specific implementation of * {@link ContentLengthStrategy} to determine the content length or transfer * encoding of the entity. * <p> * This class writes out the content of {@link HttpEntity} to the data stream * using a transfer coding based on properties on the HTTP message. /** * Creates a transfer codec based on properties of the given HTTP message * and returns {@link OutputStream} instance that transparently encodes * output data as it is being written out to the output stream. * <p> * This method is called by the public * {@link #serialize(SessionOutputBuffer, HttpMessage, HttpEntity)}. * * @param outbuffer the session output buffer. * @param message the HTTP message. * @return output stream. * @throws HttpException in case of HTTP protocol violation. * @throws IOException in case of an I/O error. */ /** * Writes out the content of the given HTTP entity to the session output * buffer based on properties of the given HTTP message. * * @param outbuffer the output session buffer. * @param message the HTTP message. * @param entity the HTTP entity to be written out. * @throws HttpException in case of HTTP protocol violation. * @throws IOException in case of an I/O error. */
0
/* $Id$ *
0
import org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.Struct;
0
public void addChild(Component component, Object constraints) throws JellyException {
0
* @throws SQLException - if a database access error occurs
0
File f = new File(location, "etc/org.apache.felix.karaf.shell.cfg"); File f = new File(location, "etc/org.apache.felix.karaf.shell.cfg"); File libDir = new File(System.getProperty("karaf.home"), "lib"); + " -Dkaraf.home=\"" + System.getProperty("karaf.home") + "\"" + " -Dkaraf.base=\"" + new File(location).getCanonicalPath() + "\"" + " -Dkaraf.startLocalConsole=false" + " -Dkaraf.startRemoteShell=true"
0
public void complete() throws IOException { public String toString() {
0
* Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not 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 * 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.metrics.MetricResults; public MetricResults metrics() { throw new UnsupportedOperationException("The SparkRunner does not currently support metrics."); } @Override
0
Copyright 2001 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
@Column(name = "notification_id", nullable = false, updatable = false)
0
import static org.easymock.EasyMock.capture; import static org.easymock.EasyMock.expect; import static org.easymock.EasyMock.newCapture; import static org.easymock.EasyMock.replay; import static org.easymock.EasyMock.reset;
0
import org.apache.accumulo.core.metadata.MetadataTable; import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection; if (TabletsSection.TabletColumnFamily.PREV_ROW_COLUMN.equals(new Text(cu.getColumnFamily()), new Text(cu.getColumnQualifier())) && !cu.isDeleted()) {
1
import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.ConfigurationCopy; import org.apache.accumulo.core.conf.Property; @Test(expected = IllegalArgumentException.class) public void noViewFS() throws Exception { ConfigurationCopy conf = new ConfigurationCopy(); conf.set(Property.INSTANCE_VOLUMES, "viewfs://dummy"); VolumeManagerImpl.get(conf); }
0
import java.awt.geom.AffineTransform; import java.awt.RenderingHints; public DynamicRenderer(RenderingHints rh, AffineTransform at){ super(rh, at);
0
import org.apache.commons.lang3.StringUtils; public static final String PROP_START_LEVEL_BEGINNING = "org.osgi.framework.startlevel.beginning"; private String beginningStartLevel; this.beginningStartLevel = getBeginningStartLevel(); LOG.debug("Activated targetStartLevel={}, beginningStartLevel={}, ", targetStartLevel, beginningStartLevel); private String getBeginningStartLevel() { String beginningStartLevel = StringUtils.defaultIfBlank(bundleContext.getProperty(PROP_START_LEVEL_BEGINNING), "<unknown>"); return beginningStartLevel; } String message = String.format(" (state: %s) Current Start Level: %d (Target: %d; Beginning: %s)", stateToStr(fsl.getBundle().getState()), fsl.getStartLevel(), targetStartLevel, beginningStartLevel); return new Result(Result.Status.OK, "Framework started" + message); return new Result(Result.Status.TEMPORARILY_UNAVAILABLE, "Framework NOT started" + message); private String stateToStr(int state) { switch(state) { case Bundle.ACTIVE: return "ACTIVE"; case Bundle.INSTALLED: return "INSTALLED"; case Bundle.RESOLVED: return "RESOLVED"; case Bundle.STARTING: return "STARTING"; case Bundle.STOPPING: return "STOPPING"; case Bundle.UNINSTALLED: return "UNINSTALLED"; default: return "unknown"; } }
0
KILL_TASK_AND_RESERVE(Optional.of(new KillTask(true))), KILL_TASK(Optional.of(new KillTask(false))),
0
import java.util.HashSet; import java.util.Map; public ZooKeeperServer getZooKeeperServer() { return zkServer; } public abstract void resetAllConnectionStats(); public abstract Iterable<Map<String, Object>> getAllConnectionInfo(boolean brief);
1
*/ * @version CVS $Id: DateSelector.java,v 1.2 2003/09/05 07:04:35 cziegeler Exp $
0
* @version CVS $Id: EPUIData.java,v 1.4 2004/01/31 08:50:39 antonio Exp $ public class EPUIData extends BaseElementProcessor { private NumericResult _selected_tab; public EPUIData() { * @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)); } // end public class EPUIData
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
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; /** Test behavior of operator {@code ReduceWindow}. */ Dataset<Long> output = ReduceWindow.of(dataset).valueBy(e -> "").reduceBy(e -> 1L).output(); assertEquals(1L, (long) collectSingle(producer.getReducer(), Stream.of("blah"))); Dataset<Long> output = ReduceWindow.of(dataset).reduceBy(e -> 1L).windowBy(windowing).output(); assertEquals(1L, (long) collectSingle(producer.getReducer(), Stream.of("blah"))); Dataset<Long> output = ReduceWindow.of(dataset) .reduceBy(e -> 1L) .withSortedValues((l, r) -> l.compareTo(r)) .windowBy(windowing) .output(); Dataset<Long> output = ReduceWindow.of(dataset) .reduceBy(e -> 1L) .withSortedValues((l, r) -> l.compareTo(r)) .applyIf(true, b -> b.windowBy(windowing)) .output(); private <IN, OUT> OUT collectSingle(ReduceFunctor<IN, OUT> fn, Stream<IN> values) {
0
import jline.console.ConsoleReader;
0
import org.easymock.classextension.EasyMock;
0
public abstract class AbstractFileOperationProvider implements FileOperationProvider private final Collection<Class<? extends FileOperation>> operations = new ArrayList<Class<? extends FileOperation>>(); final Collection<Class<? extends FileOperation>> availableOperations, final Collection<Class<? extends FileOperation>> resultList,
0
(elt, w, h);
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
/** * Allows nested tags to set a property on the task object of this tag */ public void setTaskProperty(String name, Object value) throws Exception;
0
return this.clone();
0
* @see DOMConfiguration#DOMConfiguration(String)
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.felix.ipojo.runtime.core.test.components.filter; import org.apache.felix.ipojo.runtime.core.test.services.CheckService; import org.apache.felix.ipojo.runtime.core.test.services.FooService; import java.util.Properties; public class MultipleFilterCheckSubscriber implements CheckService { private FooService[] m_foo; private int bound; public MultipleFilterCheckSubscriber() { } public boolean check() { for (int i = 0; i < m_foo.length; i++) { m_foo[i].foo(); } return true; } public Properties getProps() { Properties props = new Properties(); props.put("Bind", new Integer(bound)); props.put("Size", new Integer(m_foo.length)); return props; } private void Bind() { bound++; } private void Unbind() { bound--; } }
0
import org.apache.commons.vfs.FileName; private static final char SEPARATOR_CHAR = FileName.SEPARATOR_CHAR; if ( name.charAt( 0 ) == SEPARATOR_CHAR ) if ( name.charAt( pos ) == SEPARATOR_CHAR ) if ( path.charAt( 0 ) == SEPARATOR_CHAR ) for ( ; endElem < maxlen && path.charAt( endElem ) != SEPARATOR_CHAR; endElem++ ) for ( ; pos >= 0 && path.charAt( pos ) != SEPARATOR_CHAR; pos-- ) if ( maxlen > 0 && path.charAt( maxlen - 1 ) == SEPARATOR_CHAR && maxlen > 1 ) name.setCharAt( i, SEPARATOR_CHAR );
0
} catch (IOException ex) { throw new ReferenceNotInitializedException(ex); } catch (ParserConfigurationException ex) { throw new ReferenceNotInitializedException(ex); } catch (SAXException ex) {
0
import org.apache.ambari.annotations.ApiIgnore; @GET @ApiIgnore // until documented @GET @ApiIgnore // until documented
0
/** * Copyright 2016 Seznam.cz, a.s. * * 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 cz.seznam.euphoria.core.client.dataset.windowing; class TimestampedElement<W extends Window, T> implements WindowedElement<W, T> { private final long timestamp; public TimestampedElement(long timestamp) { this.timestamp = timestamp; } @Override public W getWindow() { throw new UnsupportedOperationException(); } @Override public long getTimestamp() { return timestamp; } @Override public T getElement() { throw new UnsupportedOperationException(); } }
0
public void setUp() { public void tearDown() { public void close() {
0
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Splitter; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Strings; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.hash.Hashing;
0
/** {@link org.apache.commons.logging} logging facility */ static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(ExclusiveC14NInterop.class.getName()); log.debug("fixSubtree took " + (int) (end - start)); log.debug(" signature.checkSignatureValue finished: " + verify); log.debug("Reference " + i + " was OK"); log.debug("Reference " + i + " failed: " + algo);
0
* @version CVS $Id: TestPortlet.java,v 1.3 2004/03/04 09:17:04 cziegeler Exp $
0
import com.google.protobuf.Message; import org.apache.beam.sdk.coders.AvroCoder; import org.apache.beam.sdk.coders.StringUtf8Coder; import org.apache.beam.sdk.extensions.protobuf.ProtoCoder; /** * Returns A {@link PTransform} that continuously reads UTF-8 encoded strings from a Google Cloud * Pub/Sub stream. */ public static Read<String> readStrings() { return PubsubIO.<String>read().withCoder(StringUtf8Coder.of()); } /** * Returns A {@link PTransform} that continuously reads binary encoded protos of the given type * from a Google Cloud Pub/Sub stream. */ public static <T extends Message> Read<T> readProtos(Class<T> messageClass) { return PubsubIO.<T>read().withCoder(ProtoCoder.of(messageClass)); } /** * Returns A {@link PTransform} that continuously reads binary encoded Avro messages of the * given type from a Google Cloud Pub/Sub stream. */ public static <T extends Message> Read<T> readAvros(Class<T> clazz) { return PubsubIO.<T>read().withCoder(AvroCoder.of(clazz)); }
0
import org.apache.http.impl.bootstrap.HttpServer; public class HttpFileServer { ClassLoader cl = HttpFileServer.class.getClassLoader(); final HttpServer server = ServerBootstrap.bootstrap()
0
private final StringBuilder primary = new StringBuilder(getMaxCodeLen()); private final StringBuilder alternate = new StringBuilder(getMaxCodeLen());
0
Integer.valueOf(Byte.MAX_VALUE), Integer.valueOf(SftpConstants.MD5_QUICK_HASH_SIZE), Integer.valueOf(IoUtils.DEFAULT_COPY_SIZE), Integer.valueOf(Byte.SIZE * IoUtils.DEFAULT_COPY_SIZE) )); try (ByteArrayOutputStream baos = new ByteArrayOutputStream(dataSize + seed.length)) { try (SshClient client = SshClient.setUpDefaultClient()) { try (SftpClient sftp = session.createSftpClient()) { } catch (IOException e) { // expected - not allowed to hash a folder try (CloseableHandle dirHandle = sftp.openDir(srcFolder)) { } catch (IOException e) { // expected - not allowed to hash a folder try (CloseableHandle fileHandle = sftp.open(srcPath, SftpClient.OpenMode.Read)) { for (byte[] qh : new byte[][]{GenericUtils.EMPTY_BYTE_ARRAY, quickHash}) { for (boolean useFile : new boolean[]{true, false}) { + " using " + type + " on " + srcFile + ": expected=" + BufferUtils.printHex(':', expectedHash) + ", actual=" + BufferUtils.printHex(':', actualHash));
1
// expected // expected
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: WebContinuation.java,v 1.7 2004/03/05 13:02:46 bdelacretaz Exp $
1
assertEquals(engine.getContext(),engine.get(JexlScriptEngine.CONTEXT_KEY));
0
protected String getQueryHint(Long startTime) { StringBuilder sb = new StringBuilder(); sb.append("/*+ "); sb.append("NATIVE_TIME_RANGE("); sb.append(startTime - nativeTimeRangeDelay); sb.append(") "); if (hBaseAccessor.isSkipBlockCacheForAggregatorsEnabled()) { sb.append("NO_CACHE "); } sb.append("*/"); return sb.toString(); }
0
/** * 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.aurora.common.stats; /** * A registry of stats. * * @author William Farner */ public interface StatRegistry { /** * Gets all stats in the registry. * * @return All registered stats. */ Iterable<RecordingStat<? extends Number>> getStats(); }
0
import com.google.common.collect.Iterables; Iterable<IScheduledTask> activeTasks = store.getTaskStore().fetchTasks(builder); if (Iterables.isEmpty(activeTasks)) {
0
return createTSCCM(schreg, -1, TimeUnit.MILLISECONDS); } public ThreadSafeClientConnManager createTSCCM(SchemeRegistry schreg, long connTTL, TimeUnit connTTLTimeUnit) { return new ThreadSafeClientConnManager(schreg, connTTL, connTTLTimeUnit); public void testCloseExpiredIdleConnections() throws Exception { @Test public void testCloseExpiredTTLConnections() throws Exception { ThreadSafeClientConnManager mgr = createTSCCM(null, 100, TimeUnit.MILLISECONDS); mgr.setMaxTotal(1); final HttpHost target = getServerHttp(); final HttpRoute route = new HttpRoute(target, null, false); ManagedClientConnection conn = getConnection(mgr, route); conn.open(route, httpContext, defaultParams); Assert.assertEquals("connectionsInPool", 1, mgr.getConnectionsInPool()); Assert.assertEquals("connectionsInPool(host)", 1, mgr.getConnectionsInPool(route)); // Release, let remain idle for forever mgr.releaseConnection(conn, -1, TimeUnit.MILLISECONDS); // Released, still active. Assert.assertEquals("connectionsInPool", 1, mgr.getConnectionsInPool()); Assert.assertEquals("connectionsInPool(host)", 1, mgr.getConnectionsInPool(route)); mgr.closeExpiredConnections(); // Time has not expired yet. Assert.assertEquals("connectionsInPool", 1, mgr.getConnectionsInPool()); Assert.assertEquals("connectionsInPool(host)", 1, mgr.getConnectionsInPool(route)); Thread.sleep(150); mgr.closeExpiredConnections(); // TTL expired now, connections are destroyed. Assert.assertEquals("connectionsInPool", 0, mgr.getConnectionsInPool()); Assert.assertEquals("connectionsInPool(host)", 0, mgr.getConnectionsInPool(route)); mgr.shutdown(); }
0
public static HostAndPort parseAddress(String address, boolean ignoreMissingPort)
0
* * @param convert The processor to use when converting a row into an * columns in the <code>ResultSet</code>. /** * Generates an <code>Iterable</code>, suitable for use in for-each loops. *
0
import org.apache.sshd.common.util.security.SecurityUtils;
0
import org.mockito.internal.util.reflection.Whitebox; Collections.emptyMap() /* sideInputId mapping */, Collections.emptyMap() /* sideInputId mapping */, Whitebox.setInternalState(operator, "stateRequestHandler", stateRequestHandler);
0
List<String> guids = repository.createEntities(typedInstance).getCreatedEntities();
0