Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
/*
* 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.
*/
package org.apache.cocoon.template.jxtg.script.event;
import org.apache.cocoon.template.jxtg.JXTemplateGenerator;
import org.xml.sax.Locator;
import org.xml.sax.helpers.LocatorImpl;
public class Event {
protected final Locator location;
protected Event next; // in document order
public Event(Locator locator) {
this.location = locator != null ? new LocatorImpl(locator)
: JXTemplateGenerator.NULL_LOCATOR;
}
public final Locator getLocation() {
return location;
}
public Event getNext() {
return next;
}
public void setNext(Event next) {
this.next = next;
}
public String locationString() {
StringBuffer buf = new StringBuffer();
buf.append(location.getSystemId());
if (buf.length() > 0) {
buf.append(", ");
}
buf.append("Line " + location.getLineNumber());
int col = location.getColumnNumber();
if (col > 0) {
buf.append("." + col);
}
return buf.toString();
} | 0 |
* or more contributor license agreements. See the NOTICE file
* regarding copyright ownership. The ASF licenses this file
* with the License. You may obtain a copy of the License at
* KIND, either express or implied. See the License for the | 0 |
/* ====================================================================
* @version $Id: DualTreeBidiMap.java,v 1.11 2004/01/14 21:43:16 scolebourne Exp $ | 0 |
* Copyright 2001-2005 The Apache Software Foundation. | 0 |
CommandLineParser parser = CommandLineParserFactory.newParser();
CommandLine line = parser.parse( options, args ); | 0 |
package org.apache.beam.sdk.extensions.sql.impl.schema; | 0 |
* @version CVS $Id$ | 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 | 0 |
import org.apache.beam.sdk.util.ReleaseInfo;
// A common user agent token that indicates that this request was originated from Apache Beam.
private static final String USER_AGENT_PREFIX = "Apache_Beam_Java";
SpannerOptions.Builder builder = SpannerOptions.newBuilder();
if (spannerConfig.getProjectId() != null) {
builder.setProjectId(spannerConfig.getProjectId().get());
}
if (spannerConfig.getServiceFactory() != null) {
builder.setServiceFactory(spannerConfig.getServiceFactory());
}
ReleaseInfo releaseInfo = ReleaseInfo.getReleaseInfo();
builder.setUserAgentPrefix(USER_AGENT_PREFIX + "/" + releaseInfo.getVersion());
SpannerOptions options = builder.build(); | 0 |
*/
/** Multiply floats
*/
public FMUL() {
super(org.apache.bcel.Constants.FMUL);
}
/**
* Call corresponding visitor method(s). The order is:
* Call visitor methods of implemented interfaces first, then
* call methods according to the class hierarchy in descending order,
* i.e., the most specific visitXXX() call comes last.
*
* @param v Visitor object
*/
public void accept( Visitor v ) {
v.visitTypedInstruction(this);
v.visitStackProducer(this);
v.visitStackConsumer(this);
v.visitArithmeticInstruction(this);
v.visitFMUL(this);
} | 0 |
Long populateHostsId(ResultSet resultSet) throws SQLException { | 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.commons.vfs2.provider.http4s;
import org.apache.commons.vfs2.provider.FileNameParser;
import org.apache.commons.vfs2.provider.GenericURLFileNameParser;
/**
* <code>FileNameParser</code> implementation for http4s provider, setting default port to 443.
*/
public class Http4sFileNameParser extends GenericURLFileNameParser {
private static final int DEFAULT_PORT = 443;
private static final Http4sFileNameParser INSTANCE = new Http4sFileNameParser();
public Http4sFileNameParser() {
super(DEFAULT_PORT);
}
public static FileNameParser getInstance() {
return INSTANCE;
}
} | 0 |
return new KeyExtent(Table.ID.of(table), toText(end), toText(prev)); | 1 |
private final CuratorFramework client;
this.client = client;
LeaderLatch leaderLatch = new LeaderLatch(client, groupPath, endpoint.getHostName()); | 0 |
for(int i = 0; i < 1 /* was 16 */; i++) {
zk.create(path + '/' + i, data, Ids.OPEN_ACL_UNSAFE,
CreateMode.PERSISTENT);
// empty
if (zk != null) {
} | 0 |
import org.apache.http.annotation.Obsolete;
* <p>
* Please do not use attributes marked as @Obsolete. They have been rendered
* obsolete by RFC 6265.
@Obsolete
@Obsolete
@Obsolete
@Obsolete
@Obsolete | 0 |
@OneToOne(mappedBy = "clusterEntity", cascade = CascadeType.REMOVE) | 0 |
* @param listener | 0 |
* @author <a href="mailto:Thomas.DeWeese@Kodak.com">Thomas DeWeese</a>
* of its rendering attribute into account. That is, exclusive of any clipping, | 1 |
* The scheme registry. | 0 |
import org.apache.sshd.common.PropertyResolver;
public PipeDataReceiver(PropertyResolver resolver, Window localWindow) {
ChannelPipedInputStream in = new ChannelPipedInputStream(resolver, localWindow); | 0 |
final static String CFG_MAX_MEMORY_ELEMENTS = "euphoria.flink.batch.state.max.memory.elements"; | 0 |
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class MailContext extends DefaultContext {
private final Log logger = LogFactory.getLog(getClass());
protected Log getLogger() { | 0 |
package org.apache.felix.karaf.admin; | 0 |
import org.apache.atlas.AtlasException;
void defineEnums(TypeSystem ts) throws AtlasException {
protected void fillStruct(Struct s) throws AtlasException {
protected Struct createStructWithEnum(String typeName) throws AtlasException {
protected Referenceable createInstanceWithEnum(String typeName) throws AtlasException {
protected ClassType defineClassTypeWithEnum(TypeSystem ts) throws AtlasException {
public void testStruct() throws AtlasException {
public void testClass() throws AtlasException {
public void testStorage() throws AtlasException {
public void testJson() throws AtlasException { | 0 |
Assert.assertEquals("stuff", new String(b1, 0, len, Consts.ASCII));
Assert.assertEquals("more stuff", new String(b2, 0, len, Consts.ASCII));
buffer.write("stuff".getBytes(Consts.ASCII));
buffer.write("more ".getBytes(Consts.ASCII));
buffer.write("stuff".getBytes(Consts.ASCII));
Assert.assertEquals("stuff;more stuff", new String(content, Consts.ASCII)); | 0 |
shards.add(input.subList(i * input.size() / numShards, (i + 1) * input.size() / numShards));
private static <T> List<List<T>> shardExponentially(List<T> input, double base) { | 1 |
/**
* This iterator facilitates document-partitioned indexing. It is an example of extending the IntersectingIterator to customize the placement of the term and
* docID. It expects a table structure of the following form:
*
* row: shardID, colfam: docColf\0type, colqual: docID, value: doc
*
* row: shardID, colfam: indexColf, colqual: term\0type\0docID\0info, value: (empty)
*
* When you configure this iterator with a set of terms, it will return only the docIDs and docs that appear with all of the specified terms. The result will
* have the following form:
*
* row: shardID, colfam: indexColf, colqual: type\0docID\0info, value: doc
*
* This iterator is commonly used with BatchScanner or AccumuloInputFormat, to parallelize the search over all shardIDs.
*/ | 0 |
.setParameter(CoreProtocolPNames.ORIGIN_SERVER, "HttpComponents/1.1")
.setParameter(CoreProtocolPNames.USER_AGENT, "HttpComponents/1.1"); | 0 |
/* $Id$ | 0 |
Copyright 2001 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/ | 0 |
protected CoreUtil coreUtil;
this.coreUtil = new CoreUtil(env, cliContext); | 0 |
*
* @version $Id$
public abstract class MagicNumberRegistryEntry
extends AbstractRegistryEntry
* this magic number compairison.
boolean isMatch(InputStream is)
public boolean isCompatibleStream(InputStream is)
if (magicNumbers[i].isMatch(is)) | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/SetTopRule.java,v 1.16 2003/02/02 16:09:53 rdonkin Exp $
* $Revision: 1.16 $
* $Date: 2003/02/02 16:09:53 $
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
* @version $Revision: 1.16 $ $Date: 2003/02/02 16:09:53 $ | 0 |
public static class Action extends ComparableType<Action> {
public Action(String name) {
super(name);
public static final AlgorithmUsage Sym_Key_Wrap = new AlgorithmUsage("Sym_Key_Wrap");
public static final AlgorithmUsage Asym_Key_Wrap = new AlgorithmUsage("Asym_Key_Wrap");
public static final AlgorithmUsage Sym_Sig = new AlgorithmUsage("Sym_Sig");
public static final AlgorithmUsage Asym_Sig = new AlgorithmUsage("Asym_Sig");
public static final AlgorithmUsage Enc = new AlgorithmUsage("Enc");
public static final AlgorithmUsage Dig = new AlgorithmUsage("Dig");
public static final AlgorithmUsage C14n = new AlgorithmUsage("C14n");
public static class AlgorithmUsage extends ComparableType<AlgorithmUsage> {
public AlgorithmUsage(String name) {
super(name); | 0 |
* This class is a helper to <code>PNGTranscoder</code> that writes PNG images | 0 |
activateInternal( );
activateInternal(); | 0 |
import org.apache.sshd.client.SshClient;
import org.apache.sshd.client.channel.ClientChannel;
import org.apache.sshd.client.session.ClientSession;
import org.apache.sshd.server.SshServer; | 0 |
for (ScheduledTask task
: Storage.Util.weaklyConsistentFetchTasks(storage, Query.roleScoped(role))) {
| 0 |
.apply(Create.of((Void) null).withCoder(VoidCoder.of())) | 0 |
@RequiresSession
@RequiresSession | 0 |
import org.apache.ambari.server.configuration.Configuration;
private static Configuration config;
if (serReq.getLocalPort() != config.getTwoWayAuthPort()) {
public static void init(Configuration instance) {
config = instance;
} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/pointers/Attic/ContainerPointer.java,v 1.5 2002/04/12 02:28:06 dmitri Exp $
* $Revision: 1.5 $
* $Date: 2002/04/12 02:28:06 $
* @version $Revision: 1.5 $ $Date: 2002/04/12 02:28:06 $ | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/jelly-tags/bean/src/java/org/apache/commons/jelly/tags/bean/BeanTagLibrary.java,v 1.4 2003/02/25 22:54:22 jstrachan Exp $
* $Revision: 1.4 $
* $Date: 2003/02/25 22:54:22 $
* $Id: BeanTagLibrary.java,v 1.4 2003/02/25 22:54:22 jstrachan Exp $
import java.lang.reflect.Method;
import org.apache.commons.beanutils.MethodUtils;
* @version $Revision: 1.4 $
/** Synchronized map of tag names to invoke methods */
private Map invokeMethods = new Hashtable();
/**
* Allows tags to register new bean types with an associated method
*/
public void registerBean(String name, Class type, Method method) {
registerBean(name, type);
if (method != null) {
invokeMethods.put(name, method);
}
else {
invokeMethods.remove(name);
}
}
/**
* Allows tags to register new bean types with an associated method
*/
public void registerBean(String name, Class type, String methodName) {
Method method = MethodUtils.getAccessibleMethod(
type, methodName, BeandefTag.EMPTY_ARGUMENT_TYPES
);
registerBean(name, type, method);
}
Method invokeMethod = (Method) invokeMethods.get(name);
return new BeanTag(beanType, name, invokeMethod); | 0 |
protected final JexlInfo info;
public JexlException(JexlInfo dbg, String msg) {
public JexlException(JexlInfo dbg, String msg, Throwable cause) { | 0 |
Map<String,Long> totalBlocks = new HashMap<>();
Map<String,Long> localBlocks = new HashMap<>();
ArrayList<String> files = new ArrayList<>(); | 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
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* 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.atlas.catalog.projection;
import com.tinkerpop.blueprints.Vertex;
import org.apache.atlas.repository.Constants;
import org.apache.atlas.typesystem.persistence.Id;
/**
* Provides functionality common across implementations.
*/
public abstract class BaseRelation implements Relation {
protected boolean isDeleted(Vertex v) {
return ! Id.EntityState.ACTIVE.name().equals(
v.<String>getProperty(Constants.STATE_PROPERTY_KEY));
}
} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/ObjectArrayListIterator.java,v 1.7 2003/09/29 03:56:12 psteitz Exp $
* Implements a {@link ListIterator} over an array of objects.
* @version $Revision: 1.7 $ $Date: 2003/09/29 03:56:12 $
* @author Phil Steitz
return this.index - this.startIndex;
return this.index - this.startIndex - 1; | 0 |
public interface ClientSession extends Session, ClientAuthenticationManager { | 0 |
import org.apache.aurora.gen.CronCollisionPolicy;
for (CronCollisionPolicy policy : CronCollisionPolicy.values()) {
enumValueMapper.addEnumValue("cron_policies", policy.getValue(), policy.name());
}
| 0 |
case HOST_SVCCOMP_STOPPED:
return new ServiceComponentHostStoppedEvent(serviceComponentName, hostName, opTimestamp);
case HOST_SVCCOMP_STARTED:
return new ServiceComponentHostStartedEvent(serviceComponentName, hostName, opTimestamp); | 0 |
public int getSocketTimeoutMillis() {
public void setSocketTimeoutMillis(final int timeout) { | 0 |
Schema.builder()
.addArrayField("pojos", FieldType.array(FieldType.row(SIMPLE_POJO_SCHEMA)))
.build(); | 0 |
return attrName; | 0 |
public void informationResponse(final HttpResponse response) throws HttpException, IOException {
}
@Override | 0 |
} catch (final IOException | HttpException ex) { | 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 |
/**
* Copyright 2016 Seznam a.s.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ | 0 |
import com.google.common.base.Optional;
import com.twitter.mesos.gen.JobKey;
import com.twitter.mesos.scheduler.base.JobKeys;
private final Multimap<JobKey, String> tasksByJobKey =
Multimaps.synchronizedSetMultimap(HashMultimap.<JobKey, String>create());
private Multimap<JobKey, String> taskIdsByJobKey(Iterable<ScheduledTask> toIndex) {
Multimaps.index(toIndex, Tasks.SCHEDULED_TO_JOB_KEY),
Optional<JobKey> jobKey = JobKeys.from(query);
} else if (jobKey.isPresent()) {
Collection<String> taskIds = tasksByJobKey.get(jobKey.get()); | 0 |
/* $Id: TestConfigurablePluginAttributes.java,v 1.4 2004/05/07 01:30:00 skitching 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
* http://www.apache.org/licenses/LICENSE-2.0
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. | 0 |
import java.util.Optional;
import org.apache.beam.sdk.transforms.windowing.Window;
/** Operator working on some context. */
public abstract class ShuffleOperator<InputT, KeyT, OutputT> extends Operator<OutputT>
implements TypeAware.Key<KeyT>, TypeAware.Output<OutputT>, WindowAware<InputT> {
private final UnaryFunction<InputT, KeyT> keyExtractor;
@Nullable private final TypeDescriptor<KeyT> keyType;
@Nullable private final Window<InputT> window;
protected ShuffleOperator(
@Nullable String name,
UnaryFunction<InputT, KeyT> keyExtractor,
@Nullable TypeDescriptor<KeyT> keyType,
@Nullable Window<InputT> windowing) {
super(name, outputType);
this.window = windowing;
public UnaryFunction<InputT, KeyT> getKeyExtractor() {
public Optional<TypeDescriptor<KeyT>> getKeyType() {
return Optional.ofNullable(keyType);
}
@Override
public Optional<Window<InputT>> getWindow() {
return Optional.ofNullable(window); | 0 |
* See {@link #ObjectParamRule(int paramIndex, String attributeName, Object param)} | 0 |
/*
* Copyright 2005 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.
*
*/
package org.apache.felix.eventadmin.impl.dispatch;
import org.apache.felix.eventadmin.impl.tasks.HandlerTask;
/**
* This is the interface for a simple queue that allows to append or push arrays
* of tasks to it. The elements of such an array are added atomically (i.e, they
* are in the same order one after the other in the queue) either at the end or the
* front of the queue. Additionally, the queue can be closed.
*
* @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a>
*/
public interface TaskQueue
{
/**
* Append the tasks to this queue in one atomic operation while preserving their
* order.
*
* @param tasks The tasks to append to this queue
*
* @throws IllegalStateException in case that this queue is already closed
*/
public void append(HandlerTask[] tasks);
/**
* Push the tasks to this queue in one atomic operation while preserving their
* order.
*
* @param tasks The tasks to push to the front of this queue.
*
* @throws IllegalStateException in case that this queue is already closed
*/
public void push(HandlerTask[] tasks);
/**
* Close the queue.
*/
public void close();
} | 0 |
* @version $Revision: 1.2 $, $Date: 2004/10/18 10:44:31 $
String string = (String) value;
if (string.startsWith("0x"))
{
return new Byte((byte) Integer.parseInt(string.substring(2), 16));
}
else
{
return new Byte(string);
}
String string = (String) value;
if (string.startsWith("0x"))
{
return new Short((short) Integer.parseInt(string.substring(2), 16));
}
else
{
return new Short(string);
}
String string = (String) value;
if (string.startsWith("0x"))
{
return new Integer((int) Long.parseLong(string.substring(2), 16));
}
else
{
return new Integer(string);
}
String string = (String) value;
if (string.startsWith("0x"))
{
return new Long(new BigInteger(string.substring(2), 16).longValue());
}
else
{
return new Long(string);
}
String string = (String) value;
if (string.startsWith("0x"))
{
return new BigInteger(string.substring(2), 16);
}
else
{
return new BigInteger(string);
} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/model/beans/LangAttributePointer.java,v 1.8 2003/01/11 05:41:24 dmitri Exp $
* $Revision: 1.8 $
* $Date: 2003/01/11 05:41:24 $
* @version $Revision: 1.8 $ $Date: 2003/01/11 05:41:24 $
public LangAttributePointer(NodePointer parent) {
public QName getName() {
public QName getExpandedName() {
public String getNamespaceURI() {
public boolean isCollection() {
public int getLength() {
public Object getBaseValue() {
public Object getImmediateNode() {
public boolean isLeaf() {
public void setValue(Object value) {
throw new UnsupportedOperationException(
"Cannot change locale using the 'lang' attribute");
public String asPath() {
if (parent != null) {
if (buffer.length() == 0
|| buffer.charAt(buffer.length() - 1) != '/') {
public int hashCode() {
public boolean equals(Object object) {
if (object == this) {
if (!(object instanceof LangAttributePointer)) {
public boolean testNode(NodeTest test) {
public int compareChildNodePointers(
NodePointer pointer1,
NodePointer pointer2)
{ | 1 |
/*
* 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.
*/
package org.apache.cocoon.components.xpointer;
import org.xml.sax.SAXException;
public class UnsupportedPart implements PointerPart {
private String schemeName;
public UnsupportedPart(String schemeName) {
this.schemeName = schemeName;
}
public boolean process(XPointerContext xpointerContext) throws SAXException {
throw new SAXException("Scheme " + schemeName + " not supported by this XPointer implementation, as used in the fragment identifier " + xpointerContext.getXPointer());
}
} | 0 |
private static <InputT, OutputT> TransformEvaluator<ParDo.MultiOutput<InputT, OutputT>> parDo() {
JavaPairDStream<TupleTag<?>, WindowedValue<?>> all =
dStream.transformToPair(
new Function<
JavaRDD<WindowedValue<InputT>>,
JavaPairRDD<TupleTag<?>, WindowedValue<?>>>() {
public JavaPairRDD<TupleTag<?>, WindowedValue<?>> call(
JavaRDD<WindowedValue<InputT>> rdd) throws Exception {
transform.getSideInputs(),
JavaSparkContext.fromSparkContext(rdd.context()),
pviews);
return rdd.mapPartitionsToPair(
new MultiDoFnFunction<>(
transform.getMainOutputTag(),
List<TaggedPValue> outputs = context.getOutputs(transform);
if (outputs.size() > 1) {
// cache the DStream if we're going to filter it more than once.
all.cache();
}
for (TaggedPValue output : outputs) {
EVALUATORS.put(ParDo.MultiOutput.class, parDo()); | 0 |
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableMap; | 0 |
import org.apache.commons.io.filefilter.FileFilterTestCase;
suite.addTest(new TestSuite(FileSystemUtilsTestCase.class)); | 0 |
CipherOutputStream cos = new CipherOutputStream(outputStream, cipher); | 0 |
try (AccumuloClient client = createClient()) { | 0 |
catch (final RuntimeException e) | 0 |
for (byte b : bytes) {
if (b == c) { return true; } | 0 |
/** Gets the {@link PTransformMatcher} to identify {@link PTransform PTransforms} to replace. */
/** Gets the {@link PTransformOverrideFactory} of this override. */ | 1 |
Set<String> namespaces = null;
namespaces = connector.namespaceOperations().list();
log.debug("Unable to obtain list of namespaces", e);
namespaces = Collections.emptySet();
Set<String> modifiedNamespaces = new HashSet<String>();
for (String a : namespaces)
modifiedNamespaces.add(a.replaceAll("([\\s'\"])", "\\\\$1"));
options.put(Command.CompletionSet.NAMESPACES, modifiedNamespaces);
TABLENAMES, USERNAMES, COMMANDS, NAMESPACES
static Set<String> getNamespaces(Map<CompletionSet,Set<String>> objects) {
return objects.get(CompletionSet.NAMESPACES);
public void registerCompletionForNamespaces(Token root, Map<CompletionSet,Set<String>> completionSet) {
registerCompletionGeneral(root, completionSet.get(CompletionSet.NAMESPACES), true); | 0 |
import org.apache.sshd.common.util.closeable.AbstractCloseable;
public class SocksProxy extends AbstractCloseable implements IoHandler { | 0 |
paramsCasted.windowFn = Objects.requireNonNull(windowing);
/**
* Trigger defining operator builder.
*/
/**
* {@link WindowingStrategy.AccumulationMode} defining operator builder.
*/
* Last builder in a chain. It concludes this operators creation by calling {@link
* #output(OutputHint...)}. | 0 |
UserIdAuthentication auth;
if (authentication instanceof UserIdAuthentication) {
auth = (UserIdAuthentication) authentication;
return auth.getUserId(); | 0 |
private NetUtils() {
// Do not allow utility class to be instantiated.
}
| 0 |
import org.slf4j.Logger; | 0 |
this.connectTimeout = TimeValue.of(connectTimeout, timeUnit);
this.soTimeout = TimeValue.of(soTimeout, timeUnit);
this.soLinger = TimeValue.of(soLinger, timeUnit); | 0 |
* @version $Id$ | 1 |
this.checkLifecycleMethod(activateName, true, component.getActivate() != null);
this.checkLifecycleMethod(deactivateName, false, component.getDeactivate() != null);
* @param isActivate Whether this is the activate or deactivate method.
* @param isSpecified Whether this method has explicitely been specified or is just
* the default
final boolean isActivate,
final boolean isSpecified)
// if no method is found, we check for any method with that name to print some warnings or errors!
final String msg = "Lifecycle method " + methods[i].getName() + " has wrong number of arguments";
if ( isSpecified ) {
this.logError(container.getComponentDescription(), msg);
} else {
this.logWarn(container.getComponentDescription(), msg);
}
final String msg = "Lifecycle method " + methods[i].getName() + " has wrong argument "
+ methods[i].getParameterTypes()[0].getName();
if ( isSpecified ) {
this.logError(container.getComponentDescription(), msg);
} else {
this.logWarn(container.getComponentDescription(), msg);
} | 0 |
import org.apache.avalon.framework.service.ServiceException;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.avalon.framework.service.Serviceable;
* @version CVS $Id: AbstractContentEventAspect.java,v 1.3 2003/10/20 13:36:42 cziegeler Exp $
implements EventAspect, ThreadSafe, Serviceable {
protected ServiceManager manager;
/* (non-Javadoc)
* @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
*/
public void service(ServiceManager manager) throws ServiceException {
this.manager = manager;
} | 0 |
public static final String ENSURE = "AdapterAnnotation.autoConfig";
@ServiceDependency(filter = "(name=" + ENSURE + ")")
public final static String ENSURE = "AdapterAnnotation.autoConfig.field";
@ServiceDependency(filter = "(name=" + ENSURE + ")")
public final static String ENSURE = "AdapterAnnotation.callback";
@ServiceDependency(filter = "(name=" + ENSURE + ")")
public final static String ENSURE = "AdapterAnnotation.S1Impl";
@ServiceDependency(filter="(name=" + ENSURE + ")")
public final static String ENSURE = "AdapterAnnotation.S2Impl";
@ServiceDependency(filter="(name=" + ENSURE + ")") | 0 |
* new OldDoFn<KV<K, CoCombineResult>, T>() {
* new OldDoFn<CoCombineResult, T>() { | 0 |
managedConn.open(route, context, defaultParams); | 0 |
result = new BigDecimal(s.substring(0, last));
break;
}
case 'f':
case 'F': {
rclass = Float.class;
result = Float.valueOf(s.substring(0, last));
result = Double.valueOf(s.substring(0, last));
default: {
rclass = Double.class;
result = Double.valueOf(s);
} catch (NumberFormatException take3) {
result = new BigDecimal(s); | 0 |
final HttpHost target = new HttpHost("localhost");
final HttpRoute route = new HttpRoute(target);
final CPoolEntry entry = new CPoolEntry(LogFactory.getLog(getClass()), "id", route, conn,
final ConnectionRequest connRequest1 = mgr.requestConnection(route, null);
final HttpClientConnection conn1 = connRequest1.get(1, TimeUnit.SECONDS);
final HttpHost target = new HttpHost("localhost");
final HttpRoute route = new HttpRoute(target);
final CPoolEntry entry = new CPoolEntry(LogFactory.getLog(getClass()), "id", route, conn,
final ConnectionRequest connRequest1 = mgr.requestConnection(route, null);
final HttpHost target = new HttpHost("localhost");
final HttpRoute route = new HttpRoute(target);
final ConnectionRequest connRequest1 = mgr.requestConnection(route, null);
final HttpHost target = new HttpHost("localhost");
final HttpRoute route = new HttpRoute(target);
final CPoolEntry entry = Mockito.spy(new CPoolEntry(LogFactory.getLog(getClass()), "id", route, conn,
final ConnectionRequest connRequest1 = mgr.requestConnection(route, null);
final HttpClientConnection conn1 = connRequest1.get(1, TimeUnit.SECONDS);
final HttpHost target = new HttpHost("localhost");
final HttpRoute route = new HttpRoute(target);
final CPoolEntry entry = Mockito.spy(new CPoolEntry(LogFactory.getLog(getClass()), "id", route, conn,
final ConnectionRequest connRequest1 = mgr.requestConnection(route, null);
final HttpClientConnection conn1 = connRequest1.get(1, TimeUnit.SECONDS); | 0 |
continue; // skip element as <pattern> can contain <defs>...
/*
*/ | 0 |
import com.fasterxml.jackson.core.type.TypeReference; | 0 |
import org.apache.accumulo.core.client.ZooKeeperInstance;
* @deprecated since 2.0.0; Use org.apache.accumulo.hadoop.mapreduce instead from the
* accumulo-hadoop-mapreduce.jar
return InputConfigurator.unwrapAuthenticationToken(context, token);
* @param instanceName
* the Accumulo instance name
* @param zooKeepers
* a comma-separated list of zookeeper servers
* @since 1.5.0
* @deprecated since 1.6.0
*/
@Deprecated
public static void setZooKeeperInstance(Job job, String instanceName, String zooKeepers) {
setZooKeeperInstance(job,
ClientConfiguration.create().withInstance(instanceName).withZkHosts(zooKeepers));
}
/**
* Configures a {@link ZooKeeperInstance} for this job.
*
* @param job
* the Hadoop job instance to be configured
* Initializes an Accumulo {@link Instance} based on the configuration.
* Sets the {@link Authorizations} used to scan. Must be a subset of the user's authorization.
* Defaults to the empty set.
* instances that convert from Accumulo {@link Key}/{@link Value} pairs to the user's K/V types. | 0 |
*
* @version CVS $Id: MillisDateConvertor.java,v 1.2 2003/12/31 17:15:46 vgritsenko Exp $ | 0 |
import org.apache.hc.core5.annotation.NotThreadSafe;
import org.apache.hc.core5.util.Args; | 1 |
package org.apache.hadoop.metadata.hive; | 0 |
import org.apache.accumulo.start.spi.KeywordExecutable;
import com.google.auto.service.AutoService;
@AutoService(KeywordExecutable.class)
public class Admin implements KeywordExecutable {
new Admin().execute(args);
}
@Override
public String keyword() {
return "admin";
}
@Override
public void execute(final String[] args) {
private DefaultConfiguration defaultConfig;
private Map<String,String> siteConfig, systemConfig;
private List<String> localUsers;
public void printConfig(ClientContext context, DumpConfigCommand opts) throws Exception {
private String getDefaultConfigValue(String key) {
private void printNameSpaceConfiguration(Connector connector, String namespace, File outputDirectory) throws IOException, AccumuloException,
private void printSystemConfiguration(Connector connector, File outputDirectory) throws IOException, AccumuloException, AccumuloSecurityException {
private void printTableConfiguration(Connector connector, String tableName, File outputDirectory) throws AccumuloException, TableNotFoundException, | 0 |
import org.apache.accumulo.core.security.tokens.SecurityToken;
* <li>{@link AccumuloOutputFormat#setConnectorInfo(Job, SecurityToken)} OR {@link AccumuloOutputFormat#setConnectorInfo(Job, Path)}
* @throws AccumuloSecurityException
public static void setConnectorInfo(Job job, SecurityToken token) throws AccumuloSecurityException {
* {@link TokenHelper#asBase64String(SecurityToken)}.
* the path to a file in the configured file system, containing the serialized, base-64 encoded {@link SecurityToken} with the user's authentication
* @see #setConnectorInfo(Job, SecurityToken)
* @throws AccumuloSecurityException
* @see #setConnectorInfo(Job, SecurityToken)
protected static SecurityToken getToken(JobContext context) throws AccumuloSecurityException {
* @deprecated since 1.5.0; Use {@link #setConnectorInfo(Job, SecurityToken)}, {@link #setConnectorInfo(Job, Path)}, {@link #setCreateTables(Job, boolean)},
try {
OutputConfigurator.setConnectorInfo(CLASS, conf, new UserPassToken(user, passwd));
} catch (AccumuloSecurityException e) {
throw new RuntimeException(e);
}
try {
return OutputConfigurator.getToken(CLASS, conf).getPrincipal();
} catch (AccumuloSecurityException e) {
throw new RuntimeException(e);
}
SecurityToken token;
try {
token = OutputConfigurator.getToken(CLASS, conf);
} catch (AccumuloSecurityException e) {
throw new RuntimeException(e);
} | 0 |
private static final int STACKS_CNT = 3;
for (StackInfo stackInfo: ambariMetaInfo.getStacks(STACK_NAME)) {
StackInfo stackInfo = ambariMetaInfo.getStack(STACK_NAME, STACK_VERSION);
stackInfo = ambariMetaInfo.getStack(STACK_NAME, STACK_VERSION); | 0 |
@Override
protected boolean containsKeyInternal(String key)
return getPropertyInternal(key) != null; | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.