Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
/**
* Supported elements of request execution pipeline.
*
* @since 5.0
*/ | 0 |
import static org.hamcrest.Matchers.empty;
import static org.junit.Assert.assertThat;
import org.apache.beam.sdk.transforms.display.DisplayData;
public void testDefaultPopulateDisplayDataImplementation() {
DoFnWithContext<String, String> fn = new DoFnWithContext<String, String>() {
};
DisplayData displayData = DisplayData.from(fn);
assertThat(displayData.items(), empty());
}
@Test | 0 |
import org.apache.ambari.server.security.authentication.AmbariUserDetails;
AmbariUserDetails userDetails = new AmbariUserDetails(users.getUser(userEntity), null, users.getUserAuthorities(userEntity));
return new AmbariUserAuthentication(null, userDetails, true); | 0 |
protected Class<?> getDefaultType() { | 0 |
* @version CVS $Id: FOM_JavaScriptInterpreter.java,v 1.30 2004/05/17 18:39:58 vgritsenko Exp $
// FIXME: Where "session scope" should go when session is invalidated?
try {
} catch (IllegalStateException e) {
// Session might be invalidated already.
if (getLogger().isDebugEnabled()) {
getLogger().debug("Got '" + e + "' while trying to set session scope.", e);
} | 0 |
* <p>Note that the {@link PubsubTestClientFactory} is serialized/deserialized even when running | 0 |
private static final int AVAIL_PROCS = Runtime.getRuntime().availableProcessors();
this.ioThreadCount = AVAIL_PROCS; | 0 |
* Gets all properties types that mach the specified type.
* @param configType the config type to return
* @return properties types for given config type
*/
Map<PropertyInfo.PropertyType, Set<String>> getConfigPropertiesTypes(String configType);
/**
* @param versionTag the config version tag to find
* Gets the specific config that matches the specified type and version. This not
* necessarily a DESIRED configuration that applies to a cluster.
* @param configType the config type to find
* @param configVersion the config version to find
* @return a {@link Config} object, or <code>null</code> if the specific type
* and version have not been set.
*/
Config getConfigByVersion(String configType, Long configVersion);
/** | 0 |
private IdentityHashMap<S, ComponentContextImpl> serviceContexts = new IdentityHashMap<S, ComponentContextImpl>();
for (Iterator<ComponentContextImpl> i = serviceContexts.values().iterator(); i.hasNext(); )
ComponentContextImpl componentContext = i.next();
disposeImplementationObject( componentContext, reason );
// overwritten in the ComponentContextImpl class
S service = createImplementationObject( bundle, new SetImplementationObject<S>()
public void presetComponentContext( ComponentContextImpl<S> componentContext )
serviceContexts.put( componentContext.getImplementationObject( false ), componentContext );
else
{
// if this is the first use of this component, switch to ACTIVE state
if ( getState() == STATE_REGISTERED )
{
changeState( Active.getInstance() );
}
}
final ComponentContextImpl<S> serviceContext;
disposeImplementationObject( serviceContext, ComponentConstants.DEACTIVATION_REASON_DISPOSED );
for ( ComponentContextImpl componentContext : serviceContexts.values() )
Object instance = componentContext.getImplementationObject(true); | 0 |
/** {@link org.apache.commons.logging} logging facility */
static org.apache.commons.logging.Log log =
org.apache.commons.logging.LogFactory.getLog(VerifyCollectableSignature.class.getName()); | 0 |
* </p>
* Provides a String representation of this file filter. | 0 |
import org.apache.ambari.server.api.services.AmbariMetaInfo;
import org.apache.ambari.server.state.ComponentInfo;
import org.apache.ambari.server.state.StackId;
import com.google.inject.Provider;
* Used for looking up a component's advertising version status given a stack
* and name.
*/
@Inject
private Provider<AmbariMetaInfo> ambariMetaInfoProvider;
/**
// get the component information for the desired stack; if a component
// moves from UNKNOWN to providing a version, we must do the version
// advertised check against the target stack
StackId desiredStackId = sch.getDesiredStackId();
AmbariMetaInfo ambariMetaInfo = ambariMetaInfoProvider.get();
ComponentInfo componentInfo = ambariMetaInfo.getComponent(desiredStackId.getStackName(),
desiredStackId.getStackVersion(), sch.getServiceName(), sch.getServiceComponentName());
if (!componentInfo.isVersionAdvertised()) {
LOG.warn(
sch.getServiceComponentName(), sch.getServiceComponentName(), sch.getHostName(),
newVersion);
ServiceComponent sc = cluster.getService(sch.getServiceName()).getServiceComponent(
sch.getServiceComponentName());
} | 0 |
int i=0;
int i=0; | 0 |
protected boolean handleUpdate(AlertDefinitionsAgentUpdateEvent update) throws AmbariException {
return false;
Map<Long, AlertCluster> existingClusters = getData(hostId).getClusters();
if (update.getEventType().equals(DELETE) && CollectionUtils.isEmpty(e.getValue().getAlertDefinitions())) {
existingClusters.remove(e.getKey());
} else {
changed |= existingClusters.get(e.getKey()).handleUpdate(update.getEventType(), e.getValue());
existingClusters.putAll(updateClusters);
return changed; | 0 |
PreparedStatement del = new TesterPreparedStatement(delegateConn,"select * from foo");
DelegatingPreparedStatement stmt4 = new DelegatingPreparedStatement(conn, del);
// Nothing is equal to null
assertFalse(stmt1.equals(null));
assertFalse(stmt2.equals(null));
assertFalse(stmt3.equals(null));
assertFalse(stmt4.equals(null));
// 1 & 2 are equivalent
assertTrue(stmt2.equals(stmt1)); // reflexive
// 1 & 3 are not (different statements, one null)
assertFalse(stmt1.equals(stmt3));
assertFalse(stmt3.equals(stmt1)); // reflexive
// 1 & 4 are not (different statements)
assertFalse(stmt1.equals(stmt4));
assertFalse(stmt4.equals(stmt1)); // reflexive
// Check self-equals
assertTrue(stmt1.equals(stmt1));
assertTrue(stmt2.equals(stmt2));
assertFalse(stmt3.equals(stmt3)); // because underlying statement is null
assertTrue(stmt4.equals(stmt4));
DelegatingStatement dstmt1 = stmt1;
// 1 & 2 are equivalent
assertTrue(dstmt1.equals(stmt2));
assertTrue(stmt2.equals(dstmt1)); // reflexive
| 0 |
return checkViewVersion(view, config.getMinAmbariVersion(), serverVersion, "minimum", -1, "less than") &&
checkViewVersion(view, config.getMaxAmbariVersion(), serverVersion, "maximum", 1, "greater than");
int compVal = index == -1 ? VersionUtils.compareVersions(serverVersion, version) :
index > 0 ? VersionUtils.compareVersions(serverVersion, version.substring(0, index), index) : 0; | 0 |
ClientCnxnSocketNetty(ZKClientConfig clientConfig) throws IOException { | 0 |
public float[] xpoints;
public float[] ypoints;
public Polyline2D(int[] xpoints, int[] ypoints, int npoints) {
float[] tmp; | 1 |
final Connection key = getConnectionKey(connection);
final XAResource xaResource = xaResources.get(key);
final int status = transaction.getStatus();
} catch (final SystemException e) {
final Connection key = getConnectionKey(connection); | 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 |
private TabletServerStatus status;
private TServerInstance instance;
public TServerUsesLoggers(TServerInstance instance, TabletServerStatus status) {
this.instance = instance;
this.status = status;
}
@Override
public Set<String> getLoggers() {
return Collections.unmodifiableSet(status.loggers);
}
@Override
public int compareTo(LoggerUser o) {
if (o instanceof TServerUsesLoggers) return instance.compareTo(((TServerUsesLoggers) o).instance);
return -1;
}
@Override
public int hashCode() {
return instance.hashCode();
}
public TServerInstance getInstance() {
return instance;
} | 1 |
* <a href='http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html#Service Provider'>JAR | 0 |
data = new TabletData(fs, ZooReaderWriter.getInstance(), getTableConfiguration(extent)); | 0 |
REPLICATION_MAX_WORK_QUEUE("replication.max.work.queue", "1000", PropertyType.COUNT, "Upper bound of the number of files queued for replication"), | 0 |
Sum.ofLongs()); | 0 |
@Override | 0 |
/**
* Copyright 2016 Seznam a.s.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ | 0 |
import org.apache.sshd.server.command.Command; | 0 |
Long resourceId = (resourceEntity == null) ? null : resourceEntity.getId(); | 0 |
* This class implements {@link SVGFEFuncRElement}.
protected SVGOMFEFuncRElement() {
* <b>DOM</b>: Implements {@link Node#getLocalName()}. | 0 |
implements Contextualizable, ThreadSafe, Disposable, Initializable, ServiceManager, Configurable, RoleManagerOwner {
// get role manager
if ( coreServicemanager instanceof RoleManagerOwner ) {
parentRoleManager = ((RoleManagerOwner)coreServicemanager).getRoleManager();
}
// get logger manager
/*
* Get the role manager
*/
public RoleManager getRoleManager() {
return this.roleManager;
}
| 0 |
* @version $Id$ | 0 |
import java.util.LinkedList;
import java.util.Queue;
* <p>
* NOTE: As from version 4.0, the IteratorChain stores the iterators in a queue
* and removes any reference to them as soon as they are not used anymore. Thus
* the methods {@code setIterator(Iterator)} and {@code getIterators()} have been
* removed and {@link #size()} will return the number of remaining iterators in
* the queue.
private final Queue<Iterator<? extends E>> iteratorChain = new LinkedList<Iterator<? extends E>>();
* Returns the remaining number of Iterators in the current IteratorChain.
currentIterator = iteratorChain.remove();
while (currentIterator.hasNext() == false && !iteratorChain.isEmpty()) {
currentIterator = iteratorChain.remove(); | 0 |
final int i = getTargetOffset(); // Depending on old position value
final short old_length = (short) super.getLength(); | 1 |
public ValueProvider<TopicPath> getTopicProvider() {
return topic;
}
| 0 |
"Only element values of type annotation can be built with this ctor - type specified: " + type); | 0 |
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper; | 0 |
throw new IllegalArgumentException("autoconfig field " + field + " can't be defined with both added/changed/removed/swap calllbacks");
if (added != null || changed != null || removed != null || swap != null) | 0 |
import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode; | 1 |
return Collections.singletonList(Short.valueOf((short) 1));
return Collections.singletonList(Short.valueOf((short) 1)); | 0 |
keyedValues.addAll(node.getOutputs()); | 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.sshd.server.channel;
import org.apache.sshd.common.channel.Channel;
import org.apache.sshd.common.channel.ChannelFactory;
/**
* @author <a href="mailto:dev@mina.apache.org">Apache MINA SSHD Project</a>
*/
public class ChannelSessionFactory implements ChannelFactory {
public static final ChannelSessionFactory INSTANCE = new ChannelSessionFactory();
public ChannelSessionFactory() {
super();
}
@Override
public String getName() {
return "session";
}
@Override
public Channel create() {
return new ChannelSession();
}
} | 0 |
BeamSqlEnv.builder(root)
BeamSqlEnv.builder(root).setQueryPlannerClassName("org.test.ClassNotFound").build(); | 0 |
import org.apache.commons.bcel6.Const;
super(Const.CONSTANT_Class);
Constant c = cp.getConstant(name_index, Const.CONSTANT_Utf8); | 0 |
* @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a> | 0 |
package org.apache.hadoop.metadata.storage;
import org.apache.hadoop.metadata.IReferenceableInstance;
import org.apache.hadoop.metadata.IStruct;
import org.apache.hadoop.metadata.ITypedReferenceableInstance;
import org.apache.hadoop.metadata.MetadataException;
import org.apache.hadoop.metadata.types.FieldMapping; | 0 |
@Contract(threading = ThreadingBehavior.STATELESS) | 0 |
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 0 |
* The root URL for the Dataflow API. {@code dataflowEndpoint} can override this value
* if it contains an absolute URL, otherwise {@code apiRootUrl} will be combined with
* {@code dataflowEndpoint} to generate the full URL to communicate with the Dataflow API.
@Description("The root URL for the Dataflow API. dataflowEndpoint can override this "
@Default.String(Dataflow.DEFAULT_ROOT_URL)
* Dataflow endpoint to use.
*
* <p> Defaults to the current version of the Google Cloud Dataflow
* API, at the time the current SDK version was released.
*
* <p> If the string contains "://", then this is treated as a url,
* otherwise {@link #getApiRootUrl()} is used as the root
* url.
*/
@Description("The URL for the Dataflow API. If the string contains \"://\""
+ " will be treated as the entire URL, otherwise will be treated relative to apiRootUrl.")
@Default.String(Dataflow.DEFAULT_SERVICE_PATH)
String getDataflowEndpoint();
void setDataflowEndpoint(String value);
/** | 0 |
@Override | 0 |
import java.util.Arrays;
import javax.annotation.Nullable;
@SuppressWarnings("deprecation")
@Override
public void verifyDeterministic() throws NonDeterministicException {
if (!isDeterministic()) {
throw new NonDeterministicException(this,
getClass().getSimpleName() + " reported it was not determinsitic.");
}
}
protected void verifyDeterministic(String message, Iterable<Coder<?>> coders)
throws NonDeterministicException {
for (Coder<?> coder : coders) {
try {
coder.verifyDeterministic();
} catch (NonDeterministicException e) {
throw new NonDeterministicException(this, message, e);
}
}
}
protected void verifyDeterministic(String message, Coder<?>... coders)
throws NonDeterministicException {
verifyDeterministic(message, Arrays.asList(coders));
}
protected void addReasons(String prefix, List<String> accumulator,
@Nullable List<String> newReasons) {
if (newReasons != null) {
for (String reason : newReasons) {
accumulator.add(prefix + reason);
}
}
} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractCollectionDoubleCollection.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 |
* @version CVS $Id$
Enumeration enumeration = request.getParameterNames();
while (enumeration.hasMoreElements()) {
String paramName = (String) enumeration.nextElement();
} | 0 |
@Override | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/compiler/ExtensionFunction.java,v 1.11 2003/10/09 21:31:39 rdonkin Exp $
* $Revision: 1.11 $
* $Date: 2003/10/09 21:31:39 $
* any, must include the following acknowledgement:
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
* permission of the Apache Software Foundation.
* @version $Revision: 1.11 $ $Date: 2003/10/09 21:31:39 $ | 0 |
// TODO: extend the file name parser to be able to parse | 0 |
if ( singleton && current.isLazyInit() ) {
this.appendAttribute(buffer, "lazy-init", "true");
} | 0 |
fooProvider = Utils.getFactoryByName(getContext(), "BazProviderType");
Factory factory = Utils.getFactoryByName(getContext(), "composite.export.3");
assertEquals("Check no foo service", Utils.getServiceReferences(getContext(), FooService.class.getName(), null).length, 0);
ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export3.getInstanceName());
ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export3.getInstanceName()+")");
ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export3.getInstanceName());
BazService fs = (BazService) getContext().getService(ref);
getContext().ungetService(ref);
ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export3.getInstanceName()+")");
BazService fs = (BazService) getContext().getService(refs[i]);
getContext().ungetService(refs[i]); | 0 |
MonitorUtil.getLocation(getClientContext()); | 0 |
import org.apache.hadoop.metadata.query.GraphPersistenceStrategies$class;
return GraphPersistenceStrategies$class.gremlinCompOp(this, op);
return GraphPersistenceStrategies$class.loopObjectExpression(this, dataType);
@Override
public String typeTestExpression(String typeName) {
return GraphPersistenceStrategies$class.typeTestExpression(this, typeName);
}
| 0 |
AfterPane.elementCountAtLeast(1).getWatermarkThatGuaranteesFiring( | 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.http.base.internal.runtime.dto;
import org.osgi.service.http.runtime.dto.ErrorPageDTO;
import org.osgi.service.http.runtime.dto.FilterDTO;
import org.osgi.service.http.runtime.dto.ListenerDTO;
import org.osgi.service.http.runtime.dto.ResourceDTO;
import org.osgi.service.http.runtime.dto.ServletContextDTO;
import org.osgi.service.http.runtime.dto.ServletDTO;
public abstract class BuilderConstants
{
public static final String[] STRING_ARRAY = new String[0];
public static final ServletContextDTO[] CONTEXT_DTO_ARRAY = new ServletContextDTO[0];
public static final ServletDTO[] SERVLET_DTO_ARRAY = new ServletDTO[0];
public static final ResourceDTO[] RESOURCE_DTO_ARRAY = new ResourceDTO[0];
public static final FilterDTO[] FILTER_DTO_ARRAY = new FilterDTO[0];
public static final ErrorPageDTO[] ERROR_PAGE_DTO_ARRAY = new ErrorPageDTO[0];
public static final ListenerDTO[] LISTENER_DTO_ARRAY = new ListenerDTO[0];
} | 0 |
public abstract class AbstractBitwiseTrie<K, V> extends AbstractMap<K, V>
private final KeyAnalyzer<? super K> keyAnalyzer;
*
* @param keyAnalyzer the {@link KeyAnalyzer} to use
protected AbstractBitwiseTrie(final KeyAnalyzer<? super K> keyAnalyzer) {
* @return the {@link KeyAnalyzer} used by this {@link Trie}
protected KeyAnalyzer<? super K> getKeyAnalyzer() {
return (getKey() == null ? 0 : getKey().hashCode()) ^
(getValue() == null ? 0 : getValue().hashCode()); | 0 |
// Used to ignore pubsub events sent before storage has completely started. This avoids a
// miscount where a StorageStarted consumer is invoked before storageStarted is invoked here,
// and pubsub events are fired for tasks that we have not yet counted. For example, if
// tasksDeleted is invoked, we would end up with a negative count.
private volatile boolean storageStarted = false;
if (!storageStarted) {
return;
}
storageStarted = true;
if (!storageStarted) {
return;
}
| 0 |
.parents(Collections.<Long>emptyList()).spanId(1).traceId(2).build(); | 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 |
componentToClusterInfoKeyMap.put("HBASE_MASTER", "hbase_master_hosts"); | 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 |
for (String tablesDir : ServerConstants.getTablesDirs(tablet.getContext())) { | 0 |
*
*
*
*
*
*
| 0 |
public interface NodeEventTarget
extends org.apache.batik.dom.dom3.events.EventTarget { | 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 | 1 |
* Copyright 2017 Seznam.cz, a.s. | 0 |
assertThat(compressedSourceDisplayData, hasDisplayItem("compressionMode")); | 0 |
@Override
@Override
@Override
@Override | 0 |
import org.apache.commons.configuration.tree.DefaultConfigurationNode;
* exactly one bean declaration or a <code>IllegalArgumentException</code>
* exception will be thrown)
this(config, key, false);
}
/**
* Creates a new instance of <code>XMLBeanDeclaration</code> and
* initializes it from the given configuration. The passed in key points to
* the bean declaration. If the key does not exist and the boolean argument
* is <b>true</b>, the declaration is initialized with an empty
* configuration. It is possible to create objects from such an empty
* declaration if a default class is provided. If the key on the other hand
* has multiple values or is undefined and the boolean argument is <b>false</b>,
* a <code>IllegalArgumentException</code> exception will be thrown.
*
* @param config the configuration
* @param key the key to the bean declaration
* @param optional a flag whether this declaration is optional; if set to
* <b>true</b>, no exception will be thrown if the passed in key is
* undefined
*/
public XMLBeanDeclaration(HierarchicalConfiguration config, String key,
boolean optional)
{
try
{
node = (key == null) ? config.getRoot() : config.configurationAt(
key).getRoot();
}
catch (IllegalArgumentException iex)
{
// If we reach this block, the key does not have exactly one value
if (!optional || config.getMaxIndex(key) > 0)
{
throw iex;
}
node = new DefaultConfigurationNode();
} | 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.commons.io.output.ByteArrayOutputStream;
| 0 |
Connection conn0 = newConnection();
assertNotNull("connection should not be null", conn0);
assertTrue("autocommit should be true for conn0", conn0.getAutoCommit());
Connection conn1 = newConnection();
assertTrue("autocommit should be true for conn1", conn1.getAutoCommit() );
conn1.close();
assertTrue("autocommit should be true for conn0", conn0.getAutoCommit());
conn0.setAutoCommit(false);
assertFalse("autocommit should be false for conn0", conn0.getAutoCommit());
conn0.close(); | 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 |
@Override
boolean hasInstance()
{
return !serviceContexts.isEmpty();
} | 0 |
* Copyright (c) 2001-2004 The Apache Software Foundation. All rights
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their name without prior
* @version $Id: StringDecoder.java,v 1.7 2004/01/02 07:01:47 ggregory Exp $ | 0 |
import org.apache.beam.sdk.values.WindowingStrategy; | 0 |
* @version CVS $Id: AbstractContinuable.java,v 1.2 2004/04/16 09:39:57 stephan Exp $
if (context.getLogger()!=null)
context.getLogger().debug("send page and wait '" + uri + "'");
if (context.getLogger()!=null)
context.getLogger().debug("send page '" + uri + "'"); | 0 |
values.put(CSSConstants.CSS_ALL_VALUE,
ValueConstants.ALL_VALUE); | 0 |
/* ====================================================================
* Copyright (c) 2001-2004 The Apache Software Foundation. All rights
* @version $Revision: 1.3 $ $Date: 2004/01/14 21:34:30 $ | 0 |
import java.util.concurrent.TimeUnit;
public interface FactoryManager extends SessionListenerManager, ChannelListenerManager, PropertyResolver {
* Key used to retrieve the value of the channel window size in the
* @see #DEFAULT_WINDOW_SIZE
* Default {@link #WINDOW_SIZE} if none set
*/
int DEFAULT_WINDOW_SIZE = 0x200000;
/**
* @see #DEFAULT_WINDOW_TIMEOUT
/**
* Default {@link #WINDOW_TIMEOUT} value
*/
long DEFAULT_WINDOW_TIMEOUT = 0L;
* @see #DEFAULT_MAX_PACKET_SIZE
* Default {@link #MAX_PACKET_SIZE} if none set
*/
int DEFAULT_MAX_PACKET_SIZE = 0x8000;
/**
* @see #DEFAULT_NIO_WORKERS
* Default number of worker threads to use if none set.
* authenticated - in milliseconds.
* @see #DEFAULT_AUTH_TIMEOUT
* Default value for {@link #AUTH_TIMEOUT} if none set
*/
long DEFAULT_AUTH_TIMEOUT = TimeUnit.MINUTES.toMillis(2L);
/**
* it will close the connection - in milliseconds.
* @see #DEFAULT_AUTH_TIMEOUT
* Default value for {@link #IDLE_TIMEOUT} if none set
*/
long DEFAULT_IDLE_TIMEOUT = TimeUnit.MINUTES.toMillis(10L);
/**
* will be forcibly closed - in milliseconds.
* @see #DEFAULT_DISCONNECT_TIMEOUT
* Default value for {@link #DISCONNECT_TIMEOUT} if none set
*/
long DEFAULT_DISCONNECT_TIMEOUT = TimeUnit.SECONDS.toMillis(10L);
/**
* @see #DEFAULT_AUTH_TIMEOUT
* Default {@link #CHANNEL_CLOSE_TIMEOUT} value if none set
*/
long DEFAULT_CHANNEL_CLOSE_TIMEOUT = TimeUnit.SECONDS.toMillis(5L);
/** | 0 |
* The mount table is an xml file which has a format similar to the <code>map:mount</code> syntax:
* @version CVS $Id: MountTableMatcher.java,v 1.2 2003/11/14 07:08:01 giacomo Exp $ | 0 |
* @version CVS $Id: RequestGenerator.java,v 1.8 2003/11/27 02:14:44 vgritsenko Exp $
attribute(attr, "sitemap", request.getSitemapURI()); | 0 |
import static org.apache.atlas.repository.Constants.RELATIONSHIP_GUID_PROPERTY_KEY;
String relationGuid = AtlasGraphUtilsV2.getEncodedProperty(edge, RELATIONSHIP_GUID_PROPERTY_KEY, String.class); | 0 |
import org.apache.ambari.server.orm.entities.WidgetEntity;
private WidgetDAO widgetDAO;
widgetDAO = injector.getInstance(WidgetDAO.class);
widgetLayoutEntity.setUserName("username");
widgetLayoutEntity.setScope("CLUSTER");
widgetLayoutEntity.setDisplayName("displ_name");
widgetLayoutEntity2.setUserName("username");
widgetLayoutEntity2.setScope("CLUSTER");
widgetLayoutEntity2.setDisplayName("displ_name2");
WidgetEntity widgetEntity = new WidgetEntity();
widgetEntity.setDisplayName("display name" + i);
widgetEntity.setAuthor("author");
widgetEntity.setClusterId(clusterId);
widgetEntity.setMetrics("metrics");
widgetEntity.setDescription("description");
widgetEntity.setProperties("{\"warning_threshold\": 0.5,\"error_threshold\": 0.7 }");
widgetEntity.setScope("CLUSTER");
widgetEntity.setWidgetName("widget" + i);
widgetEntity.setWidgetType("GAUGE");
widgetEntity.setWidgetValues("${`jvmMemoryHeapUsed + jvmMemoryHeapMax`}");
widgetDAO.create(widgetEntity);
widgetLayoutUserWidget.setWidget(widgetEntity); | 0 |
import aQute.service.reporter.*;
import aQute.service.reporter.Reporter.SetLocation;
static class WARNINGImpl implements ERROR {
Reporter.SetLocation loc;
public SetLocation file(String file) {
return loc.file(file);
}
public SetLocation header(String header) {
return loc.header(header);
}
public SetLocation context(String context) {
return loc.context(context);
}
public SetLocation method(String methodName) {
return loc.method(methodName);
}
public SetLocation line(int n) {
return loc.line(n);
}
public SetLocation reference(String reference) {
return loc.reference(reference);
}
public WARNINGImpl(Reporter.SetLocation loc) {
this.loc = loc;
}
}
static class ERRORImpl extends WARNINGImpl implements WARNING {
public ERRORImpl(SetLocation e) {
super(e);
}
}
return new ERRORImpl(reporter.error(format, args));
return new WARNINGImpl(reporter.warning(format, args)); | 0 |
import org.apache.commons.lang3.StringUtils; | 0 |
import java.util.List;
import org.apache.ambari.server.orm.RequiresSession;
import org.apache.ambari.server.orm.entities.KerberosDescriptorEntity;
import com.google.inject.persist.Transactional; | 0 |
//XMLUtils.circumventBug2650(doc); | 0 |
import org.apache.ambari.server.agent.stomp.dto.HashAndTimestampIgnoreMixIn;
import org.apache.ambari.server.agent.stomp.dto.HashIgnoreMixIn;
import org.apache.ambari.server.events.AgentConfigsUpdateEvent;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
private final static ObjectMapper MAPPER = new ObjectMapper();
static {
MAPPER.addMixIn(Hashable.class, HashIgnoreMixIn.class);
MAPPER.addMixIn(AgentConfigsUpdateEvent.class, HashAndTimestampIgnoreMixIn.class);
}
String json = null;
try {
json = MAPPER.writeValueAsString(data);
} catch (JsonProcessingException e) {
throw new RuntimeException("Error during mapping message to calculate hash", e);
} | 0 |
private static final Map<String,ZooConfiguration> instances = new HashMap<>(); | 0 |
package org.apache.felix.gogo.runtime.activator;
import org.apache.felix.gogo.runtime.CommandProcessorImpl;
import org.apache.felix.gogo.runtime.CommandProxy; | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableList.java,v 1.1 2003/09/21 20:01:53 scolebourne Exp $
* @version $Revision: 1.1 $ $Date: 2003/09/21 20:01:53 $
public class TestObservableList extends TestList implements ObservedTestHelper.ObservedFactory {
public TestObservableList(String testName) {
return new TestSuite(TestObservableList.class);
String[] testCaseName = { TestObservableList.class.getName()}; | 0 |
import org.apache.beam.sdk.runners.AppliedPTransform; | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.