Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
* @param access_flags the class flags
*
*
* @throws IOException if a failure from reading from the bytes argument occurs
*
* @throws ClassFormatException if the signature is for Void
* @param chopit
* @param vars
if (str.indexOf(old) != -1) { // `old' found in str
*
* @throws ClassFormatException if signature is not a method signature
*
* @throws ClassFormatException if signature isn't a known type
/** Convert bytes into hexadecimal string
* @param bytes an array of bytes to convert to hexadecimal
*
* @return bytes as hexadecimal string, e.g. 00 FA 12 ...
/**
* @param ch the character to test if it's part of an identifier
*
* @return true, if character is one of (a, ... z, A, ... Z, 0, ... 9, _)
*
* @throws IOException if there's a gzip exception
*
* @throws IOException if there's a gzip exception | 0 |
options.put(Finder.NOT+Finder.PATH, "*CVS*");
// finds one in file and also one in dir as
// CVS needs a file in dir for people to commonly have it checked out
assertEquals(2, files.length); | 0 |
* Whether the component supports rolling restart.
* */
private boolean rollingRestartSupported;
/**
rollingRestartSupported = component.getRollingRestartSupported();
* Get whether the component supports rolling restart
*
* @return whether the component supports rolling restart
*/
@ApiModelProperty(name = "rollingRestartSupported")
public boolean isRollingRestartSupported(){
return rollingRestartSupported;
}
/** | 0 |
Configuration c = (Configuration) conf.clone();
* the original are completely detached.
XMLConfiguration c = (XMLConfiguration) conf.clone(); | 0 |
* @version CVS $Id: Tokenizer.java,v 1.3 2004/03/28 14:28:04 antonio Exp $
* @deprecated Use methos from org.apache.commons.lang instead | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/compiler/ProcessingInstructionTest.java,v 1.6 2003/03/11 00:59:22 dmitri Exp $
* $Revision: 1.6 $
* $Date: 2003/03/11 00:59:22 $
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
* @version $Revision: 1.6 $ $Date: 2003/03/11 00:59:22 $ | 0 |
import org.apache.beam.runners.core.StateNamespaces.WindowNamespace; | 0 |
@Column(name = "authenticated_user_id")
private Integer authenticatedUserId;
public Integer getAuthenticatedUserId() {
return authenticatedUserId;
}
public void setAuthenticatedUserId(Integer authenticatedUser) {
this.authenticatedUserId = authenticatedUser;
}
| 0 |
protected int keyCode;
protected char keyChar;
/**
* The key location.
*/
protected int keyLocation;
* @param lockState bitmask indicating which key locks were activated
* @param keyCode the Java key code
* @param keyChar the generated character
* @param keyLocation the location of the key
long when, int modifiers, int lockState,
int keyCode, char keyChar, int keyLocation) {
super(source, id, when, modifiers, lockState);
this.keyLocation = keyLocation;
/**
* Returns the key location.
*/
public int getKeyLocation() {
return keyLocation;
} | 0 |
int dx = xCurrent - xStart;
int dy = yCurrent - yStart;
if (dx < 0) {
dx = -dx;
xStart = xCurrent;
}
if (dy < 0) {
dy = -dy;
yStart = yCurrent;
}
float scaleX = size.width / (float)dx;
float scaleY = size.height / (float)dy; | 0 |
package org.apache.batik.anim.dom; | 0 |
package org.apache.beam.sdk.io.gcp.testing;
import org.apache.beam.sdk.testing.FastNanoClockAndSleeper; | 0 |
AccumuloRowInputFormat.setClientInfo(job, getClientInfo()); | 0 |
BeamRecord
.withRecordType(BID_ADAPTER.getRecordType())
.addValues(BID_ADAPTER.getFieldsValues(BID1_EUR))
.build();
BeamRecord
.withRecordType(BID_ADAPTER.getRecordType())
.addValues(BID_ADAPTER.getFieldsValues(BID2_EUR))
.build(); | 0 |
import org.apache.batik.bridge.resources.Messages;
import org.apache.batik.ext.awt.image.renderable.Clip;
import org.apache.batik.ext.awt.image.renderable.ClipRable8Bit;
import org.apache.batik.ext.awt.image.renderable.Filter;
Viewport oldViewport = ctx.getViewport();
ctx.setViewport(new ObjectBoundingBoxViewport());
ctx.setViewport(oldViewport); | 0 |
* @deprecated (4.1) use {@link #setObjects(Map)} | 0 |
Table table = metaStore.getTables().get("person");
Table table = metaStore.getTables().get("person");
Table table = metaStore.getTables().get("person");
Table table = metaStore.getTables().get("person"); | 0 |
/*
* @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
*/ | 0 |
private final String instanceId;
this.instanceId = instanceId; | 0 |
package org.apache.beam.runners.core.metrics;
import java.io.Serializable;
import org.apache.beam.sdk.metrics.MetricQueryResults;
import org.apache.beam.sdk.metrics.MetricResults;
/**
* Abstract base class for all metric sinks.
*/
public abstract class MetricsSink<OutputT> implements Serializable{
private MetricsSerializer<OutputT> metricsSerializer = provideSerializer();
void writeMetrics(MetricQueryResults metricQueryResults) throws Exception {
OutputT serializedMetrics = metricsSerializer.serializeMetrics(metricQueryResults);
writeSerializedMetrics(serializedMetrics);
}
protected abstract MetricsSerializer<OutputT> provideSerializer();
protected abstract void writeSerializedMetrics(OutputT metrics) throws Exception;
}
| 0 |
* @return The connection URI.
* @return The Properties.
* @return The user name. | 0 |
* http://www.apache.org/licenses/LICENSE-2.0 | 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 |
StructType structType = ts.defineStructType("ts", true, createRequiredAttrDef("a", DataTypes.INT_TYPE),
Struct s = createStructWithEnum("ts"); | 0 |
* @since 2.4 | 0 |
*
*
* defined in the parent class. All users (based on username) share a single
*
* When a <code>getConnection(username, password)</code> request is processed
* throwing an exception, or -1 to wait indefinitely. Will fail
* throwing an exception, or -1 to wait indefinitely. Will fail
protected PooledConnectionAndInfo
*
String username, String password)
factory.setMaxConnLifetimeMillis(getMaxConnLifetimeMillis());
try | 0 |
/*
* Copyright (C) 2015 Google Inc.
*
* 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 com.google.cloud.dataflow.examples;
import com.google.common.io.Files;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.io.File;
import java.nio.charset.StandardCharsets;
/**
* Tests for {@link DebuggingWordCount}.
*/
@RunWith(JUnit4.class)
public class DebuggingWordCountTest {
@Rule public TemporaryFolder tmpFolder = new TemporaryFolder();
@Test
public void testDebuggingWordCount() throws Exception {
File file = tmpFolder.newFile();
Files.write("stomach secret Flourish message Flourish here Flourish", file,
StandardCharsets.UTF_8);
DebuggingWordCount.main(new String[]{"--inputFile=" + file.getAbsolutePath()});
}
}
| 0 |
case EXACT :
// TODO exact version handing
break; | 0 |
/* ====================================================================
* Copyright (c) 2001-2004 The Apache Software Foundation. All rights
* @version $Revision: 1.11 $ $Date: 2004/01/14 21:34:30 $ | 0 |
import org.apache.atlas.TestOnlyModule;
@Guice(modules = TestOnlyModule.class) | 0 |
if ((m_type != null) && m_type.equalsIgnoreCase(Resource.VERSION)) | 0 |
String fileName = "build/encryptedInfo.xml";
String fileName = "build/kek";
outputDocToFile(document, "build/decryptedInfo.xml"); | 0 |
* Extension of {@link AbstractTestCollection} for exercising the {@link TransformedCollection} | 0 |
implements SynchronousBundleListener, FrameworkListener, ServiceListener{ | 0 |
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.atlas.utils.AtlasJson;
callAPIWithResource(API_VERSION, resource, null, ObjectNode.class);
ObjectNode response = callAPIWithResource(API_STATUS, resource, null, ObjectNode.class);
result = response.get("Status").asText();
if (responseType.getRawClass().equals(ObjectNode.class)) {
JsonNode jsonObject = AtlasJson.parseToV1JsonNode(stringEntity);
} catch (IOException e) {
ObjectNode callAPIWithRetries(API api, Object requestObject, ResourceCreator resourceCreator)
return callAPIWithResource(api, resource, requestObject, ObjectNode.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.sshd.agent.local;
import org.apache.sshd.common.channel.Channel;
import org.apache.sshd.common.channel.ChannelFactory;
/**
* @author <a href="mailto:dev@mina.apache.org">Apache MINA SSHD Project</a>
*/
public class ChannelAgentForwardingFactory implements ChannelFactory {
public static final ChannelAgentForwardingFactory INSTANCE = new ChannelAgentForwardingFactory();
public ChannelAgentForwardingFactory() {
super();
}
@Override
public String getName() {
return "auth-agent@openssh.com";
}
@Override
public Channel create() {
return new ChannelAgentForwarding();
}
} | 0 |
@Override
@Override
@Override
@Override | 0 |
import org.apache.http.params.CoreConnectionPNames;
* Creates an instance of this class.
* <p>
* The following HTTP parameters affect the initialization:
* <p>
* {@link CoreConnectionPNames#MAX_HEADER_COUNT} parameter determines
* the maximum HTTP header count allowed. If set to a positive value,
* the number of HTTP headers received from the data stream exceeding
* this limit will cause an IOException. A negative or zero value will
* effectively disable the check. Per default the check is disabled.
* <p>
* {@link CoreConnectionPNames#MAX_LINE_LENGTH} parameter determines
* the maximum line length limit. If set to a positive value, any HTTP line
* exceeding this limit will cause an IOException. A negative or zero value
* will effectively disable the check the check. Per default the check is
* disabled.
* | 0 |
* @param cursor the parser cursor containing the current position and
*
CharArrayBuffer buffer,
* @param cursor the parser cursor containing the current position and
* @param cursor the parser cursor containing the current position and | 0 |
c.accept("rp:" + k.getRowData().subSequence(0, 2));
c.accept("fp:" + k.getColumnFamilyData().subSequence(0, 2));
c.accept("qp:" + k.getColumnQualifierData().subSequence(0, 2)); | 0 |
import javax.xml.XMLConstants;
@SuppressWarnings("unchecked")
private static final ThreadLocal<DocumentBuilder> tl[][] = new ThreadLocal[2][2];
static {
tl[0][0] = new MyThreadLocal(false, false);
tl[0][1] = new MyThreadLocal(false, true);
tl[1][0] = new MyThreadLocal(true, false);
tl[1][1] = new MyThreadLocal(true, true);
}
DocumentBuilder documentBuilder = tl[validating ? 1 : 0][disAllowDocTypeDeclarations ? 1 : 0].get();
documentBuilder.reset();
return documentBuilder;
private static final class MyThreadLocal extends ThreadLocal<DocumentBuilder> {
private final boolean validating;
private final boolean disAllowDocTypeDeclarations;
public MyThreadLocal(boolean validating, boolean disAllowDocTypeDeclarations) {
this.validating = validating;
this.disAllowDocTypeDeclarations = disAllowDocTypeDeclarations;
@Override
protected DocumentBuilder initialValue() {
try {
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
dfactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE);
if (disAllowDocTypeDeclarations) {
dfactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
dfactory.setValidating(validating);
dfactory.setNamespaceAware(true);
return dfactory.newDocumentBuilder();
} catch (ParserConfigurationException e) {
throw new RuntimeException(e);
} | 0 |
if(getProcessMyRequests() == true) { | 0 |
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.dom.util;
/**
* This class represents a stack of HashTable objects.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id$
*/
public class HashTableStack {
/**
* The current link.
*/
protected Link current = new Link(null);
/**
* Creates a new HashTableStack object.
*/
public HashTableStack() {
}
/**
* Pushes a new table on the stack.
*/
public void push() {
current = new Link(current);
}
/**
* Removes the table on the top of the stack.
*/
public void pop() {
current = current.next;
}
/**
* Creates a mapping in the table on the top of the stack.
*/
public String put(String s, Object o) {
return (String)current.table.put(s, o);
}
/**
* Gets an item in the table on the top of the stack.
*/
public String get(String s) {
for (Link l = current; l != null; l = l.next) {
String uri = (String)l.table.get(s);
if (uri != null) {
return uri;
}
}
return null;
}
/**
* To store the hashtables.
*/
protected static class Link {
/**
* The table.
*/
public HashTable table;
/**
* The next link.
*/
public Link next;
/**
* Creates a new link.
*/
public Link(Link n) {
table = new HashTable();
next = n;
}
}
} | 1 |
* Copyright 2000-2009 The Apache Software Foundation | 0 |
* Represents a disposable system resource used for handling
* cached response bodies.
/**
* Returns an {@link InputStream} from which the response
* body can be returned.
* @throws IOException
*/
/**
* Returns the length in bytes of the response body.
*/
/**
* Indicates the system no longer needs to keep this
* response body and any system resources associated with
* it may be reclaimed.
*/ | 0 |
*
*
*
"IBM367",
"cp367",
"ascii7",
"ANSI_X3.4-1986",
"us",
"646",
"iso_646.irv:1983", | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/functions/ConstructorFunction.java,v 1.5 2002/04/26 03:28:37 dmitri Exp $
* $Revision: 1.5 $
* $Date: 2002/04/26 03:28:37 $
import org.apache.commons.jxpath.JXPathException;
* @version $Revision: 1.5 $ $Date: 2002/04/26 03:28:37 $
throw new JXPathException("Cannot invoke constructor " + constructor, exception); | 0 |
import org.apache.http.entity.ByteArrayEntity;
CacheEntry cacheEntry = new CacheEntry(new Date(), new Date(),
new ProtocolVersion("HTTP",1,1), headers,
new ByteArrayEntity(new byte[] {}), 200, "OK");
CacheEntry cacheEntry = new CacheEntry(new Date(), new Date(),
new ProtocolVersion("HTTP",1,1), headers, new ByteArrayEntity(new byte[] {}),
200, "OK"); | 0 |
protected ClientConnectionOperator getOperator() { | 0 |
if (transform.getNumShards() > 0) {
last = last.mapToPair(new PairFunction<T, T, Void>() {
@Override
public Tuple2<T, Void> call(T t) throws Exception {
return new Tuple2<>(t, null);
}})
.repartition(transform.getNumShards())
.map(new Function<Tuple2<T, Void>, T>() {
@Override
public T call(Tuple2<T, Void> tuple) throws Exception {
return tuple._1();
}});
} | 0 |
* $Id: VersionRange.java 46 2008-01-17 19:05:21Z peter.kriens@aqute.biz $
static String V = "[0-9]+(\\.[0-9]+(\\.[0-9]+(\\.[a-zA-Z0-9_-]+)?)?)?";
static Pattern RANGE = Pattern.compile("(\\(|\\[)\\s*(" + V + ")\\s*,\\s*(" + V
+ ")\\s*(\\)|\\])");
low = new Version(m.group(2));
high = new Version(m.group(6));
if (low.compareTo(high) > 0)
} | 0 |
/** literal value. */
/**
* Create the node given an id.
*
* @param id node id.
*/
/**
* Create a node with the given parser and id.
*
* @param p a parser.
* @param id node id.
*/
/** {@inheritDoc} */
*
* @param obj the object to evaluate against.
* @param ctx the {@link JexlContext}.
* @throws Exception on any error.
* @return the resulting value.
* @see ASTArrayAccess#evaluateExpr(Object, Object)
public Object execute(Object obj, JexlContext ctx) throws Exception {
return ASTArrayAccess.evaluateExpr(obj, val);
/** {@inheritDoc} */ | 0 |
private synchronized void startListeningForLogService() { | 0 |
final String method = getMethod();
final ProtocolVersion ver = getProtocolVersion();
final URI uri = getURI(); | 0 |
HashSet<Text> splits1 = new HashSet<>(env.getConnector().tableOperations().listSplits(indexTableName));
HashSet<Text> splits2 = new HashSet<>(env.getConnector().tableOperations().listSplits(tmpIndexTableName));
HashMap<String,String> props1 = new HashMap<>();
HashMap<String,String> props2 = new HashMap<>(); | 1 |
private static final String AMS_SITE = "ams-site";
private static final String AMS_MODE = "timeline.metrics.service.operation.mode";
private static final String AMS_HBASE_SITE = "ams-hbase-site";
private static final String HBASE_ROOTDIR = "hbase.rootdir";
boolean isDistributed = false;
Config amsSite = cluster.getDesiredConfigByType(AMS_SITE);
if (amsSite != null) {
if ("distributed".equals(amsSite.getProperties().get(AMS_MODE))) {
isDistributed = true;
}
}
if (isDistributed) {
Config amsHbaseSite = cluster.getDesiredConfigByType(AMS_HBASE_SITE);
if (amsHbaseSite != null) {
Map<String, String> amsHbaseSiteProperties = amsHbaseSite.getProperties();
String rootDir = amsHbaseSiteProperties.get(HBASE_ROOTDIR);
if (StringUtils.isNotEmpty(rootDir) && rootDir.startsWith("hdfs://")) {
int indexOfSlash = rootDir.indexOf("/", 7);
Map<String, String> newProperties = new HashMap<>();
String newRootdir = rootDir.substring(indexOfSlash);
newProperties.put(HBASE_ROOTDIR, newRootdir);
LOG.info("Changing ams-hbase-site rootdir to " + newRootdir);
updateConfigurationPropertiesForCluster(cluster, AMS_HBASE_SITE, newProperties, true, true);
}
}
}
| 0 |
import static org.apache.beam.sdk.io.common.IOITHelper.getHashForRecordCount;
return getHashForRecordCount(rowCount, EXPECTED_HASHES); | 0 |
import org.apache.excalibur.source.Source;
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String src, Parameters parameters)
Source source = null;
try {
source = resolver.resolveURI(formSource);
Form form = formManager.createForm(source);
Request request = ObjectModelHelper.getRequest(objectModel);
request.setAttribute(formAttribute, form);
} finally {
resolver.release(source);
} | 0 |
import org.apache.accumulo.core.client.impl.Tables;
import org.apache.accumulo.core.master.state.tables.TableState;
import org.apache.accumulo.master.Master;
private Master master;
public ReplicationMetrics(Master master) throws MalformedObjectNameException, AccumuloException, AccumuloSecurityException {
this.master = master;
replicationUtil = new ReplicationUtil(master);
if (TableState.ONLINE != Tables.getTableState(master.getInstance(), ReplicationTable.ID)) {
Map<String,String> peers = replicationUtil.getPeers();
Set<ReplicationTarget> allConfiguredTargets = replicationUtil.getReplicationTargets();
Map<ReplicationTarget,Long> targetCounts = replicationUtil.getPendingReplications();
return replicationUtil.getPeers().size();
return replicationUtil.getMaxReplicationThreads(master.getMasterMonitorInfo()); | 1 |
if (LOG.isDebugEnabled()) {
if (LOG.isDebugEnabled()) {
if (LOG.isDebugEnabled()) {
if (LOG.isDebugEnabled()) {
if (LOG.isDebugEnabled()) {
if (LOG.isDebugEnabled()) { | 0 |
import java.nio.charset.StandardCharsets;
import org.apache.hc.core5.annotation.NotThreadSafe;
import org.apache.hc.core5.http.NameValuePair;
import org.apache.hc.core5.http.entity.ContentType;
import org.apache.hc.core5.http.entity.StringEntity;
charset != null ? charset : StandardCharsets.ISO_8859_1),
* of parameters with the default encoding of {@link StandardCharsets#ISO_8859_1}
* of parameters with the default encoding of {@link StandardCharsets#ISO_8859_1} | 0 |
import com.google.common.collect.ImmutableMap;
expect(storageUtil.quotaStore.fetchQuotas())
.andReturn(ImmutableMap.of("steve", Quotas.NO_QUOTA)); | 0 |
import java.util.Arrays;
import java.util.List;
* Project types which this plugin supports.
*
* @parameter
*/
private List supportedProjectTypes = Arrays.asList( new String[]
{ "jar", "bundle" } );
/**
if ( !supportedProjectTypes.contains( project.getPackaging() ) )
{
getLog().info( "Ignoring packaging type " + project.getPackaging() );
return;
}
else if ( "NONE".equalsIgnoreCase( obrRepository ) ) | 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 |
/*
/**
* Checks case when there are 2 cluster stack versions present (CURRENT and OUT_OF_SYNC),
* and we add a new host to cluster. On a new host, both CURRENT and OUT_OF_SYNC host
* versions should be present
*/ | 0 |
import org.apache.accumulo.harness.UnmanagedAccumuloIT;
public class ConstraintIT extends UnmanagedAccumuloIT { | 0 |
LoggingHttp1StreamListener.INSTANCE); | 0 |
import org.apache.ambari.server.actionmanager.CustomActionDBAccessor;
import org.apache.ambari.server.actionmanager.CustomActionDBAccessorImpl;
bind(CustomActionDBAccessor.class).to(CustomActionDBAccessorImpl.class); | 0 |
import org.mockito.junit.MockitoJUnitRunner; | 0 |
* Copyright 2000-2009 The Apache Software Foundation | 0 |
public class StrokeLinejoinFactory
extends AbstractIdentifierFactory
implements SVGValueConstants {
values.put(CSS_MITER_VALUE, MITER_VALUE);
values.put(CSS_ROUND_VALUE, ROUND_VALUE);
values.put(CSS_BEVEL_VALUE, BEVEL_VALUE);
return CSS_STROKE_LINEJOIN_PROPERTY; | 0 |
StateTags.combiningValueFromInputInternal(
"sumInteger", VarIntCoder.of(), new Sum.SumIntegerFn()); | 0 |
import java.util.Map;
Map<TupleTag<?>, PValue> expand(); | 0 |
package org.apache.beam.sdk.extensions.sql.meta.provider.text;
protected BeamTextTable(BeamRecordSqlType beamRecordSqlType, String filePattern) {
super(beamRecordSqlType); | 0 |
/**
* Copyright 2008, Yahoo! Inc.
*
* 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 com.yahoo.zookeeper.jmx.server.quorum;
/**
* Leader election protocol MBean.
*/
public interface LeaderElectionMXBean {
/**
* @return leader election instance name
*/
public String getName();
/**
*
* @return the time when the leader election started
*/
public String getStartTime();
} | 0 |
throw new IllegalArgumentException("invalid option " + RADIX_OPTION + ":" + options.get(RADIX_OPTION)); | 1 |
public void prepare() {
storage.prepare();
}
@Override | 0 |
import org.apache.accumulo.core.data.NamespaceId;
import org.apache.accumulo.core.data.TableId;
private final TableId tableId;
private final NamespaceId namespaceId;
public CompactRange(NamespaceId namespaceId, TableId tableId, byte[] startRow, byte[] endRow,
throw new AcceptableThriftTableOperationException(tableId.canonical(), null,
throw new AcceptableThriftTableOperationException(tableId.canonical(), null,
throw new AcceptableThriftTableOperationException(tableId.canonical(), null,
static void removeIterators(Master environment, final long txid, TableId tableId) | 0 |
import com.google.common.collect.ImmutableMultimap;
import org.apache.aurora.scheduler.sla.SlaGroup.GroupType;
import static org.apache.aurora.scheduler.sla.MetricCalculator.MetricCategory.JOB_UPTIMES;
import static org.apache.aurora.scheduler.sla.MetricCalculator.MetricCategory.MEDIANS;
import static org.apache.aurora.scheduler.sla.MetricCalculator.MetricCategory.PLATFORM_UPTIME;
import static org.apache.aurora.scheduler.sla.MetricCalculator.NAME_QUALIFIER_NON_PROD;
import static org.apache.aurora.scheduler.sla.MetricCalculator.NAME_QUALIFIER_PROD;
static final Multimap<AlgorithmType, GroupType> PROD_METRICS =
ImmutableMultimap.<AlgorithmType, GroupType>builder()
.putAll(JOB_UPTIMES.getMetrics())
.putAll(MEDIANS.getMetrics())
.putAll(PLATFORM_UPTIME.getMetrics())
.build();
static final Multimap<AlgorithmType, GroupType> NON_PROD_METRICS =
ImmutableMultimap.<AlgorithmType, GroupType>builder()
.putAll(JOB_UPTIMES.getMetrics())
.putAll(MEDIANS.getMetrics())
.putAll(PLATFORM_UPTIME.getMetrics())
.build();
MetricCalculatorSettings settings = new MetricCalculatorSettings(
10000,
ImmutableSet.of(JOB_UPTIMES, MEDIANS, PLATFORM_UPTIME),
ImmutableSet.of(JOB_UPTIMES, MEDIANS, PLATFORM_UPTIME));
names.add(metric + entry.getKey().getAlgorithmName() + NAME_QUALIFIER_PROD);
names.add(metric + entry.getKey().getAlgorithmName() + NAME_QUALIFIER_NON_PROD); | 0 |
public CopyOnAccessInMemoryStateInternals<K> commit() { | 0 |
import org.springframework.beans.factory.support.*;
* @param element Can be null.
* @param info ConfigurationInfo.
* @param registry BeanDefinitionRegistry.
* @param reader Can be null.
* @param resourceLoader ResourceLoader.
* @throws Exception from called components.
// add string template parser for sitemap variable substitution
final ChildBeanDefinition parserDef = new ChildBeanDefinition("org.apache.cocoon.template.expression.AbstractStringTemplateParser");
parserDef.setBeanClassName("org.apache.cocoon.components.treeprocessor.variables.LegacySitemapStringTemplateParser");
parserDef.setSingleton(true);
parserDef.setLazyInit(false);
parserDef.getPropertyValues().addPropertyValue("serviceManager", new RuntimeBeanReference("org.apache.avalon.framework.service.ServiceManager"));
this.register(parserDef, "org.apache.cocoon.el.parsing.StringTemplateParser/legacySitemap", null, registry);
final RootBeanDefinition resolverDef = new RootBeanDefinition();
resolverDef.setBeanClassName("org.apache.cocoon.components.treeprocessor.variables.StringTemplateParserVariableResolver");
resolverDef.setLazyInit(false);
resolverDef.setScope("prototype");
resolverDef.getPropertyValues().addPropertyValue("stringTemplateParser", new RuntimeBeanReference("org.apache.cocoon.el.parsing.StringTemplateParser/legacySitemap"));
resolverDef.getPropertyValues().addPropertyValue("objectModel", new RuntimeBeanReference("org.apache.cocoon.el.objectmodel.ObjectModel"));
this.register(resolverDef, "org.apache.cocoon.components.treeprocessor.variables.StringTemplateParserVariableResolver", null, registry); | 0 |
package org.apache.felix.cm.impl.persistence;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.apache.felix.cm.impl.CaseInsensitiveDictionary;
import org.apache.felix.cm.impl.Factory;
import org.apache.felix.cm.impl.SimpleFilter;
public class CachingPersistenceManagerProxy implements ExtPersistenceManager
private volatile boolean fullyLoaded;
@Override
public void delete( final String pid ) throws IOException
@Override
public boolean exists( final String pid )
@Override
return Collections.enumeration(getDictionaries( null ));
@Override
public Collection<Dictionary> getDictionaries( final SimpleFilter filter ) throws IOException
cache.put( pid, new CaseInsensitiveDictionary( next ) );
cache.put( pid, new CaseInsensitiveDictionary( next ) );
final List<Dictionary> configs = new ArrayList<Dictionary>();
for (final Dictionary d : cache.values())
configs.add( new CaseInsensitiveDictionary( d ) );
return configs;
* such dictionary is stored by the underlying persistence manager. This
@Override
public Dictionary load( final String pid ) throws IOException
CaseInsensitiveDictionary loaded = cache.get( pid );
final Dictionary props = pm.load( pid );
if ( props != null )
{
loaded = new CaseInsensitiveDictionary( props );
cache.put( pid, loaded );
}
return new CaseInsensitiveDictionary(loaded);
@Override
public void store( final String pid, final Dictionary properties ) throws IOException
cache.put( pid, new CaseInsensitiveDictionary( properties ) ); | 0 |
@SuppressWarnings("Finally") | 0 |
assertEquals("Mismatched suffling selected for current=" + expected + ", available=" + available,
expected, SftpVersionSelector.CURRENT.selectVersion(expected, available));
final int fixedValue = 7365;
testVersionSelector(SftpVersionSelector.Utils.fixedVersionSelector(fixedValue), fixedValue);
+ " for current= " + version
+ ", available=" + unavailable
+ ", preferred=" + preferred); | 0 |
/**
* Copyright 2008, Yahoo! Inc.
*
* 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 com.yahoo.zookeeper.jmx.server.quorum;
import com.yahoo.zookeeper.jmx.server.ZooKeeperServerBean;
import com.yahoo.zookeeper.server.quorum.QuorumPeer;
/**
* Implementation of the local peer MBean interface.
*/
public class LocalPeerBean extends ZooKeeperServerBean implements LocalPeerMXBean {
private QuorumPeer peer;
public LocalPeerBean(QuorumPeer peer){
this.peer=peer;
}
public String getName() {
return "replica."+peer.getId();
}
public boolean isHidden() {
return false;
}
public String getQuorumAddress() {
return peer.getQuorumAddress().getHostName()+":"+
peer.getQuorumAddress().getPort();
}
} | 0 |
Copyright 2003,2005 The Apache Software Foundation
import org.apache.batik.ext.awt.image.spi.ImageWriter;
import org.apache.batik.ext.awt.image.spi.ImageWriterRegistry;
OutputStream out = new FileOutputStream(imgFile);
try {
saveImage(img, out);
} finally {
out.close();
}
throws IOException {
ImageWriter writer = ImageWriterRegistry.getInstance()
.getWriterFor("image/png");
writer.writeImage(img, os);
saveImage(img, imageFile); | 0 |
import org.apache.http.nio.reactor.SessionInputBuffer;
import org.apache.http.nio.reactor.SessionOutputBuffer;
this.requestParser = createRequestParser(this.inbuf, requestFactory, params);
this.responseWriter = createResponseWriter(this.outbuf, params);
protected NHttpMessageParser createRequestParser(
final SessionInputBuffer buffer,
final HttpRequestFactory requestFactory,
final HttpParams params) {
return new HttpRequestParser(buffer, requestFactory, params);
}
protected HttpResponseWriter createResponseWriter(
final SessionOutputBuffer buffer,
final HttpParams params) {
return new HttpResponseWriter(buffer, params);
}
| 0 |
try (AccumuloClient client = this.createClient()) { | 0 |
import org.apache.beam.sdk.io.fs.MatchResult.Metadata;
Metadata fileMetadata = FileSystems.matchSingleFileSpec(filename);
String schemaA = AvroUtils.readMetadataFromFile(fileMetadata.resourceId()).getSchemaString();
String schemaB = AvroUtils.readMetadataFromFile(fileMetadata.resourceId()).getSchemaString();
Metadata fileMetadata = FileSystems.matchSingleFileSpec(filename);
String schemaA = AvroUtils.readMetadataFromFile(fileMetadata.resourceId()).getSchemaString();
String schemaB = AvroUtils.readMetadataFromFile(fileMetadata.resourceId()).getSchemaString();
.withSchema(schemaA).createForSubrangeOfFile(fileMetadata, 0L, 0L);
.withSchema(schemaB).createForSubrangeOfFile(fileMetadata, 0L, 0L); | 0 |
nodeRenderContext.setTransform(usr2dev);
this.usr2dev = usr2dev;
//nodeRenderContext.setTransform(usr2dev); | 0 |
package org.apache.accumulo.core.cryptoImpl; | 0 |
import org.apache.xml.security.utils.XMLUtils;
DocumentBuilder documentBuilder = XMLUtils.createDocumentBuilder(false); | 0 |
@Override
@Override | 0 |
public ServletInfo(final ResourceInfo resource) | 0 |
import org.apache.atlas.AtlasErrorCode;
import org.apache.atlas.model.typedef.AtlasBaseTypeDef;
AtlasAttributeDef multiValuedAttribMinMax = new AtlasAttributeDef();
AtlasAttributeDef multiValuedAttribMin = new AtlasAttributeDef();
AtlasAttributeDef multiValuedAttribMax = new AtlasAttributeDef();
multiValuedAttribMinMax.setName(MULTI_VAL_ATTR_NAME_MIN_MAX);
multiValuedAttribMinMax.setTypeName(AtlasBaseTypeDef.getArrayTypeName(ATLAS_TYPE_INT));
multiValuedAttribMin.setName(MULTI_VAL_ATTR_NAME_MIN);
multiValuedAttribMin.setTypeName(AtlasBaseTypeDef.getArrayTypeName(ATLAS_TYPE_INT));
multiValuedAttribMin.setCardinality(Cardinality.SET);
multiValuedAttribMax.setName(MULTI_VAL_ATTR_NAME_MAX);
multiValuedAttribMax.setTypeName(AtlasBaseTypeDef.getArrayTypeName(ATLAS_TYPE_INT));
multiValuedAttribMax.setCardinality(Cardinality.LIST);
@Test
public void testInvalidStructDef_MultiValuedAttributeNotArray() {
AtlasAttributeDef invalidMultiValuedAttrib = new AtlasAttributeDef("invalidAttributeDef", ATLAS_TYPE_INT);
invalidMultiValuedAttrib.setCardinality(Cardinality.LIST);
AtlasStructDef invalidStructDef = ModelTestUtil.newStructDef();
invalidStructDef.addAttribute(invalidMultiValuedAttrib);
try {
AtlasStructType invalidStructType = new AtlasStructType(invalidStructDef, ModelTestUtil.getTypesRegistry());
fail("invalidStructDef not detected: structDef=" + invalidStructDef + "; structType=" + invalidStructType);
} catch (AtlasBaseException excp) {
assertTrue(excp.getAtlasErrorCode() == AtlasErrorCode.INVALID_ATTRIBUTE_TYPE_FOR_CARDINALITY);
}
}
| 0 |
import org.apache.flink.api.common.functions.GroupCombineFunction;
* Flink {@link org.apache.flink.api.common.functions.GroupCombineFunction} for executing a
public class FlinkPartialReduceFunction<K, VI, VA> implements GroupCombineFunction<KV<K, VI>, KV<K, VA>> { | 0 |
Buffer buf = ByteArrayBuffer.getCompactClone(data, off, len); | 0 |
public class UncommittedBundleOutputManager implements OutputManager {
public static UncommittedBundleOutputManager create(
return new UncommittedBundleOutputManager(outputBundles);
public UncommittedBundleOutputManager(Map<TupleTag<?>, UncommittedBundle<?>> bundles) { | 0 |
else if (Tables.getTableState(context, tableId) == TableState.OFFLINE)
Tables.getPrintableTableInfoFromId(context, tableId), tse); | 0 |
import org.apache.ambari.server.agent.CommandRepository;
import org.apache.ambari.server.controller.spi.SystemException;
String repoInfoString;
try {
repoInfoString = repoVersionHelper.getRepoInfoString(cluster, component, host);
} catch (SystemException e) {
throw new RuntimeException(e);
}
hostLevelParams.put(REPO_INFO, repoInfoString);
CommandRepository commandRepository;
try {
commandRepository = repoVersionHelper.getCommandRepository(cluster, component, host);
} catch (SystemException e) {
throw new RuntimeException(e);
}
execCmd.setRepositoryFile(commandRepository); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.