Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
helper.createStack(stackId);
| 0 |
/** The compiled class. */
protected final Class clazz;
public QDoxJavaClassDescription(Class clazz, JavaSource source, JavaClassDescriptorManager m) {
this.clazz = clazz;
* @see org.apache.felix.scrplugin.tags.JavaClassDescription#getFieldByName(java.lang.String)
*/
public JavaField getFieldByName(String name)
throws MojoExecutionException {
final com.thoughtworks.qdox.model.JavaField field = this.javaClass.getFieldByName(name);
if ( field != null ) {
return new QDoxJavaField(field, this);
}
if ( this.getSuperClass() != null ) {
return this.getSuperClass().getFieldByName(name);
}
return null;
}
/**
/**
* @see java.lang.Object#toString()
*/
public Class getCompiledClass() {
return this.clazz;
} | 0 |
/**
* A Combiner that interprets Values as Longs and returns their sum.
*/ | 0 |
* </p> | 0 |
org.junit.Assume.assumeTrue(bcInstalled);
org.junit.Assume.assumeTrue(bcInstalled);
org.junit.Assume.assumeTrue(bcInstalled);
org.junit.Assume.assumeTrue(bcInstalled);
| 0 |
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.google.inject.Inject; | 0 |
setValidators(repeaterElement, repeaterDefinition); | 0 |
public LoggingIOSession(final IOSession session) {
this.wirelog = new Wire(LogFactory.getLog("org.apache.http.wire"), getId());
this.session.setEventMask(ops);
this.log.debug(getId() + " " + this.session + ": Event mask set " + formatOps(ops));
this.session.setEvent(op);
this.log.debug(getId() + " " + this.session + ": Event set " + formatOps(op));
this.session.clearEvent(op);
this.log.debug(getId() + " " + this.session + ": Event cleared " + formatOps(op));
this.log.debug(getId() + " " + this.session + ": Close");
this.log.debug(getId() + " " + this.session + ": Shutdown");
this.log.debug(getId() + " " + this.session + ": Set timeout " + timeout);
this.log.debug(getId() + " " + this.session + ": Set attribute " + name);
this.log.debug(getId() + " " + this.session + ": Remove attribute " + name);
private String getId() {
StringBuilder buf = new StringBuilder();
buf.append(getLocalAddress()).append("->").append(getRemoteAddress());
return buf.toString();
}
@Override
public String toString() {
return getId() + " " + this.session.toString();
}
log.debug(getId() + " " + session + ": " + bytesRead + " bytes read");
log.debug(getId() + " " + session + ": " + byteWritten + " bytes written");
log.debug(getId() + " " + session + ": Channel close"); | 0 |
for (char aPatArr : patArr) {
if (aPatArr == '*') { | 0 |
import org.springframework.web.context.support.ServletContextResourcePatternResolver;
final ServletContextResourcePatternResolver resolver = new ServletContextResourcePatternResolver(resourceLoader); | 0 |
if (LOG.isDebugEnabled()) {
if (LOG.isDebugEnabled()) {
if (LOG.isDebugEnabled()) { | 0 |
concreteLSInput.setByteStream(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("bindings/schemas/XMLSchema.dtd"));
concreteLSInput.setByteStream(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("bindings/schemas/XMLSchema.dtd"));
concreteLSInput.setByteStream(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("bindings/schemas/datatypes.dtd"));
concreteLSInput.setByteStream(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("bindings/schemas/xmldsig-core-schema.xsd"));
concreteLSInput.setByteStream(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("bindings/schemas/xml.xsd")); | 0 |
import org.apache.sshd.common.AlgorithmNameProvider;
* Signature interface for SSH used to sign or verify packets. Usually wraps a
* {@code javax.crypto.Signature} object. The reported algorithm name refers to
* the signature type being applied.
public interface Signature extends AlgorithmNameProvider { | 0 |
public static void main(final String[] argv) | 0 |
import java.nio.charset.StandardCharsets;
if (ok != null && ok.contains(key = new String(cv, StandardCharsets.UTF_8))) | 0 |
import org.apache.beam.sdk.values.PInput;
private final PTransform<PInput, PCollection<Row>> query; | 0 |
* Sets the filesCache implementation used to cache files.
* Get the cache strategy used.
* Get the file object decorator used.
* Set a fileObject decorator to be used for ALL returned file objects.
* configuration.
* Resolve the uri to a filename.
* Get the configuration builder for the given scheme. | 0 |
* Copyright (C) 2015 Google Inc. | 0 |
CharArrayBuffer current = null;
CharArrayBuffer previous = null;
if (current == null) {
current = new CharArrayBuffer(64);
} else {
current.clear();
}
int l = datareceiver.readLine(current);
if (l == -1 || current.length() < 1) {
if ((current.charAt(0) == ' ' || current.charAt(0) == '\t') && previous != null) {
int i = 0;
while (i < current.length()) {
char ch = current.charAt(i);
if (ch != ' ' && ch != '\t') {
break;
}
i++;
}
previous.append(' ');
previous.append(current.getBuffer(), i, current.length() - i);
headerLines.add(current);
previous = current;
current = null;
CharArrayBuffer buffer = (CharArrayBuffer) headerLines.get(i);
headers[i] = Header.parse(buffer.toString()); | 0 |
Map<Node, AggregatedLocation> predecessorLocationsMap = new HashMap<>();
Map<Node, AggregatedLocation> successorLocationsMap = new HashMap<>();
Map<Node, ExecutionLocation> deducedLocationsMap = new HashMap<>(); | 0 |
* @see ResultSetHandler#handle(ResultSet) | 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.logsearch.query.converter;
import org.apache.ambari.logsearch.model.request.impl.UserExportRequest;
import org.apache.ambari.logsearch.query.model.UserExportSearchCriteria;
import org.springframework.stereotype.Component;
@Component
public class UserExportRequestConverter extends AbstractCommonAuditLogRequestConverter<UserExportRequest, UserExportSearchCriteria> {
@Override
public UserExportSearchCriteria createCriteria(UserExportRequest request) {
UserExportSearchCriteria criteria = new UserExportSearchCriteria();
criteria.addParam("field", request.getField());
return criteria;
}
} | 0 |
public class TestCountingSource
extends UnboundedSource<KV<Integer, Integer>, TestCountingSource.CounterMark> {
TestCountingSource.finalizeTracker = finalizeTracker;
public TestCountingSource(int numMessagesPerShard) {
public TestCountingSource withDedup() {
return new TestCountingSource(numMessagesPerShard, shardNumber, true);
private TestCountingSource withShardNumber(int shardNumber) {
return new TestCountingSource(numMessagesPerShard, shardNumber, dedup);
private TestCountingSource(int numMessagesPerShard, int shardNumber, boolean dedup) {
public List<TestCountingSource> generateInitialSplits(
int desiredNumSplits, PipelineOptions options) {
List<TestCountingSource> splits = new ArrayList<>();
public TestCountingSource getCurrentSource() {
return TestCountingSource.this; | 0 |
* This class provides for binary compatibility between Commons Collections
* @param <E> the element type
* @param <E> the element type | 0 |
* Note that this one is not mentioned in documentation due to high number of RBK examples and
* rather lower explanation value. Please consider to include it in future | 0 |
package org.apache.accumulo.hadoopImpl.mapreduce.lib;
import org.apache.accumulo.hadoop.mapreduce.InputTableConfig;
* Returns the {@link InputTableConfig} for the configuration based on the properties set using
* the single-table input methods. | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/share/org/apache/commons/validator/ValidatorResources.java,v 1.6 2002/03/30 04:33:17 dwinterfeldt Exp $
* $Revision: 1.6 $
* $Date: 2002/03/30 04:33:17 $
*
* ====================================================================
* @version $Revision: 1.6 $ $Date: 2002/03/30 04:33:17 $ | 0 |
return assertType(name, LongHistogram.class, accs.computeIfAbsent(
name, s -> new LongHistogram()));
return assertType(name, NanosecondTimer.class, accs.computeIfAbsent(
name, s -> new NanosecondTimer()));
/**
* Accumulator provider factory.
*/ | 0 |
uiMappingConfig.getAuditFieldFallbackPrefixes(),
uiMappingConfig.getAuditFieldFallbackSuffixes());
uiMappingConfig.getAuditFieldFallbackPrefixes(), uiMappingConfig.getAuditFieldFallbackSuffixes()); | 0 |
* Add the logger bean.
* @param configuration The location of the logging configuration.
* @param registry The bean registry.
* @param loggerCategory The optional category for the logger.
*/
protected void addLogger(String configuration,
BeanDefinitionRegistry registry,
String loggerCategory) {
final RootBeanDefinition beanDef = this.createBeanDefinition(AvalonChildLoggerFactoryBean.class, "init", false);
if ( loggerCategory != null ) {
beanDef.getPropertyValues().addPropertyValue("category", loggerCategory);
}
this.register(beanDef, ProcessingUtil.LOGGER_ROLE, registry);
}
/**
protected ConfigurationInfo readConfiguration(String location, ResourceLoader resourceLoader)
throws Exception {
return ConfigurationReader.readSitemap(null, location, resourceLoader); | 0 |
import org.apache.commons.digester.Digester; | 0 |
package org.apache.bcel.generic;
import org.apache.bcel.ExceptionConst;
import org.apache.bcel.util.ByteSequence;
super(org.apache.bcel.Const.NEWARRAY, (short) 2);
return super.toString(verbose) + " " + org.apache.bcel.Const.getTypeName(type); | 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.
*/
package org.apache.aurora.common.application.http;
import javax.servlet.Filter;
import org.apache.aurora.common.base.MorePreconditions;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* Configuration tuple for an HTTP filter.
*/
public class HttpFilterConfig {
public final Class<? extends Filter> filterClass;
public final String pathSpec;
/**
* Creates a new filter configuration.
*
* @param filterClass Filter class.
* @param pathSpec Path spec that the filter should match.
*/
public HttpFilterConfig(Class<? extends Filter> filterClass, String pathSpec) {
this.pathSpec = MorePreconditions.checkNotBlank(pathSpec);
this.filterClass = checkNotNull(filterClass);
}
} | 0 |
public static void sumArray(Class<? extends Encoder<List<Long>>> encoderClass, String type) throws IOException, InstantiationException,
IllegalAccessException {
Encoder<List<Long>> encoder = encoderClass.newInstance();
IteratorSetting is = new IteratorSetting(1, SummingArrayCombiner.class);
SummingArrayCombiner.setEncodingType(is, SummingArrayCombiner.Type.valueOf(type));
Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("cf001")));
ai.init(new SortedMapIterator(tm1), is.getProperties(), null);
ai.seek(new Range(), EMPTY_COL_FAMS, false);
assertTrue(ai.hasTop());
assertEquals(nk(1, 1, 1, 3), ai.getTopKey());
assertBytesEqual(encoder.encode(nal(4l, 6l, 5l)), ai.getTopValue().get());
ai.next();
assertFalse(ai.hasTop());
is.clearOptions();
SummingArrayCombiner.setEncodingType(is, encoderClass);
Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("cf001")));
ai.init(new SortedMapIterator(tm1), is.getProperties(), null);
ai.seek(new Range(), EMPTY_COL_FAMS, false);
assertTrue(ai.hasTop());
assertEquals(nk(1, 1, 1, 3), ai.getTopKey());
assertBytesEqual(encoder.encode(nal(4l, 6l, 5l)), ai.getTopValue().get());
ai.next();
assertFalse(ai.hasTop());
is.clearOptions();
SummingArrayCombiner.setEncodingType(is, encoderClass.getName());
public void sumArrayTest() throws IOException, InstantiationException, IllegalAccessException {
sumArray(SummingArrayCombiner.VarNumArrayEncoder.class, "VARNUM");
sumArray(SummingArrayCombiner.LongArrayEncoder.class, "LONG");
sumArray(SummingArrayCombiner.StringArrayEncoder.class, "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 | 0 |
import org.jetbrains.annotations.NotNull;
public @NotNull Servlet createDispatcherServlet()
public void register(@NotNull final ServletContext containerContext, @NotNull final Hashtable<String, Object> props) | 0 |
private Object readResolve() {
return INSTANCE;
}
| 0 |
/**
* This will parse the element and construct the Java Objects.
* That will allow a user to validate the signature.
*
* @param element ds:Signature element that contains the whole signature
* @param baseURI URI to be prepended to all relative URIs
* @throws XMLSecurityException
* @throws XMLSignatureException if the signature is badly formatted
*/
public XMLSignature(Element element, String baseURI)
throws XMLSignatureException, XMLSecurityException {
this(element, baseURI, false);
}
* @param baseURI URI to be prepended to all relative URIs
* @param secureValidation whether secure secureValidation is enabled or not
public XMLSignature(Element element, String baseURI, boolean secureValidation)
super(element, baseURI);
this.signedInfo = new SignedInfo(signedInfoElem, baseURI, secureValidation);
this.keyInfo = new KeyInfo(keyInfoElem, baseURI);
this.keyInfo.setSecureValidation(secureValidation);
new Manifest(childElem, baseURI);
new SignatureProperties(childElem, baseURI); | 0 |
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import org.apache.bcel.Constants; | 0 |
assertDirContents(taskA.taskRoot, "sandbox", "pidfile");
assertDirContents(taskA.sandbox, "a.txt", "run.sh", "stderr", "stdout");
assertDirContents(taskA.taskRoot, "sandbox", "pidfile");
assertDirContents(taskA.sandbox, "run.sh", "stderr", "stdout");
assertThat(Files.readLines(new File(taskA.sandbox, "stdout"), Charsets.UTF_8), | 0 |
import org.apache.cocoon.objectmodel.ObjectModel;
import org.apache.cocoon.xml.NamespacesTable;
ObjectModel objectModel, ExecutionContext executionContext,
MacroContext macroContext, NamespacesTable namespaces, Event startEvent, Event endEvent)
Object val = this.value.getNode(objectModel);
Invoker.execute(consumer, objectModel, executionContext,
newMacroContext, namespaces, call.getNext(), call.getEndElement()); | 0 |
throw new MetadataServiceException(api, clientResponse); | 0 |
/*
* Copyright 2009 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 |
/*
* 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 |
/*
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.batik.css.engine.value.svg12;
/**
* This class represents an CIE L*a*b* color value.
*
* @version $Id$
*/
public class CIELabColor extends AbstractCIEColor {
public static final String CIE_LAB_COLOR_FUNCTION = "cielab";
/**
* Creates a new CIELabColor.
* @param l the L* value
* @param a the a* value
* @param b the b* value
* @param whitepoint the white point in CIE XYZ coordinates
*/
public CIELabColor(float l, float a, float b, float[] whitepoint) {
super(new float[] {l, a, b}, whitepoint);
}
/**
* Creates a new CIELabColor with D50 as illuminant.
*/
public CIELabColor(float l, float a, float b) {
this(l, a, b, null);
}
/** {@inheritDoc} */
public String getFunctionName() {
return CIE_LAB_COLOR_FUNCTION;
}
} | 0 |
import com.google.common.collect.ImmutableSet;
.createClassTypeDef(HIVE_TABLE_TYPE, ImmutableSet.of("DataSet"),
.createClassTypeDef(HIVE_PROCESS_TYPE, ImmutableSet.of("Process"),
.createTraitTypeDef("classification", ImmutableSet.<String>of(),
TypesUtil.createTraitTypeDef("pii", ImmutableSet.<String>of());
TypesUtil.createTraitTypeDef("phi", ImmutableSet.<String>of());
TypesUtil.createTraitTypeDef("pci", ImmutableSet.<String>of());
TypesUtil.createTraitTypeDef("sox", ImmutableSet.<String>of());
TypesUtil.createTraitTypeDef("sec", ImmutableSet.<String>of());
TypesUtil.createTraitTypeDef("finance", ImmutableSet.<String>of()); | 0 |
import static org.testng.Assert.assertNotNull;
AtlasEntityType entityType = typeRegistry.getEntityTypeByName(entityDef.getName());
assertNotNull(entityType);
AtlasEntity ent1 = entityType.createDefaultValue();
entityType.normalizeAttributeValues(ent2);
AtlasEntityType entityType = typeRegistry.getEntityTypeByName(entityDef.getName());
assertNotNull(entityType);
AtlasEntity ent1 = entityType.createDefaultValue();
entityType.normalizeAttributeValues(ent2);
AtlasEntityType entityType = typeRegistry.getEntityTypeByName(entityDef.getName());
assertNotNull(entityType);
AtlasEntity ent1 = entityType.createDefaultValue();
entityType.normalizeAttributeValues(ent2); | 0 |
import org.apache.accumulo.core.util.format.DateFormatSupplier;
import org.apache.accumulo.core.util.format.FormatterConfig;
public static final String DATE_FORMAT = DateFormatSupplier.HUMAN_READABLE_FORMAT;
private static final DateFormatSupplier formatter = DateFormatSupplier.createSimpleFormatSupplier(DATE_FORMAT);
private FormatterConfig config;
if (config.willPrintTimestamps()) {
return DefaultFormatter.formatEntry(next, config.willPrintTimestamps());
public void initialize(Iterable<Entry<Key,Value>> scanner, FormatterConfig config) {
this.config = new FormatterConfig(config); | 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 |
private long __estimatedArticleCount;
private long __firstArticle;
private long __lastArticle;
void _setArticleCount(long count)
void _setFirstArticle(long first)
void _setLastArticle(long last)
public long getArticleCount()
public long getFirstArticle()
public long getLastArticle() | 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.state.live.node;
public class NodeUnhealthyHeartbeatEvent extends NodeEvent {
private final long heartbeatTime;
private final NodeHealthStatus healthStatus;
public NodeUnhealthyHeartbeatEvent(String nodeName, long heartbeatTime,
NodeHealthStatus healthStatus) {
super(nodeName, NodeEventType.NODE_HEARTBEAT_UNHEALTHY);
this.heartbeatTime = heartbeatTime;
this.healthStatus = healthStatus;
}
/**
* @return the heartbeatTime
*/
public long getHeartbeatTime() {
return heartbeatTime;
}
/**
* @return the healthStatus
*/
public NodeHealthStatus getHealthStatus() {
return healthStatus;
}
} | 0 |
* Executes the request. Please Note that response content must be processed
* | 0 |
serviceClients.put("yarn" , Role.YARN_CLIENT.toString()); | 0 |
public class RawUnionValue { | 0 |
managedConn.releaseConnection();
managedConn.releaseConnection(); | 0 |
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import com.google.cloud.spanner.ErrorCode;
import com.google.cloud.spanner.SpannerExceptionFactory;
import org.apache.beam.sdk.testing.PAssert;
public void reportFailures() throws Exception {
PCollection<MutationGroup> mutations = pipeline
.apply(Create.of(
g(m(1L)), g(m(2L)), g(m(3L)), g(m(4L)), g(m(5L)),
g(m(6L)), g(m(7L)), g(m(8L)), g(m(9L)), g(m(10L)))
);
when(serviceFactory.mockDatabaseClient().writeAtLeastOnce(any()))
.thenAnswer(invocationOnMock -> {
throw SpannerExceptionFactory.newSpannerException(ErrorCode.ALREADY_EXISTS, "oops");
});
SpannerWriteResult result = mutations.apply(SpannerIO.write()
.withProjectId("test-project")
.withInstanceId("test-instance")
.withDatabaseId("test-database")
.withServiceFactory(serviceFactory)
.withBatchSizeBytes(1000000000)
.withFailureMode(SpannerIO.FailureMode.REPORT_FAILURES)
.withSampler(fakeSampler(m(2L), m(5L), m(10L)))
.grouped());
PAssert.that(result.getFailedMutations()).satisfies(m -> {
assertEquals(10, Iterables.size(m));
return null;
});
pipeline.run();
verifyBatches(
batch(m(1L), m(2L)),
batch(m(3L), m(4L), m(5L)),
batch(m(6L), m(7L), m(8L), m(9L), m(10L)),
// Mutations were also retried individually.
batch(m(1L)), batch(m(2L)),batch(m(3L)),batch(m(4L)),batch(m(5L)),
batch(m(6L)), batch(m(7L)),batch(m(8L)),batch(m(9L)),batch(m(10L)));
}
@Test
@Category(NeedsRunner.class) | 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.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.function;
import java.util.List;
public class TimelineMetricsSeriesAvgAggregateFunction extends AbstractTimelineMetricsSeriesAggregateFunction {
private static final String FUNCTION_NAME = "AVG";
@Override
protected Double applyFunction(List<Double> values) {
double sum = 0.0d;
for (Double value : values) {
sum += value;
}
return sum / values.size();
}
@Override
protected String getFunctionName() {
return FUNCTION_NAME;
}
} | 0 |
import org.w3c.dom.*;
import org.w3c.dom.traversal.NodeIterator;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.apache.xml.security.transforms.params.XPathContainer;
* @param transforms {@link Transforms} applied to data
* @param messageDigestAlgorithm {@link MessageDigestAlgorithm Digest algorithm} which is applied to the data
* @param messageDigestAlgorithm {@link MessageDigestAlgorithm Digest algorithm} which is applied to the data
* @param transforms {@link Transforms} applied to data
* @see Manifest#verifyReferences | 0 |
import java.io.File;
import java.security.cert.X509Certificate;
import java.util.List;
import java.util.Map;
import org.osgi.framework.Version;
public int compareTo(Bundle o)
{
return 0;
}
public Map<X509Certificate, List<X509Certificate>> getSignerCertificates(int signersType)
{
return null;
}
public Version getVersion()
{
return null;
}
public <A> A adapt(Class<A> type)
{
return null;
}
public File getDataFile(String filename)
{
return null;
} | 0 |
import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory;
Helper.getDefaultOptions(
// this is how you set the default log level when using pax logging (logProfile)
systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG")),
workingDirectory("target/paxrunner/core/"),
| 0 |
locator.invalidateCache(context, location.toString());
locator.invalidateCache(context, location.toString());
locator.invalidateCache(context, location.toString());
locator.invalidateCache(context, location.toString()); | 0 |
import org.apache.beam.sdk.values.BeamRecordType;
BeamRecordType type = BeamRecordSqlType
.builder()
.withIntegerField("c1")
.withVarcharField("c2")
.withDoubleField("c3")
.build();
public @Nullable
Void apply(BeamRecord input) {
public @Nullable
Void apply(BeamRecord input) { | 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.test.component;
import java.util.Random;
/**
* Simple component that holds an integer. It is exposed as a MBean.
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
*/
public class SimpleManagedComponent {
/**
* The integer.
*/
private int m_integer /*= new Random().nextInt()*/;
/**
* Set the value of the integer.
* @param newValue the new value
* @return the old value of the integer.
*/
@SuppressWarnings("unused")
private synchronized int setIntegerValue(int newValue) {
int oldValue = m_integer;
m_integer = newValue;
return oldValue;
}
/**
* Get the value of the integer.
* @return the currentvalue of the integer.
*/
@SuppressWarnings("unused")
private synchronized int getIntegerValue() {
return m_integer;
}
} | 0 |
FileTime lastModified = FileTime.from(time.getLastModifiedTime(), TimeUnit.MILLISECONDS);
FileTime lastAccess = FileTime.from(time.getLastAccessTime(), TimeUnit.MILLISECONDS); | 1 |
zipExtractor.addRule("**legacy/sitemap-additions/**", new SingleFileDeployer("WEB-INF/cocoon/sitemap-additions"));
zipExtractor.addRule("**properties/**", new SingleFileDeployer("WEB-INF/cocoon/properties")); | 0 |
return new ReadOnlyDictionary( m_componentManager.getProperties() ); | 0 |
final String[] userConfigs =
userConfigString.trim().isEmpty() ? new String[] {""} : userConfigString.split(";");
final String[] hostConfigs =
hostConfigString.trim().isEmpty() ? new String[] {""} : hostConfigString.split(";");
final String[] splitUserConfig = userConfig.split(":");
String[] allowedUsers = allowedImpersonationsForRemoteUser.split(",");
String[] allowedHosts = hostConfig.split(","); | 0 |
public class MultipleConnectionTestCase {
public static void setUpClass() throws FtpException, IOException {
public static void tearDownClass() {
private FTPSClient init(final FTPSClient client) {
private FileObject resolveRoot() throws FileSystemException {
public void testConnectRoot() throws IOException {
public void testUnderlyingConnect() throws SocketException, IOException {
try {
} finally {
if (client1 != null) {
if (client2 != null) { | 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 | 1 |
public List /* <ServiceReference> */ getAllServiceReferences(String clazz, String filter) {
return result;
add(reference);
modify(reference);
public void add(ServiceReference reference) {
List /* <String> */ keys = createKeys(reference);
synchronized (m_keyToServiceReferencesMap) {
for (int i = 0; i < keys.size(); i++) {
List /* <ServiceReference> */ references = (List) m_keyToServiceReferencesMap.get(keys.get(i));
if (references == null) {
references = new ArrayList();
m_keyToServiceReferencesMap.put(keys.get(i), references);
}
references.add(reference);
}
}
}
public void modify(ServiceReference reference) {
// TODO this is a quite expensive linear scan over the existing collection
// because we first need to remove any existing references and they can be
// all over the place :)
Iterator iterator = m_keyToServiceReferencesMap.values().iterator();
while (iterator.hasNext()) {
List /* <ServiceReference> */ list = (List) iterator.next();
if (list != null) {
Iterator i2 = list.iterator();
while (i2.hasNext()) {
ServiceReference ref = (ServiceReference) i2.next();
if (ref.equals(reference)) {
i2.remove();
}
}
}
}
| 0 |
void initialize(String instanceId, boolean initialize);
boolean validSecurityHandlers(Authorizor auth, PermissionHandler pm);
void initializeSecurity(TCredentials credentials, String principal, byte[] token) throws AccumuloSecurityException, ThriftSecurityException;
boolean authenticateUser(String principal, AuthenticationToken token) throws AccumuloSecurityException;
Set<String> listUsers() throws AccumuloSecurityException;
void createUser(String principal, AuthenticationToken token) throws AccumuloSecurityException;
void dropUser(String user) throws AccumuloSecurityException;
void changePassword(String principal, AuthenticationToken token) throws AccumuloSecurityException;
boolean userExists(String user) throws AccumuloSecurityException;
Set<Class<? extends AuthenticationToken>> getSupportedTokenTypes();
boolean validTokenClass(String tokenClass); | 0 |
import org.apache.accumulo.core.security.thrift.ThriftSecurityException; | 0 |
* A {@link org.apache.commons.collections.map.PassiveExpiringMap.ExpirationPolicy ExpirationPolicy}
* that returns a expiration time that is a
* @throws IllegalArgumentException if the time unit is null. | 0 |
* $Id$
* $Rev$
* $Date$
* Copyright 2001-2005 The Apache Software Foundation | 0 |
*
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a> | 0 |
import org.apache.accumulo.core.client.impl.ClientContext;
* @deprecated since 2.0.0, replaced by
* {@link #MutationsRejectedException(ClientInfo, List, Map, Collection, int, Throwable)}
@Deprecated
super(
"# constraint violations : " + cvsList.size() + " security codes: " + hashMap.toString()
+ " # server errors " + serverSideErrors.size() + " # exceptions " + unknownErrors,
cause);
this.cvsl = cvsList;
this.af = hashMap;
this.es = serverSideErrors;
this.unknownErrors = unknownErrors;
}
/**
* Creates Mutations rejected exception
*
* @param info
* Client info
* @param cvsList
* list of constraint violations
* @param hashMap
* authorization failures
* @param serverSideErrors
* server side errors
* @param unknownErrors
* number of unknown errors
*
* @since 2.0.0
*/
public MutationsRejectedException(ClientInfo info, List<ConstraintViolationSummary> cvsList,
Map<TabletId,Set<SecurityErrorCode>> hashMap, Collection<String> serverSideErrors,
int unknownErrors, Throwable cause) {
+ format(hashMap, new ClientContext(info)) + " # server errors " + serverSideErrors.size()
private static String format(Map<TabletId,Set<SecurityErrorCode>> hashMap,
ClientContext context) {
String tableInfo = Tables.getPrintableTableInfoFromId(context, | 0 |
import org.apache.ambari.server.configuration.Configuration;
import org.apache.ambari.server.orm.entities.RemoteAmbariClusterEntity;
import org.apache.ambari.view.AmbariHttpException;
import org.apache.ambari.view.AmbariStreamProvider;
import org.apache.ambari.view.cluster.Cluster;
import org.apache.commons.io.IOUtils;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
| 0 |
public <T> void output(TupleTag<T> tag, T output) {
context.output(tag, output);
public <T> void outputWithTimestamp(TupleTag<T> tag, T output, Instant timestamp) {
context.outputWithTimestamp(tag, output, timestamp);
public <T> void output(TupleTag<T> tag, T output) {
context.output(tag, output);
public <T> void outputWithTimestamp(TupleTag<T> tag, T output, Instant timestamp) {
context.outputWithTimestamp(tag, output, timestamp); | 0 |
*
*
*
*
*
* | 0 |
* @version $Id: FileItem.java,v 1.18 2004/10/29 04:17:23 martinc Exp $
extends Serializable { | 1 |
BeamFlow flow = BeamFlow.create(pipeline);
BeamFlow flow = BeamFlow.create(pipeline); | 0 |
public static final String NAGIOS_IGNORE_FOR_SERVICES_KEY = "nagios.ignore_for_services";
public static final String NAGIOS_IGNORE_FOR_HOSTS_KEY = "nagios.ignore_for_hosts"; | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/java/org/apache/commons/beanutils/BeanUtilsBean.java,v 1.8 2003/05/21 09:41:45 rdonkin Exp $
* $Revision: 1.8 $
* $Date: 2003/05/21 09:41:45 $
* @version $Revision: 1.8 $ $Date: 2003/05/21 09:41:45 $
Object newBean = null;
if (bean instanceof DynaBean) {
newBean = ((DynaBean) bean).getDynaClass().newInstance();
} else {
newBean = bean.getClass().newInstance();
} | 0 |
* Handles command line parameters to configure the <code>SVGConverter</code>
* Each command line option is handled by an <code>OptionHandler</code> which
* <code>SVGConverter</code> which is used to perform the conversion.
* The <code>OptionHandler</code> should configure the <code>SVGConverter</code>
* This abstract implementation of the <code>OptionHandler</code> interface
* <code>handleOption</code> method does not match the number of expected
* optionValues. If the size matches, the <code>safeHandleOption</code>
* Subclasses can implement the <code>safeHandleOption</code> method
* the <code>handleOption</code> method which takes only an <code>SVGConverter</code>
* provide an implementation for the <code>handleOption</code> method which
* takes a <code>String</code> and an <code>SVGConverter</code> as parameters.
* be a float. Subclasses should implement the <code>handleOption</code>
* method which takes a float and an <code>SVGConverter</code> as
* be a time value. Subclasses should implement the <code>handleOption</code>
* method which takes a float and an <code>SVGConverter</code> as
* Base class for options which expect a <code>Rectangle</code> optionValue.
* Subclasses should implement the <code>handleOption</code> method which
* takes a <code>Rectangle</code> and an <code>SVGConverter</code> as parameters.
* Base class for options which expect a <code>Color</code> optionValue.
* Subclasses should implement the <code>handleOption</code> method which
* takes a <code>Color</code> and an <code>SVGConverter</code> as parameters. | 0 |
/**
* Add a global session to those being tracked.
* @param id sessionId
* @param to sessionTimeout
* @return whether the session was newly added (if false, already existed)
*/
boolean addGlobalSession(long id, int to);
/**
* Add a session to those being tracked. The session is added as a local
* session if they are enabled, otherwise as global.
* @param id sessionId
* @param to sessionTimeout
* @return whether the session was newly added (if false, already existed)
*/
boolean addSession(long id, int to);
*
/**
* @param sessionId
* @return whether or not the SessionTracker is aware of this session
*/
boolean isTrackingSession(long sessionId);
/**
* Checks whether the SessionTracker is aware of this session, the session
* is still active, and the owner matches. If the owner wasn't previously
* set, this sets the owner of the session.
*
* UnknownSessionException should never been thrown to the client. It is
* only used internally to deal with possible local session from other
* machine
*
* @param sessionId
* @param owner
*/
public void checkSession(long sessionId, Object owner)
throws KeeperException.SessionExpiredException,
KeeperException.SessionMovedException,
KeeperException.UnknownSessionException;
/**
* Strictly check that a given session is a global session or not
* @param sessionId
* @param owner
* @throws KeeperException.SessionExpiredException
* @throws KeeperException.SessionMovedException
*/
public void checkGlobalSession(long sessionId, Object owner)
throws KeeperException.SessionExpiredException,
KeeperException.SessionMovedException; | 0 |
import java.io.File;
import org.apache.commons.vfs.test.AbstractProviderTestCase;
* @version $Revision: 1.2 $ $Date: 2002/11/23 00:33:54 $ | 0 |
if (bundle.getInfo().isExtension())
{
return;
} | 0 |
import java.util.Base64;
import org.apache.xml.security.utils.XMLUtils;
// base64 decode signatureValue
String content = XMLUtils.getFullTextChildrenFromElement(sigValueElem);
value = Base64.getMimeDecoder().decode(content);
valueBase64 = Base64.getMimeEncoder().encodeToString(value); | 0 |
}
// try to resolve using system ID
if (log.isDebugEnabled()) {
log.debug(" Trying to resolve using system ID '" + systemId + "'");
}
try {
entityURL = new URL(systemId);
} catch (MalformedURLException e) {
throw new IllegalArgumentException("Malformed URL '" + systemId
+ "' : " + e.getMessage()); | 0 |
@Description("The maximum number of elements in a bundle.")
@Default.Long(1000)
Long getMaxBundleSize();
void setMaxBundleSize(Long size);
@Description("The maximum time to wait before finalising a bundle (in milliseconds).")
@Default.Long(1000)
Long getMaxBundleTimeMills();
void setMaxBundleTimeMills(Long time);
| 0 |
String hostname = getServerHttp().getHostName();
Assert.assertEquals(hostname + ":" + port, headers[0].getValue()); | 0 |
import java.io.File;
import java.io.FileOutputStream;
import java.util.Iterator;
import org.apache.commons.collections.iterators.AbstractIteratorDecorator;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.LineIterator;
private Option disablePaginationOpt;
@SuppressWarnings("unchecked")
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws IOException {
final String historyPath = home + "/" + Shell.HISTORY_DIR_NAME + "/" + Shell.HISTORY_FILE_NAME;
final FileOutputStream out = new FileOutputStream(historyPath);
out.close();
} else {
final LineIterator it = FileUtils.lineIterator(new File(historyPath));
shellState.printLines(new HistoryLineIterator(it), !cl.hasOption(disablePaginationOpt.getOpt()));
} finally {
it.close();
return 0;
}
/**
* Decorator that prepends a running counter to an Iterator<String>.
*/
private static class HistoryLineIterator extends AbstractIteratorDecorator {
int counter = 0;
public HistoryLineIterator(Iterator<String> iterator) {
super(iterator);
@Override
public Object next() {
return counter++ + " " + super.next();
}
disablePaginationOpt = new Option("np", "no-pagination", false, "disable pagination of output");
o.addOption(disablePaginationOpt); | 0 |
import static org.junit.Assert.assertThat;
import org.apache.beam.sdk.values.TypeDescriptor;
@Test
public void testEncodedTypeDescriptor() throws Exception {
assertThat(
SerializableCoder.of(MyRecord.class).getEncodedTypeDescriptor(),
Matchers.equalTo(TypeDescriptor.of(MyRecord.class)));
} | 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 |
import static org.apache.aurora.scheduler.updater.SideEffect.InstanceUpdateStatus; | 0 |
import java.net.URLDecoder;
final String sourceFile = URLDecoder.decode(codeSource.getLocation().getFile(),"UTF-8"); // ensure special characters are decoded OK | 0 |
try {
channel.close();
} catch (IOException e) {
log.warn("Error unbinding socket", e);
}
if (channels.containsKey(address) && !disposing.get()) { | 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 under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ | 0 |
import com.twitter.common.base.Function;
import org.apache.aurora.scheduler.storage.entities.IDockerParameter;
import org.apache.mesos.Protos;
Iterable<Protos.Parameter> parameters = Iterables.transform(config.getParameters(),
new Function<IDockerParameter, Protos.Parameter>() {
@Override public Protos.Parameter apply(IDockerParameter item) {
return Protos.Parameter.newBuilder().setKey(item.getName())
.setValue(item.getValue()).build();
}
});
ContainerInfo.DockerInfo.Builder dockerBuilder = ContainerInfo.DockerInfo.newBuilder()
.setImage(config.getImage()).addAllParameters(parameters); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.