Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
InnerClassManipulator innerManipulator = new InnerClassManipulator(inner,
outerClassInternalName,
manipulator);
// Compute manipulation metadata
result.visitClassStructure(manipulator.getManipulationMetadata());
| 0 |
package org.apache.bcel.generic;
import org.apache.bcel.Const;
import org.apache.bcel.ExceptionConst;
import org.apache.bcel.classfile.ConstantPool;
import org.apache.bcel.util.ByteSequence; | 1 |
* @version CVS $Id: EPDiagonal.java,v 1.2 2003/03/11 19:05:01 vgritsenko Exp $ | 0 |
package org.apache.http.nio.testserver; | 0 |
public PathCallParamBuilder callParamPath()
{
return addProvider( new PathCallParamBuilder( keyPattern, namespaceURI, mainBinder, this ) ); | 0 |
* Copyright 2001-2005 The Apache Software Foundation | 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 |
* @version CVS $Id: CocoonBean.java,v 1.26 2003/09/15 19:18:17 upayavira Exp $
l.pageGenerated(uri, "", 0, linksInPage, 0, pagesRemaining, 0, 0L);
l.brokenLinkFound(uri, "", warning, null); | 0 |
final NHttpClientConnection conn; | 0 |
* doubling memory consumption for each image and making the GC work twice
+ ':' + this.fitUniform
+ ':' + this.enlarge | 1 |
//TODO See why it fails...
//assertEquals("Test int", i, 5); // The code fix to 5. | 0 |
import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.TIMELINE_METRICS_EVENT_METRIC_PATTERNS;
import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
private String skipInterpolationMetricPatternStrings;
private Set<Pattern> skipInterpolationMetricPatterns = new HashSet<>();
this.skipInterpolationMetricPatternStrings = metricsConf.get(TIMELINE_METRICS_EVENT_METRIC_PATTERNS, "");
if (StringUtils.isNotEmpty(skipInterpolationMetricPatternStrings)) {
for (String patternString : skipInterpolationMetricPatternStrings.split(",")) {
String javaPatternString = hBaseAccessor.getJavaRegexFromSqlRegex(patternString);
LOG.info("SQL pattern " + patternString + " converted to Java pattern : " + javaPatternString);
skipInterpolationMetricPatterns.add(Pattern.compile(javaPatternString));
}
}
for (Pattern pattern : skipInterpolationMetricPatterns) {
Matcher m = pattern.matcher(timelineMetric.getMetricName());
if (m.matches()) {
LOG.debug("Skipping interpolation for " + timelineMetric.getMetricName());
return;
}
} | 0 |
result.apply(TextIO.write().to(new URI(resultPath).getPath() + "/part")); | 0 |
* Autogenerated by Thrift Compiler (0.12.0)
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)")
@org.apache.thrift.annotation.Nullable | 0 |
} catch (final ProtocolException ex) { | 0 |
public boolean innermostDelegateEquals(Connection c) {
Connection innerCon = getInnermostDelegate();
if (innerCon == null) {
return c == null;
} else {
return innerCon.equals(c);
}
}
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (obj instanceof DelegatingConnection) {
return c.innermostDelegateEquals(delegate); | 0 |
@Override // TODO make this a default method in JDK-8
@Override // TODO make this a default method in JDK-8
public SftpClient createSftpClient(final int version) throws IOException {
return createSftpClient(SftpVersionSelector.Utils.fixedVersionSelector(version));
}
public FileSystem createSftpFileSystem(int version) throws IOException {
return createSftpFileSystem(SftpVersionSelector.Utils.fixedVersionSelector(version));
}
@Override
public FileSystem createSftpFileSystem(int version, int readBufferSize, int writeBufferSize) throws IOException {
return createSftpFileSystem(SftpVersionSelector.Utils.fixedVersionSelector(version), readBufferSize, writeBufferSize);
}
@Override | 0 |
protected long seqi;
protected long seqo;
outMac.updateUInt(seqo);
seqo = (seqo + 1) & 0xffffffffL;
inMac.updateUInt(seqi);
seqi = (seqi + 1) & 0xffffffffL; | 0 |
* @deprecated since 1.4, replaced by {@link org.apache.accumulo.core.iterators.user.AgeOffFilter} | 0 |
* Include a linked layout in the generated XML.
*
* <h2>Applicable to:</h2>
* <ul>
* <li>{@link org.apache.cocoon.portal.layout.impl.LinkLayout}</li>
* </ul>
* @version CVS $Id: DefaultLinkRenderer.java,v 1.5 2004/04/25 20:10:29 haul Exp $ | 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 |
@Override
@Override
@Override | 0 |
import org.apache.commons.lang.ArrayUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
options.addOption("d", "database", true, "Database name");
options.addOption("f", "filename", true, "Filename");
String fileToImport = cmd.getOptionValue("f");
if (StringUtils.isNotEmpty(fileToImport)) {
File f = new File(fileToImport);
if (f.exists() && f.canRead()) {
BufferedReader br = new BufferedReader(new FileReader(f));
String line = null;
while((line = br.readLine()) != null) {
String val[] = line.split(":");
if (ArrayUtils.isNotEmpty(val)) {
databaseToImport = val[0];
if (val.length > 1) {
tableToImport = val[1];
} else {
tableToImport = "";
}
hiveMetaStoreBridge.importHiveMetadata(databaseToImport, tableToImport, failOnError);
}
}
exitCode = EXIT_CODE_SUCCESS;
} else {
LOG.error("Failed to read the input file: " + fileToImport);
}
} else {
hiveMetaStoreBridge.importHiveMetadata(databaseToImport, tableToImport, failOnError);
}
System.out.println("Usage 4: import-hive.sh -f <filename>");
System.out.println(" Imports all databases and tables in the file...");
System.out.println(" Format:");
System.out.println(" database1:tbl1");
System.out.println(" database1:tbl2");
System.out.println(" database2:tbl2"); | 0 |
import org.apache.hc.core5.http.HttpException; | 0 |
* @author Apache Software Foundation
* @version $Id: Metaphone.java,v 1.15 2004/02/29 04:08:31 tobrien Exp $ | 0 |
import org.apache.batik.dom.svg.XMLBaseSupport;
String baseURI = XMLBaseSupport.getCascadedXMLBase(cursorElement); | 0 |
* @version $Revision: 1.44 $ $Date: 2004/12/30 21:59:36 $
NamespaceResolver parentNR = null;
if (parentContext instanceof JXPathContextReferenceImpl) {
parentNR = ((JXPathContextReferenceImpl)parentContext).getNamespaceResolver();
}
namespaceResolver = new NamespaceResolver(parentNR); | 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 | 0 |
public Table.ID tableId;
this.tableId = tableId;
this.tableId = tableId; | 0 |
import org.apache.sshd.client.subsystem.sftp.extensions.openssh.OpenSSHFsyncExtension;
import org.apache.sshd.client.subsystem.sftp.extensions.openssh.impl.OpenSSHFsyncExtensionImpl;
import org.apache.sshd.common.subsystem.sftp.extensions.openssh.FsyncExtensionParser;
},
OPENSSH_FSYNC(FsyncExtensionParser.NAME, OpenSSHFsyncExtension.class) {
@Override // co-variant return
public OpenSSHFsyncExtension create(SftpClient client, RawSftpClient raw, Map<String,byte[]> extensions, Map<String,?> parsed) {
return new OpenSSHFsyncExtensionImpl(client, raw, extensions);
} | 0 |
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.beam.sdk.io.cassandra;
import java.math.BigInteger;
/** Models a Cassandra token range. */
final class RingRange {
private final BigInteger start;
private final BigInteger end;
RingRange(BigInteger start, BigInteger end) {
this.start = start;
this.end = end;
}
BigInteger getStart() {
return start;
}
BigInteger getEnd() {
return end;
}
/**
* Returns the size of this range.
*
* @return size of the range, max - range, in case of wrap
*/
BigInteger span(BigInteger ringSize) {
if (start.compareTo(end) >= 0) {
return end.subtract(start).add(ringSize);
} else {
return end.subtract(start);
}
}
/**
* @return true if 0 is inside of this range. Note that if start == end, then wrapping is true
*/
public boolean isWrapping() {
return start.compareTo(end) >= 0;
}
@Override
public String toString() {
return String.format("(%s,%s]", start.toString(), end.toString());
}
} | 0 |
context.createAmbariResources(topology, CLUSTER_NAME, null, null, null);
context.createAmbariResources(topology, CLUSTER_NAME, null, null, null);
context.createAmbariResources(topology, CLUSTER_NAME, null, null, null);
context.createAmbariResources(topology, CLUSTER_NAME, null, "xyz", null); | 0 |
// ACCUMULO-1152 added a tserver lock check to the tablet location cache, so this invalidation prevents future attempts to contact the | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/pointers/Attic/BeanPointer.java,v 1.2 2001/09/03 01:22:31 dmitri Exp $
* $Revision: 1.2 $
* $Date: 2001/09/03 01:22:31 $
* @version $Revision: 1.2 $ $Date: 2001/09/03 01:22:31 $
public class BeanPointer extends PropertyOwnerPointer {
public BeanPointer(QName name, Object bean, JXPathBeanInfo beanInfo){
this(null, name, bean, beanInfo);
}
public BeanPointer(NodePointer parent, QName name, Object bean, JXPathBeanInfo beanInfo){
super(parent);
public Object getBaseValue(){
return PropertyAccessHelper.getLength(getBaseValue());
if (parent != null){
return super.asPath();
}
// pointer.value = value; | 0 |
* nor may "Apache" appear in their name, without
* @version $Id: CopyStreamAdapter.java,v 1.6 2003/01/26 04:33:32 brekke Exp $ | 0 |
import java.util.Arrays;
import java.util.Collections;
@Test
public void testComplexMapSerialization2() {
Map<String, Object> m2 = new LinkedHashMap<>();
m2.put("yes", Boolean.TRUE);
m2.put("no", Collections.singletonMap("maybe", false));
Map<String, Object> cm = new LinkedHashMap<>();
cm.put("list", Arrays.asList(
Collections.singletonMap("x", "y"),
Collections.singletonMap("x", "b")));
cm.put("embedded", m2);
String expected = "list: \n" +
" - \n" +
" x: 'y'\n" +
" - \n" +
" x: 'b'\n" +
"embedded: \n" +
" yes: true\n" +
" no: \n" +
" maybe: false";
assertEquals(expected, new YamlCodecImpl().encode(cm).toString().trim());
} | 0 |
import com.google.common.collect.ImmutableMap;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public Map<String, String> getConfigByType(String type) {
Config configs = cluster.getDesiredConfigByType(type);
return ImmutableMap.copyOf(configs.getProperties());
}
@Override | 0 |
* .by(Transaction::getTypeName)
* .via(tx -> tx.getTypeName().toFields(tx), // Convert the data to be written to CSVSink | 0 |
// Command parameter names
public static final String UPGRADE_FROM_STACK = "source_stack_version";
public static final String UPGRADE_TO_STACK = "target_stack_version";
| 0 |
public void testHeuristicFreshnessLifetime() {
Date now = new Date();
Date oneSecondAgo = new Date(now.getTime() - 1 * 1000L);
Date elevenSecondsAgo = new Date(now.getTime() - 11 * 1000L);
Header[] headers = new Header[] {
new BasicHeader("Date", DateUtils.formatDate(oneSecondAgo)),
new BasicHeader("Last-Modified", DateUtils.formatDate(elevenSecondsAgo))
};
HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(headers);
CacheValidityPolicy impl = new CacheValidityPolicy();
Assert.assertEquals(1, impl.getHeuristicFreshnessLifetimeSecs(entry, 0.1f, 0));
}
@Test
public void testHeuristicFreshnessLifetimeDefaultsProperly() {
long defaultFreshness = 10;
HttpCacheEntry entry = HttpTestUtils.makeCacheEntry();
CacheValidityPolicy impl = new CacheValidityPolicy();
Assert.assertEquals(defaultFreshness, impl.getHeuristicFreshnessLifetimeSecs(entry, 0.1f, defaultFreshness));
}
@Test
public void testHeuristicFreshnessLifetimeIsNonNegative() {
Date now = new Date();
Date oneSecondAgo = new Date(now.getTime() - 1 * 1000L);
Date elevenSecondsAgo = new Date(now.getTime() - 1 * 1000L);
Header[] headers = new Header[] {
new BasicHeader("Date", DateUtils.formatDate(elevenSecondsAgo)),
new BasicHeader("Last-Modified", DateUtils.formatDate(oneSecondAgo))
};
HttpCacheEntry entry = HttpTestUtils.makeCacheEntry(headers);
CacheValidityPolicy impl = new CacheValidityPolicy();
Assert.assertTrue(impl.getHeuristicFreshnessLifetimeSecs(entry, 0.1f, 10) >= 0);
}
@Test | 0 |
public static void readProperties(String directoryName, | 0 |
long ephemeralOwner, int parentCVersion, long zxid, long time)
if (parentCVersion == -1) {
parentCVersion = parent.stat.getCversion();
parentCVersion++;
}
parent.stat.setCversion(parentCVersion);
createTxn.getParentCVersion(), | 0 |
package org.apache.hadoop.metadata.bridge;
import org.apache.hadoop.metadata.types.AttributeDefinition;
import org.apache.hadoop.metadata.types.ClassType;
import org.apache.hadoop.metadata.types.HierarchicalTypeDefinition;
import org.apache.hadoop.metadata.types.TypeSystem;
import com.google.common.collect.ImmutableList;
public class BridgeAssistant {
protected HierarchicalTypeDefinition<ClassType> createClassTypeDef(String name, ImmutableList<String> superTypes, AttributeDefinition... attrDefs) {return new HierarchicalTypeDefinition(ClassType.class, name, superTypes, attrDefs);}
} | 0 |
import org.apache.accumulo.core.data.impl.KeyExtent; | 1 |
package org.apache.batik.css.engine.value;
import org.w3c.dom.DOMException;
* This singleton class represents the 'inherit' value.
public class InheritValue extends AbstractValue {
* The only instance of this class.
public final static InheritValue INSTANCE = new InheritValue();
/**
* Creates a new InheritValue object.
*/
protected InheritValue() {
}
* A string representation of the current value.
public String getCssText() {
return "inherit";
* A code defining the type of the value.
return CSSValue.CSS_INHERIT;
* Returns a printable representation of this object.
public String toString() {
return getCssText(); | 0 |
import com.google.cloud.dataflow.sdk.util.TimerManager.TimeDomain; | 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: LayoutMapping.java,v 1.2 2004/03/05 13:02:09 bdelacretaz Exp $ | 1 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.io.input;
import junit.framework.TestCase;
/**
* JUnit Test Case for {@link ClosedInputStream}.
*/
public class ClosedInputStreamTest extends TestCase {
/**
* Test the <code>read()</code> method.
*/
public void testRead() {
assertEquals("read()", -1, new ClosedInputStream().read());
}
} | 0 |
* Copyright (C) 2015 Google Inc. | 0 |
props.put("instance.name",name); | 0 |
@VisibleForTesting static final String DATAFLOW_GRAPH_FILE_NAME = "dataflow_graph.pb";
// Upload the job to GCS and remove the graph object from the API call. The graph
// will be downloaded from GCS by the service.
if (hasExperiment(options, "upload_graph")) {
DataflowPackage stagedGraph =
options
.getStager()
.stageToFile(
DataflowPipelineTranslator.jobToString(newJob).getBytes(UTF_8),
DATAFLOW_GRAPH_FILE_NAME);
newJob.getSteps().clear();
newJob.setStepsLocation(stagedGraph.getLocation());
}
+ "exceeds the allowable limit for the API. Use experiment "
+ "'upload_graph' (--experiments=upload_graph) to direct the runner to "
+ "upload the JSON to your GCS staging bucket instead of embedding in the API request."; | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/observed/Attic/ObservableList.java,v 1.5 2003/11/27 22:55:15 scolebourne Exp $
* @deprecated TO BE REMOVED BEFORE v3.0
* @version $Revision: 1.5 $ $Date: 2003/11/27 22:55:15 $ | 0 |
*
*/
private static final long serialVersionUID = 1L; | 1 |
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceSelector;
* @version CVS $Id: DefaultAspectDataHandler.java,v 1.3 2003/10/20 13:36:41 cziegeler Exp $
protected ServiceSelector storeSelector;
ServiceSelector storeSelector) {
} catch (ServiceException ce) {
this.storeSelector.release( store );
} catch (ServiceException ce) {
this.storeSelector.release( store );
} catch (ServiceException ce) {
this.storeSelector.release( store ); | 0 |
private Trigger<W>.TriggerContext context(BitSet finishedSet, W window) {
return new TriggerContextImpl(finishedSet, rootTrigger, window);
context(finishedSet, window), value.getValue(), value.getTimestamp());
rootTrigger.invokeClear(context(finishedSet, window));
new OnTimerContextImpl(context(finishedSet, window), triggerId));
return new OnMergeContextImpl(context, toBeMerged, finishedSets.build());
Trigger<W>.TriggerContext context = context(finishedSet, resultWindow);
rootTrigger.invokeClear(context(lookupFinishedSet(windowBeingMerged), windowBeingMerged));
trigger.invokeClear(context(finishedSet, window));
private final W window;
private TriggerContextImpl(
BitSet finishedSet, ExecutableTrigger<W> trigger, W window) {
this.window = window;
return new TriggerContextImpl(finishedSet, trigger, window);
public void resetTree() throws Exception {
trigger.invokeClear(this);
@Override
public W window() {
return window;
}
Trigger<W>.TriggerContext delegate, Object value, Instant timestamp) {
delegate.current().getSpec().super(value, timestamp);
return new OnElementContextImpl(delegate.forTrigger(trigger), element(), eventTimestamp());
public void resetTree() throws Exception {
delegate.resetTree();
@Override
public W window() {
return delegate.window();
}
Iterable<W> oldWindows, Map<W, BitSet> finishedSets) {
delegate.current().getSpec().super(oldWindows, finishedSets);
return new OnMergeContextImpl(delegate.forTrigger(trigger), oldWindows(), finishedSets);
public void resetTree() throws Exception {
delegate.resetTree();
@Override
public W window() {
return delegate.window();
}
public void resetTree() throws Exception {
delegate.resetTree();
@Override
public W window() {
return delegate.window();
}
} | 0 |
FluentIterable.from(resourceIds).transform(ResourceId::toString).toList());
.transform(ResourceId::getScheme)
Set<String> schemes = FluentIterable.from(specs).transform(FileSystems::parseScheme).toSet(); | 0 |
public static Map getTemplateObjectModel(final Map objectModel,
final Parameters parameters) {
// cocoon.request
final Request request = ObjectModelHelper.getRequest( objectModel );
cocoon.put("request", request);
// cocoon.session
final Session session = request.getSession(false);
if (session != null) {
cocoon.put("session", session);
// cocoon.context
final org.apache.cocoon.environment.Context context =
ObjectModelHelper.getContext( objectModel );
cocoon.put("context", context);
| 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.scenarios.component;
import org.apache.felix.ipojo.test.scenarios.bad.service.FooService;
import org.osgi.framework.ServiceReference;
public abstract class CheckProviderParentClass {
int simpleU = 0;
int objectU = 0;
int refU = 0;
int bothU = 0;
public void bothUnbind(FooService o, ServiceReference sr) {
if(sr != null && o != null && o instanceof FooService) { bothU++; }
}
public void refUnbind(ServiceReference sr) {
if(sr != null) { refU++; }
}
public void objectUnbind(FooService o) {
if(o != null && o instanceof FooService) { objectU++; }
else {
System.err.println("Unbind null : " + o);
}
}
public void voidUnbind() {
simpleU++;
}
} | 0 |
package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
fooProvider = Utils.getComponentInstance(context, "LFCB-FooProviderType-1", p2);
instance = Utils.getComponentInstance(context, "LFCB-ImmediateCallbackCheckService", p1); | 0 |
public static final String close = "close";
public static final String copy = "copy";
public static final String create = "create";
public static final String logAppend = "logAppend";
public static final String logFlush = "logFlush";
public static final String logException = "logException";
public long getCloseCount();
public long getCloseAvgTime();
public long getCloseMinTime();
public long getCloseMaxTime();
public long getCopyCount();
public long getCopyAvgTime();
public long getCopyMinTime();
public long getCopyMaxTime();
public long getCreateCount();
public long getCreateMinTime();
public long getCreateMaxTime();
public long getCreateAvgTime();
public long getLogAppendCount();
public long getLogAppendMinTime();
public long getLogAppendMaxTime();
public long getLogAppendAvgTime();
public long getLogFlushCount();
public long getLogFlushMinTime();
public long getLogFlushMaxTime();
public long getLogFlushAvgTime();
public long getLogExceptionCount();
public void reset();
| 1 |
for (K k : sm.keySet()) { | 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 |
* The HTML generator reads HTML from a source, converts it to XHTML
* using JTidy and generates SAX Events.
* @cocoon.sitemap.component.documentation
* The HTML generator reads HTML from a source, converts it to XHTML
* using JTidy and generates SAX Events.
* @cocoon.sitemap.component.documentation.caching Yes.
* Uses the last modification date of the xml document for validation
implements Configurable, CacheableProcessingComponent, Disposable {
private String xpath;
private XPathProcessor processor;
super.service(manager);
this.processor = (XPathProcessor) this.manager.lookup(XPathProcessor.ROLE);
if (configUrl != null) {
this.resolver.release(this.inputSource);
if (this.processor != null) {
this.processor = null;
this.manager = null; | 0 |
public static final BigInteger ONE_YB = ONE_KB_BI.multiply(ONE_ZB); | 1 |
public BufferedHeader(final CharArrayBuffer buffer) throws ParseException {
throw new ParseException("Invalid header: " + buffer.toString());
throw new ParseException("Invalid header: " + buffer.toString()); | 0 |
for (String p: allEphems) {
if(p.startsWith(prefixPath)) {
ephemerals.add(p); | 0 |
import org.apache.http.protocol.BasicHttpProcessor;
BasicHttpProcessor httpproc = new BasicHttpProcessor(); | 0 |
package org.apache.commons.digester3.binder;
/*
* 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.beam.sdk.metrics;
import org.apache.beam.sdk.PipelineResult;
import org.apache.beam.sdk.annotations.Experimental;
import org.apache.beam.sdk.annotations.Experimental.Kind;
/**
* Methods for interacting with the metrics of a pipeline that has been executed. Accessed via
* {@link PipelineResult#metrics()}.
*/
@Experimental(Kind.METRICS)
public abstract class MetricResults {
/**
* Query for all metrics that match the filter.
*/
public abstract MetricQueryResults queryMetrics(MetricsFilter filter);
} | 0 |
* Encapsulates a {@link FileSystem} and a base {@link Path} within that filesystem. This also avoid the necessity to pass around a Configuration.
*
* @param p
* The suffix to use
*
* @param p
* The suffix to use
* Determine if the Path is valid on this Volume. A Path is valid if it is contained in the Volume's FileSystem and is rooted beneath the basePath | 0 |
(PrivilegedAction<GSSCredential>) () -> {
try {
return gssManager.createCredential(
null /* Use the service principal name defined in jaas.conf */,
GSSCredential.INDEFINITE_LIFETIME,
new Oid[] {new Oid(GSS_SPNEGO_MECH_OID), new Oid(GSS_KRB5_MECH_OID)},
GSSCredential.ACCEPT_ONLY);
} catch (GSSException e) {
throw Throwables.propagate(e); | 0 |
@Test
public void testBackfill() {
setUpStore(false);
snapshotStore.applySnapshot(makeNonBackfilled());
Snapshot backfilled = snapshotStore.createSnapshot();
assertEquals(expected(), makeComparable(backfilled));
}
private Snapshot makeNonBackfilled() {
Snapshot snapshot = expected();
snapshot.getTasks().forEach(e -> e.getAssignedTask().getTask().unsetResources());
snapshot.getCronJobs()
.forEach(e -> e.getJobConfiguration().getTaskConfig().unsetResources());
snapshot.getJobUpdateDetails()
.forEach(e -> e.getDetails().getUpdate().getInstructions()
.getDesiredState().getTask().unsetResources());
snapshot.getJobUpdateDetails()
.forEach(e -> e.getDetails().getUpdate().getInstructions()
.getInitialState().forEach(i -> i.getTask().unsetResources()));
return snapshot;
}
| 0 |
import com.twitter.aurora.scheduler.storage.entities.IJobConfiguration;
import com.twitter.aurora.scheduler.storage.entities.IJobKey;
public Iterable<IJobConfiguration> fetchJobs(String managerId) {
public Optional<IJobConfiguration> fetchJob(String managerId, IJobKey jobKey) {
public void saveAcceptedJob(String managerId, IJobConfiguration jobConfig) {
public void removeJob(IJobKey jobKey) {
public Optional<JobUpdateConfiguration> fetchJobUpdateConfig(IJobKey jobKey) {
public void removeShardUpdateConfigs(IJobKey jobKey) { | 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.accumulo.hadoopImpl.mapred;
import java.io.IOException;
import java.util.Collection;
import org.apache.accumulo.core.client.impl.Table;
import org.apache.accumulo.core.data.Range;
import org.apache.hadoop.mapred.InputSplit;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
/**
* The Class BatchInputSplit. Encapsulates Accumulo ranges for use in Map Reduce jobs. Can contain
* several Ranges per InputSplit.
*/
@SuppressFBWarnings(value = "NM_SAME_SIMPLE_NAME_AS_SUPERCLASS",
justification = "Intended to share code between mapred and mapreduce")
public class BatchInputSplit extends org.apache.accumulo.hadoopImpl.mapreduce.BatchInputSplit
implements InputSplit {
public BatchInputSplit() {
super();
}
public BatchInputSplit(BatchInputSplit split) throws IOException {
super(split);
}
public BatchInputSplit(String table, Table.ID tableId, Collection<Range> ranges,
String[] location) {
super(table, tableId, ranges, location);
}
} | 0 |
package cloudtrace.instrument;
import org.junit.Test;
public class PerformanceTest {
@Test
public void test() {
}
public static void main(String[] args) {
long now = System.currentTimeMillis();
for (long i = 0; i < 1000*1000; i++) {
@SuppressWarnings("unused")
Long x = new Long(i);
}
System.out.println(String.format("Trivial took %d millis", System.currentTimeMillis() - now));
now = System.currentTimeMillis();
for (long i = 0; i < 1000*1000; i++)
{
Span s = Trace.start("perf");
s.stop();
}
System.out.println(String.format("Span Loop took %d millis", System.currentTimeMillis() - now));
now = System.currentTimeMillis();
Trace.on("test");
for (long i = 0; i < 1000*1000; i++)
{
Span s = Trace.start("perf");
s.stop();
}
Trace.off();
System.out.println(String.format("Trace took %d millis", System.currentTimeMillis() - now));
}
} | 1 |
// When HttpClient instance is no longer needed,
httpclient.getConnectionManager().shutdown();
InetSocketAddress socksaddr = new InetSocketAddress(proxyHost, proxyPort);
final Socket socket,
final InetSocketAddress localAddress,
final HttpParams params)
throw new ConnectTimeoutException("Connect to " + remoteAddress.getHostName() + "/"
| 0 |
import org.apache.accumulo.server.replication.ReplicationWorkAssignerHelper;
ReplicationTarget target = new ReplicationTarget("cluster1", "table1");
ReplicationTarget target1 = new ReplicationTarget("cluster1", "table1"), target2 = new ReplicationTarget("cluster1", "table2");
String keyTarget1 = target1.getPeerName() + ReplicationWorkAssignerHelper.KEY_SEPARATOR + target1.getRemoteIdentifier(), keyTarget2 = target2
.getPeerName() + ReplicationWorkAssignerHelper.KEY_SEPARATOR + target2.getRemoteIdentifier();
String key = filename1 + "|" + keyTarget1;
key = filename2 + "|" + keyTarget2;
String key = filename2 + "|" + keyTarget2;
key = filename1 + "|" + keyTarget1;
ReplicationTarget target1 = new ReplicationTarget("cluster1", "table1"), target2 = new ReplicationTarget("cluster1", "table2");
public void workNotReAdded() throws Exception {
ReplicationTarget target = new ReplicationTarget("cluster1", "table1");
String serializedTarget = target.getPeerName() + ReplicationWorkAssignerHelper.KEY_SEPARATOR + target.getRemoteIdentifier();
WorkSection.add(m, target.toText(), StatusUtil.openWithUnknownLengthValue());
| 1 |
import javax.persistence.EntityManager;
import org.easymock.EasyMock;
import com.google.inject.Provider;
bind(EntityManager.class).toProvider(EasyMock.createNiceMock(Provider.class)); | 0 |
public void testIso8859_1() {
Assert.assertEquals("ISO-8859-1", Charsets.ISO_8859_1.name());
}
@Test | 0 |
* any, must include the following acknowledgement:
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear. | 0 |
// any longer unless delayed component instances have to
// be kept (FELIX-3039)
if ( m_useCount == 0 && !getActivator().getConfiguration().keepInstances() ) | 0 |
headers = new HashMap<>(headers); | 1 |
* @author <a href="mailto:dev@mina.apache.org">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$ | 0 |
package org.apache.felix.ipojo.test.scenarios.ps;
import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
String type = "PS-FooProviderType-2";
ServiceReference fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName(), "PS-FooProviderType-2");
ServiceReference fact_ref = Utils.getServiceReferenceByName(context, Factory.class.getName(), "PS-FooProviderType-2");
ServiceReference fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), "PS-FooProviderType-2");
ServiceReference fact_ref = Utils.getServiceReferenceByName(context, ManagedServiceFactory.class.getName(), "PS-FooProviderType-2"); | 0 |
try (AccumuloClient accumuloClient = opts.createClient()) {
Scanner scanner = accumuloClient.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
scanner.fetchColumnFamily(TabletsSection.CurrentLocationColumnFamily.NAME);
scanner.fetchColumnFamily(DataFileColumnFamily.NAME);
scanner.setRange(MetadataSchema.TabletsSection.getRange());
Map<String,Long> totalBlocks = new HashMap<>();
Map<String,Long> localBlocks = new HashMap<>();
ArrayList<String> files = new ArrayList<>();
for (Entry<Key,Value> entry : scanner) {
Key key = entry.getKey();
if (key.compareColumnFamily(TabletsSection.CurrentLocationColumnFamily.NAME) == 0) {
String location = entry.getValue().toString();
String[] parts = location.split(":");
String host = parts[0];
addBlocks(fs, host, files, totalBlocks, localBlocks);
files.clear();
} else if (key.compareColumnFamily(DataFileColumnFamily.NAME) == 0) {
files.add(fs.getFullPath(key).toString());
}
}
System.out.println(" Server %local total blocks");
for (Entry<String,Long> entry : totalBlocks.entrySet()) {
final String host = entry.getKey();
final Long blocksForHost = entry.getValue();
System.out.println(String.format("%15s %5.1f %8d", host,
(localBlocks.get(host) * 100.) / blocksForHost, blocksForHost)); | 0 |
package org.apache.commons.vfs.provider.bzip2; | 0 |
* updates is also bound by {@link #getMinReportingInterval} and
* {@link #getMaxReportingInterval}.
/** The default lease duration to request from the external worker service (3 minutes). */
/** The lease renewal RPC latency margin (5 seconds). */
* {@link WorkProgressUpdater} does not generate update storms (5 seconds).
* {@link WorkProgressUpdater} does not cause monitoring staleness (10 minutes).
* that it falls between the [{@link #getMinReportingInterval},
* {@link #getMaxReportingInterval}] interval. Makes an attempt to bound
* {@link #getLeaseRenewalLatencyMargin}.
* Returns the current work item's suggested progress reporting interval.
return leaseRemainingTime(getWorkUnitLeaseExpirationTimestamp()) / 2; | 0 |
import org.apache.accumulo.core.clientImpl.ClientContext;
import org.apache.accumulo.core.clientImpl.Credentials;
import org.apache.accumulo.core.clientImpl.MasterClient;
import org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException;
import org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl; | 0 |
import org.apache.felix.dm.dependencies.Dependency;
.setStateMask(m_bundleStateMask)
for (Object d : dependencies) {
service.add(((Dependency) d).createCopy());
}
| 0 |
Set<String> onlineTables();
Set<TServerInstance> onlineTabletServers();
Collection<MergeInfo> merges();
| 1 |
StackConsumer /* @since 6.0 */, StackProducer { | 0 |
switch(s.charAt(8)) {
case 's': // optimizeSpeed
hints.put(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_OFF);
case 'l': // optimizeLegibility
hints.put(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
hints.put(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_DEFAULT); | 0 |
List<String> fail = client.bulkImportFiles(Tracer.traceInfo(), SystemCredentials.get().toThrift(master.getInstance()), tid, tableId, attempt,
errorDir, setTime); | 0 |
import com.twitter.mesos.scheduler.storage.AttributeStore;
import static com.google.common.base.Preconditions.checkNotNull;
* <p>
* Exposes bindings for storage components:
* <ul>
* <li>{@link com.twitter.mesos.scheduler.storage.Storage}</li>
* <li>Keyed with keys provided by the provided{@code keyFactory}:</li>
* <ul>
* <li>{@link com.twitter.mesos.scheduler.storage.SchedulerStore}</li>
* <li>{@link com.twitter.mesos.scheduler.storage.JobStore}</li>
* <li>{@link com.twitter.mesos.scheduler.storage.TaskStore}</li>
* <li>{@link com.twitter.mesos.scheduler.storage.UpdateStore}</li>
* <li>{@link com.twitter.mesos.scheduler.storage.QuotaStore}</li>
* <li>{@link com.twitter.mesos.scheduler.storage.AttributeStore}</li>
* </ul>
* </ul>
private final KeyFactory keyFactory;
public MemStorageModule(KeyFactory keyFactory) {
this.keyFactory = checkNotNull(keyFactory);
Key<T> key = keyFactory.create(binding);
bind(key).to(impl);
expose(key);
Key<Storage> storageKey = keyFactory.create(Storage.class);
expose(storageKey);
bindStore(AttributeStore.Mutable.class, MemAttributeStore.class); | 0 |
public static final Factory INSTANCE = new ExceptionFactory<>(); | 1 |
* @return this writer
* @since IO 2.0
* @return this writer
* @since IO 2.0
* @return this writer
* @since IO 2.0 | 0 |
/*
* Copyright 2001-2004 The Apache Software Foundation.
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* @version $Id: JNDIConfiguration.java,v 1.7 2004/02/27 17:41:35 epugh Exp $ | 0 |
.add(DisplayData.item("foo", "bar"))
.add(DisplayData.item("foo2", DataflowPipelineTranslatorTest.class)
.withLinkUrl("http://www.google.com"));
builder.add(DisplayData.item("foo3", 1234));
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked") | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.