Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
@Test
public void testGetAuroraStatUnit() {
assertEquals("cores", CPUS.getAuroraStatUnit());
} | 0 |
import org.apache.atlas.typesystem.types.cache.TypeCache;
final Collection<Provider<EntityChangeListener>> entityListenerProviders, TypeCache typeCache)
TypeSystem.getInstance(), ApplicationProperties.get(), typeCache);
final Configuration configuration, TypeCache typeCache) throws AtlasException {
/**
* Ideally a TypeCache implementation should have been injected in the TypeSystemProvider,
* but a singleton of TypeSystem is constructed privately within the class so that
* clients of TypeSystem would never instantiate a TypeSystem object directly in
* their code. As soon as a client makes a call to TypeSystem.getInstance(), they
* should have the singleton ready for consumption. Manually inject TypeSystem with
* the Guice-instantiated type cache here, before types are restored.
* This allows cache implementations to participate in Guice dependency injection.
*/
this.typeSystem.setTypeCache(typeCache);
| 0 |
*
*
package org.apache.cocoon.components.serializers.util;
import javax.servlet.http.HttpServletRequest;
import org.xml.sax.helpers.AttributesImpl;
*
* This serializer is reusable. Inbetween uses, {@link #recycle()} should be
* called, folled by {@link #setup(HttpServletRequest)} when starting a new serialization.
public abstract class EncodingSerializer implements Locator {
protected HttpServletRequest request;
/* ====================================================================== */
public void setup(HttpServletRequest request) {
this.request = request;
public static void include(String content, HttpServletRequest request, ContentHandler handler)
attr.addAttribute("", "index", "index", "CDATA", String.valueOf(values.size() - 1));
public void setEncoding(String encoding)
throws UnsupportedEncodingException {
this.charset = CharsetFactory.newInstance().getCharset(encoding);
}
public void setIndentPerLevel(int i) {
indentPerLevel = i;
| 0 |
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 |
package org.apache.beam.runners.flink.translation.wrappers.streaming.io;
import org.apache.beam.runners.flink.FlinkPipelineRunner; | 0 |
package org.apache.felix.ipojo.runtime.core.api.components;
import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.runtime.core.api.services.Foo;
/**
* This class is marked as a component to be manipulated.
*/
@Component(name="do-not-use-this-factory", public_factory = false)
public class MyComponentImpl {
private Foo myFoo;
private int anInt;
public MyComponentImpl() {
anInt = 2;
}
public MyComponentImpl(int i) {
anInt = i;
}
public void start() {
myFoo.doSomething();
if (anInt > 0) {
System.out.println("Set int to " + anInt);
}
}
} | 0 |
return streamNames.stream() | 0 |
// This should throw ReadOnlyBufferException, but THRIFT-883 requires that the ByteBuffers
// themselves not be read-only | 0 |
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at | 0 |
* @version $Revision$ | 0 |
import org.springframework.stereotype.Component;
@Component | 0 |
*
*
*
// the localization context's resource bundle
final private ResourceBundle bundle;
// the localization context's locale
final private Locale locale;
/**
* Constructs an empty I18N localization context.
*/
public LocalizationContext() {
bundle = null;
locale = null;
}
/**
* Constructs an I18N localization context from the given resource bundle
* and locale.
*
* <p> The specified locale is the application- or browser-based preferred
* locale that led to the resource bundle match.
*
* @param bundle The localization context's resource bundle
* @param locale The localization context's locale
*/
public LocalizationContext(ResourceBundle bundle, Locale locale) {
this.bundle = bundle;
this.locale = locale;
}
/**
* Constructs an I18N localization context from the given resource bundle.
*
* <p> The localization context's locale is taken from the given
* resource bundle.
*
* @param bundle The resource bundle
*/
public LocalizationContext(ResourceBundle bundle) {
this.bundle = bundle;
this.locale = bundle.getLocale();
}
/**
* Gets the resource bundle of this I18N localization context.
*
* @return The resource bundle of this I18N localization context, or null
* if this I18N localization context is empty
*/
public ResourceBundle getResourceBundle() {
return bundle;
}
/**
* Gets the locale of this I18N localization context.
*
* @return The locale of this I18N localization context, or null if this
* I18N localization context is empty, or its resource bundle is a
* (locale-less) root resource bundle.
*/
public Locale getLocale() {
return locale;
} | 0 |
protected class DOMAttrModifiedEventListener implements EventListener { | 0 |
List<List<Integer>> partitionMax = ListUtils.partition(strings, Integer.MAX_VALUE);
assertEquals(1, partitionMax.size());
assertEquals(strings.size(), partitionMax.get(0).size());
assertEquals(strings, partitionMax.get(0)); | 0 |
public static final String ACCUMULO_CLASSPATH_VALUE =
+ "$ACCUMULO_HOME/lib/[^.].*.jar,\n"
+ "$ZOOKEEPER_HOME/zookeeper[^.].*.jar,\n"
+ "$HADOOP_PREFIX/[^.].*.jar,\n" + "$HADOOP_CONF_DIR,\n" | 0 |
public boolean isAbsoluteName(final String name)
StringBuffer b = new StringBuffer(name);
UriParser.fixSeparators(b);
extractRootPrefix(name, b);
catch (FileSystemException e)
protected abstract String extractRootPrefix(final String uri,
final StringBuffer name) | 0 |
import java.net.Socket;
import java.util.Map;
import java.util.Set;
* A strategy allowing for a choice of an alias during SSL authentication.
*
* @since 4.3
public interface PrivateKeyStrategy {
/**
* Determines what key material to use for SSL authentication.
*/
String chooseAlias(Map<String, PrivateKeyDetails> aliases, Socket socket); | 0 |
* @since 3.0 | 0 |
import org.apache.accumulo.core.security.crypto.impl.AESKeyUtils;
key = AESKeyUtils.generateKey(sr, 16);
key = AESKeyUtils.generateKey(sr, 24);
key = AESKeyUtils.generateKey(sr, 32);
key = AESKeyUtils.generateKey(sr, 11);
java.security.Key kek = AESKeyUtils.generateKey(sr, 16);
java.security.Key fek = AESKeyUtils.generateKey(sr, 16);
byte[] wrapped = AESKeyUtils.wrapKey(fek, kek);
java.security.Key unwrapped = AESKeyUtils.unwrapKey(wrapped, kek);
SecretKeySpec fileKey = AESKeyUtils.loadKekFromUri("file:///tmp/testAESFile"); | 0 |
if (LOG.isTraceEnabled()) {
LOG.trace("==> AtlasPluginClassLoader.findClass(" + name + ")");
if (LOG.isTraceEnabled()) {
LOG.trace("AtlasPluginClassLoader.findClass(" + name + "): calling pluginClassLoader.findClass()");
if (LOG.isTraceEnabled()) {
LOG.trace(
if (LOG.isTraceEnabled()) {
LOG.trace("<== AtlasPluginClassLoader.findClass(" + name + "): " + ret);
if (LOG.isTraceEnabled()) {
LOG.trace("==> AtlasPluginClassLoader.loadClass(" + name + ")");
if (LOG.isTraceEnabled()) {
LOG.trace("AtlasPluginClassLoader.loadClass(" + name + "): calling pluginClassLoader.loadClass()");
if (LOG.isTraceEnabled()) {
LOG.trace(
if (LOG.isTraceEnabled()) {
LOG.trace("<== AtlasPluginClassLoader.loadClass(" + name + "): " + ret); | 0 |
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import org.apache.commons.configuration.ConfigurationUtils;
/** Constant for the jar URL protocol.*/
private static final String JAR_PROTOCOL = "jar";
/** Stores a reference to the configuration to be monitored.*/
if ((now > lastChecked + refreshDelay))
if(hasChanged())
{
reloading = true;
}
File file = getFile();
if (file != null)
{
lastModified = file.lastModified();
}
File file = getFile();
if (file == null || !file.exists())
return (file.lastModified() > lastModified);
}
/**
* Returns the file that is monitored by this strategy. Note that the return
* value can be <b>null </b> under some circumstances.
*
* @return the monitored file
*/
protected File getFile()
{
return (configuration.getURL() != null) ? fileFromURL(configuration
.getURL()) : configuration.getFile();
/**
* Helper method for transforming a URL into a file object. This method
* handles file: and jar: URLs.
*
* @param url the URL to be converted
* @return the resulting file or <b>null </b>
*/
private File fileFromURL(URL url)
{
if (JAR_PROTOCOL.equals(url.getProtocol()))
{
String path = url.getPath();
try
{
return ConfigurationUtils.fileFromURL(new URL(path.substring(0,
path.indexOf('!'))));
}
catch (MalformedURLException mex)
{
return null;
}
}
else
{
return ConfigurationUtils.fileFromURL(url);
}
} | 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.dependencymanager.samples.customdep;
import org.osgi.service.log.LogService;
public class PathTracker {
volatile LogService logService;
void start() {
logService.log(LogService.LOG_INFO, "PathTracker.start");
}
void stop() {
logService.log(LogService.LOG_INFO, "PathTracker.stop");
}
void add(String path) {
logService.log(LogService.LOG_INFO, "PathTracker.add: " + path);
}
void remove(String path) {
logService.log(LogService.LOG_INFO, "PathTracker.remove: " + path);
}
} | 0 |
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.List;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;
@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE)
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown=true)
this.setEntityRelationships(templateElement.getEntityRelationships());
public List<Relationship> getEntityRelationships()
if (entityRelationships == null)
{
return null;
}
else
{
return new ArrayList<>(entityRelationships);
}
public void setEntityRelationships(List<Relationship> entityRelationships)
if (entityRelationships == null)
{
this.entityRelationships = null;
}
else
{
this.entityRelationships = new ArrayList<>(entityRelationships);
} | 0 |
if (Character.toUpperCase(c1) != Character.toUpperCase(c2) &&
Character.toLowerCase(c1) != Character.toLowerCase(c2)) { | 0 |
* $todo$ Currently, the test vectors are in the file system under the data/ directory. It is planned to put them all into a single jar/zip which is deployed with the library. | 0 |
import org.apache.avalon.framework.parameters.ParameterException;
import org.apache.avalon.framework.parameters.Parameters;
* @version CVS $Id: WindowAspect.java,v 1.3 2003/06/15 16:56:08 cziegeler Exp $
final PreparedConfiguration config = (PreparedConfiguration)context.getAspectConfiguration();
XMLUtils.startElement(contenthandler, config.tagName, attributes);
XMLUtils.endElement(contenthandler, config.tagName);
}
protected class PreparedConfiguration {
public String tagName;
public void takeValues(PreparedConfiguration from) {
this.tagName = from.tagName;
}
}
/* (non-Javadoc)
* @see org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect#prepareConfiguration(org.apache.avalon.framework.parameters.Parameters)
*/
public Object prepareConfiguration(Parameters configuration)
throws ParameterException {
PreparedConfiguration pc = new PreparedConfiguration();
pc.tagName = configuration.getParameter("tag-name", "window");
return pc; | 0 |
*
*
*
*
@Test | 0 |
import org.junit.Assert;
final String string = instructionHandle.getInstruction().toString(cp.getConstantPool());
Assert.assertNotNull(string);
// TODO Need real assertions.
// System.out.println(string); | 0 |
* {@link DoFn.ProcessElement @ProcessElement}. | 0 |
@Override | 0 |
import org.apache.beam.sdk.runners.AppliedPTransform; | 0 |
RepositoryVersionEntity repositoryVersionEntity = clusterVersionEntity.getRepositoryVersion();
StackId repoVersionStackId = repositoryVersionEntity.getStackId();
if (repoVersionStackId.equals(currentStackId)
ClusterConfigMappingEntity entityStored = temp.get(type);
return temp.values(); | 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.mishell.console;
public class CommandNotFoundException extends Exception {
} | 0 |
DocumentBuilderFactory dbf =
DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setAttribute("http://xml.org/sax/features/namespaces", Boolean.TRUE);
DocumentBuilder db = dbf.newDocumentBuilder();
Document d = db.parse(
new InputSource(new StringReader(fragment)));
// String outp = serialize(d);
| 0 |
Mutation m = new Mutation(String.format("%016x", rand.nextLong() & 0x7fffffffffffffffl));
long val = rand.nextLong() & 0x7fffffffffffffffl; | 0 |
expect(parentClassLoader.loadClass("org.slf4j.LoggerFactory")).andReturn(parentClass).once();
// should be loaded by parent loader
clazz = classLoader.loadClass("org.slf4j.LoggerFactory");
Assert.assertNotNull(clazz);
Assert.assertSame(parentClass, clazz);
| 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 |
case AdapterService:
service = createAdapterService(b, dm, parser);
break;
* Creates an Adapter Service.
* @param b
* @param dm
* @param parser
* @return
*/
private Service createAdapterService(Bundle b, DependencyManager dm, DescriptorParser parser)
throws ClassNotFoundException
{
Class<?> adapterImpl = b.loadClass(parser.getString(DescriptorParam.impl));
Class<?> adapterService = b.loadClass(parser.getString(DescriptorParam.adapterService));
Dictionary<String, String> adapterProperties = parser.getDictionary(DescriptorParam.adapterProperties, null);
Class<?> adapteeService = b.loadClass(parser.getString(DescriptorParam.adapteeService));
String adapteeFilter = parser.getString(DescriptorParam.adapteeFilter, null);
Service service = dm.createAdapterService(adapteeService, adapteeFilter, adapterService, adapterImpl, adapterProperties);
setServiceCallbacks(service, parser);
setServiceComposition(service, parser);
return service;
}
/** | 0 |
import static org.junit.Assert.fail;
import org.apache.ambari.server.controller.internal.ConfigurationTopologyException;
import org.apache.ambari.server.topology.ConfigRecommendationStrategy;
import org.apache.ambari.server.topology.Configuration;
import org.apache.ambari.server.topology.HostGroup;
import org.apache.ambari.server.topology.HostGroupInfo;
import com.google.common.collect.Maps;
| 0 |
import com.google.common.primitives.Longs;
Map<String,String> data = s.getKVAnnotations();
s.getSpanId(), Longs.asList(s.getParents()), s.getStartTimeMillis(),
s.getStopTimeMillis(), s.getDescription(), data, annotations)); | 0 |
package org.apache.beam.sdk.extensions.sql.impl.interpreter.operator.math;
import org.apache.beam.sdk.extensions.sql.impl.interpreter.operator.BeamSqlExpression;
import org.apache.beam.sdk.extensions.sql.impl.interpreter.operator.BeamSqlPrimitive; | 0 |
properties.setProperty(Configuration.OS_VERSION_KEY,
"centos5"); | 1 |
public final boolean isUnique;
public final boolean isIndexable;
this.isUnique = def.isUnique;
this.isIndexable = def.isIndexable;
", isUnique=" + isUnique +
", isIndexable=" + isIndexable + | 0 |
if (activateContext.getServiceReference() != null)
{
result.put( "theValue", "anotherValue1" );
} | 0 |
userResourceProvider = new UserResourceProvider(amc); | 0 |
if (rgn.intersects(alphaRed.getBounds()))
rgn = rgn.intersection(alphaRed.getBounds());
else
return wr;
final int bands = wr.getSampleModel().getNumBands();
int i=0, a, b;
a = alphaData[x]&0xFF;
break;
a = alphaData[x]&0xFF;
break;
a = alphaData[x]&0xFF;
for (b=0; b<bands; b++) { | 0 |
List<? extends BoundedSource<TableRow>> sources = bqSource.split(100, options);
List<? extends BoundedSource<TableRow>> sources = bqSource.split(100, options);
List<? extends BoundedSource<TableRow>> sources = bqSource.split(100, options);
stringSource, stringSource.split(100, options), options);
stringSource, stringSource.split(100, options), options); | 0 |
package org.apache.jcp.xml.dsig.internal.dom; | 0 |
import org.apache.accumulo.server.zookeeper.IZooReaderWriter;
IZooReaderWriter session = ZooReaderWriter.getInstance(); | 0 |
import org.apache.avalon.framework.service.ServiceException;
* @version CVS $Id: BaseCachingProcessingPipeline.java,v 1.3 2004/07/15 12:49:50 sylvain Exp $
} catch (ServiceException ce) { | 0 |
* Uses the last modification date of the directory and the contained files. | 0 |
public class ParameterTest extends AbstractCommonTest { | 0 |
@Override
@Override
@Override
@Override | 0 |
if (!hostsType.unhealthy.isEmpty()) {
context.addUnhealthy(hostsType.unhealthy);
}
| 0 |
Object[] values = copy.value;
@Override
protected CopyOnWriteList<V> compute(K key) {
return new CopyOnWriteList<V>();
}
| 0 |
@SuppressWarnings("deprecation")
public void consumeContent() { | 0 |
private void addClassifications(String entityGuid, String typeName, String qualifiedName, List<AtlasClassification> list) {
entitiesStore.addClassifications(entityGuid, list);
summarize(PROCESS_ADD, entityGuid, typeName, qualifiedName, classificationNames, status);
private void updateClassifications(String entityGuid, String typeName, String qualifiedName, List<AtlasClassification> list) {
entitiesStore.updateClassifications(entityGuid, list);
summarize(PROCESS_UPDATE, entityGuid, typeName, qualifiedName, classificationNames, status);
private void deleteClassifications(String entityGuid, String typeName, String qualifiedName, List<AtlasClassification> list) { | 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.felix.bundlerepository.Repository;
public void testRemoveRepository() throws Exception {
URL url = getClass().getResource("/repo_for_resolvertest.xml");
RepositoryAdminImpl repoAdmin = createRepositoryAdmin();
Repository repository = repoAdmin.addRepository(url);
assertNotNull(repository);
String repositoryUri = repository.getURI();
assertNotNull(repositoryUri);
assertTrue(repoAdmin.removeRepository(repositoryUri));
for (Repository repo : repoAdmin.listRepositories()) {
assertNotSame(repositoryUri, repo.getURI());
}
} | 0 |
/**
* This method is for test usage only
*/
public Write<T> withTestServices(BigQueryServices testServices) { | 0 |
ots.addTestSuite(OptionalNoNullableDependencies.class); | 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 |
AgeOffFilter.setTTL(is, 101L);
AgeOffFilter.setCurrentTime(is, 1001L);
ColumnAgeOffFilter.addTTL(is, new IteratorSetting.Column("a"), 901L);
ColumnAgeOffFilter.addTTL(is, new IteratorSetting.Column("a", "b"), 101L);
ColumnAgeOffFilter.addTTL(is, new IteratorSetting.Column("a"), 901L);
ColumnAgeOffFilter.addTTL(is, new IteratorSetting.Column("a", "b"), 101L);
ColumnAgeOffFilter.addTTL(is, new IteratorSetting.Column("negate"), 901L);
ColumnAgeOffFilter.addTTL(is, new IteratorSetting.Column("negate", "b"), 101L);
k.setTimestamp(157L);
TimestampFilter.setEnd(is, 253402300800001L, true); | 0 |
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License. | 1 |
public static final String IS_HEALTHY = "OK\n";
private static final String IS_NOT_HEALTHY = "SICK\n"; | 0 |
import org.apache.aurora.scheduler.resources.ResourceTestUtil;
import static org.apache.aurora.scheduler.resources.ResourceTestUtil.mesosScalar;
import static org.apache.aurora.scheduler.resources.ResourceType.CPUS;
import static org.apache.aurora.scheduler.resources.ResourceType.DISK_MB;
import static org.apache.aurora.scheduler.resources.ResourceType.RAM_MB;
.addResources(mesosScalar(CPUS, 2.0, true))
.addResources(mesosScalar(CPUS, 4.0, false))
.addResources(mesosScalar(RAM_MB, 1024))
.addResources(mesosScalar(DISK_MB, 2048))
ResourceTestUtil.bag(cpu, 1024, 2048), | 0 |
* Management interface for {@link ManagedClientConnection client connections}.
* The purpose of an HTTP connection manager is to serve as a factory for new
* HTTP connections, manage persistent connections and synchronize access to
* persistent connections making sure that only one thread of execution can
* data must be synchronized as methods of this interface may be executed
*
*
*
*
* | 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.
*/ | 0 |
assertThat(options.getSavepointPath(), is(nullValue()));
assertThat(options.getAllowNonRestoredState(), is(false)); | 0 |
if (element != null && element.getParentNode() == null) {
throw new XMLEncryptionException("empty", "The element can't be serialized as it has no parent");
}
if (element != null && element.getParentNode() == null) {
throw new XMLEncryptionException("empty", "The element can't be serialized as it has no parent");
} | 0 |
import java.util.ArrayDeque;
private final Queue<Iterable<TimestampedValue<T>>> batches = new ArrayDeque<>();
private final Deque<SparkWatermarks> times = new ArrayDeque<>(); | 0 |
* A {@link CollectionCoder} encodes {@link Collection Collections} in the format of {@link
* IterableLikeCoder}.
* @return the decoded elements directly, since {@link List} is a subtype of {@link Collection}. | 1 |
return 0; | 0 |
* Matches the target host ("Host" request header) against a wildcard expression.
*
public class WildcardHostMatcher extends AbstractWildcardMatcher {
| 0 |
@Override
@Override
@Override
@Override
@Override | 0 |
/*
* @author <a href="mailto:[email protected]">Felix Project Team</a>
*/ | 0 |
import java.util.regex.Pattern;
private final Pattern redir = Pattern.compile("[0-9&]?>|[0-9]?>>|[0-9]?>&|[0-9]?<|[0-9]?<>");
Token t, tn;
case '>':
case '<':
t = text.subSequence(start, index);
tn = text.subSequence(start, index + 1);
if (redir.matcher(tn).matches()) {
getch();
break;
}
if (redir.matcher(t).matches() && start < index - 1) {
getch();
}
word = 0;
return token(start);
case '&':
// beginning of token
if (start == index - 1) {
if (peek() == '&' || peek() == '>') {
getch();
getch();
}
word = 0;
return token(start);
}
// in the middle of a redirection
else if (redir.matcher(text.subSequence(start, index)).matches()) {
getch();
break;
}
else {
word = 0;
return token(start);
}
if (start == index - 1 && (peek() == '|' || peek() == '&')) {
getch();
getch();
}
word = 0;
return token(start);
case ';': | 0 |
zks.getFollower().request(request); | 0 |
import java.util.UUID;
import org.apache.accumulo.proxy.thrift.TableExistsException;
import org.apache.accumulo.proxy.thrift.UnknownScanner;
import org.apache.accumulo.proxy.thrift.UnknownWriter;
public void testExists() throws Exception {
client.createTable(creds, "ett1", false, TimeType.MILLIS);
client.createTable(creds, "ett2", false, TimeType.MILLIS);
try {
client.createTable(creds, "ett1", false, TimeType.MILLIS);
fail("exception not thrown");
} catch (TableExistsException tee) {}
try {
client.renameTable(creds, "ett1", "ett2");
fail("exception not thrown");
} catch (TableExistsException tee) {}
try {
client.cloneTable(creds, "ett1", "ett2", false, new HashMap<String,String>(), new HashSet<String>());
fail("exception not thrown");
} catch (TableExistsException tee) {}
}
@Test(timeout = 10000)
public void testUnknownScanner() throws Exception {
try {
client.nextEntry("99999999");
fail("exception not thrown");
} catch (UnknownScanner us) {}
try {
client.nextK("99999999", 6);
fail("exception not thrown");
} catch (UnknownScanner us) {}
try {
client.hasNext("99999999");
fail("exception not thrown");
} catch (UnknownScanner us) {}
try {
client.hasNext(UUID.randomUUID().toString());
fail("exception not thrown");
} catch (UnknownScanner us) {}
}
@Test(timeout = 10000)
public void testUnknownWriter() throws Exception {
try {
client.flush("99999");
fail("exception not thrown");
} catch (UnknownWriter uw) {}
try {
client.flush(UUID.randomUUID().toString());
fail("exception not thrown");
} catch (UnknownWriter uw) {}
try {
client.closeWriter("99999");
fail("exception not thrown");
} catch (UnknownWriter uw) {}
}
@Test(timeout = 10000) | 0 |
@Override | 0 |
*
* @deprecated (4.3) do not use
@Deprecated | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestCollectionUtils.java,v 1.25 2003/10/05 21:03:44 scolebourne Exp $
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* permission of the Apache Software Foundation.
* @version $Revision: 1.25 $ $Date: 2003/10/05 21:03:44 $
test = CollectionUtils.get(list, 2); | 0 |
import java.io.IOException;
import org.apache.accumulo.server.fs.VolumeManager;
import org.apache.hadoop.fs.Path;
private final VolumeManager fs;
public StatusMaker(Connector conn, VolumeManager fs) {
this.fs = fs;
try {
// If the createdTime is not set, work around the issue by retrieving the WAL creation time
// from HDFS (or the current time if the WAL does not exist). See ACCUMULO-4751
long createdTime = setAndGetCreatedTime(new Path(file.toString()), tableId);
stat = Status.newBuilder(stat).setCreatedTime(createdTime).build();
value = ProtobufUtil.toValue(stat);
log.debug("Status was lacking createdTime, set to {} for {}", createdTime, file);
} catch (IOException e) {
log.warn("Failed to get file status, will retry", e);
return false;
} catch (MutationsRejectedException e) {
log.warn("Failed to write status mutation for replication, will retry", e);
return false;
}
private long setAndGetCreatedTime(Path file, String tableId) throws IOException, MutationsRejectedException {
long createdTime;
if (fs.exists(file)) {
createdTime = fs.getFileStatus(file).getModificationTime();
} else {
createdTime = System.currentTimeMillis();
}
Status status = Status.newBuilder().setCreatedTime(createdTime).build();
Mutation m = new Mutation(new Text(ReplicationSection.getRowPrefix() + file.toString()));
m.put(MetadataSchema.ReplicationSection.COLF, new Text(tableId), ProtobufUtil.toValue(status));
replicationWriter.addMutation(m);
replicationWriter.flush();
return createdTime;
} | 0 |
*
*
*
* @version CVS $Id$
/**
* Constructor. Set the namespace.
*/
super.defaultNamespaceURI = SessionConstants.SESSION_NAMESPACE_URI;
if (namespaceURI.equals(uri)
&& name.equals(GETXML_ELEMENT)) {
if (namespaceURI.equals(uri)
&& name.equals(GETXML_ELEMENT)) { | 0 |
import java.util.ArrayList;
import java.util.List;
| 0 |
* @version CVS $Id: AuthenticationContext.java,v 1.5 2003/05/08 12:33:56 cziegeler Exp $
frag = this.authContext.getXML(path);
frag = this.authContext.getXML(path);
this.authContext.setXML(path, fragment);
this.authContext.setXML(path, fragment);
this.authContext.appendXML(path, fragment);
this.authContext.appendXML(path, fragment);
this.authContext.removeXML(path);
this.authContext.removeXML(path);
return this.authContext.streamXML(path, contentHandler, lexicalHandler);
return this.authContext.streamXML(path, contentHandler, lexicalHandler); | 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.dependencymanager.samples.device.annot;
import java.util.Dictionary;
import org.apache.felix.dm.annotation.api.Component;
/**
* @author <a href="mailto:[email protected]">Felix Project Team</a>
*/
@Component(factoryName = "DeviceParameter", factoryConfigure = "configure")
public class DeviceParameterImpl implements DeviceParameter {
int id;
void configure(Dictionary<String, Object> configuration) {
this.id = (Integer) configuration.get("device.id");
}
@Override
public int getDeviceId() {
return id;
}
} | 0 |
boolean isInternal = isInternalType(edge.getInVertex()) && isInternalType(edge.getOutVertex());
deleteEdge(edge, isInternalType(inVertex) && isInternalType(outVertex)); | 0 |
import org.junit.Assert;
import org.junit.Test;
public class TestByteArrayEntity {
@Test
Assert.assertEquals(bytes.length, httpentity.getContentLength());
Assert.assertNotNull(httpentity.getContent());
Assert.assertTrue(httpentity.isRepeatable());
Assert.assertFalse(httpentity.isStreaming());
@Test
Assert.fail("IllegalArgumentException should have been thrown");
@Test
Assert.assertNotNull(bytes2);
Assert.assertEquals(bytes.length, bytes2.length);
Assert.assertEquals(bytes[i], bytes2[i]);
Assert.assertNotNull(bytes2);
Assert.assertEquals(bytes.length, bytes2.length);
Assert.assertEquals(bytes[i], bytes2[i]);
Assert.fail("IllegalArgumentException should have been thrown"); | 0 |
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList; | 0 |
static QuickLinksProfile create(List<Filter> globalFilters, List<Service> services) {
QuickLinksProfile profile = new QuickLinksProfile();
profile.setFilters(globalFilters);
profile.setServices(services);
return profile;
}
| 0 |
import org.apache.log4j.Logger;
private static final Logger LOG = Logger.getLogger(AckRequestProcessor.class);
QuorumPeer self = leader.self;
if(self != null)
leader.processAck(self.getId(), request.zxid, null);
else
LOG.error("Null QuorumPeer"); | 0 |
if ( type.equals( address.getType() ) ) {
} | 0 |
m_configurations = new ConcurrentHashMap<>();
m_hosts = new ConcurrentHashMap<>();
Set<Map<String, Object>> hostnames = new HashSet<>();
Map<String, Object> hostMap = new HashMap<>();
Set<Map<String, Object>> configObjMap = new HashSet<>();
Map<String, Object> configMap = new HashMap<>(); | 1 |
import org.apache.aurora.common.quantity.Time;
import org.apache.aurora.scheduler.maintenance.MaintenanceModule;
opts.sla.minRequiredInstances,
opts.sla.maxSlaDuration.as(Time.SECONDS),
install(new MaintenanceModule(options.maintenance)); | 0 |
SERVICE;
public static KerberosPrincipalType translate(String string) {
if(string == null)
return null;
else {
string = string.trim();
if(string.isEmpty())
return null;
else {
return valueOf(string.toUpperCase());
}
}
}
public static String translate(KerberosPrincipalType type) {
return (type == null)
? null
: type.name().toLowerCase();
} | 0 |
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.script.jpython;
import org.apache.batik.script.Interpreter;
import org.apache.batik.script.InterpreterFactory;
/**
* Allows to create instances of <code>JPythonInterpreterFactory</code>.
* @author <a href="mailto:[email protected]">Christophe Jolif</a>
* @version $Id$
*/
public class JPythonInterpreterFactory implements InterpreterFactory {
/**
* Builds a <code>JPythonInterpreterFactory</code>.
*/
public JPythonInterpreterFactory() {
}
/**
* Creates an instance of <code>JPythonInterpreter</code> class.
*/
public Interpreter createInterpreter() {
return new JPythonInterpreter();
}
} | 0 |
protected String convertToString(Object value) {
String result = null;
} else {
result = value.toString();
if (log().isDebugEnabled()) {
log().debug(" Converted to String using toString() '" + result + "'");
} | 0 |
private byte[] columnFamily;
private byte[] columnQualifier;
private byte[] columnVisibility;
private long timestamp;
private boolean hasTimestamp;
private byte[] val;
private byte[] data;
private int tsOffset;
private boolean deleted;
public ColumnUpdate(byte[] cf, byte[] cq, byte[] cv, boolean hasts, long ts, boolean deleted, byte[] val, byte[] data, int tsOffset) {
this.columnFamily = cf;
this.columnQualifier = cq;
this.columnVisibility = cv;
this.hasTimestamp = hasts;
this.timestamp = ts;
this.deleted = deleted;
this.val = val;
this.data = data;
this.tsOffset = tsOffset;
}
public void setSystemTimestamp(long v) {
if (hasTimestamp) throw new IllegalStateException("Cannot set system timestamp when user set a timestamp");
int tso = this.tsOffset;
data[tso++] = (byte) (v >>> 56);
data[tso++] = (byte) (v >>> 48);
data[tso++] = (byte) (v >>> 40);
data[tso++] = (byte) (v >>> 32);
data[tso++] = (byte) (v >>> 24);
data[tso++] = (byte) (v >>> 16);
data[tso++] = (byte) (v >>> 8);
data[tso++] = (byte) (v >>> 0);
this.timestamp = v;
}
public boolean hasTimestamp() {
return hasTimestamp;
}
/**
* Returns the column
*
*/
public byte[] getColumnFamily() {
return columnFamily;
}
public byte[] getColumnQualifier() {
return columnQualifier;
}
public byte[] getColumnVisibility() {
return columnVisibility;
}
public long getTimestamp() {
return this.timestamp;
}
public boolean isDeleted() {
return this.deleted;
}
public byte[] getValue() {
return this.val;
}
public String toString() {
return new String(Arrays.toString(columnFamily)) + ":" + new String(Arrays.toString(columnQualifier)) + " ["
+ new String(Arrays.toString(columnVisibility)) + "] " + (hasTimestamp ? timestamp : "NO_TIME_STAMP") + " " + Arrays.toString(val) + " " + deleted;
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.