Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
if (fieldValue == null && !field.getType().getNullable()) { | 0 |
String NName = attribute.getLocalName();
if (!XMLNS_URI.equals(attribute.getNamespaceURI())) { | 1 |
import net.jcip.annotations.Immutable;
@Immutable | 0 |
* Empty constructor needed for Instruction.readInstruction.
* Not to be used otherwise. | 0 |
log.info("Created empty WAL at {}", emptyWalog.toURI());
log.info("Created WAL with malformed header at {}", partialHeaderWalog.toURI()); | 0 |
import java.util.List;
import org.apache.sshd.common.NamedResource;
import org.apache.sshd.common.signature.SignatureFactoriesManager;
public class OpenSshHostKeysHandler extends AbstractOpenSshHostKeysHandler implements SignatureFactoriesManager {
public static final OpenSshHostKeysHandler INSTANCE = new OpenSshHostKeysHandler() {
@Override
public List<NamedFactory<Signature>> getSignatureFactories() {
return null;
}
@Override
public void setSignatureFactories(List<NamedFactory<Signature>> factories) {
if (!GenericUtils.isEmpty(factories)) {
throw new UnsupportedOperationException("Not allowed to change default instance signature factories");
}
}
};
private List<NamedFactory<Signature>> factories;
public List<NamedFactory<Signature>> getSignatureFactories() {
return factories;
}
@Override
public void setSignatureFactories(List<NamedFactory<Signature>> factories) {
this.factories = factories;
}
@Override
Collection<? extends NamedFactory<Signature>> factories =
ValidateUtils.checkNotNullAndNotEmpty(
SignatureFactoriesManager.Utils.resolveSignatureFactories(this, session),
"No signature factories available for host keys of session=%s",
session);
log.debug("handleHostKeys({})[want-reply={}] received {} keys - factories={}",
session, wantReply, GenericUtils.size(keys), NamedResource.Utils.getNames(factories)); | 0 |
package org.apache.http.nio.testserver; | 0 |
// put the core into the context
this.appContext.put(Core.ROLE, core);
return (Core)this.parentManager.lookup(Core.ROLE);
if ( Core.ROLE.equals(key) ) {
if ( Core.ROLE.equals(key) ) { | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/compiler/CoreFunction.java,v 1.3 2002/04/24 04:05:38 dmitri Exp $
* $Revision: 1.3 $
* $Date: 2002/04/24 04:05:38 $
* @version $Revision: 1.3 $ $Date: 2002/04/24 04:05:38 $ | 0 |
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
private final byte[][] endKeys;
super(HFileOutputFormat2.class, toConf(updaters, conf));
private static Configuration toConf(List<Update<Job>> updaters, Configuration conf) {
// initialize this inside the `keyBy` or `reduceBy` function
final AtomicReference<ByteBuffer[]> bufferedKeys = new AtomicReference<>();
if (!iterator.hasNext()) {
break;
}
}
private static int toRegionIdUninitialized(
private static int toRegionIdUninitialized(
private static int toRegionId(ByteBuffer[] endKeys, ByteBuffer row) {
try (Connection conn = ConnectionFactory.createConnection(configuration)) {
.toArray(byte[][]::new); | 0 |
* @version $Revision: 1.10 $ $Date: 2004/04/01 02:55:31 $ | 0 |
// Adds dependencies (except named dependencies, which are managed by the lifecycle handler).
addUnamedDependencies(b, dm, srv, srvMeta, depsMeta); | 0 |
import org.apache.hc.client5.http.CircularRedirectException;
import org.apache.hc.client5.http.RedirectException; | 0 |
getConfigurationsDisabledThenEnable(pid, 0, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
ComponentConfigurationDTO cc = getDisabledConfigurationAndEnable(pid, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
ComponentConfigurationDTO cc = getDisabledConfigurationAndEnable(pid, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED_REFERENCE);
findComponentConfigurationByName(pid, ComponentConfigurationDTO.UNSATISFIED_REFERENCE); | 0 |
import org.apache.cocoon.Cocoon;
// protected Configuration getConfiguration() {
// DefaultConfiguration config = new DefaultConfiguration("cocoon", "CoreBlockActivator");
// return config;
// }
manager.addInstance(Cocoon.class.getName(), this.processor); | 0 |
input -> input.getName();
input -> input.getSimpleName();
annotation -> {
String annotationName = annotation.annotationType().getName();
String annotationNameWithoutPackage =
annotationName.substring(annotationName.lastIndexOf('.') + 1).replace('$', '.');
String annotationToString = annotation.toString();
String values = annotationToString.substring(annotationToString.indexOf('('));
return String.format("%s%s", annotationNameWithoutPackage, values);
input -> getClosureOfMethodsOnInterface(input)); | 0 |
/**
* Copyright 2016 Seznam a.s.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ | 0 |
* This implements the coercion table in RFC 190 5.6.3
//annotation fields can be primitives, String, Class, enums, annotations, and arrays of the preceding types
final Class clazz = type;
return ( (Character) o ).charValue();
return ( (Character) o ).charValue();
return ( (Character) o ).charValue();
return ( (Character) o ).charValue(); | 0 |
import java.security.AccessController;
import java.security.PrivilegedAction;
public void configurationEvent(final ConfigurationEvent configurationEvent)
{
if (System.getSecurityManager() != null)
{
AccessController.doPrivileged(
new PrivilegedAction<Void>()
{
public Void run()
{
doConfigurationEvent(configurationEvent);
return null;
}
}
);
}
else
{
doConfigurationEvent(configurationEvent);
}
}
public void doConfigurationEvent(ConfigurationEvent configurationEvent) | 0 |
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.ImmutableMap; | 0 |
private final Collection<Capability> caps = new HashSet<Capability>(); | 0 |
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Lists; | 0 |
.addTransition(State.INSTALLED,
State.INSTALLED,
ServiceComponentHostEventType.HOST_SVCCOMP_OP_SUCCEEDED,
new ServiceComponentHostOpCompletedTransition())
State.INSTALLING,
ServiceComponentHostEventType.HOST_SVCCOMP_INSTALL,
new ServiceComponentHostOpStartedTransition())
.addTransition(State.INSTALLING,
.addTransition(State.STARTING,
State.STARTING,
ServiceComponentHostEventType.HOST_SVCCOMP_START,
new ServiceComponentHostOpStartedTransition())
.addTransition(State.INSTALLED,
State.INSTALLED,
ServiceComponentHostEventType.HOST_SVCCOMP_OP_SUCCEEDED,
new ServiceComponentHostOpCompletedTransition())
.addTransition(State.INSTALLING,
State.INSTALLING,
ServiceComponentHostEventType.HOST_SVCCOMP_INSTALL,
new ServiceComponentHostOpStartedTransition())
if (serviceComponent.isClientComponent()) {
this.stateMachine = clientStateMachineFactory.make(this);
} else {
this.stateMachine = daemonStateMachineFactory.make(this);
} | 0 |
import org.apache.htrace.HTraceConfiguration;
// Visible for testing
SendSpansViaThrift() {}
public SendSpansViaThrift(HTraceConfiguration conf) {
super(conf); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractCollectionCharCollection.java,v 1.2 2003/08/31 17:21:17 scolebourne Exp $
* any, must include the following acknowledgement:
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
* @version $Revision: 1.2 $ $Date: 2003/08/31 17:21:17 $ | 0 |
Iterator<EncryptionProperty> getEncryptionProperties(); | 0 |
import org.joda.time.DateTime;
public BeamSqlPrimitive<DateTime> evaluate(Row inputRow, BoundedWindow window) {
return BeamSqlPrimitive.of(SqlTypeName.TIMESTAMP,
new DateTime(((IntervalWindow) window).start())); | 0 |
/* $Id$
* | 0 |
import org.apache.ambari.server.audit.event.kerberos.CreatePrincipalKerberosAuditEvent;
import org.junit.Test;
| 0 |
String base = System.getProperty("basedir") == null ? "./": System.getProperty("basedir");
File dir = new File(base + fs + | 0 |
ValidateUtils.checkNotNull(
createConnectionCompletionHandler(future, socket, getFactoryManager(), getIoHandler()),
"No connection completion handler created for %s",
address);
address, t.getClass().getSimpleName(), t.getMessage());
address, err.getClass().getSimpleName(), err.getMessage());
address, err.getClass().getSimpleName(), err.getMessage());
log.debug("onCompleted - failed {} to start session: {}",
t.getClass().getSimpleName(), t.getMessage());
log.debug("onCompleted - failed {} to close socket: {}",
err.getClass().getSimpleName(), err.getMessage());
protected Nio2Session createSession(
FactoryManager manager, IoHandler handler, AsynchronousSocketChannel socket)
throws Throwable { | 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.view.configuration;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import java.util.List;
/**
* View instance configuration.
*/
@XmlAccessorType(XmlAccessType.FIELD)
public class InstanceConfig {
/**
* The instance name.
*/
private String name;
/**
* The instance properties.
*/
@XmlElement(name="property")
private List<PropertyConfig> properties;
/**
* Get the instance name.
*
* @return the name
*/
public String getName() {
return name;
}
/**
* Get the instance properties.
*
* @return the instance properties
*/
public List<PropertyConfig> getProperties() {
return properties;
}
} | 0 |
public List<TraceInformation> traces = new ArrayList<>();
public TraceList() {} | 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 |
CloudObjects.asCloudObject(coder, /*sdkComponents=*/ null),
KvCoder.of(keyCoder, IterableCoder.of(valueCoder)), IntervalWindowCoder.of()),
/*sdkComponents=*/ null),
IntervalWindowCoder.of()),
/*sdkComponents=*/ null), | 0 |
private Map<Role, Float> successFactors = new HashMap<>(); | 0 |
if (span != null) {
span.stop();
org.htrace.Tracer.getInstance().continueSpan(null);
} | 0 |
* Copyright 2001-2006 The Apache Software Foundation. | 0 |
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* @version CVS $Id: ScriptablePropertyPointer.java,v 1.3 2003/05/01 09:32:34 coliver Exp $
public Object getImmediateNode() {
Object value;
if (index == WHOLE_COLLECTION) {
value = getBaseValue();
}
else {
value = getBaseValue();
if (value instanceof Scriptable) {
Object property =
ScriptableObject.getProperty((Scriptable)value, index);
if (property != ScriptableObject.NOT_FOUND) {
value = property; // hack?
}
} else {
return super.getImmediateNode();
}
}
if (value instanceof Wrapper) {
value = ((Wrapper)value).unwrap();
}
return value;
}
| 0 |
import java.io.IOException;
import java.util.Collection; | 0 |
private static final long serialVersionUID = -4820523787212147844L;
| 1 |
* See https://issues.apache.org/jira/browse/BEANUTILS-291 | 0 |
public FileName createName(final String path, final FileType type)
protected void appendRootUri(final StringBuilder buffer, final boolean addPassword) | 1 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(ClusterResourceProvider.class);
| 0 |
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
import org.apache.beam.runners.spark.aggregators.metrics.sink.InMemoryMetrics;
import org.junit.rules.ExternalResource;
@Rule
public ExternalResource inMemoryMetricsSink = new InMemoryMetricsSinkRule();
assertThat(InMemoryMetrics.valueOf("emptyLines"), is(nullValue()));
assertThat(InMemoryMetrics.<Double>valueOf("emptyLines"), is(1d)); | 0 |
@Override
protected int defaultTimeoutSeconds() {
return 90;
}
@Test | 0 |
@Deprecated | 0 |
* Use <code>onePredicate</code> if you want that. | 0 |
import org.apache.http.HttpEntity;
HttpEntity generate( | 0 |
import org.apache.hc.core5.http.ContentType; | 0 |
final Path root = dir.toPath(); | 0 |
private String traitName;
Assert.assertTrue(
e.getMessage().contains("\"error\":\"Cannot convert value '2014-07-11' to datatype date\""));
TypesUtil.createClassTypeDef("test", ImmutableList.<String>of(),
traitName = "PII_Trait" + randomString();
Assert.assertEquals(response.getString(MetadataServiceClient.ERROR),
"trait=" + traitName + " should be defined in type system before it can be deleted");
private String randomString() {
return RandomStringUtils.randomAlphanumeric(10);
}
| 0 |
* or more contributor license agreements. See the NOTICE file
* regarding copyright ownership. The ASF licenses this file
* with the License. You may obtain a copy of the License at
* KIND, either express or implied. See the License for the | 0 |
if (!PipelineRunner.class.isAssignableFrom(runnerClass)) { | 0 |
* @version CVS $Id: FlowVelocityGenerator.java,v 1.10 2003/09/04 09:38:34 cziegeler Exp $
public class FlowVelocityGenerator extends ServiceableGenerator | 0 |
* @param commonAtts common configuration attributes {@link org.apache.cocoon.forms.binding.JXPathBindingBuilderBase.CommonAttributes} | 0 |
* Sends a request to obtain the log file names for a given host
* @return a HostLogFilesResponse, containing include the log file names for components associated
* with a hostname
HostLogFilesResponse sendGetLogFileNamesRequest(String hostName); | 0 |
public boolean globalExtender()
{
return globalExtender;
} | 0 |
import java.util.HashSet;
}
private static Predicate<Number> EQUALS_TWO = new Predicate<Number>() {
public boolean evaluate(Number input) {
return (input.intValue() == 2);
}
};
public void testSelect() {
List<Integer> list = new ArrayList<Integer>();
list.add(1);
list.add(2);
list.add(3);
list.add(4);
// Ensure that the collection is the input type or a super type
List<Integer> output1 = ListUtils.select(list, EQUALS_TWO);
List<Number> output2 = ListUtils.<Number>select(list, EQUALS_TWO);
HashSet<Number> output3 = CollectionUtils.select(list, EQUALS_TWO, new HashSet<Number>());
Assert.assertTrue(CollectionUtils.isEqualCollection(output1, output3));
Assert.assertEquals(4, list.size());
Assert.assertEquals(1, output1.size());
Assert.assertEquals(2, output2.iterator().next());
}
public void testSelectRejected() {
List<Long> list = new ArrayList<Long>();
list.add(1L);
list.add(2L);
list.add(3L);
list.add(4L);
List<Long> output1 = ListUtils.selectRejected(list, EQUALS_TWO);
List<? extends Number> output2 = ListUtils.selectRejected(list, EQUALS_TWO);
HashSet<Number> output3 = CollectionUtils.selectRejected(list, EQUALS_TWO, new HashSet<Number>());
Assert.assertTrue(CollectionUtils.isEqualCollection(output1, output2));
Assert.assertTrue(CollectionUtils.isEqualCollection(output1, output3));
Assert.assertEquals(4, list.size());
Assert.assertEquals(3, output1.size());
Assert.assertTrue(output1.contains(1L));
Assert.assertTrue(output1.contains(3L));
Assert.assertTrue(output1.contains(4L));
} | 0 |
Matchers.containsInAnyOrder(
Matchers.containsInAnyOrder(
assertThat(shard.getWindows(), Matchers.contains(GlobalWindow.INSTANCE));
Matchers.containsInAnyOrder( | 0 |
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
private final Map<InetAddress, AtomicInteger> ipMap = new ConcurrentHashMap<>();
private void addCnxn(final NettyServerCnxn cnxn) {
InetAddress addr =
((InetSocketAddress) cnxn.getChannel().remoteAddress()).getAddress();
ipMap.compute(addr, (a, cnxnCount) -> {
if (cnxnCount == null) {
cnxnCount = new AtomicInteger();
cnxnCount.incrementAndGet();
return cnxnCount;
});
ipMap.compute(remoteAddress, (addr, cnxnCount) -> {
if (cnxnCount == null) {
LOG.error("Unexpected remote address {} when removing cnxn {}",
remoteAddress, cnxn);
return null;
}
final int newValue = cnxnCount.decrementAndGet();
return newValue == 0 ? null : cnxnCount;
});
private int getClientCnxnCount(final InetAddress addr) {
final AtomicInteger count = ipMap.get(addr);
return count == null ? 0 : count.get(); | 0 |
List<TupleTag<?>> additionalOutputTags,
additionalOutputTags,
List<TupleTag<?>> additionalOutputTags,
additionalOutputTags, | 0 |
new HostsMap((String) null), null, injector.getInstance(UnitOfWork.class), cdb,
injector.getInstance(RequestFactory.class), null); | 0 |
import java.util.HashMap;
import java.util.Map; | 0 |
public void testIdentityFilterByPredicate() {
@Category(RunnableOnService.class)
public void testNoFilterByPredicate() {
public void testFilterByPredicate() {
public void testFilterLessThan() {
.apply(Create.of(1, 2, 3, 4, 5, 6, 7))
.apply(Filter.lessThan(4));
PAssert.that(output).containsInAnyOrder(1, 2, 3);
public void testFilterGreaterThan() {
.apply(Filter.greaterThan(4));
PAssert.that(output).containsInAnyOrder(5, 6, 7);
public void testFilterLessThanEq() {
.apply(Filter.lessThanEq(4));
PAssert.that(output).containsInAnyOrder(1, 2, 3, 4);
public void testFilterGreaterThanEq() {
.apply(Filter.greaterThanEq(4));
PAssert.that(output).containsInAnyOrder(4, 5, 6, 7);
assertThat(DisplayData.from(Filter.lessThan(123)), hasDisplayItem("predicate", "x < 123"));
assertThat(DisplayData.from(Filter.lessThanEq(234)), hasDisplayItem("predicate", "x ≤ 234"));
assertThat(DisplayData.from(Filter.greaterThan(345)), hasDisplayItem("predicate", "x > 345"));
assertThat(DisplayData.from(Filter.greaterThanEq(456)), hasDisplayItem("predicate", "x ≥ 456")); | 0 |
* $Id$
* $Rev$
* $Date$
* Copyright 2001-2005 The Apache Software Foundation | 0 |
// Initialized in init()
private @Nullable ResidualElements residualElements; | 0 |
throw new XMLSecurityException(ex, "empty");
throw new XMLSecurityException(ex, "empty");
throw new XMLSecurityException(ex, "empty"); | 0 |
import org.apache.sshd.common.util.logging.AbstractLoggingBean; | 0 |
import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
TABLE_ITERATOR_SCAN_PREFIX(TABLE_ITERATOR_PREFIX.getKey() + IteratorScope.scan.name() + ".", null, PropertyType.PREFIX, "Convenience prefix to find options for the scan iterator scope"),
TABLE_ITERATOR_MINC_PREFIX(TABLE_ITERATOR_PREFIX.getKey() + IteratorScope.minc.name() + ".", null, PropertyType.PREFIX, "Convenience prefix to find options for the minc iterator scope"),
TABLE_ITERATOR_MAJC_PREFIX(TABLE_ITERATOR_PREFIX.getKey() + IteratorScope.majc.name() + ".", null, PropertyType.PREFIX, "Convenience prefix to find options for the majc iterator scope"), | 0 |
package org.apache.beam.sdk.extensions.euphoria.core;
import org.apache.beam.sdk.extensions.euphoria.core.testkit.FlatMapTest;
import org.apache.beam.sdk.extensions.euphoria.core.testkit.JoinTest;
import org.apache.beam.sdk.extensions.euphoria.core.testkit.ReduceByKeyTest; | 0 |
package org.apache.bcel.verifier;
import org.apache.bcel.verifier.tests.TestReturn01Creator;
import org.apache.bcel.verifier.tests.TestReturn03Creator; | 1 |
* <p>
* <p>
* <p> | 0 |
import org.apache.sshd.server.session.ServerSession;
protected List<OpenSSHExtension> resolveOpenSSHExtensions(ServerSession session) {
List<OpenSSHExtension> original = super.resolveOpenSSHExtensions(session);
buffer.putByte((byte) SftpConstants.SSH_FXP_EXTENDED_REPLY); | 0 |
package org.apache.beam.sdk.extensions.gcp.util; | 0 |
import org.apache.log4j.Level;
final String LOG_MESSAGE_KEY = SolrUtil.class
.getSimpleName() + "_SOLR_UTIL";
LogFeederUtil.logErrorMessageByInterval(
LOG_MESSAGE_KEY,
"Error constructing solrUtil", e, logger,
Level.WARN);
logger.error("solrClient can't be null");
QueryResponse response = process(solrQuery);
if (response != null) {
SolrDocumentList documentList = response.getResults();
if (documentList != null && documentList.size() > 0) {
SolrDocument configDoc = documentList.get(0);
String configJson = LogFeederUtil.getGson().toJson(configDoc);
configMap = (HashMap<String, Object>) LogFeederUtil
.toJSONObject(configJson);
}
} catch (Exception e) {
logger.error("Error getting config", e); | 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 java.awt.Graphics2D; | 0 |
import com.google.inject.persist.jpa.AmbariJpaPersistModule;
injector = Guice.createInjector(new InMemoryDefaultTestModule());
configGroup.refresh(); | 0 |
package org.apache.commons.vfs.operations;
import org.apache.commons.vfs.FileSystemException;
/**
* FileOperations interface provides API to work with operations.
*
* @see FileOperation on what a operation in the context of VFS is.
*
* @author Siarhei Baidun
* @since 0.1
*/
public interface FileOperations
{
/**
* @return all operations associated with the fileObject
* @throws FileSystemException
*/
Class[] getOperations() throws FileSystemException;
/**
* @return a operation implementing the given <code>operationClass</code>
* @throws FileSystemException
*/
FileOperation getOperation(Class operationClass) throws FileSystemException;
/**
* @return if a operation <code>operationClass</code> is available
* @throws FileSystemException
*/
boolean hasOperation(Class operationClass) throws FileSystemException;
} | 0 |
public class ShipperConfigOperationDescriptions {
public static final String GET_SERVICE_NAMES = "Get service names";
public static final String GET_SHIPPER_CONFIG = "Get shipper config";
public static final String SET_SHIPPER_CONFIG = "Set shipper config";
}
| 0 |
import org.apache.ambari.server.events.MetadataUpdateEvent;
expect(cluster.getClusterId()).andReturn(1L).atLeastOnce();
expect(controller.getClusterMetadataOnConfigsUpdate(eq(cluster)))
.andReturn(createNiceMock(MetadataUpdateEvent.class))
.once();
replay(clusters, cluster, zeppelinEnvConf, coreSiteConf, coreSiteConfNew, controller);
verify(clusters, cluster, zeppelinEnvConf, coreSiteConf, coreSiteConfNew, controller);
expect(cluster.getClusterId()).andReturn(1L).atLeastOnce();
expect(controller.getClusterMetadataOnConfigsUpdate(eq(cluster)))
.andReturn(createNiceMock(MetadataUpdateEvent.class))
.once();
replay(artifactDAO, artifactEntity, cluster, clusters, config, newConfig, hsiConfig, newHsiConfig, response, response1, controller, stackId);
verify(artifactDAO, artifactEntity, cluster, clusters, config, newConfig, response, controller, stackId); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/MapDynamicPropertyHandler.java,v 1.2 2002/04/24 03:29:33 dmitri Exp $
* $Revision: 1.2 $
* $Date: 2002/04/24 03:29:33 $
import java.util.Iterator;
import java.util.Map;
* @version $Revision: 1.2 $ $Date: 2002/04/24 03:29:33 $
Map map = (Map) object;
public Object getProperty(Object object, String propertyName) {
return ((Map) object).get(propertyName); | 0 |
* Copyright 2000-2009 The Apache Software Foundation | 0 |
* @param <K> the key type
* @param <V> the value type | 0 |
* @since 2.2 | 0 |
} else {
} | 0 |
public static final String EXTENSIONS_DIR_PATH = "extensions.path";
* Gets ambari extensions-path
* @return String
*/
public String getExtensionsPath() {
return properties.getProperty(EXTENSIONS_DIR_PATH);
}
/** | 0 |
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.UriInfo;
import org.apache.ambari.server.api.resources.ResourceDefinition;
import org.apache.ambari.server.api.resources.ResourceInstance;
import org.junit.Test;
| 0 |
import org.apache.beam.sdk.testing.NeedsRunner;
import org.junit.experimental.categories.Category;
@Category(NeedsRunner.class) | 0 |
@Test
public void testTernaryFail() throws Exception {
JexlEvalContext jc = new JexlEvalContext();
JexlExpression e = JEXL.createExpression("false ? bar : quux");
Object o;
jc.setStrict(true);
jc.setSilent(false);
try {
o = e.evaluate(jc);
Assert.fail("Should have failed");
} catch (JexlException xjexl) {
// OK
Assert.assertTrue(xjexl.toString().contains("quux"));
}
} | 0 |
int hashcode = builder.hashCode();
int port = PortUtils.getRandomFreePort(); | 0 |
EasyMock.isA(HttpClientContext.class),
EasyMock.isA(HttpClientContext.class), | 0 |
import org.apache.accumulo.core.security.SecurityUtil; | 0 |
import org.apache.felix.framework.util.manifestparser.Capability;
ManifestParser mp = new ManifestParser(m_logger, m_configMap, this, m_headerMap);
capList.add(
new Capability(
this,
caps[capIdx].getNamespace(),
((Capability) caps[capIdx]).getDirectives(),
((Capability) caps[capIdx]).getAttributes()));
long impId = module.getBundle().getBundleId();
long expId = wires[i].getExporter().getBundle().getBundleId();
ICapability[] exporters =
long expId = exporters[0].getModule().getBundle().getBundleId(); | 0 |
import com.twitter.mesos.gen.JobKey;
* Fetches the update configuration (if present) for the given job key.
* @param jobKey Job to fetch update configuration for.
Optional<JobUpdateConfiguration> fetchJobUpdateConfig(JobKey jobKey);
* @deprecated Use {@link #removeShardUpdateConfigs(com.twitter.mesos.gen.JobKey)}.
@Deprecated
* Removes the update configuration for the job.
*
* @param jobKey Key of the job.
*/
void removeShardUpdateConfigs(JobKey jobKey);
/** | 0 |
/*
* Copyright 2016-2018 Seznam.cz, a.s. | 0 |
import org.apache.beam.model.fnexecution.v1.BeamFnApi;
import org.apache.beam.model.fnexecution.v1.BeamFnApi.RegisterResponse; | 0 |
/**
* VALIDATOR-296 - A / or a ! is valid in the user part,
* but not in the domain part
*/
public void testEmailWithSlashes() {
assertTrue(
"/ and ! valid in username",
validator.isValid("joe!/blow@apache.org")
);
assertFalse(
"/ not valid in domain",
validator.isValid("joe@ap/ache.org")
);
assertFalse(
"! not valid in domain",
validator.isValid("joe@apac!he.org")
);
} | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.