Diff stringlengths 5 2k | FaultInducingLabel int64 0 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 |
* Copyright 2006-2009 The Apache Software Foundation. | 0 |
package org.apache.batik.ext.awt.image.codec.util; | 0 |
FilterHandler h1 = createHandler(0, "a");
FilterHandler h2 = createHandler(10, "b");
FilterHandler h3 = createHandler(10, "c");
FilterHandler h1 = createHandler(0, "/a");
FilterHandler h1 = createHandler(0, "/a");
FilterHandler h1 = createHandler(0, "/");
FilterHandler h1 = createHandler(0, "/a");
final ServletHandler sc = mock(ServletHandler.class);
final InvocationChain ic = new InvocationChain(sc, new FilterHandler[] {h1});
FilterHandler h1 = createHandler(0, "/a");
final ServletHandler sc = mock(ServletHandler.class);
final InvocationChain ic = new InvocationChain(sc, new FilterHandler[] {h1});
FilterHandler h1 = createHandler(0, "/a");
final ServletHandler sc = mock(ServletHandler.class);
final InvocationChain ic = new InvocationChain(sc, new FilterHandler[] {h1});
FilterHandler h1 = createHandler(0, "/a");
final ServletHandler sc = mock(ServletHandler.class);
final InvocationChain ic = new InvocationChain(sc, new FilterHandler[] {h1});
FilterHandler h1 = createHandler(0, "/a");
final ServletHandler sc = mock(ServletHandler.class);
final InvocationChain ic = new InvocationChain(sc, new FilterHandler[] {h1});
FilterHandler h1 = createHandler(0, "/a");
private FilterHandler createHandler(int ranking, String pattern)
private FilterHandler createHandler(String pattern, int ranking, Map<String, String> initParams)
return new HttpServiceFilterHandler(0, this.context, info, this.filter); | 0 |
CounterSet.AddCounterMutator addCounterMutator,
StateSampler stateSampler) {
addCounterMutator,
stateSampler);
StateSampler stateSampler)
addCounterMutator,
stateSampler);
CounterSet.AddCounterMutator addCounterMutator,
StateSampler stateSampler) {
addCounterMutator, stateSampler); | 0 |
if (!"id".equals(N.getLocalName()) && XML_LANG_URI.equals(N.getNamespaceURI())) { | 0 |
* @version CVS $Id: TempRepeaterJXPathBindingBuilder.java,v 1.3 2004/04/12 14:05:08 tim Exp $ | 0 |
import org.apache.hc.core5.http.entity.ContentType; | 0 |
/*
* Copyright 2015 Data Artisans GmbH
*
* 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
* | 0 |
@Override
@Override | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.felix.karaf.features;
import java.util.EventObject;
public class RepositoryEvent extends EventObject {
public static enum EventType {
RepositoryAdded,
RepositoryRemoved,
}
private final EventType type;
private final Repository repository;
private final boolean replay;
public RepositoryEvent(Repository repository, EventType type, boolean replay) {
super(repository);
this.type = type;
this.repository = repository;
this.replay = replay;
}
public EventType getType() {
return type;
}
public Repository getRepository() {
return repository;
}
public boolean isReplay() {
return replay;
}
} | 0 |
public StatusAction(DataInputStream in, DataOutputStream out) throws IOException
super(in, out);
public BundleStatus[] client(Void in) throws IOException
for (int i = 0; i < num; i++)
{
public void server(Framework fw) throws IOException
log("Read status");
writeInt(bundles.length);
for (Bundle b : bundles)
{
if (bsn == null)
writeString((String) b.getHeaders().get(BUNDLE_VERSION));
flush(); | 0 |
// !!! the services map is from the stack, which may not contain services in the cluster.
// This is the case for upgrades where the target stack may remove services
if (!servicesMap.containsKey(service.getName())) {
continue;
}
| 0 |
ValidationEventHandler validationEventHandler = event -> {
throw new RuntimeException("MyCustomValidationEventHandler failure mesage"); | 0 |
import org.apache.beam.sdk.extensions.gcp.util.RetryHttpRequestInitializer;
import org.apache.beam.sdk.extensions.gcp.util.Transport; | 0 |
if ( name == null || name.trim().length() == 0 ) {
issues.add(this.getMessage("Property name can not be empty."));
}
// might want to check type (and value) | 0 |
import org.apache.ambari.server.orm.dao.HostRoleCommandDAO;
// Host role commands status summary max cache enable/disable
bindConstant().annotatedWith(Names.named(HostRoleCommandDAO.HRC_STATUS_SUMMARY_CACHE_ENABLED)).
to(configuration.getHostRoleCommandStatusSummaryCacheEnabled());
// Host role commands status summary max cache size
bindConstant().annotatedWith(Names.named(HostRoleCommandDAO.HRC_STATUS_SUMMARY_CACHE_SIZE)).
to(configuration.getHostRoleCommandStatusSummaryCacheSize());
// Host role command status summary cache expiry duration in minutes
bindConstant().annotatedWith(Names.named(HostRoleCommandDAO.HRC_STATUS_SUMMARY_CACHE_EXPIRY_DURATION_MINUTES)).
to(configuration.getHostRoleCommandStatusSummaryCacheExpiryDuration());
| 0 |
return !this.closed && !this.session.isClosed(); | 0 |
/*
* Copyright 2000-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.bcel.generic;
| 0 |
LOG.debug(ex.getMessage(), ex);
LOG.debug("writeBytesToFilename got null byte[] pointed"); | 0 |
import java.util.List;
cm.setConfigurationPid( new String[] {"configurationPid"} );
cm.setConfigurationPid( new String[] {"configurationPid"} );
List<String> pid = cm.getConfigurationPid();
assertFalse( "Expect non-null configuration pid when component name is not specified", pid.isEmpty() );
"implementation.class", pid.get( 0 ) );
List<String> pid = cm.getConfigurationPid();
assertFalse( "Expect non-null configuration pid when component name is not specified", pid.isEmpty() );
"my.component.name", pid.get( 0 ) ); | 0 |
package org.apache.http.impl.client.cache; | 0 |
* @param <E> the type of the elements in the list
public abstract class AbstractListDecorator<E> extends AbstractCollectionDecorator<E> implements
List<E> {
/** Serialization version--necessary in an abstract class? */
private static final long serialVersionUID = 4500739654952315623L;
protected AbstractListDecorator(List<E> list) {
protected List<E> decorated() {
return (List<E>) super.decorated();
public void add(int index, E object) {
decorated().add(index, object);
public boolean addAll(int index, Collection<? extends E> coll) {
return decorated().addAll(index, coll);
public E get(int index) {
return decorated().get(index);
return decorated().indexOf(object);
return decorated().lastIndexOf(object);
public ListIterator<E> listIterator() {
return decorated().listIterator();
public ListIterator<E> listIterator(int index) {
return decorated().listIterator(index);
public E remove(int index) {
return decorated().remove(index);
public E set(int index, E object) {
return decorated().set(index, object);
public List<E> subList(int fromIndex, int toIndex) {
return decorated().subList(fromIndex, toIndex); | 0 |
properties.add(PropertyHelper.getPropertyId("metrics/mapred/jobtracker", "jobs_failed"));
Assert.assertEquals(10, PropertyHelper.getProperties(resource).size());
Assert.assertEquals(2, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/mapred/jobtracker", "jobs_submitted")));
Assert.assertEquals(1, resource.getPropertyValue(PropertyHelper.getPropertyId("metrics/mapred/jobtracker", "jobs_failed"))); | 0 |
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at | 0 |
import org.apache.sshd.common.channel.ChannelAsyncInputStream;
import org.apache.sshd.common.channel.ChannelAsyncOutputStream;
if (streaming == Streaming.Async) {
asyncIn = new ChannelAsyncOutputStream(this, SshConstants.SSH_MSG_CHANNEL_DATA);
asyncOut = new ChannelAsyncInputStream(this);
} else {
invertedIn = out = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_DATA);
ChannelPipedInputStream pis = new ChannelPipedInputStream(localWindow);
pipe = new ChannelPipedOutputStream(pis);
invertedOut = in = pis;
} | 0 |
static class StorageResolverIterator implements Iterator {
Iterator _resolvers = null;
return _resolvers.hasNext();
return _resolvers.next(); | 0 |
import org.apache.hadoop.metadata.typesystem.IReferenceableInstance;
import org.apache.hadoop.metadata.typesystem.ITypedReferenceableInstance;
public interface MetadataRepository { | 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 |
record.timestamp() != null
? record.timestamp()
: (spec.getPublishTimestampFunction() != null
? spec.getPublishTimestampFunction()
.getTimestamp(record, ctx.timestamp())
.getMillis()
: null);
String topicName = record.topic() != null ? record.topic() : spec.getTopic();
new ProducerRecord<>(topicName, null, timestampMillis, record.key(), record.value()), | 0 |
import org.apache.cocoon.portal.layout.LayoutException;
import org.apache.cocoon.portal.om.FrameLayout;
import org.apache.cocoon.portal.om.Layout;
import org.apache.cocoon.portal.om.LayoutFeatures;
import org.apache.cocoon.portal.om.LayoutInstance;
* <li>{@link org.apache.cocoon.portal.om.FrameLayout}</li>
* @see org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect#toSAX(org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext, org.apache.cocoon.portal.om.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler)
throws SAXException, LayoutException {
LayoutFeatures.checkLayoutClass(layout, FrameLayout.class, true);
String source = null;
final LayoutInstance instance = LayoutFeatures.getLayoutInstance(service, layout, false);
if ( instance != null ) {
source = (String)instance.getTemporaryAttribute("frame"); | 0 |
import org.apache.batik.util.CSSConstants; | 0 |
buffer.append("[chunk-coded; completed: ");
buffer.append("]"); | 0 |
import com.twitter.mesos.scheduler.configuration.Resources;
import com.twitter.mesos.scheduler.filter.SchedulingFilter;
import com.twitter.mesos.scheduler.filter.SchedulingFilter.Veto; | 0 |
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at | 0 |
import org.apache.sshd.common.AbstractFactoryManager;
import org.apache.sshd.common.Channel;
import org.apache.sshd.common.Cipher;
import org.apache.sshd.common.Compression;
import org.apache.sshd.common.Factory;
import org.apache.sshd.common.ForwardingAcceptorFactory;
import org.apache.sshd.common.ForwardingFilter;
import org.apache.sshd.common.KeyExchange;
import org.apache.sshd.common.Mac;
import org.apache.sshd.common.NamedFactory;
import org.apache.sshd.common.Session;
import org.apache.sshd.common.Signature;
import org.apache.sshd.common.forward.DefaultForwardingAcceptorFactory;
| 0 |
import org.apache.aurora.scheduler.storage.entities.IHostAttributes;
IHostAttributes attributes, | 0 |
map.put(Constants.REFERENCE_CHECKED, String.valueOf(this.reference.isChecked())); | 0 |
CommonAttributes commonAtts = JXpathBindingBuilderBase.getCommonAttributes(bindingElm);
new ValueJXPathBinding(commonAtts, | 0 |
public final int N;
public final int ALL;
shutdownAll();
ps.peer.start();
}
public void restart(int id) throws IOException {
start(id);
Assert.assertTrue("Waiting for server up", ClientBase.waitForServerUp("127.0.0.1:"
+ getPeer(id).clientPort, ClientBase.CONNECTION_TIMEOUT));
}
public void startThenShutdown(int id) throws IOException {
PeerStruct ps = getPeer(id);
LOG.info("Creating QuorumPeer " + ps.id + "; public port " + ps.clientPort);
ps.peer = new QuorumPeer(peersView, ps.dataDir, ps.dataDir, ps.clientPort, electionAlg,
ps.id, tickTime, initLimit, syncLimit);
Assert.assertEquals(ps.clientPort, ps.peer.getClientPort());
Assert.assertTrue("Waiting for server up", ClientBase.waitForServerUp("127.0.0.1:"
+ getPeer(id).clientPort, ClientBase.CONNECTION_TIMEOUT));
shutdown(id); | 0 |
import org.apache.mesos.Protos.Resource;
public synchronized Set<ScheduledTask> getTasks(final Query query) {
return stateManager.fetchTasks(query);
return Iterables.transform(getTasks(query), Tasks.SCHEDULED_TO_INFO); | 0 |
JXpathBindingBuilderBase.CommonAttributes commonAtts, String repeaterId, String repeaterPath, String rowPath, boolean clearOnLoad, boolean deleteIfEmpty, JXPathBindingBase rowBinding) {
super(commonAtts); | 0 |
public abstract String getLocation();
public abstract Builder location(String location); | 0 |
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import org.apache.aurora.scheduler.resources.ResourceBag;
import static org.apache.aurora.scheduler.resources.ResourceManager.bagFromMesosResources;
import static org.apache.aurora.scheduler.resources.ResourceManager.getOfferResources;
private final LoadingCache<TierInfo, ResourceBag> resourceBagCache;
this.resourceBagCache = CacheBuilder.newBuilder().build(
new CacheLoader<TierInfo, ResourceBag>() {
@Override
public ResourceBag load(TierInfo tierInfo) {
return bagFromMesosResources(getOfferResources(offer, tierInfo));
}
});
public ResourceBag getResourceBag(TierInfo tierInfo) {
return resourceBagCache.getUnchecked(tierInfo);
}
| 0 |
private transient BundleFactory bundleFactory;
bundleFactory = InProcessBundleFactory.create();
bundleFactory.createRootBundle(pcollection).add(element).commit(Instant.now());
bundleFactory.createRootBundle(pcollection).add(element).commit(Instant.now());
bundleFactory.createRootBundle(pcollection).add(element).commit(Instant.now()); | 0 |
public static void main(String[] unused) throws Exception { | 0 |
package org.apache.felix.scr.impl;
import org.apache.felix.scr.impl.parser.KXml2SAXHandler;
import org.apache.felix.scr.impl.parser.ParseException;
* @see org.apache.felix.scr.impl.parser.KXml2SAXHandler#characters(java.lang.String)
* @see org.apache.felix.scr.impl.parser.KXml2SAXHandler#processingInstruction(java.lang.String, java.lang.String)
* @see org.apache.felix.scr.impl.parser.KXml2SAXHandler#setLineNumber(int)
* @see org.apache.felix.scr.impl.parser.KXml2SAXHandler#setColumnNumber(int) | 0 |
return cp.addString((String) value); | 0 |
private static Set<String> pkPropertyIds = new HashSet<>(
Arrays.asList(new String[]{STACK_NAME_PROPERTY_ID,
STACK_VERSION_PROPERTY_ID, PROPERTY_NAME_PROPERTY_ID}));
final Set<StackLevelConfigurationRequest> requests = new HashSet<>();
Set<Resource> resources = new HashSet<>(); | 0 |
* @throws org.apache.commons.beanutils.ConversionException if conversion | 0 |
package org.apache.accumulo.master.tableOps.tableExport; | 0 |
* @version CVS $Id: CocoonProcessorDelegate.java,v 1.2 2003/03/16 18:03:54 vgritsenko Exp $ | 0 |
*
List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated,
long readaheadThreshold) {
| 0 |
private Set<String> pkPropertyIds = new HashSet<>(
Arrays.asList(new String[]{SERVICE_NAME_PROPERTY_ID}));
final Set<RootServiceRequest> requests = new HashSet<>();
Set<Resource> resources = new HashSet<>(); | 0 |
* @version $Revision: 1.12 $ $Date: 2004/04/04 22:06:35 $
value = ValueUtils.getValue(dynaBean.get(name));
value = ValueUtils.getValue(dynaBean.get(name, index)); | 0 |
* @version $Revision: 1.4 $ $Date: 2003/02/21 13:08:59 $
final WebDavFileSystem fileSystem ) | 0 |
import org.apache.beam.vendor.grpc.v1p13p1.com.google.protobuf.ByteString; | 0 |
/**
* Copyright 2013 Apache Software Foundation | 0 |
* TODO - remove this
* @version CVS $Id: AspectStatus.java,v 1.2 2003/05/07 20:24:02 cziegeler Exp $ | 0 |
setRankingInterceptor(new ComparatorBasedServiceRankingInterceptor(m_comparator)); | 0 |
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License. | 0 |
import org.apache.http.io.CharArrayBuffer;
HttpVersion.parse(" ");
fail("ProtocolException should have been thrown");
} catch (ProtocolException e) {
//expected
}
try {
HttpVersion.parse("HTT");
fail("ProtocolException should have been thrown");
} catch (ProtocolException e) {
//expected
}
try {
public void testInvalidInput() throws Exception {
CharArrayBuffer buffer = new CharArrayBuffer(32);
buffer.append("HTTP/1.1");
try {
HttpVersion.parse(null, 0, 0);
fail("IllegalArgumentException should have been thrown");
} catch (IllegalArgumentException ex) {
// expected
}
try {
HttpVersion.parse(null);
fail("IllegalArgumentException should have been thrown");
} catch (IllegalArgumentException ex) {
// expected
}
try {
HttpVersion.parse(buffer, -1, 0);
fail("IllegalArgumentException should have been thrown");
} catch (IndexOutOfBoundsException ex) {
// expected
}
try {
HttpVersion.parse(buffer, 0, 1000);
fail("IllegalArgumentException should have been thrown");
} catch (IndexOutOfBoundsException ex) {
// expected
}
try {
HttpVersion.parse(buffer, 2, 1);
fail("IllegalArgumentException should have been thrown");
} catch (IndexOutOfBoundsException ex) {
// expected
}
}
| 0 |
if (ci instanceof CompositeManager) {
((CompositeManager) ci).kill();
} else {
((InstanceManager) ci).kill();
}
m_componentDesc = null;
if (m_componentDesc != null) { // Already started.
}
* Callback called by instance when disposed.
* @param ci : the destroyed instance
protected synchronized void disposed(ComponentInstance ci) {
m_componentInstances.remove(ci.getInstanceName()); | 0 |
import com.google.auth.Credentials;
import java.net.URI;
import java.util.Collections;
import java.util.List;
import java.util.Map;
public class TestCredential extends Credentials {
@Override
public String getAuthenticationType() {
return "Test";
}
@Override
public Map<String, List<String>> getRequestMetadata() throws IOException {
return Collections.emptyMap();
}
@Override
public Map<String, List<String>> getRequestMetadata(URI uri) throws IOException {
return Collections.emptyMap();
@Override
public boolean hasRequestMetadata() {
return false;
}
@Override
public boolean hasRequestMetadataOnly() {
return true;
public void refresh() throws IOException { | 0 |
private List<DiskInfo> mounts = new ArrayList<DiskInfo>();
@JsonProperty("mounts")
public List<DiskInfo> getMounts() {
return this.mounts;
}
@JsonProperty("mounts")
public void setMounts(List<DiskInfo> mounts) {
this.mounts = mounts;
}
| 0 |
public static final ObjectType OBJECT = new ObjectType("java.lang.Object");
public static final ObjectType CLASS = new ObjectType("java.lang.Class");
public static final ObjectType STRING = new ObjectType("java.lang.String");
public static final ObjectType STRINGBUFFER = new ObjectType("java.lang.StringBuffer");
public static final ObjectType THROWABLE = new ObjectType("java.lang.Throwable"); | 0 |
* BeanProcessorTest
public class BeanProcessorTest extends BaseTestCase {
private static final BeanProcessor beanProc = new BeanProcessor();
public BeanProcessorTest(String name) {
b = (TestBean) beanProc.toBean(this.rs, TestBean.class); | 0 |
import org.apache.ambari.server.controller.metrics.ThreadPoolEnabledPropertyProvider;
ThreadPoolEnabledPropertyProvider.init(injector.getInstance(Configuration.class)); | 0 |
static final String KEY_VALUE = "value";
static final String KEY_TYPE = "type";
static final String KEY_CONFIGURATION = "configuration";
static final String KEY_LOCAL_USERNAME = "local_username";
* @param principal the principal name
* @param type the principal type (user, service, etc...)
this(getStringValue(data, KEY_VALUE),
getKerberosPrincipalTypeValue(data, KEY_TYPE),
getStringValue(data, KEY_CONFIGURATION),
getStringValue(data, KEY_LOCAL_USERNAME)
map.put(KEY_VALUE, getValue());
map.put(KEY_TYPE, KerberosPrincipalType.translate(getType()));
map.put(KEY_CONFIGURATION, getConfiguration());
map.put(KEY_LOCAL_USERNAME, getLocalUsername()); | 1 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/Bag.java,v 1.9 2003/05/11 14:14:58 scolebourne Exp $
* @version $Revision: 1.9 $ $Date: 2003/05/11 14:14:58 $
int getCount(Object object);
boolean add(Object object);
boolean add(Object object, int nCopies);
boolean remove(Object object);
boolean remove(Object object, int nCopies);
Set uniqueSet();
int size();
boolean containsAll(Collection coll);
boolean removeAll(Collection coll);
boolean retainAll(Collection coll);
Iterator iterator(); | 0 |
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkArgument;
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkNotNull;
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Verify.verifyNotNull;
import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Predicate;
import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Predicates;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Lists; | 0 |
*
*
*
* A dummy MBean interface
| 1 |
String CONFIGURATIONS = "configurations";
setConfiguration(ConfigurableHelper.parseConfigs(configs));
return ConfigurableHelper.convertConfigToMap(getConfiguration()); | 0 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Objects;
/**
* Logger.
*/
private static final Logger LOG = LoggerFactory.getLogger(ClusterGrouping.class);
/**
* A condition element with can prevent this stage from being scheduled in
* the upgrade.
*/
@XmlElement(name = "condition")
public Condition condition;
/**
* {@inheritDoc}
*/
@Override
public String toString() {
return Objects.toStringHelper(this).add("id", id).add("title",
title).omitNullValues().toString();
}
// if there is a condition on the group, evaluate it and skip scheduling
// of this group if the condition has not been satisfied
if (null != execution.condition && !execution.condition.isSatisfied(upgradeContext)) {
LOG.info("Skipping {} while building upgrade orchestration due to {}", execution,
execution.condition);
continue;
}
if (StringUtils.isNotEmpty(service) && StringUtils.isNotEmpty(component)) {
@Override | 0 |
import java.net.MalformedURLException;
import java.net.URL;
*
* @param uri the uri of the document or null if any
protected void transcode(Document document,
String uri,
TranscoderOutput output)
AffineTransform Px;
String ref = null;
try {
ref = new URL(uri).getRef();
} catch (MalformedURLException ex) {
// nothing to do, catched previously
}
try {
Px = ViewBox.getViewTransform(ref, root, width, height);
} catch (BridgeException ex) {
throw new TranscoderException(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 | 0 |
if (index + 1 >= source.allElementsBytes.size()) {
index++; | 0 |
* @param <K> the type of the keys in this map
* @param <V> the type of the values in this map | 0 |
package org.apache.accumulo.tserver.logger;
import org.apache.accumulo.tserver.log.DfsLogger;
import org.apache.accumulo.tserver.log.DfsLogger.DFSLoggerInputStreams;
import org.apache.accumulo.tserver.log.MultiReader;
DFSLoggerInputStreams streams = DfsLogger.readHeaderAndReturnStream(fs, path, SiteConfiguration.getSiteConfiguration());
DataInputStream input = streams.getDecryptingInputStream();
| 1 |
activeWorkMap.get(computation).completeWork(work.getKey());
activeWorkMap.get(computation).completeWork(work.getKey()); | 0 |
.apply(JUST_NEW_PERSONS)
.apply(
"Query8.WindowPersons",
Window.into(FixedWindows.of(Duration.standardSeconds(configuration.windowSizeSec))))
events
.apply(JUST_NEW_AUCTIONS)
.apply(
"Query8.WindowAuctions",
Window.into(FixedWindows.of(Duration.standardSeconds(configuration.windowSizeSec))))
.apply(
name + ".Select",
ParDo.of(
new DoFn<KV<Long, CoGbkResult>, IdNameReserve>() { | 0 |
AccumuloInputFormat.setClientProperties(job, getClientProperties());
AccumuloOutputFormat.setClientProperties(job, getClientProperties()); | 0 |
import com.google.cloud.dataflow.sdk.transforms.Combine;
import com.google.cloud.dataflow.sdk.util.state.CombiningValueStateInternal;
import com.google.cloud.dataflow.sdk.util.state.StateMerging;
protected static final StateTag<CombiningValueStateInternal<Instant, Combine.Holder<Instant>,
Instant>> DELAYED_UNTIL_TAG =
public void prefetchOnMerge(MergingStateContext<W> state) {
super.prefetchOnMerge(state);
StateMerging.prefetchCombiningValues(state, DELAYED_UNTIL_TAG);
// NOTE: We could try to delete all timers which are still active, but we would
// need access to a timer context for each merging window.
// for (CombiningValueStateInternal<Instant, Combine.Holder<Instant>, Instant> state :
// c.state().accessInEachMergingWindow(DELAYED_UNTIL_TAG).values()) {
// Instant timestamp = state.get().read();
// if (timestamp != null) {
// <context for merging window>.deleteTimer(timestamp, timeDomain);
// }
// }
// Instead let them fire and be ignored.
StateMerging.clear(c.state(), DELAYED_UNTIL_TAG);
// NOTE: We do not attempt to delete the timers.
StateMerging.mergeCombiningValues(c.state(), DELAYED_UNTIL_TAG);
Instant earliestTargetTime = c.state().access(DELAYED_UNTIL_TAG).get().read(); | 0 |
* @version CVS $Id: CocoonBean.java,v 1.3 2003/03/28 12:55:42 nicolaken Exp $
if (followLinks && confirmExtension) {
final Iterator i = this.getLinks(deparameterizedURI, parameters).iterator();
while (i.hasNext()) {
String link = (String) i.next();
// Fix relative links starting with "?"
String relativeLink = link;
if (relativeLink.startsWith("?")) {
relativeLink = pageURI + relativeLink;
}
String absoluteLink = NetUtils.normalize(NetUtils.absolutize(path, relativeLink));
{
final TreeMap p = new TreeMap();
absoluteLink = NetUtils.parameterize(NetUtils.deparameterize(absoluteLink, p), p);
String translatedAbsoluteLink = (String)allTranslatedLinks.get(absoluteLink);
if (translatedAbsoluteLink == null) {
try {
translatedAbsoluteLink = this.translateURI(absoluteLink);
log.info(" Link translated: " + absoluteLink);
allTranslatedLinks.put(absoluteLink, translatedAbsoluteLink);
absoluteLinks.add(absoluteLink);
} catch (ProcessingException pe) {
printBroken(absoluteLink, pe.getMessage());
}
}
// I have to add also broken links to the absolute links
// to be able to generate the "broken link" page
absoluteLinks.add(absoluteLink);
final String translatedRelativeLink = NetUtils.relativize(path, translatedAbsoluteLink);
translatedLinks.put(link, translatedRelativeLink);
printInfo("["+translatedLinks.size()+"] ");
printInfo("["+gatheredLinks.size()+"] "); | 0 |
import org.apache.sshd.server.scp.UnknownCommand; | 0 |
File file = new File(getTestDirectoryFile(), name);
public static File getTestDirectoryFile()
// final String baseDirProp = System.getProperty("test.basedir");
final String baseDirProp = getTestDirectory();
baseDir = getCanonicalFile(new File(baseDirProp));
}
return baseDir;
}
public static String getTestDirectory()
{
return System.getProperty("test.basedir");
/*
if (baseDir == null)
{
*/
File file = new File(getTestDirectoryFile(), name); | 0 |
public void encode(BigInteger value, OutputStream outStream) throws IOException, CoderException { | 1 |
import org.apache.ambari.server.security.authorization.UserType; | 0 |
* Accepts an inverse offer.
*
* @param offerID ID of the inverse offer.
* @param filter offer filter to apply.
*/
void acceptInverseOffer(OfferID offerID, Filters filter);
/** | 0 |
package org.apache.felix.karaf.admin.command; | 0 |
private static final long serialVersionUID = 1L;
private Set<String> includedFiles = new HashSet<String>();
PatternStack stack, Set<String> includedFiles) {
Class<?> cls = Class.forName(className);
public List<Rule> match(String pattern) {
public List<Rule> match(String namespaceURI, String pattern) {
public List<Rule> rules() {
ArrayList<String> paramTypesList = new ArrayList<String>();
Class<?> clazz = Class.forName(type); | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ambari.server.upgrade;
import org.apache.ambari.server.AmbariException;
import java.sql.SQLException;
/**
* Interface for upgrading Ambari DB
*/
public interface UpgradeCatalog {
/**
* Run the upgrade scripts for upgrading ambari server from current version
* to the new version.
* @throws AmbariException
*/
public void upgradeSchema() throws AmbariException, SQLException;
/**
* Start persistence service and perform updates as necessary
* @throws AmbariException
* @throws SQLException
*/
public void executeDMLUpdates() throws AmbariException, SQLException;
/**
* Return the version that will be upgraded to
* @return
*/
public abstract String getTargetVersion();
/**
* Return latest source version that can be upgraded from.
* Return null since no UpgradeCatalogs exist before this one.
*
* @return null : default
*/
public String getSourceVersion();
} | 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.
*/
package org.apache.cocoon.template.jxtg.script.event;
public class StartParameter extends StartInstruction {
public StartParameter(StartElement raw, String name, String optional,
String defaultValue) {
super(raw);
this.name = name;
this.optional = optional;
this.defaultValue = defaultValue;
}
public String getDefaultValue() {
return defaultValue;
}
final String name;
final String optional;
private final String defaultValue; | 0 |
private static class NameVersion {
public List preParse(List<String> original) { | 0 |
* Copyright 1999-2002,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: LinkTransformer.java,v 1.5 2004/03/05 13:02:16 bdelacretaz Exp $ | 1 |
* @version $Revision$ $Date$ | 0 |
// No action required
// Expected result | 0 |
import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.xml.security.exceptions.AlgorithmAlreadyRegisteredException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource; | 0 |
client.loadTablet(Tracer.traceInfo(), SystemCredentials.get().toThrift(instance), lockString(lock), extent.toThrift());
client.unloadTablet(Tracer.traceInfo(), SystemCredentials.get().toThrift(instance), lockString(lock), extent.toThrift(), save);
return client.getTabletServerStatus(Tracer.traceInfo(), SystemCredentials.get().toThrift(instance));
client.halt(Tracer.traceInfo(), SystemCredentials.get().toThrift(instance), lockString(lock));
client.fastHalt(Tracer.traceInfo(), SystemCredentials.get().toThrift(instance), lockString(lock));
client.flush(Tracer.traceInfo(), SystemCredentials.get().toThrift(instance), lockString(lock), tableId,
startRow == null ? null : ByteBuffer.wrap(startRow), endRow == null ? null : ByteBuffer.wrap(endRow));
client.chop(Tracer.traceInfo(), SystemCredentials.get().toThrift(instance), lockString(lock), extent.toThrift());
client.splitTablet(Tracer.traceInfo(), SystemCredentials.get().toThrift(instance), extent.toThrift(),
client.flushTablet(Tracer.traceInfo(), SystemCredentials.get().toThrift(instance), lockString(lock), extent.toThrift());
client.compact(Tracer.traceInfo(), SystemCredentials.get().toThrift(instance), lockString(lock), tableId,
private Map<TServerInstance,TServerInfo> currentInstances = new HashMap<TServerInstance,TServerInfo>();
} else if (System.currentTimeMillis() - firstSeen > 10 * 60 * 1000) { | 0 |
@Deprecated | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.