Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
import java.util.concurrent.atomic.AtomicLong;
// FIXME: this is basically wrong and cannot function this way outside of local executor
// the correct way of doing this is #192
// fix this after implementation of that issue
AtomicLong time = new AtomicLong(1000);
Dataset<String> lines = flow.createInput(input, e -> time.addAndGet(2000L));
.keyBy(Pair::getFirst)
.valueBy(Pair::getSecond)
.combineBy(Sums.ofLongs())
.windowBy(Time.of(Duration.ofSeconds(1)))
.output();
executor
.setTriggeringSchedulerSupplier(() -> new WatermarkTriggerScheduler<>(0))
.submit(flow).get(); | 0 |
import org.apache.ambari.view.utils.UserLocal;
private static UserLocal<HdfsApi> hdfsApi;
private static UserLocal<TempletonApi> templetonApi;
templetonApi = new UserLocal<TempletonApi>(TempletonApi.class) {
hdfsApi = new UserLocal<HdfsApi>(HdfsApi.class) { | 0 |
LoggingHttp1StreamListener.INSTANCE_CLIENT); | 0 |
private final HashSet<String> children = new HashSet<String>();
return children.toArray(new String[children.size()]); | 0 |
import org.apache.ambari.server.api.services.ResultStatus; | 0 |
/**
* @since 4.2
*/
public ByteArrayEntity(final byte[] b, final ContentType contentType) {
if (contentType != null) {
setContentType(contentType.toString());
}
/**
* @since 4.2
*/
public ByteArrayEntity(final byte[] b, int off, int len, final ContentType contentType) {
if (contentType != null) {
setContentType(contentType.toString());
}
}
public ByteArrayEntity(final byte[] b) {
this(b, null);
}
public ByteArrayEntity(final byte[] b, int off, int len) {
this(b, off, len, null); | 0 |
case OpCode.getEphemerals:
case OpCode.getEphemerals:
case OpCode.getEphemerals:
return "getEphemerals"; | 0 |
import java.beans.PropertyChangeEvent;
public void addGlobalPropertyChangeListener(PropertyChangeListener l) {
PropertyChangeListener l){
public void removeGlobalPropertyChangeListener(PropertyChangeListener l){
public void fireGlobalPropertyChange(Object source,
String propertyName,
Object oldValue, Object newValue) {
PropertyChangeEvent evt = new PropertyChangeEvent(source,
propertyName,
oldValue,
newValue);
pcs.firePropertyChange(evt);
public void fireGlobalPropertyChange(Object source,
String propertyName,
boolean oldValue, boolean newValue) {
Object oldV = (oldValue) ? Boolean.TRUE : Boolean.FALSE;
Object newV = (oldValue) ? Boolean.TRUE : Boolean.FALSE;
PropertyChangeEvent evt = new PropertyChangeEvent(source,
propertyName,
oldV,
newV);
pcs.firePropertyChange(evt);
public void fireGlobalPropertyChange(Object source,
String propertyName,
int oldValue, int newValue) {
Object oldV = new Integer(oldValue);
Object newV = new Integer(newValue);
PropertyChangeEvent evt = new PropertyChangeEvent(source,
propertyName,
oldV,
newV);
pcs.firePropertyChange(evt); | 0 |
@Rule public final TestPipeline pipeline = TestPipeline.create(); | 0 |
TimestampFilter.setRange(is, "19990101010011GMT+01:00", "19990101010031GMT+01:00");
a.init(new SortedMapIterator(tm), is.getProperties(), null);
a.seek(new Range(), EMPTY_COL_FAMS, false);
assertEquals(size(a), 21);
TimestampFilter.setRange(is, baseTime + 11000, baseTime + 31000); | 0 |
protected void pruneTables(Set<String> tables) { | 0 |
/**
* Copyright 2016-2017 Seznam.cz, a.s.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cz.seznam.euphoria.beam;
import cz.seznam.euphoria.core.client.accumulators.AccumulatorProvider;
import cz.seznam.euphoria.core.client.accumulators.Counter;
import cz.seznam.euphoria.core.client.accumulators.Histogram;
import cz.seznam.euphoria.core.client.accumulators.Timer;
import cz.seznam.euphoria.core.util.Settings;
import java.io.Serializable;
import java.util.Objects;
/**
* Instantiate accumulator provider on the first usage.
*/
class LazyAccumulatorProvider implements AccumulatorProvider, Serializable {
private final AccumulatorProvider.Factory factory;
private final Settings settings;
private transient AccumulatorProvider accumulators;
LazyAccumulatorProvider(AccumulatorProvider.Factory factory, Settings settings) {
this.factory = Objects.requireNonNull(factory);
this.settings = Objects.requireNonNull(settings);
}
@Override
public Counter getCounter(String name) {
return getAccumulatorProvider().getCounter(name);
}
@Override
public Histogram getHistogram(String name) {
return getAccumulatorProvider().getHistogram(name);
}
@Override
public Timer getTimer(String name) {
return getAccumulatorProvider().getTimer(name);
}
private AccumulatorProvider getAccumulatorProvider() {
if (accumulators == null) {
accumulators = factory.create(settings);
}
return accumulators;
}
} | 0 |
Copyright 2001-2002 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 |
this.serverParams);
this.clientParams); | 0 |
* This method expects the given key to have an arbitrary number of String
* values, each of which is of the form <code>key=value</code>. These
* strings are splitted at the equals sign, and the key parts will become
* keys of the returned <code>Properties</code> object, the value parts
* become values. | 0 |
if (files == null)
{
return null;
}
else if (files.length == 0) | 0 |
private volatile int m_state;
public int getState()
void setState(int i) | 1 |
KeyPair kp = SecurityUtils.loadKeyPairIdentity(null, keyFilePath, inputStream, null); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/test/org/apache/commons/jxpath/ri/model/dom/TestDOMFactory.java,v 1.4 2003/10/09 21:31:44 rdonkin Exp $
* $Revision: 1.4 $
* $Date: 2003/10/09 21:31:44 $
* any, must include the following acknowledgement:
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
* permission of the Apache Software Foundation.
* @version $Revision: 1.4 $ $Date: 2003/10/09 21:31:44 $ | 0 |
import org.apache.http.params.HttpConnectionParams;
this.responseParser = new HttpResponseParser(
this.inbuf,
params.getIntParameter(HttpConnectionParams.MAX_LINE_LENGTH, -1),
params.getIntParameter(HttpConnectionParams.MAX_HEADER_COUNT, -1),
responseFactory); | 0 |
/** {@link org.apache.commons.logging} logging facility */
static org.apache.commons.logging.Log log =
org.apache.commons.logging.LogFactory.getLog(
ResolverXPointer.class.getName());
// log.debug("Use #xpointer(id('" + id + "')) on element " + selectedElem);
// log.debug("idPlusDelim=" + idPlusDelim);
log.debug("Id=" | 0 |
Table.ID tableId;
LocatorKey(String instanceId, Table.ID table) {
this.tableId = table;
return instanceId.hashCode() + tableId.hashCode();
return instanceId.equals(lk.instanceId) && tableId.equals(lk.tableId);
public static synchronized TabletLocator getLocator(ClientContext context, Table.ID tableId) { | 1 |
protected ParamSaxBuffer getMessage(String catalogueID, String key) {
getLogger().debug("Untranslated key: '" + key + "'");
public final class CatalogueInfo { | 0 |
/**
* TODO: add javadoc.
*/ | 0 |
package org.apache.atlas.web.service;
import static org.apache.atlas.security.SecurityProperties.CERT_STORES_CREDENTIAL_PROVIDER_PATH;
import static org.apache.atlas.security.SecurityProperties.CLIENT_AUTH_KEY;
import static org.apache.atlas.security.SecurityProperties.DEFATULT_TRUSTORE_FILE_LOCATION;
import static org.apache.atlas.security.SecurityProperties.DEFAULT_KEYSTORE_FILE_LOCATION;
import static org.apache.atlas.security.SecurityProperties.KEYSTORE_FILE_KEY;
import static org.apache.atlas.security.SecurityProperties.KEYSTORE_PASSWORD_KEY;
import static org.apache.atlas.security.SecurityProperties.SERVER_CERT_PASSWORD_KEY;
import static org.apache.atlas.security.SecurityProperties.TRUSTSTORE_FILE_KEY;
import static org.apache.atlas.security.SecurityProperties.TRUSTSTORE_PASSWORD_KEY;
String password; | 1 |
* Copyright (C) 2015 Google Inc. | 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 |
private int glyphIndex;
public TextHit(int glyphIndex, boolean leadingEdge) {
this.glyphIndex = glyphIndex;
public int getGlyphIndex() {
return glyphIndex;
int i = getGlyphIndex(); | 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: PhpGenerator.java,v 1.2 2004/03/05 13:02:03 bdelacretaz Exp $ | 1 |
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
| 0 |
Mutation m = new Mutation(String.format("%016x", (rand.nextLong() & 0x7fffffffffffffffl)));
long val = (rand.nextLong() & 0x7fffffffffffffffl); | 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 |
b[o + i] = (char)c; | 0 |
import static org.apache.accumulo.fate.util.UtilWaitThread.sleepUninterruptibly; | 0 |
final Configuration one = new BaseConfiguration();
final String properties =
final PropertiesConfiguration two = new PropertiesConfiguration();
final PropertiesConfigurationLayout layout =
final Properties props = configurationFactory.getObject();
final Properties props = configurationFactory.getObject();
final Resource[] locations = {
final Resource[] locationsUpdate = locations.clone();
final Resource[] locations = {
final Resource[] locationsGet = configurationFactory.getLocations();
final Configuration[] configs = {
final Configuration[] configsUpdate = configs.clone();
final Configuration[] configs = {
final Configuration[] configsGet = configurationFactory.getConfigurations(); | 0 |
// this._constructionElement.appendChild(this._doc.createTextNode("\n"));
Node result = null;
if (this._state == MODE_SIGN) {
result = this._constructionElement.appendChild(node);
}
return result; | 0 |
public AgentConfigsUpdateEvent getCurrentDataExcludeCluster(Long hostId, Long clusterId) throws AmbariException {
return configHelper.getHostActualConfigsExcludeCluster(hostId, clusterId);
}
| 0 |
// TODO unused - is there a bug in the test? | 0 |
import static com.google.cloud.dataflow.sdk.runners.worker.SourceTranslationUtils.readerProgressToCloudProgress;
import static com.google.cloud.dataflow.sdk.runners.worker.SourceTranslationUtils.toCloudPosition;
@Nullable SourceFormat.OperationResponse operationResponse, @Nullable List<Status> errors)
throws IOException {
@Nullable Reader.ForkResult forkResult,
@Nullable SourceFormat.OperationResponse operationResponse, @Nullable List<Status> errors) {
status.setProgress(readerProgressToCloudProgress(progress));
if (forkResult instanceof Reader.ForkResultWithPosition) {
Reader.ForkResultWithPosition asPosition = (Reader.ForkResultWithPosition) forkResult;
status.setStopPosition(toCloudPosition(asPosition.getAcceptedPosition()));
} else if (forkResult != null) {
throw new IllegalArgumentException("Unexpected type of fork result: " + forkResult); | 0 |
package org.apache.atlas.bridge; | 1 |
import org.apache.beam.sdk.values.PBegin;
public PCollection<Row> buildIOReader(PBegin begin) {
public POutput buildIOWriter(PCollection<Row> input) {
return input.apply(
BigQueryIO.<Row>write()
.withSchema(BigQueryUtils.toTableSchema(getSchema()))
.withFormatFunction(BigQueryUtils.toTableRow())
.to(tableSpec)); | 0 |
/*
* $Id$
*
* 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.ognl.performance.objects;
/**
*
*/
public class GameGeneric
extends BaseGeneric<GameGenericObject, Long>
{
public GameGeneric()
{
_value = new GameGenericObject();
}
} | 0 |
import java.util.Map;
import java.util.TreeMap;
import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
| 0 |
* @deprecated since 2.0.0, use {@link #setClientPropertiesFile(JobConf, String)} instead
ClientContext context = new ClientContext(getClientInfo(job));
ClientContext context = new ClientContext(getClientInfo(job));
tableId = Tables.getTableId(context, tableName);
if (!Tables.exists(context, tableId))
if (Tables.getTableState(context, tableId) == TableState.OFFLINE)
throw new TableOfflineException(Tables.getTableOfflineMsg(context, tableId)); | 0 |
import org.apache.beam.sdk.runners.AppliedPTransform; | 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.sdk.util.state;
import com.google.cloud.dataflow.sdk.annotations.Experimental;
import com.google.cloud.dataflow.sdk.annotations.Experimental.Kind;
/**
* A {@code StateContents} is produced by the read methods on all {@link State} objects.
* Calling {@link #read} returns the associated value.
*
* <p>This class is similar to {@link java.util.concurrent.Future}, but each invocation of
* {@link #read} need not return the same value.
*
* <p>Getting the {@code StateContents} from a read method indicates the desire to eventually
* read a value. Depending on the runner this may or may not immediately start the read.
*
* @param <T> The type of value returned by {@link #read}.
*/
@Experimental(Kind.STATE)
public interface StateContents<T> {
/**
* Read the current value.
*/
T read();
} | 0 |
return ImmutableList.of(
deserializedView, Matchers.equalTo(createViewTransform.getView()));
deserializedView, Matchers.equalTo(createViewTransform.getView())); | 0 |
public void testLoadIncludeOptional() throws Exception
{
final PropertiesConfiguration pc = new PropertiesConfiguration();
final FileHandler handler = new FileHandler(pc);
handler.setBasePath(testBasePath);
handler.setFileName("includeoptional.properties");
handler.load();
assertTrue("Make sure we have multiple keys", pc.getBoolean("includeoptional.loaded"));
}
@Test | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/example/org/apache/commons/validator/example/ValidateBean.java,v 1.2 2003/10/05 16:47:28 dgraham Exp $
* $Revision: 1.2 $
* $Date: 2003/10/05 16:47:28 $
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
* any, must include the following acknowledgement:
* 4. The names, "Apache", "The Jakarta Project", "Commons", and "Apache Software
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
* @version $Revision: 1.2 $ $Date: 2003/10/05 16:47:28 $
*/
this.lastName = lastName;
this.firstName = firstName;
public void setStreet1(String street1) {
this.street1 = street1;
this.street2 = street2;
this.city = city;
this.state = state;
this.postalCode = postalCode;
public void setAge(String age) {
this.age = age;
return this.lastName;
return this.firstName;
public String getStreet1() {
return this.street1;
return this.street2;
return this.city;
return this.state;
return this.postalCode;
public String getAge() {
return this.age;
return "{lastname="
+ this.lastName
+ ", firstname="
+ this.firstName
+ ", street1="
+ this.street1
+ ",\n street2="
+ this.street2
+ ", "
+ "city="
+ this.city
+ ", state="
+ this.state
+ ",\n postalcode="
+ this.postalCode
+ ", age="
+ this.age
+ "}";
} | 0 |
import org.junit.Test;
* @version $Id$
public class BooleanComparatorTest extends AbstractComparatorTest<Boolean> {
public BooleanComparatorTest(String testName) {
@Test
@Test
@Test | 0 |
import org.apache.beam.sdk.runners.PipelineRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
private static final Logger LOG = LoggerFactory.getLogger(DoFnLifecycleManager.class);
OldDoFn<?, ?> fn = outstanding.asMap().remove(currentThread);
fn.teardown();
* Remove all {@link DoFn DoFns} from this {@link DoFnLifecycleManager}. Returns all exceptions
* that were thrown while calling the remove methods.
*
* <p>If the returned Collection is nonempty, an exception was thrown from at least one
* {@link DoFn#teardown()} method, and the {@link PipelineRunner} should throw an exception.
public Collection<Exception> removeAll() throws Exception {
Iterator<OldDoFn<?, ?>> fns = outstanding.asMap().values().iterator();
Collection<Exception> thrown = new ArrayList<>();
while (fns.hasNext()) {
OldDoFn<?, ?> fn = fns.next();
fns.remove();
try {
fn.teardown();
} catch (Exception e) {
thrown.add(e);
}
}
return thrown;
OldDoFn<?, ?> fn = (OldDoFn<?, ?>) SerializableUtils.deserializeFromByteArray(original,
fn.setup();
return fn; | 0 |
*
* @since 2.0
*
* @since 2.0
*
* @since 2.0
*
* @since 2.0
*
* @since 2.0
*
* @since 2.0 | 0 |
* @since 3.0 | 0 |
Copyright 2001-2003 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 |
* Test basic stuff on AbstractSession. | 0 |
import org.apache.cocoon.webapps.authentication.configuration.ApplicationConfiguration;
* @version CVS $Id: DefaultAuthenticationManager.java,v 1.18 2003/10/23 11:29:36 cziegeler Exp $
// And now load applications
Iterator applications = handler.getHandlerConfiguration().getApplications().values().iterator();
while ( applications.hasNext() ) {
ApplicationConfiguration appHandler = (ApplicationConfiguration)applications.next();
if ( !appHandler.getLoadOnDemand() ) {
handler.getContext().loadApplicationXML( appHandler, this.resolver );
}
} | 0 |
public interface ColorMatrixRable extends FilterColorInterpolation {
* Returns the type of this color matrix.
| 0 |
buffer = session.createBuffer(SshConstants.SSH_MSG_REQUEST_SUCCESS, Integer.SIZE / Byte.SIZE); | 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 |
public AlertState state(double value) {
public String formatMessage(double value, List<Object> args) {
return MessageFormat.format(message(value), args.toArray());
}
| 0 |
import org.springframework.stereotype.Component;
@Component
} | 0 |
* Copyright 2001-2005 The Apache Software Foundation | 0 |
private final Stack<BranchTarget> branchTargets = new Stack<>();
private final Hashtable<InstructionHandle, BranchTarget> visitedTargets = new Hashtable<>(); | 0 |
/**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ | 0 |
import java.util.Collections;
/** The request parameter name used for adding event information to the url. */
/** These parameters are used by default for adding portal specific information to a url. */
List DEFAULT_INTERNAL_PARAMETERS = Collections.singletonList("cocoon-*");
| 0 |
try (Reader reader = new Reader(new Configuration(), Reader.file(new Path(outputFile.toURI())))) {
while (reader.next(key, value)) {
try (Writer writer = SequenceFile.createWriter(
new Configuration(),
Writer.keyClass(IntWritable.class), Writer.valueClass(Text.class),
Writer.file(new Path(this.inputFile.toURI())))) { | 0 |
import java.util.Comparator;
import java.util.Map;
import java.util.Map.Entry;
public class Pair<F, S> implements Map.Entry<F, S> {
@SuppressWarnings("rawtypes")
private static final Comparator<Map.Entry<Comparable, ?>> BY_KEY_COMPARATOR =
new Comparator<Map.Entry<Comparable, ?>>() {
@SuppressWarnings("unchecked")
@Override
public int compare(Entry<Comparable, ?> o1, Entry<Comparable, ?> o2) {
Comparable k1 = o1.getKey();
Comparable k2 = o2.getKey();
return k1.compareTo(k2);
}
};
@Override
public final F getKey() {
return getFirst();
}
@Override
public S getValue() {
return getSecond();
}
@Override
public S setValue(S value) {
throw new UnsupportedOperationException("setValue(" + value + ") N/A");
}
/**
* @param <K> The {@link Comparable} key type
* @param <V> The associated entry value
* @return A {@link Comparator} for {@link java.util.Map.Entry}-ies that
* compares the key values
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
public static <K extends Comparable<K>, V> Comparator<Map.Entry<K, V>> byKeyEntryComparator() {
return (Comparator) BY_KEY_COMPARATOR;
} | 0 |
* @version $Id$ | 0 |
log.error("Failed to read locks for " + id + " continuing.", e); | 0 |
private ThreadLocal<LdapServerProperties> ldapServerProperties = new ThreadLocal<>();
private ThreadLocal<LdapAuthenticationProvider> providerThreadLocal = new ThreadLocal<>(); | 1 |
outputs.set(partitionId, output); | 0 |
this.contextManager = new ServletContextHelperManager(bundleContext, httpService); | 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
* 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 |
(((javax.xml.crypto.dom.DOMStructure) xmlStructure).getNode(),
private XMLSignature unmarshal(Node node, XMLCryptoContext context)
TransformService spi;
| 0 |
public class RequestAttributeOutputModule extends AbstractOutputModule implements ThreadSafe { | 0 |
import static org.apache.beam.sdk.io.FileIO.ReadMatches.DirectoryTreatment;
.apply(FileIO.readMatches().withDirectoryTreatment(DirectoryTreatment.PROHIBIT))
new CreateSourceFn<>(getRecordClass(), getSchema().toString()),
AvroCoder.of(getRecordClass(), getSchema())));
.apply(FileIO.readMatches().withDirectoryTreatment(DirectoryTreatment.PROHIBIT))
new ReadAllViaFileBasedSource<>(getDesiredBundleSizeBytes(), createSource, coder)); | 0 |
sb.append(rules[i].toString(eng)); | 0 |
import org.apache.accumulo.core.conf.PropertyType;
if (!Property.isValidZooPropertyKey(property)) {
IllegalArgumentException iae = new IllegalArgumentException("Zookeeper property is not mutable: " + property);
log.debug("Attempted to set zookeeper property. It is not mutable", iae);
throw iae;
}
// Find the property taking prefix into account
Property foundProp = null;
for (Property prop : Property.values()) {
if (PropertyType.PREFIX == prop.getType() && property.startsWith(prop.getKey()) || prop.getKey().equals(property)) {
foundProp = prop;
break;
}
}
if ((foundProp == null || !foundProp.getType().isValidFormat(value))) {
IllegalArgumentException iae = new IllegalArgumentException("Ignoring property " + property + " it is either null or in an invalid format");
log.debug("Attempted to set zookeeper property. Value is either null or invalid", iae);
throw iae;
boolean result = ZooReaderWriter.getInstance().putPersistentData(zPath, value.getBytes(UTF_8), NodeExistsPolicy.OVERWRITE);
return result; | 0 |
pipeline.replaceAll(
FlinkTransformOverrides.getDefaultOverrides(
translationMode == TranslationMode.STREAMING, options));
prepareFilesToStageForRemoteClusterExecution(options);
| 0 |
void reset();
void collect(Value value);
Value aggregate(); | 1 |
assertTrue("This returns array", eprop.getVector("number") instanceof java.util.Vector);
assertTrue("This returns array", eprop.getList("number") instanceof java.util.List);
assertTrue("This returns scalar", eprop.getString("number") instanceof String);
assertTrue("This returns vector", eprop.getVector("prop.string") instanceof java.util.Vector);
assertTrue("This returns list", eprop.getList("prop.string") instanceof java.util.List);
assertTrue("This returns array", eprop.getString("prop.string") instanceof java.lang.String);
assertTrue("This returns string for subset", subEprop.getString("string") instanceof java.lang.String);
assertTrue("This returns array for subset", subEprop.getVector("string") instanceof java.util.Vector);
assertTrue("This returns array for subset", subEprop.getList("string") instanceof java.util.List); | 0 |
* Elemental example for executing a GET request.
*
*
* <!-- empty lines above to avoid 'svn diff' context problems --> | 0 |
@SuppressWarnings({"unchecked", "serial", "rawtypes", "unused"}) public class ConstraintViolationException extends TException implements org.apache.thrift.TBase<ConstraintViolationException, ConstraintViolationException._Fields>, java.io.Serializable, Cloneable, Comparable<ConstraintViolationException> {
public enum _Fields implements org.apache.thrift.TFieldIdEnum { | 0 |
// Create a new IV for the block or update an existing one in the case of GCM
cryptoParams.updateInitializationVector(); | 0 |
public class BasicHttpEntity extends AbstractHttpEntity implements HttpContentProducer { | 0 |
checkNotNull(combiner, "Combiner passed to createAggregatorInternal cannot be null"); | 0 |
Future<LocalPoolEntry> future2 = pool.lease("somehost", null);
GetPoolEntryThread t2 = new GetPoolEntryThread(future2);
t2.start();
Future<LocalPoolEntry> future2 = pool.lease("somehost", null);
GetPoolEntryThread t2 = new GetPoolEntryThread(future2, 50, TimeUnit.MICROSECONDS);
t2.start();
| 0 |
* @version $Id$ | 0 |
assertEquals(true, map.containsKey(Integer.valueOf((String) els[i])));
assertEquals(els[i], map.get(Integer.valueOf((String) els[i])));
assertEquals(els[0], map.remove(Integer.valueOf((String) els[0])));
assertEquals(true, map.containsValue(Integer.valueOf((String) els[i])));
assertEquals(Integer.valueOf((String) els[i]), map.get(els[i]));
assertEquals(Integer.valueOf((String) els[0]), map.remove(els[0]));
assertEquals(Integer.valueOf(66), array[0].getValue());
assertEquals(Integer.valueOf(66), map.get(array[0].getKey()));
assertEquals(Integer.valueOf(88), entry.getValue());
assertEquals(Integer.valueOf(88), map.get(entry.getKey()));
assertEquals(Integer.valueOf(4), trans.get("D"));
assertEquals(Integer.valueOf(1), trans.get("A"));
assertEquals(Integer.valueOf(2), trans.get("B"));
assertEquals(Integer.valueOf(3), trans.get("C"));
assertEquals(Integer.valueOf(4), trans.get("D")); | 0 |
/*
* Copyright (c) OSGi Alliance (2012, 2013). All Rights Reserved.
*
* 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.
*/
/**
* OSGi Data Transfer Object Package Version 1.0.
*
* <p>
* Bundles wishing to use this package must list the package in the
* Import-Package header of the bundle's manifest. This package has two types of
* users: the consumers that use the API in this package and the providers that
* implement the API in this package.
*
* <p>
* Example import for consumers using the API in this package:
* <p>
* {@code Import-Package: org.osgi.dto; version="[1.0,2.0)"}
* <p>
* Example import for providers implementing the API in this package:
* <p>
* {@code Import-Package: org.osgi.dto; version="[1.0,1.1)"}
*
* @author $Id: 1209bb5e60e6b6fc8239119a2dd4a2c15b9a40f2 $
*/
//@Version("1.0")
package org.osgi.dto;
//import org.osgi.annotation.versioning.Version;
| 0 |
Service sa2 = m.createAspectService(ServiceInterface.class, null, 20, null).setImplementation(new ServiceAspect(e, 3));
Service sa3 = m.createAspectService(ServiceInterface.class, null, 30, null).setImplementation(new ServiceAspect(e, 2));
Service sa1 = m.createAspectService(ServiceInterface.class, null, 10, null).setImplementation(new ServiceAspect(e, 4)); | 0 |
return new Referenceable(guids.get(guids.size() - 1), referenceable.getTypeName(), null); | 1 |
WebResource resource = getResource(api.getNormalizedPath());
return getResource(api.getNormalizedPath(), params);
return getResource(apiV1.getNormalizedPath(), params); | 0 |
import org.apache.hc.core5.annotation.ThreadSafe;
import org.apache.hc.core5.pool.io.AbstractConnPool;
import org.apache.hc.core5.pool.io.ConnFactory; | 0 |
public static CompactionReason findByValue(int value) { | 0 |
getDigester().getLogger().debug("[SetNextRule]{" + getDigester().getMatch() +
getDigester().getLogger().debug("[SetNextRule]{" + getDigester().getMatch() + | 0 |
public int execute(final String fullCommand, final CommandLine cl, final Shell shellState)
throws AccumuloException, AccumuloSecurityException, IOException, NamespaceNotFoundException {
final String namespace = cl.hasOption(OptUtil.namespaceOpt().getOpt())
? OptUtil.getNamespaceOpt(cl, shellState)
: null;
Iterator<String> it = Iterators.transform(tables.entrySet().iterator(),
new Function<Entry<String,String>,String>() {
@Override
public String apply(Map.Entry<String,String> entry) {
String tableName = String.valueOf(sortByTableId ? entry.getValue() : entry.getKey());
String tableId = String.valueOf(sortByTableId ? entry.getKey() : entry.getValue());
if (namespace != null)
tableName = Tables.qualify(tableName).getSecond();
if (cl.hasOption(tableIdOption.getOpt()))
return String.format(NAME_AND_ID_FORMAT, tableName, tableId);
else
return tableName;
}
});
tableIdOption = new Option("l", "list-ids", false,
"display internal table ids along with the table name"); | 0 |
else if (m_namespace.equals(ICapability.PACKAGE_NAMESPACE) &&
m_attributes[i].getName().equals(ICapability.VERSION_PROPERTY)) | 0 |
import java.io.IOException;
* Signals a generic resource I/O error.
public class ResourceIOException extends IOException {
public ResourceIOException(final String message) {
public ResourceIOException(final String message, final Throwable cause) {
super(message);
initCause(cause); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.