Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
* @version $Revision$ $Date$
| 0 |
private static final Set<RoleAuthorization> REQUIRED_GET_AUTHORIZATIONS = EnumSet.of(RoleAuthorization.CLUSTER_TOGGLE_KERBEROS,
RoleAuthorization.CLUSTER_VIEW_CONFIGS,
RoleAuthorization.HOST_VIEW_CONFIGS,
RoleAuthorization.SERVICE_VIEW_CONFIGS);
| 0 |
assertEquals("d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f",
DigestUtils.digest(MessageDigestAlgorithms.SHA_224,StringUtils.getBytesUtf8("")));
DigestUtils.digest(MessageDigestAlgorithms.SHA_224,StringUtils.getBytesUtf8("The quick brown fox jumps over the lazy dog")));
| 0 |
final Constant c = cp.getConstant(super.getIndex());
final StringTokenizer tok = new StringTokenizer(cp.constantToString(c));
final String signature = getSignature(cpg);
final String signature = getSignature(cpg);
| 1 |
context.keyedState(),
context.keyedState(),
@Override
public Instant currentProcessingTime() {
throw new UnsupportedOperationException("Streaming doesn't yet support processing time.");
}
| 0 |
out.writeObject(decorated());
setCollection((Collection<E>) in.readObject());
| 0 |
import org.apache.accumulo.core.client.Accumulo;
try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {
try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {
try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).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.
*/
package org.apache.ambari.server.state.live;
public class StackVersion {
private String stackVersion;
public StackVersion(String stackVersion) {
super();
this.stackVersion = stackVersion;
}
/**
* @return the stackVersion
*/
public String getStackVersion() {
return stackVersion;
}
/**
* @param stackVersion the stackVersion to set
*/
public void setStackVersion(String stackVersion) {
this.stackVersion = stackVersion;
}
}
| 0 |
import org.apache.ambari.server.state.State;
State.valueOf(service.getDesiredState()), configs));
| 0 |
fs.delete(dir, true);
fs.delete(fail, true);
| 0 |
void setSocketTimeout(int timeout) throws IOException;
int getSocketTimeout() throws IOException;
boolean isStale();
| 0 |
tlsSession.startTls(sslContext, host, sslBufferMode,
TlsSupport.enforceStrongSecurity(initializer), verifier, handshakeTimeout);
| 0 |
import org.junit.Assert;
UtilWaitThread.sleep(1000);
verifySomeData(c, tableName, 1000 * 50 + 1);
private void verifySomeData(Connector c, String tableName, int expected) throws Exception {
Scanner scan = c.createScanner(tableName, EMPTY);
int result = Iterators.size(scan.iterator());
scan.close();
Assert.assertEquals(expected, result);
}
| 0 |
if (c.getRoleCommand().equals(RoleCommand.ACTIONEXECUTE)) {
processActionDeath(cluster.getClusterName(), c.getHostname(), roleStr);
}
if (c.getRoleCommand().equals(RoleCommand.ACTIONEXECUTE)) {
processActionDeath(cluster.getClusterName(), c.getHostname(), roleStr);
}
c.getRole(), hostName, now, true);
if (c.getRoleCommand().equals(RoleCommand.ACTIONEXECUTE)) {
String clusterName = c.getClusterName();
processActionDeath(clusterName,
c.getHostname(),
c.getRole());
}
processActionDeath(clusterName,
hostRoleCommand.getHostName(),
hostRoleCommand.getRole().name());
/**
* Attempts to process kill/timeout/abort of action and send
* appropriate event to all listeners
*/
private void processActionDeath(String clusterName,
String hostname,
String role) {
try {
// Usually clusterId is defined (except the awkward case when
// "Distribute repositories/install packages" action has been issued
// against a concrete host without binding to a cluster)
Long clusterId = clusterName != null ?
fsmObject.getCluster(clusterName).getClusterId() : null;
ActionFinalReportReceivedEvent event = new ActionFinalReportReceivedEvent(
clusterId, hostname, null,
role);
ambariEventPublisher.publish(event);
} catch (AmbariException e) {
LOG.error(String.format("Can not get cluster %s", clusterName), e);
}
}
| 0 |
* Use <code>transformerClosure</code> if you want that.
| 0 |
public Enumeration<String> getKeys()
return new CombinedEnumeration<String>( resourceBundle.getKeys(), defaultResourceBundle.getKeys() );
| 0 |
import org.apache.ambari.server.AmbariException;
* Get the Cluster Name
*/
public String getClusterName();
/**
* Add a new host to the cluster
* @throws AmbariException
*/
public void addHost(String host) throws AmbariException;
/**
* Add a new ServiceComponentHost to the cluster
* @param serviceName
* @param componentName
* @param hostName
* @param isClient
*/
public void addServiceComponentHost(String serviceName, String componentName,
String hostName, boolean isClient) throws AmbariException;
/**
* @throws AmbariException
public HostState getHostState(String hostName) throws AmbariException;
public void setHostState(String hostName, HostState state)
throws AmbariException;
throws AmbariException, InvalidStateTransitonException;
String serviceComponent, String hostName) throws AmbariException;
ServiceComponentHostState state) throws AmbariException;
ServiceComponentHostEvent event)
throws AmbariException, InvalidStateTransitonException;
| 0 |
transform.setSecureValidation(secureValidation);
| 0 |
/*
* File LenientNotOKBean.java
* created by mpo
* on Dec 26, 2003 | 4:01:40 PM
*
* (c) 2003 - Outerthought BVBA
*/
package org.apache.cocoon.woody.samples.bindings;
/**
* LenientNotOKBean
*/
public class LenientNotOKBean extends LenientBaseBean{
public LenientNotOKBean(String initVal) {
super(initVal);
}
}
| 0 |
protected HttpResponse createMessage(final CharArrayBuffer buffer) throws HttpException {
| 0 |
import javax.annotation.Nonnull;
* Build an array of filter DTOs from a filter handler array
public static @Nonnull FilterDTO[] build(@Nonnull final FilterHandler[] handlers)
array[i] = build(handlers[i], -1);
public static @Nonnull FilterDTO build(@Nonnull final FilterHandler handler, final int reason)
final FilterDTO filterDTO = build(handler.getFilterInfo(), reason);
public static @Nonnull FilterDTO build(@Nonnull final FilterInfo info, final int reason)
final FilterDTO filterDTO = (reason != -1 ? new FailedFilterDTO() : new FilterDTO());
if ( reason != -1 )
{
((FailedFilterDTO)filterDTO).failureReason = reason;
}
private static @Nonnull String[] getNames(@Nonnull final DispatcherType[] dispatcher)
final String[] names = new String[dispatcher.length];
| 0 |
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.inject.Inject;
import org.apache.atlas.repository.graph.AtlasGraphProvider;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
//force graph initialization / built in type registration
TestUtils.getGraph();
new GraphBackedSearchIndexer();
TestUtils.resetRequestContext();
TestUtils.dumpGraph(TestUtils.getGraph());
AtlasGraphProvider.cleanup();
| 1 |
/*
* Copyright 2009 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 |
* buttons from the content of a resource bundle. <br>
| 0 |
/*
* Copyright 2001-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.
*/
import java.util.List;
import java.util.LinkedList;
/**
* See Main.java.
*/
public class Row {
/**
* Alas, we can't just use a Map to store the (name, value) pairs
* because the output will look weird if we don't preserve the column
* order. This wouldn't be a problem if we were really inserting into
* a database; it only matters because we are displaying the SQL statements
* via stdout instead. The LinkedHashMap class would be nice to use, but
* that would require java 1.4, so we'll use a list instead, and may as
* well call the entries in the list 'Column' objects.
*/
public static class Column {
private String name, value;
public Column(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public String getValue() {
return value;
}
}
private LinkedList columns = new LinkedList();
public Row() {
}
public void addColumn(String name, String value) {
columns.add(new Column(name, value));
}
public List getColumns() {
return columns;
}
}
| 0 |
Copyright 2001 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.batik.ext.swing;
| 0 |
package org.apache.zookeeper.jmx.server;
import org.apache.jute.BinaryOutputArchive;
import org.apache.zookeeper.jmx.ZKMBeanInfo;
org.apache.zookeeper.server.DataTree dataTree;
public DataTreeBean(org.apache.zookeeper.server.DataTree dataTree){
* @see org.apache.zookeeper.jmx.server.DataTreeMBean#getDataSize()
* @see org.apache.zookeeper.jmx.server.DataTreeMBean#getEphemeralCount()
* @see org.apache.zookeeper.jmx.server.DataTreeMBean#getWatchCount()
| 0 |
* @version $Revision$ $Date$
| 0 |
import cz.seznam.euphoria.shaded.guava.com.google.common.collect.Iterables;
| 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/example/org/apache/commons/validator/example/ValidateExample.java,v 1.7 2003/05/22 03:12:18 dgraham Exp $
* $Revision: 1.7 $
* $Date: 2003/05/22 03:12:18 $
* @version $Revision: 1.7 $ $Date: 2003/05/22 03:12:18 $
ValidatorResources resources = null;
resources = new ValidatorResources(in);
// Make sure we close the input stream.
// Create a test bean to validate against.
ValidateBean bean = new ValidateBean();
// Create a validator with the ValidateBean actions for the bean
// we're interested in.
Validator validator = new Validator(resources, "ValidateBean");
// Tell the validator which bean to validate against.
validator.addParameter(Validator.BEAN_KEY, bean);
ValidatorResults results = null;
// Run the validation actions against the bean. Since all of the properties
// are null, we expect them all to error out except for street2, which has
// no validations (it's an optional property)
results = validator.validate();
printResults(bean, results, resources);
// Now set all the required properties, but make the age a non-integer.
// You'll notice that age will pass the required test, but fail the int
// test.
bean.setLastName("Tester");
bean.setFirstName("John");
bean.setStreet1("1 Test Street");
bean.setCity("Testville");
bean.setState("TE");
bean.setPostalCode("12345");
bean.setAge("Too Old");
results = validator.validate();
printResults(bean, results, resources);
// Now everything should pass.
bean.setAge("123");
results = validator.validate();
printResults(bean, results, resources);
| 0 |
import org.apache.aurora.scheduler.storage.Storage.MutateWork.NoResult;
storage.write((NoResult.Quiet) (Storage.MutableStoreProvider storeProvider) -> {
for (TaskStatus status : updates) {
ScheduleStatus translatedState = Conversions.convertProtoState(status.getState());
StateChangeResult result = stateManager.changeState(
storeProvider,
status.getTaskId().getValue(),
Optional.absent(),
translatedState,
formatMessage(status));
if (status.hasReason()) {
counters.get(statName(status, result)).incrementAndGet();
| 0 |
import java.nio.charset.StandardCharsets;
md4.update(input.getBytes(StandardCharsets.US_ASCII));
| 0 |
HashMap<String, String> attrs = getPseudoAttributes();
String type = attrs.get("type");
String title = attrs.get("title");
String media = attrs.get("media");
String href = attrs.get("href");
String alternate = attrs.get("alternate");
| 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/test/org/apache/commons/validator/FloatTest.java,v 1.11 2003/08/23 02:24:07 rleland Exp $
* $Revision: 1.11 $
* $Date: 2003/08/23 02:24:07 $
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* any, must include the following acknowledgement:
* 4. The names, "Apache", "The Jakarta Project", "Commons", and "Apache Software
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
* @version $Revision: 1.11 $ $Date: 2003/08/23 02:24:07 $
| 0 |
import org.apache.http.HttpRequest;
import org.apache.http.nio.NHttpMessageWriterFactory;
* SSLSetupHandler, NHttpMessageParserFactory, NHttpMessageWriterFactory,
* ByteBufferAllocator, ConnectionConfig)}
final NHttpMessageWriterFactory<HttpRequest> requestWriterFactory,
this(new DefaultNHttpClientConnectionFactory(
responseParserFactory, requestWriterFactory, allocator, config),
new SSLNHttpClientConnectionFactory(
sslcontext, sslHandler, responseParserFactory, requestWriterFactory,
this(sslcontext, sslHandler, null, null, null, config);
| 0 |
MASTER_BULK_TIMEOUT("master.bulk.timeout", "5m", PropertyType.TIMEDURATION, "The time to wait for a tablet server to process a bulk import request"),
MASTER_MINTHREADS("master.server.threads.minimum", "20", PropertyType.COUNT, "The minimum number of threads to use to handle incoming requests."),
TSERV_BULK_TIMEOUT("tserver.bulk.timeout", "5m", PropertyType.TIMEDURATION, "The time to wait for a tablet server to process a bulk import request."),
TSERV_MINTHREADS("tserver.server.threads.minimum", "20", PropertyType.COUNT, "The minimum number of threads to use to handle incoming requests."),
| 0 |
p.traverseTopologically(new Pipeline.PipelineVisitor.Defaults() {});
| 0 |
return tableInfo.tableId.canonical();
| 0 |
Assert.assertEquals(3, definitions.size());
| 0 |
public SecurityToken getSecurityToken(KeyInfoType keyInfoType,
SecurityToken.KeyInfoUsage keyInfoUsage,
return getSecurityToken(keyValueType, securityProperties.getCallbackHandler(), securityContext);
securityProperties.getCallbackHandler(), "", XMLSecurityConstants.XMLKeyIdentifierType.X509_ISSUER_SERIAL);
new SecretKeySecurityToken(securityContext, securityProperties.getCallbackHandler(), "",
| 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 |
* </p>
| 0 |
switch (type.getInternalType()) {
| 0 |
private Trigger<IntervalWindow>.TriggerContext isTriggerContext() {
| 0 |
import org.apache.accumulo.start.classloader.vfs.AccumuloVFSClassLoader;
clazz = AccumuloVFSClassLoader.loadClass(cl.getOptionValue(interpreterOpt.getOpt()), ScanInterpreter.class);
clazz = AccumuloVFSClassLoader.loadClass(cl.getOptionValue(formatterInterpeterOpt.getOpt()), ScanInterpreter.class);
return AccumuloVFSClassLoader.loadClass(cl.getOptionValue(formatterOpt.getOpt()), Formatter.class);
return AccumuloVFSClassLoader.loadClass(cl.getOptionValue(formatterInterpeterOpt.getOpt()), Formatter.class);
| 0 |
import org.apache.commons.jxpath.JXPathAbstractFactoryException;
throw new JXPathAbstractFactoryException("Factory " + factory
+ " could not create an object for path: " + asPath());
| 0 |
/** {@link org.apache.commons.logging} logging facility */
static org.apache.commons.logging.Log log =
org.apache.commons.logging.LogFactory.getLog(X509SKIResolver.class.getName());
log.debug("Can I resolve " + element.getTagName() + "?");
log.debug("I can't");
log.debug("Yes Sir, I can");
log.debug("I can't");
log.info("", ex);
log.debug("Return PublicKey from "
| 0 |
package org.apache.atlas.repository.store.graph.v2;
public class AtlasEntityDefStoreV2 extends AtlasAbstractDefStoreV2<AtlasEntityDef> {
private static final Logger LOG = LoggerFactory.getLogger(AtlasEntityDefStoreV2.class);
public AtlasEntityDefStoreV2(AtlasTypeDefGraphStoreV2 typeDefStore, AtlasTypeRegistry typeRegistry) {
if (AtlasGraphUtilsV2.typeHasInstanceVertex(name)) {
if (typeDefStore.hasIncomingEdgesWithLabel(ret, AtlasGraphUtilsV2.RELATIONSHIPTYPE_EDGE_LABEL)){
String typeName = AtlasGraphUtilsV2.getProperty(ret, Constants.TYPENAME_PROPERTY_KEY, String.class);
if (AtlasGraphUtilsV2.typeHasInstanceVertex(typeName)) {
if (typeDefStore.hasIncomingEdgesWithLabel(ret, AtlasGraphUtilsV2.RELATIONSHIPTYPE_EDGE_LABEL)){
AtlasStructDefStoreV2.updateVertexPreCreate(entityDef, entityType, vertex, typeDefStore);
AtlasStructDefStoreV2.updateVertexPreUpdate(entityDef, entityType, vertex, typeDefStore);
AtlasStructDefStoreV2.updateVertexAddReferences(entityDef, vertex, typeDefStore);
AtlasStructDefStoreV2.toStructDef(vertex, ret, typeDefStore);
| 1 |
try {
ViewRegistry.getInstance().installViewInstance(toEntity(properties));
} catch (org.apache.ambari.view.SystemException e) {
throw new AmbariException("Caught exception trying to create view instance.", 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 |
* @version $Id$
| 0 |
static List<String> parts(Object... parts) {
List<String> result = new ArrayList<String>();
for (Object obj : parts) {
result.add(obj.toString());
return result;
}
@Test
public void testJoin() {
assertEquals(StringUtil.join(parts(), ","), "");
assertEquals(StringUtil.join(parts("a", "b", "c"), ","), "a,b,c");
assertEquals(StringUtil.join(parts("a"), ","), "a");
assertEquals(StringUtil.join(parts("a", "a"), ","), "a,a");
}
| 1 |
final String servletPath = "/".equals(getAlias()) ? "" : getAlias(); // XXX handle wildcard aliases!
// See section 9.4 of Servlet 3.0 spec
// Since we're already created this RequestDispatcher for *this* servlet handler, we do not need to
// After a forward has taken place, the results should be committed,
// Since we're already created this RequestDispatcher for *this* servlet handler, we do not need to
// Only wrap the original ServletRequest in case we're handling plain requests,
// not inclusions or forwards from servlets. Should solve FELIX-2774 and FELIX-3054...
// FELIX-3988: If the response is not yet committed and still has the default
| 0 |
@org.junit.Test
@org.junit.Test
@org.junit.Test
@org.junit.Test
@org.junit.Test
| 0 |
public void encode(Person value, OutputStream outStream)
LONG_CODER.encode(value.id, outStream);
STRING_CODER.encode(value.name, outStream);
STRING_CODER.encode(value.emailAddress, outStream);
STRING_CODER.encode(value.creditCard, outStream);
STRING_CODER.encode(value.city, outStream);
STRING_CODER.encode(value.state, outStream);
LONG_CODER.encode(value.dateTime, outStream);
STRING_CODER.encode(value.extra, outStream);
public Person decode(InputStream inStream)
long id = LONG_CODER.decode(inStream);
String name = STRING_CODER.decode(inStream);
String emailAddress = STRING_CODER.decode(inStream);
String creditCard = STRING_CODER.decode(inStream);
String city = STRING_CODER.decode(inStream);
String state = STRING_CODER.decode(inStream);
long dateTime = LONG_CODER.decode(inStream);
String extra = STRING_CODER.decode(inStream);
| 0 |
LOG.debug("I could find a key using the per-KeyInfo key resolvers");
LOG.debug("I couldn't find a key using the per-KeyInfo key resolvers");
LOG.debug("I could find a key using the system-wide key resolvers");
LOG.debug("I couldn't find a key using the system-wide key resolvers");
LOG.debug("Try {}", keyResolver.getClass().getName());
LOG.debug("I could find a X509Certificate using the per-KeyInfo key resolvers");
LOG.debug("I couldn't find a X509Certificate using the per-KeyInfo key resolvers");
LOG.debug("I could find a X509Certificate using the system-wide key resolvers");
LOG.debug("I couldn't find a X509Certificate using the system-wide key resolvers");
LOG.debug(
"Start getX509CertificateFromStaticResolvers() with {} resolvers", KeyResolver.length()
);
LOG.debug(
"Start getX509CertificateFromInternalResolvers() with {} resolvers",
+ this.lengthInternalKeyResolver()
);
LOG.debug("Try {}", keyResolver.getClass().getName());
LOG.debug("I could find a secret key using the per-KeyInfo key resolvers");
LOG.debug("I couldn't find a secret key using the per-KeyInfo key resolvers");
LOG.debug("I could find a secret key using the system-wide key resolvers");
LOG.debug("I couldn't find a secret key using the system-wide key resolvers");
LOG.debug("Try {}", keyResolver.getClass().getName());
LOG.debug("I could find a private key using the per-KeyInfo key resolvers");
LOG.debug("I couldn't find a secret key using the per-KeyInfo key resolvers");
LOG.debug("I could find a private key using the system-wide key resolvers");
LOG.debug("I couldn't find a private key using the system-wide key resolvers");
LOG.debug("Try {}", keyResolver.getClass().getName());
| 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.
*/
package org.apache.ambari.server.api.services.stackadvisor;
import org.codehaus.jackson.annotate.JsonProperty;
/**
* Abstract stack advisor response POJO.
*/
public abstract class StackAdvisorResponse {
private int id;
@JsonProperty("Versions")
private Version version;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public Version getVersion() {
return version;
}
public void setVersion(Version version) {
this.version = version;
}
public static class Version {
@JsonProperty("stack_name")
private String stackName;
@JsonProperty("stack_version")
private String stackVersion;
public String getStackName() {
return stackName;
}
public void setStackName(String stackName) {
this.stackName = stackName;
}
public String getStackVersion() {
return stackVersion;
}
public void setStackVersion(String stackVersion) {
this.stackVersion = stackVersion;
}
}
}
| 0 |
import org.apache.sshd.util.BaseTestSupport;
public class PortForwardingTest extends BaseTestSupport {
assertTrue("socket is not connected", socket.isConnected());
assertFalse("socket should not be closed", socket.isClosed());
assertTrue("socket has not closed", socket.isClosed());
| 0 |
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.cocoon.components.xscript;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* An <code>XScriptObject</code> created from a JAXP
* <code>Result</code> object.
*
* @version $Id$
* @since August 30, 2001
*/
public class XScriptObjectResult extends XScriptObject {
/**
* The XML content of this object.
*/
String content;
public XScriptObjectResult(XScriptManager manager, String content) {
super(manager);
this.content = content;
}
public InputStream getInputStream() throws IOException {
return new ByteArrayInputStream(content.getBytes());
}
public long getContentLength() {
return content.length();
}
public String getURI() {
// FIXME: Return a real URL that identifies this object
return "file:/";
}
public String toString() {
return "XScriptObjectResult: " + content;
}
}
| 0 |
public abstract FileBasedWriteOperation<T> createWriteOperation();
| 0 |
* This is the main, starting class of the Bundle. It initializes and disposes
private BundleActivator statusActivator;
private static final String STATUS_ACTIVATOR = "org.apache.felix.status.impl.Activator";
public void start( final BundleContext bundleContext ) throws Exception
try
{
final Class activatorClass = bundleContext.getBundle().loadClass(STATUS_ACTIVATOR);
this.statusActivator = (BundleActivator) activatorClass.newInstance();
}
catch (Throwable t)
{
// we ignore this as the status activator is only available if the web console
// bundle contains the status bundle.
}
if ( this.statusActivator != null)
{
this.statusActivator.start(bundleContext);
}
public void stop( final BundleContext bundleContext ) throws Exception
if ( this.statusActivator != null)
{
this.statusActivator.stop(bundleContext);
this.statusActivator = null;
}
| 0 |
import static org.junit.Assert.assertEquals;
assertEquals("Read(NoopNamedSource)", read.getKindString());
assertEquals("Read(AnonymousSource)", read.getKindString());
| 0 |
m_Listener.activate( bundleContext );
| 0 |
public final static String SVG_BROKEN_LINK_DOCUMENT_PROPERTY =
| 0 |
* Autogenerated by Thrift Compiler (0.12.0)
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)")
public @org.apache.thrift.annotation.Nullable java.util.List<TIteratorSetting> iterators; // required
@org.apache.thrift.annotation.Nullable
@org.apache.thrift.annotation.Nullable
@org.apache.thrift.annotation.Nullable
@org.apache.thrift.annotation.Nullable
public IteratorConfig setIterators(@org.apache.thrift.annotation.Nullable java.util.List<TIteratorSetting> iterators) {
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
@org.apache.thrift.annotation.Nullable
@org.apache.thrift.annotation.Nullable
@org.apache.thrift.annotation.Nullable TIteratorSetting _elem99;
@org.apache.thrift.annotation.Nullable TIteratorSetting _elem104;
| 0 |
import org.apache.http.HeaderIterator;
for (HeaderIterator it = message.headerIterator(); it.hasNext(); ) {
Header header = it.nextHeader();
| 0 |
import org.apache.ambari.spi.RepositoryType;
| 0 |
* Parses a request line from the given buffer containing one line of text.
* @param buffer a buffer holding a line to parse
RequestLine parseRequestLine(CharArrayBuffer buffer) throws ParseException;
* Parses a status line from the given buffer containing one line of text.
* @param buffer a buffer holding a line to parse
StatusLine parseStatusLine(CharArrayBuffer buffer) throws ParseException;
* Parses a header from the given buffer containing one line of text.
* The full header line is expected here. Header continuation
* lines must be joined by the caller before invoking this method.
Header parseHeader(CharArrayBuffer buffer) throws ParseException;
| 0 |
public LocalityGroupIterator(LocalityGroup[] groups) {
| 0 |
import org.w3c.dom.Document;
import org.w3c.dom.DocumentType;
| 0 |
package org.apache.felix.karaf.shell.wrapper;
import org.apache.felix.karaf.shell.console.OsgiCommandSupport;
| 0 |
import org.apache.http.Consts;
SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 128, Consts.ASCII);
SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 128, Consts.ASCII);
SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 128, Consts.ASCII);
SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 128, Consts.ASCII);
SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 128, Consts.ASCII);
SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 128, Consts.ASCII);
SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 128, Consts.ASCII);
SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 128, Consts.ASCII);
SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 128, Consts.ASCII);
| 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 |
return new ArrayList<>();
final List<E> list = new ArrayList<>();
final List<E> list = new ArrayList<>();
final List<E> adds = new ArrayList<>();
final List<Object> originalList = new ArrayList<>();
| 1 |
import org.apache.felix.ipojo.parser.ParseUtils;
* Listened topics.
return EventUtil.matches(topic, ParseUtils.split(m_topics, ","));
* Is the subscriber metadata valid ? This method check only the existence of a callback and a name attribute.
* Create and set the filter. The filter is create from the given argument.
| 0 |
package org.apache.accumulo.cloudtrace.thrift;
| 0 |
import org.apache.cocoon.util.AbstractLogEnabled;
public class BlockContextSourceFactory extends AbstractLogEnabled
implements SourceFactory, Serviceable, ThreadSafe {
* @see Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
/**
* @see SourceFactory#getSource(java.lang.String, java.util.Map)
public Source getSource(String location, Map parameters) throws IOException {
if (location.endsWith(":/")) {
}
if (blockContext == null) {
" in block context uri " + location);
}
if (getLogger().isDebugEnabled()) {
getLogger().debug("block context source " + location + " is resolved to " + resolvedPath);
}
throw new MalformedURLException("The block name part of a block context uri must end with a '/' in " + location);
* @see SourceFactory#release(org.apache.excalibur.source.Source)
| 0 |
return input.apply(CreatePCollectionView.<T, List<T>>of(PCollectionViews.listView(
input.getPipeline(), input.getWindowingStrategy(), input.getCoder())));
| 0 |
* value zero '\000' in the source byte array.
| 0 |
if (obj == null)
return "-";
if (status.host == null)
return "--Unknown--";
| 1 |
return ImmutableList.of(DataflowPipelineOptions.class);
return ImmutableList.of(DataflowRunner.class, TestDataflowRunner.class);
| 0 |
FileSystem(final int maxFileLength, final int maxPathLength, final char[] illegalFileNameChars,
final String[] reservedFileNames) {
| 0 |
return "Starts Accumulo proxy";
| 0 |
* "License"); you may not use this file except in compliance
* distributed under the License is distributed on an "AS IS" BASIS,
| 0 |
package org.apache.bcel.generic;
public class AnnotationGen
{
}
| 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestCollectionUtils.java,v 1.33 2003/12/29 01:18:23 scolebourne Exp $
* @version $Revision: 1.33 $ $Date: 2003/12/29 01:18:23 $
| 0 |
import org.apache.http.entity.ContentType;
protected void onEntityEnclosed(final HttpEntity entity, final ContentType contentType) {
}
@Override
| 0 |
import org.apache.commons.jxpath.ri.InfoSetUtil;
if (!(predicates[count - 1] instanceof NameAttributeTest)){
if (!(predicates[count - 1] instanceof NameAttributeTest)){
Object value = predicate.computeValue(context);
return (int)(InfoSetUtil.doubleValue(value) + 0.5) - 1;
else if (InfoSetUtil.booleanValue(value)){
private static String keyFromPredicate(EvalContext context,
Expression predicate){
Expression expr = ((NameAttributeTest)predicate).
getNameTestExpression();
return InfoSetUtil.stringValue(expr.computeValue(context));
| 0 |
LOG.info("Initialized Ambari DB Metrics Source...");
LOG.info("Started Ambari DB Metrics source...");
| 0 |
Set<SubResourceDefinition> children = new HashSet<>();
| 0 |
package org.apache.hc.core5.reactor;
| 1 |
private boolean isValid;
private boolean bufferEvents;
/** Widgets that need to be updated in the client when in AJAX mode */
/** Widgets that have at least one descendant that has to be updated */
/** Optional id which overrides the value from the form definition */
this.listener.phaseEnded(new ProcessingPhaseEvent(this, ProcessingPhase.PROCESSING_INITIALIZE));
this.listener.phaseEnded(new ProcessingPhaseEvent(this, ProcessingPhase.READ_FROM_REQUEST));
this.endProcessing = BooleanUtils.toBooleanObject(!redisplayForm);
this.listener.phaseEnded(new ProcessingPhaseEvent(this, ProcessingPhase.VALIDATE));
if (this.id != null) {
| 0 |
* WARNING: Due to human error certain binary incompatibilities were introduced
* @version $Id$
* Use <code>EmptyIterator.INSTANCE</code> for compatibility with Commons Collections 2.1.1.
* Use <code>EmptyListIterator.INSTANCE</code> for compatibility with Commons Collections 2.1.1.
* Use <code>EmptyIterator.INSTANCE</code> for compatibility with Commons Collections 2.1.1.
* Use <code>EmptyListIterator.INSTANCE</code> for compatibility with Commons Collections 2.1.1.
* Use <code>new SingletonIterator(object)</code> for compatibility.
* Use <code>new ArrayIterator(array)</code> for compatibility.
* Use <code>new ArrayIterator(array,start)</code> for compatibility.
* Use <code>new ArrayIterator(array,start,end)</code> for compatibility.
| 0 |
private final Map<FileName, FileObject> cache = new HashMap<FileName, FileObject>();
| 0 |
Map<String, List<? extends SingularAttribute<?, ?>>> mapping = new HashMap<>();
| 1 |
Set<HostVersionEntity> hostVersionsAllowed = new HashSet<HostVersionEntity>();
hostVersionsAllowed.add(hostVersion);
// May need to first transition to UPGRADED
outSB.append(String.format("Will finalize the upgraded state of host components in %d host(s).\n", hostVersionsAllowed.size()));
// Reset the upgrade state
for (HostVersionEntity hostVersion : hostVersionsAllowed) {
outSB.append(String.format("Will finalize the version for %d host(s).\n", hostVersionsAllowed.size()));
| 0 |
public MinIntegerFn() {
super(Integer.MAX_VALUE);
}
public MinLongFn() {
super(Long.MAX_VALUE);
}
public MinDoubleFn() {
super(Double.POSITIVE_INFINITY);
}
| 0 |
import org.apache.beam.sdk.state.BagState;
import org.apache.beam.sdk.state.CombiningState;
import org.apache.beam.sdk.state.GroupingState;
import org.apache.beam.sdk.state.ReadableState;
import org.apache.beam.sdk.state.ValueState;
| 0 |
@Description("The path to the gcloud binary. "
+ " Default is to search the system path.")
String getGCloudPath();
void setGCloudPath(String value);
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.