Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* 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.
*/
@XmlJavaTypeAdapter(value=TrimmingAdapter.class,type=String.class)
package org.apache.ambari.server.state.stack;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; | 0 |
* @param <E> the type of the elements in the buffer
public static <E> BlockingBuffer<E> blockingBuffer(Buffer<E> buffer) {
return new BlockingBuffer<E>(buffer);
* @param <E> the type of the elements in the buffer
public static <E> BlockingBuffer<E> blockingBuffer(Buffer<E> buffer, long timeoutMillis) {
return new BlockingBuffer<E>(buffer, timeoutMillis);
* {@inheritDoc}
* @return the next object in the buffer
* {@inheritDoc}
* @return the next object in the buffer, which is also removed | 0 |
* @version $Id: DateType.java,v 1.3 2004/02/11 09:53:44 antonio Exp $ | 0 |
private static final long serialVersionUID = -1082157891095177114L;
private int local_variable_type_table_length; // Table of local | 0 |
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. | 0 |
import org.apache.commons.dbcp.SQLNestedException;
* @version $Id: PooledConnectionImpl.java,v 1.7 2003/08/11 16:01:47 dirkv Exp $
} catch (RuntimeException e) {
throw e;
throw new SQLNestedException("Cannot close connection (return to pool failed)", e);
throw new SQLNestedException("Borrow prepareStatement from pool failed", e);
throw new SQLNestedException("Borrow prepareStatement from pool failed", e); | 0 |
import org.apache.hc.core5.http.impl.bootstrap.StandardFilters;
import org.apache.hc.core5.http.io.HttpFilterChain;
import org.apache.hc.core5.http.io.HttpFilterHandler;
.addFilterBefore(StandardFilters.MAIN_HANDLER.name(), "no-keep-alive", new HttpFilterHandler() {
final HttpFilterChain.ResponseTrigger responseTrigger,
final HttpContext context,
final HttpFilterChain chain) throws HttpException, IOException {
chain.proceed(request, new HttpFilterChain.ResponseTrigger() {
@Override
public void sendInformation(
final ClassicHttpResponse response) throws HttpException, IOException {
responseTrigger.sendInformation(response);
}
@Override
public void submitResponse(
final ClassicHttpResponse response) throws HttpException, IOException {
if (request.getPath().startsWith("/no-keep-alive")) {
response.setHeader(HttpHeaders.CONNECTION, HeaderElements.CLOSE);
}
responseTrigger.submitResponse(response);
}
}, context);
| 0 |
import java.util.concurrent.TimeUnit;
import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
sleepUninterruptibly(200, TimeUnit.MILLISECONDS); | 1 |
import org.apache.accumulo.core.clientImpl.Table;
import org.apache.accumulo.core.dataImpl.KeyExtent; | 0 |
private Hashtable<InstructionHandle, String> map;
map = new Hashtable<InstructionHandle, String>();
String str = map.get(ih);
String str = new StringTokenizer(map.get(ih), "\n").nextToken();
String str = map.get(ih); | 0 |
* If {@code null} {@link org.apache.http.nio.util.HeapByteBufferAllocator#INSTANCE}
* If {@code null} simple type cast will be used for byte to char conversion.
* If {@code null} simple type cast will be used for char to byte conversion.
* @param constraints Message constraints. If {@code null}
* @param incomingContentStrategy incoming content length strategy. If {@code null}
* @param outgoingContentStrategy outgoing content length strategy. If {@code null}
* @param requestParserFactory request parser factory. If {@code null}
* @param responseWriterFactory response writer factory. If {@code null} | 0 |
private static final long serialVersionUID = 0L;
| 0 |
* done for Stack Upgrades. | 0 |
assertEquals(2, customCommands.size()); | 0 |
import static com.google.common.base.Verify.verify;
/**
* Like {@link #match(List)}, but for a single resource specification.
*
* <p>The function {@link #match(List)} is preferred when matching multiple patterns, as it allows
* for bulk API calls to remote filesystems.
*/
public static MatchResult match(String spec) throws IOException {
List<MatchResult> matches = match(Collections.singletonList(spec));
verify(
matches.size() == 1,
"FileSystem implementation for %s did not return exactly one MatchResult: %s",
spec,
matches);
return matches.get(0);
} | 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.faces.taglib;
import org.apache.cocoon.taglib.TagSupport;
import org.apache.cocoon.faces.FacesUtils;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
import javax.faces.component.UIParameter;
import javax.faces.FacesException;
/**
* @version CVS $Id$
*/
public class VerbatimTag extends UIComponentBodyTag {
protected String getComponentType() {
return "javax.faces.Output";
}
protected String getRendererType() {
return "javax.faces.Text";
}
protected void setProperties(UIComponent component) {
super.setProperties(component);
// TODO: VerbatimTag: Implement escape attribute support
component.setTransient(true);
}
public void recycle() {
super.recycle();
}
public int doAfterBody() throws SAXException {
if (content != null) {
String value = content.getContent().toString();
((UIOutput)getComponentInstance()).setValue(value);
}
return getDoAfterBody();
}
} | 0 |
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.annotations.VisibleForTesting; | 0 |
package org.apache.sshd.server.auth; | 0 |
*
*
*
*
*
*
*
*
*
*
*
*
*
| 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.
*/ | 0 |
import org.apache.beam.sdk.transforms.OldDoFn;
* of-line. This OldDoFn tokenizes lines of text into individual words; we pass it to a ParDo in
* the pipeline.
static class ExtractWordsFn extends OldDoFn<String, String> { | 0 |
import org.apache.zookeeper.KeeperException.SessionExpiredException;
/**
* set the owner of this session as owner
* @param id the session id
* @param owner the owner of the session
* @throws SessionExpiredException
*/
public void setOwner(long id, Object owner) throws SessionExpiredException {
sessionTracker.setOwner(id, owner);
}
| 0 |
/**
* Parser and formatter for {@link HttpVersion HttpVersion}.
*
* @author <a href="mailto:[email protected]">Oleg Kalnichevski</a>
*
*
* <!-- empty lines above to avoid 'svn diff' context problems -->
* @version $Revision$
*
* @since 4.0
*/
public class BasicHttpVersionFormat { | 0 |
import java.util.Map;
return cluster._exec(service, serverType, Map.of(property.getKey(), Integer.toString(port))) | 0 |
import org.apache.ambari.server.topology.tasks.ConfigureClusterTaskFactory;
@Mock(type = MockType.NICE)
private ConfigureClusterTaskFactory configureClusterTaskFactory; | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/observed/standard/Attic/StandardModificationHandler.java,v 1.7 2003/10/09 20:50:04 scolebourne Exp $
* @version $Revision: 1.7 $ $Date: 2003/10/09 20:50:04 $
* The handler can only be used after it has been properly initialized.
* This is normally done automatically by
* {@link ObservableCollection#decorate(Collection, Object)}.
* The handler can only be used after it has been properly initialized.
* This is normally done automatically by
* {@link ObservableCollection#decorate(Collection, Object)}. | 0 |
public AbstractHandler(ExtServletContext context, final Map<String, String> initParams, String baseName)
{
this.context = context;
this.baseName = baseName;
this.id = ID.incrementAndGet();
this.initParams = new HashMap<String, String>();
if ( initParams != null)
{
this.initParams.putAll(initParams);
}
}
| 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.logsearch.query.model;
import org.apache.ambari.logsearch.common.Marker;
@Marker
public class UserConfigSearchCriteria extends CommonSearchCriteria {
} | 0 |
import java.nio.charset.StandardCharsets;
headers.add("headerKey", "headerVal".getBytes(StandardCharsets.UTF_8)); | 0 |
sb.append("[");
if (sb.length() > 1)
{
sb.append(", ");
}
sb.append("[");
if (sb.length() > 1)
{
sb.append(", ");
} | 0 |
public AccumuloClient getAccumuloClient(String user, AuthenticationToken token) { | 0 |
private static final Coder<Integer> TEST_CODER = BigEndianIntegerCoder.of();
CoderProperties.coderDecodeEncodeEqual(TEST_CODER, value);
// This should never change. The definition of big endian encoding is fixed.
private static final String EXPECTED_ENCODING_ID = "";
@Test
public void testEncodingId() throws Exception {
CoderProperties.coderHasEncodingId(TEST_CODER, EXPECTED_ENCODING_ID);
} | 0 |
outputChannel.submit(response, endStream, endStream ? FlushMode.IMMEDIATE : FlushMode.BUFFER);
outputChannel.submit(response, true, FlushMode.IMMEDIATE); | 0 |
Map<String, Map<String, String>> map = new TreeMap<>(); | 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
*
* 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.view.hive2.client;
public class HiveClientRuntimeException extends RuntimeException {
public HiveClientRuntimeException(String comment, Exception ex) {
super(comment + ((ex == null)?"":(": " + ex.toString())), ex);
}
} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestDoubleOrderedMap.java,v 1.8 2003/10/02 23:01:09 scolebourne Exp $
* $Revision: 1.8 $
* $Date: 2003/10/02 23:01:09 $
public class TestDoubleOrderedMap extends AbstractTestMap {
protected Map makeEmptyMap() {
protected Map makeMap() { | 0 |
if( m_logger.isDebugEnabled( ) )
m_logger.debug( "Hand over Command " +
m_command.toString( ) + " to pool \"" +
m_pool.getName( ) + "\" with delay=" + m_delay +
" and interval=" + m_interval ); | 0 |
Boolean.TRUE, | 1 |
java.security.Signature signature = ValidateUtils.checkNotNull(getSignature(), "Signature not initialized"); | 0 |
* @version CVS $Id: CacheEventAction.java,v 1.2 2003/08/04 03:06:30 joerg Exp $ | 0 |
boolean isKerberosEnabled = AuthenticationUtil.isKerberosAuthenticationEnabled(ugi);
if (isKerberosEnabled) { | 0 |
@Timed("scheduler_log_upgrade_task_storage")
@Override
public void upgradeTaskStorage() {
doInTransaction(new Work.NoResult.Quiet() {
@Override
protected void execute(StoreProvider unused) {
LogStorage.super.upgradeTaskStorage(); // schema upgrade in the forwarded store (DbStorage)
}
});
}
| 0 |
return ValueConstants.CSS_TEXT_DECORATION_PROPERTY;
return new CSSOMReadOnlyValue(TextDecorationFactory.NONE_VALUE); | 0 |
public interface MacFactory extends MacInformation, BuiltinFactory<Mac> {
// nothing extra | 0 |
public interface LinkedCallMethodBuilder extends BackToLinkedRuleBuilder { | 0 |
* $Id$
* $Rev$
* $Date$
* Copyright 2000-2005 The Apache Software Foundation | 0 |
assertFalse(httpentity.isStreaming());
assertEquals("text/csv; charset=ANSI_X3.4-1968",
assertEquals("text/plain; charset=US-ASCII",
assertEquals("text/plain; charset=ISO-8859-1",
| 0 |
import java.util.HashMap;
/*
* Use only for json serialization
* @nonpublic
*/
@Override
public Map<String, Object> getValuesMap() throws MetadataException {
Map<String,Object> m = new HashMap<>();
for (String attr : fieldMapping.fields.keySet()) {
m.put(attr, get(attr));
}
return m;
}
| 0 |
@Override
public void close() {
getConnection().close();
}
@Override
public boolean isClosed() {
return getConnection().isClosed();
}
| 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/test/org/apache/commons/beanutils/WrapDynaBeanTestCase.java,v 1.4 2002/12/19 18:05:20 craigmcc Exp $
* $Revision: 1.4 $
* $Date: 2002/12/19 18:05:20 $
* @version $Revision: 1.4 $ $Date: 2002/12/19 18:05:20 $
/**
* Suppress serialization and deserialization tests. WrapDynaClass
* is not serializable.
*/
public void testSerialization() { }
| 0 |
import javax.inject.Inject;
@Inject | 0 |
* Copyright (c) 2002 The Apache Software Foundation. All rights | 0 |
package org.apache.felix.sigil.eclipse.internal.model.repository;
import org.apache.felix.sigil.eclipse.model.repository.IRepositoryType; | 0 |
public abstract class AbstractClassicServerExchangeHandler implements AsyncServerExchangeHandler {
public AbstractClassicServerExchangeHandler(final int initialBufferSize, final Executor executor) { | 0 |
import org.apache.accumulo.core.security.NamespacePermission;
public boolean hasNamespacePermission(final String principal, final String namespace, final NamespacePermission permission) throws AccumuloException,
AccumuloSecurityException {
ArgumentChecker.notNull(principal, namespace, permission);
return client.hasNamespacePermission(Tracer.traceInfo(), credentials.toThrift(instance), principal, namespace, permission.getId());
public void grantNamespacePermission(final String principal, final String namespace, final NamespacePermission permission) throws AccumuloException,
ArgumentChecker.notNull(principal, namespace, permission);
client.grantNamespacePermission(Tracer.traceInfo(), credentials.toThrift(instance), principal, namespace, permission.getId());
public void revokeNamespacePermission(final String principal, final String namespace, final NamespacePermission permission) throws AccumuloException,
ArgumentChecker.notNull(principal, namespace, permission);
client.revokeNamespacePermission(Tracer.traceInfo(), credentials.toThrift(instance), principal, namespace, permission.getId());
| 0 |
* @version $Revision$ $Date$ | 0 |
try (AccumuloClient c = createClient()) { | 0 |
implements CacheableProcessingComponent { | 0 |
public ServletBootstrapEnvironment(ServletConfig config,
ClassLoader cl, | 0 |
.register(CookieSpecs.STANDARD, new RFC2965SpecFactory())
.register("rfc2109", new RFC2109SpecFactory())
.register("rfc2965", new RFC2965SpecFactory()) | 0 |
getQueryHint(startTime), outputTableName, endTime, tableName, startTime, endTime)); | 0 |
import org.apache.sshd.util.test.NoIoTestCase;
import org.junit.experimental.categories.Category;
@Category({ NoIoTestCase.class }) | 0 |
public boolean accept( final File dir, String name ) {
public ClassPath(final ClassPath parent, final String class_path) {
public ClassPath(final String class_path) {
public boolean equals( final Object o ) {
private static void getPathComponents( final String path, final List<String> list ) {
public InputStream getInputStream( final String name ) throws IOException {
public InputStream getInputStream( final String name, final String suffix ) throws IOException {
public InputStream getResourceAsStream(final String name) {
public URL getResource(final String name) {
public Enumeration<URL> getResources(final String name) {
public ClassFile getClassFile( final String name, final String suffix ) throws IOException {
private ClassFile getClassFileInternal(final String name, final String suffix) throws IOException {
public ClassFile getClassFile( final String name ) throws IOException {
public byte[] getBytes( final String name, final String suffix ) throws IOException {
public byte[] getBytes( final String name ) throws IOException {
public String getPath( final String name, final String suffix ) throws IOException {
Dir(final String d) {
URL getResource(final String name) {
InputStream getResourceAsStream(final String name) {
ClassFile getClassFile( final String name, final String suffix ) throws IOException {
Zip(final ZipFile z) {
URL getResource(final String name) {
InputStream getResourceAsStream(final String name) {
ClassFile getClassFile( final String name, final String suffix ) throws IOException { | 0 |
Copyright 2002-2004 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/ | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/share/org/apache/commons/validator/util/ValidatorUtils.java,v 1.3 2003/08/15 23:44:19 dgraham Exp $
* $Revision: 1.3 $
* $Date: 2003/08/15 23:44:19 $
import java.util.Collection;
* @version $Revision: 1.3 $ $Date: 2003/08/15 23:44:19 $
* <code>String</code>. If the property is a <code>String[]</code> or
* <code>Collection</code> and it is empty, an empty <code>String</code>
* "" is returned. Otherwise, property.toString() is returned. This method
* may return <code>null</code> if there was an error retrieving the
* property.
public static String getValueAsString(Object bean, String property) {
Object value = null;
try {
value = PropertyUtils.getProperty(bean, property);
} catch (IllegalAccessException e) {
log.error(e.getMessage(), e);
} catch (InvocationTargetException e) {
log.error(e.getMessage(), e);
} catch (NoSuchMethodException e) {
log.error(e.getMessage(), e);
}
if (value == null) {
return null;
}
if (value instanceof String[]) {
return ((String[]) value).length > 0 ? value.toString() : "";
} else if (value instanceof Collection) {
return ((Collection) value).isEmpty() ? "" : value.toString();
} else {
return value.toString();
}
} | 0 |
Assert.assertEquals(200, response.getCode());
Assert.assertEquals(200, response.getCode());
Assert.assertEquals(200, response.getCode());
Assert.assertEquals(299, response.getCode());
Assert.assertEquals(298, response.getCode());
Assert.assertEquals(200, response.getCode());
Assert.assertEquals(500, response.getCode()); | 0 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(HostImpl.class);
LOG.error("Error while looking up the cluster", e);
| 0 |
*
*
*
*/
* them for a parameter marker in the sQL statement of the | 1 |
import static org.apache.beam.sdk.transforms.display.DisplayDataMatchers.includesDisplayDataFor;
assertThat(displayData, includesDisplayDataFor("fn", fn));
assertThat(displayData, includesDisplayDataFor("fn", fn));
assertThat(displayData, includesDisplayDataFor("fn", fn)); | 0 |
* @see org.apache.felix.moduleloader.ModuleFactoryImpl
* @see org.apache.felix.moduleloader.ModuleImpl
private IModule m_module = null;
public ModuleEvent(IModuleFactory factory, IModule module)
super(factory);
public IModule getModule() | 0 |
import java.util.Map;
import org.apache.commons.vfs.provider.TemporaryFileStore; | 0 |
case Stage:
return new StageResourceProvider(); | 0 |
* --runner=BlockingDataflowRunner | 0 |
import java.util.Set;
Set<String> includedFiles = memoryRulesBinder.getIncludedFiles();
String xmlRulesResourceString = xmlRulesResource.toString();
if ( includedFiles.add( xmlRulesResourceString ) )
try
install( new FromXmlRulesModule()
@Override
protected void loadRules()
{
loadXMLRules( xmlRulesResource );
}
} );
}
finally
{
includedFiles.remove( xmlRulesResourceString );
} | 0 |
System.err.println("System property 'storage.location' is not set. \n" + | 0 |
getManagementController().getConfigHelper().invalidateStaleConfigsCache(cluster.getDesiredConfigs()); | 0 |
import static org.easymock.EasyMock.capture;
import static org.easymock.EasyMock.createNiceMock;
import static org.easymock.EasyMock.createStrictMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.google.gson.Gson;
import com.google.inject.Injector;
"cluster1", null, "component1", "host1", null);
"cluster1", null, "component1", "host1", null);
"cluster1", null, "component1", "host1", null);
"cluster1", null, "component2", "host1", null);
"cluster1", null, "component3", "host1", null);
"cluster1", null, "component1", "host1", null);
"cluster1", null, "component2", "host1", null);
"cluster1", null, "component3", "host1", null);
"cluster1", null, "component1", "host1", null);
"cluster1", null, "component2", "host1", null);
"cluster1", null, "component3", "host1", null);
"cluster1", null, "component1", null, null);
"cluster1", null, "component2", "host2", null);
"cluster1", null, "component3", null, null);
"cluster1", null, "component1", "host1", null);
"cluster1", null, "component2", "host1", null);
"cluster1", null, "component3", "host1", null);
"cluster1", null, "component1", "host1", null);
"cluster1", null, "component2", "host2", null);
"cluster1", null, "component3", "host1", null);
"cluster1", null, "component1", null, null);
"cluster1", null, null, null, null); | 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.zookeeper.graph;
public class Log4JEntry extends LogEntry {
public Log4JEntry(long timestamp, int node, String entry) {
super(timestamp);
setAttribute("log-text", entry);
setAttribute("node", new Integer(node));
}
public String getEntry() {
return (String) getAttribute("log-text");
}
public String toString() {
return "" + getTimestamp() + "::::" + getNode() + "::::" + getEntry();
}
public int getNode() {
return (Integer) getAttribute("node");
}
public Type getType() { return LogEntry.Type.LOG4J; }
} | 0 |
@Override | 0 |
import java.net.URI;
import java.net.URISyntaxException;
public URI absolutizeURI(URI uri) throws URISyntaxException {
String mountPath =
((Configuration)this.blockConfs.get(uri.getScheme())).getChild("mount").getAttribute("path", null);
if (mountPath == null)
throw new URISyntaxException(uri.toString(), "No mount point for this URI");
if (mountPath.endsWith("/"))
mountPath = mountPath.substring(0, mountPath.length() - 1);
String absoluteURI = mountPath + uri.getSchemeSpecificPart();
getLogger().debug("Resolving " + uri.toString() + " to " + absoluteURI);
return new URI(absoluteURI);
}
| 0 |
import static org.junit.Assert.fail;
import org.apache.accumulo.server.master.state.TabletLocationState.BadLocationStateException;
import org.junit.Assert;
TabletLocationState assigned = null;
try {
assigned = new TabletLocationState(root, server, null, null, null, false);
} catch (BadLocationStateException e) {
fail("Unexpected error " + e);
}
TabletLocationState broken = null;
try {
broken = new TabletLocationState(notRoot, server, null, null, null, false);
} catch (BadLocationStateException e) {
fail("Unexpected error " + e);
} | 1 |
} catch (final IllegalArgumentException e) {
} catch (final IllegalArgumentException e) { | 0 |
import org.apache.http.protocol.HTTP;
charset = HTTP.DEFAULT_CONTENT_CHARSET;
this.contentType = HTTP.PLAIN_TEXT_TYPE + HTTP.CHARSET_PARAM + charset;
return new Header(HTTP.CONTENT_TYPE, this.contentType);
return new Header(HTTP.CONTENT_ENCODING, this.contentEncoding); | 0 |
* @author <A HREF="mailto:[email protected]">M. Dahm</A> | 0 |
for (int attempts = 0; attempts < 50 && !reloaded; attempts++)
public void testReloadDefinitionFileDefaultBuilder() | 0 |
import org.apache.beam.vendor.guava.v20_0.com.google.common.annotations.VisibleForTesting;
import org.apache.beam.vendor.guava.v20_0.com.google.common.io.ByteStreams;
import org.apache.beam.vendor.guava.v20_0.com.google.common.io.CountingOutputStream; | 0 |
private static void advanceOnce(UnboundedReader<?> reader, boolean isStarted) throws IOException {
if (!isStarted && reader.start()) {
return;
}
for (int i = 0; i < numToSkip; ++i) {
advanceOnce(reader, i > 0);
advanceOnce(reader, i > numToSkip);
for (int l = 0; l < initialNumElements; ++l) {
advanceOnce(reader, l > 0);
advanceOnce(reader, i > initialNumElements); | 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
* 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 |
/*
* Copyright 1999-2002,2004-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.cocoon.portal.event.aspect;
import java.util.Map;
import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.portal.PortalService;
import org.apache.cocoon.portal.event.EventConverter;
/**
*
* @version $Id$
*/
public interface EventAspectContext {
/**
* Invoke next aspect
*/
void invokeNext(PortalService service);
/**
* Get the {@link Parameters} of the aspect.
*/
Parameters getAspectParameters();
/**
* Get the encoder
*/
EventConverter getEventConverter();
/**
* Get the object model
*/
Map getObjectModel();
} | 0 |
ServiceRegistration dep1Reg = register(new SimpleComponent(), 0);
ServiceRegistration dep2Reg = register(new SimpleComponent2(), 1000);
dep1Reg = register(new SimpleComponent(), 0);
delay(300);
mainCompInst = main.getComponentInstance();
TestCase.assertNotNull(mainCompInst);
main.disable();
dep1Reg.unregister();
dep2Reg.unregister();
dep1Reg = register(new SimpleComponent(), 0);
dep2Reg = register(new SimpleComponent2(), 1000);
main.enable();
delay(300);
dep1Reg.unregister();
delay(100);
dep1Reg = register(new SimpleComponent(), 0);
delay(2000);
mainCompInst = main.getComponentInstance();
TestCase.assertNotNull(mainCompInst);
}
protected ServiceRegistration register(final Object service, final int delay) {
return bundleContext.registerService(service.getClass().getName(), new ServiceFactory() {
public Object getService(Bundle bundle, ServiceRegistration registration)
{
delay(delay);
return service;
}
public void ungetService(Bundle bundle, ServiceRegistration registration, Object service)
{
}
}, null); | 0 |
package org.apache.beam.sdk.coders;
import static org.apache.beam.sdk.util.Structs.addString;
import org.apache.beam.sdk.util.CloudObject;
import org.apache.beam.sdk.values.TypeDescriptor;
* {@link org.apache.beam.sdk.transforms.GroupByKey} operations. | 0 |
import java.net.URISyntaxException;
import java.security.PrivilegedActionException;
private AtlasPluginClassLoader(String pluginType, Class<?> pluginClass) throws URISyntaxException {
AtlasPluginClassLoader(String libraryPath) {
public static AtlasPluginClassLoader getInstance(final String pluginType, final Class<?> pluginClass) throws PrivilegedActionException {
me = AccessController.doPrivileged(new PrivilegedExceptionAction<AtlasPluginClassLoader>() {
public AtlasPluginClassLoader run() throws URISyntaxException {
return new AtlasPluginClassLoader(pluginType, pluginClass);
}
}); | 0 |
Path resFolder = getClassResourcesFolder(TEST_SUBFOLDER, getClass()); | 0 |
import org.apache.sshd.common.kex.AbstractKexFactoryManager;
public abstract class AbstractFactoryManager extends AbstractKexFactoryManager implements FactoryManager { | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/ExprTag.java,v 1.2 2003/01/26 03:45:09 morgand Exp $
* $Revision: 1.2 $
* $Date: 2003/01/26 03:45:09 $
* $Id: ExprTag.java,v 1.2 2003/01/26 03:45:09 morgand Exp $
import org.apache.commons.jelly.JellyTagException;
import org.jaxen.JaxenException;
import org.xml.sax.SAXException;
* @version $Revision: 1.2 $
public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException {
try {
String text = select.stringValueOf(xpathContext);
if ( text != null ) {
output.write(text);
}
}
catch (SAXException e) {
throw new JellyTagException(e);
}
catch (JaxenException e) {
throw new JellyTagException(e); | 0 |
class UngroupedShuffleReaderIterator extends LegacyReaderIterator<T> { | 0 |
@PathParam("appId") String appId) throws YarnException, IOException, InterruptedException { | 0 |
return addProvider( new FactoryCreateBuilder( keyPattern, namespaceURI, mainBinder, this, classLoader ) );
return addProvider( new ObjectCreateBuilder( keyPattern, namespaceURI, mainBinder, this, classLoader ) ); | 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.client.subsystem.sftp.extensions.openssh.impl;
import java.io.IOException;
import java.util.Map;
import org.apache.sshd.client.subsystem.sftp.RawSftpClient;
import org.apache.sshd.client.subsystem.sftp.SftpClient;
import org.apache.sshd.client.subsystem.sftp.extensions.openssh.OpenSSHStatExtensionInfo;
import org.apache.sshd.client.subsystem.sftp.extensions.openssh.OpenSSHStatPathExtension;
import org.apache.sshd.common.subsystem.sftp.extensions.openssh.StatVfsExtensionParser;
/**
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
*/
public class OpenSSHStatPathExtensionImpl extends AbstractOpenSSHStatCommandExtension implements OpenSSHStatPathExtension {
public OpenSSHStatPathExtensionImpl(SftpClient client, RawSftpClient raw, Map<String,byte[]> extensions) {
super(StatVfsExtensionParser.NAME, client, raw, extensions);
}
@Override
public OpenSSHStatExtensionInfo stat(String path) throws IOException {
return doGetStat(path);
}
} | 0 |
package org.apache.aurora.scheduler.reconciliation;
import static org.apache.aurora.scheduler.reconciliation.TaskReconciler.EXPLICIT_STAT_NAME;
import static org.apache.aurora.scheduler.reconciliation.TaskReconciler.IMPLICIT_STAT_NAME;
import static org.apache.aurora.scheduler.reconciliation.TaskReconciler.TASK_TO_PROTO;
import static org.apache.aurora.scheduler.reconciliation.TaskReconciler.TaskReconcilerSettings; | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.