Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
import org.w3c.dom.Node;
protected SVGOMLineElement() {
result = new SVGOMAnimatedLength(this, null, "x1", null);
result = new SVGOMAnimatedLength(this, null, "y1", null);
result = new SVGOMAnimatedLength(this, null, "x2", null);
result = new SVGOMAnimatedLength(this, null, "y2", null);
/**
* Returns a new uninitialized instance of this object's class.
*/
protected Node newNode() {
return new SVGOMLineElement();
} | 0 |
@Override
public String toString() {
return "AgentCommand{" +
"commandType=" + commandType +
'}';
} | 1 |
result =
_children[i] instanceof SimpleNode && ( (SimpleNode) _children[i] ).isSimpleProperty( context ); | 0 |
package org.apache.hadoop.metrics2.sink.timeline; | 0 |
throws SAXException { | 0 |
import java.sql.SQLException;
import org.apache.ambari.server.AmbariException;
import org.apache.ambari.server.H2DatabaseCleaner;
import org.junit.AfterClass;
@AfterClass
public static void after() throws AmbariException, SQLException {
H2DatabaseCleaner.clearDatabaseAndStopPersistenceService(injector);
}
| 0 |
/** @inheritDoc */ | 0 |
import org.apache.cocoon.portal.util.AbstractComponent; | 0 |
package org.apache.xml.security.stax.config; | 0 |
* @author <a href="mailto:[email protected]">Felix Project Team</a> | 0 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
if (interrupt) {
}
if (interrupt) {
}
if (interrupt) {
}
if (interrupt) {
}
if (interrupt) {
}
for (int i = 0; i <= 4; i++) {
}
for (int i = 1; i <= 4; i++) {
}
private static final Logger log = LoggerFactory.getLogger(InMemoryMapTest.class);
for (long count : counts) {
}
e.execute(() -> {
while (System.currentTimeMillis() - now < 1000) {
for (int k = 0; k < 1000; k++) {
Mutation m = new Mutation("row");
m.put("cf", "cq", new Value("v".getBytes()));
List<Mutation> mutations = Collections.singletonList(m);
imm.mutate(mutations, 1);
counts[threadId]++;
log.info("{}", | 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.predicate.operators;
import org.apache.ambari.server.controller.predicate.GreaterEqualsPredicate;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* GreaterEquals operator test.
*/
public class GreaterEqualsOperatorTest {
@Test
public void testGetName() {
assertEquals("GreaterEqualsOperator", new GreaterEqualsOperator().getName());
}
@Test
public void testToPredicate() {
assertEquals(new GreaterEqualsPredicate<String>("1", "2"),
new GreaterEqualsOperator().toPredicate("1", "2"));
}
@Test
public void testGetType() {
assertSame(Operator.TYPE.GREATER_EQUAL, new GreaterEqualsOperator().getType());
}
@Test
public void testGetBasePrecedence() {
assertEquals(-1, new GreaterEqualsOperator().getBasePrecedence());
}
@Test
public void testGetPrecedence() {
assertEquals(-1, new GreaterEqualsOperator().getPrecedence());
}
} | 0 |
/*
* (c) COPYRIGHT 1999 World Wide Web Consortium
* (Massachusetts Institute of Technology, Institut National de Recherche
* en Informatique et en Automatique, Keio University).
* All Rights Reserved. http://www.w3.org/Consortium/Legal/
*
* $Id$
*/
package org.w3c.css.sac;
/**
* @version $Revision$
* @author Philippe Le Hegaret
* @see Selector#SAC_CONDITIONAL_SELECTOR
*/
public interface ConditionalSelector extends SimpleSelector {
/**
* Returns the simple selector.
* <p>The simple selector can't be a <code>ConditionalSelector</code>.</p>
*/
public SimpleSelector getSimpleSelector();
/**
* Returns the condition to be applied on the simple selector.
*/
public Condition getCondition();
} | 1 |
/*
* Copyright 2016-2018 Seznam.cz, a.s. | 0 |
Filter maskSrc = getMaskNode().getGraphicsNodeRable(true); | 0 |
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at | 0 |
try (AccumuloClient client = this.getClient()) {
// Yes, there's a tabletserver
assertEquals(1, client.instanceOperations().getTabletServers().size());
final String tableName = getUniqueNames(1)[0];
client.tableOperations().create(tableName);
// Kill dfs
cluster.getMiniDfs().shutdown();
// ask the tserver to do something
final AtomicReference<Exception> ex = new AtomicReference<>();
Thread splitter = new Thread() {
@Override
public void run() {
try {
TreeSet<Text> splits = new TreeSet<>();
splits.add(new Text("X"));
client.tableOperations().addSplits(tableName, splits);
} catch (Exception e) {
ex.set(e);
}
};
splitter.start();
// wait for the tserver to give up on writing to the WAL
while (client.instanceOperations().getTabletServers().size() == 1) {
sleepUninterruptibly(1, TimeUnit.SECONDS); | 0 |
import java.util.Iterator;
throw new KerberosOperationException("This operation handler has not been opened");
* @param service a boolean value indicating whether the principal is to be created as a service principal or not
public Integer createPrincipal(String principal, String password, boolean service)
throw new KerberosOperationException("This operation handler has not been opened");
throw new KerberosOperationException("This operation handler has not been opened");
public boolean removePrincipal(String principal) throws KerberosOperationException {
throw new KerberosOperationException("This operation handler has not been opened");
throw new KerberosOperationException("This operation handler has not been opened");
// Build command string, replacing administrator password with "********"
StringBuilder cleanCommand = new StringBuilder();
Iterator<String> iterator = command.iterator();
if(iterator.hasNext())
cleanCommand.append(iterator.next());
while(iterator.hasNext()){
String part = iterator.next();
cleanCommand.append(' ');
if(part.contains(" ")) {
cleanCommand.append('"');
cleanCommand.append(part);
cleanCommand.append('"');
}
else {
cleanCommand.append(part);
}
if("-w".equals(part)) {
// Skip the password and use "********" instead
if(iterator.hasNext())
iterator.next();
cleanCommand.append(" ********");
}
}
String message = String.format("Failed to execute kadmin:\n\tCommand: %s\n\tExitCode: %s\n\tSTDOUT: %s\n\tSTDERR: %s",
cleanCommand.toString(), result.getExitCode(), result.getStdout(), result.getStderr()); | 0 |
import org.apache.accumulo.cloudtrace.thrift.RemoteSpan; | 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 |
static org.slf4j.Logger log =
org.slf4j.LoggerFactory.getLogger(ForbiddenAlgorithmTest.class); | 1 |
/*
* 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.template.jxtg.script.event;
import org.xml.sax.Locator;
public class EndDocument extends Event {
public EndDocument(Locator location) {
super(location);
} | 0 |
this.logger.debug("Starting SCR Descriptor Generator....");
if (this.options.getOutputDirectory() == null) {
throw new SCRDescriptorFailureException("Output directory has not been set!");
}
this.logger.debug("..using output directory: " + this.options.getOutputDirectory());
this.logger.debug("..using scr name: " + this.options.getSCRName());
this.logger.debug("..using metatype name: " + this.options.getMetaTypeName());
this.logger.debug("..strict mode: " + this.options.isStrictMode()); | 0 |
private static final String XMLDSIG_11_XMLNS | 0 |
package org.apache.felix.scr.impl.manager; | 0 |
package org.apache.commons.ognl;
import org.apache.commons.ognl.enhance.ExpressionAccessor; | 0 |
import org.apache.accumulo.harness.AccumuloClusterIT;
import org.apache.accumulo.harness.UnmanagedAccumuloIT;
*
* New tests should be written using {@link AccumuloClusterIT} or a subclass thereof. {@link UnmanagedAccumuloIT} provides the most similar semantics.
@Deprecated | 0 |
assertTrue("Skipping the Thread.join() did not work, duration="+duration, duration < 9000); | 0 |
import org.apache.ambari.server.state.UriInfo; | 0 |
import org.apache.commons.configuration.interpol.ConfigurationInterpolator;
ConfigurationInterpolator interpolator = config.getInterpolator();
getInterpolator().registerLocalLookups(interpolator);
if (parent instanceof AbstractConfiguration) {
interpolator.setParentInterpolator(((AbstractConfiguration)parent).getInterpolator());
} | 0 |
import org.apache.http.conn.HttpInetSocketAddress;
String hostname;
if (remoteAddress instanceof HttpInetSocketAddress) {
hostname = ((HttpInetSocketAddress) remoteAddress).getHost().getHostName();
} else {
hostname = remoteAddress.getHostName();
}
this.hostnameVerifier.verify(hostname, sslsock); | 0 |
log.warn("Unable to find tablets that overlap file " + mapFile.toString(), ex);
log.warn("Exception finding overlapping tablets, will retry tablet " + ke, ex);
log.error("Failed to get map files in for {}: {}", paths, e.getMessage(), e); | 0 |
public KeyExtent extent;
public long timestamp;
public String server;
public String filename;
public int tabletId;
public Collection<String> logSet;
public String toString() {
return extent.toString() + " " + filename + " (" + tabletId + ")";
}
public String getName() {
return server + "/" + filename;
}
public byte[] toBytes() throws IOException {
DataOutputBuffer out = new DataOutputBuffer();
extent.write(out);
out.writeLong(timestamp);
out.writeUTF(server);
out.writeUTF(filename);
out.write(tabletId);
out.write(logSet.size());
for (String s : logSet) {
out.writeUTF(s);
return Arrays.copyOf(out.getData(), out.getLength());
}
public void fromBytes(byte bytes[]) throws IOException {
DataInputBuffer inp = new DataInputBuffer();
inp.reset(bytes, bytes.length);
extent = new KeyExtent();
extent.readFields(inp);
timestamp = inp.readLong();
server = inp.readUTF();
filename = inp.readUTF();
tabletId = inp.read();
int count = inp.read();
ArrayList<String> logSet = new ArrayList<String>(count);
for (int i = 0; i < count; i++)
logSet.add(inp.readUTF());
this.logSet = logSet;
}
| 1 |
import org.apache.sshd.common.NamedResource;
return NamedResource.Utils.findByName(name, String.CASE_INSENSITIVE_ORDER, VALUES); | 0 |
package org.apache.accumulo.tserver.constraints; | 1 |
package org.apache.http.client.impl; | 0 |
* @return <code>true<code> if the mapped property contains a value for
* the specified key, otherwise <code>false</code>
* @return The property's value
* @return The indexed property's value
* @return The mapped property's value
*
* @return The associated DynaClass | 0 |
public void dump(final File file) throws IOException {
try (DataOutputStream dos = new DataOutputStream(new FileOutputStream(file))) { | 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.
*/
* @version CVS $Id: PageLocal.java,v 1.3 2004/03/05 13:02:46 bdelacretaz Exp $ | 1 |
* 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. | 0 |
conf.set("mapreduce.framework.name", "local"); | 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.
*/
* @version $Id: EffectPipe.java,v 1.9 2004/03/05 13:02:34 bdelacretaz Exp $ | 1 |
reportFailure(computation, work, t);
// Try again, but go to the end of the queue to avoid a tight loop.
sleep(60000);
executor.forceExecute(new Runnable() {
public void run() {
process(computation, work);
}
});
private void reportFailure(String computation, Windmill.WorkItem work, Throwable t) {
windmillServer.reportStats(Windmill.ReportStatsRequest.newBuilder()
.setComputationId(computation)
.setKey(work.getKey())
.setWorkToken(work.getWorkToken())
.addExceptions(buildExceptionReport(t))
.build()); | 0 |
UtilWaitThread.sleep(10000); | 0 |
public TabletServerBatchReader(ClientContext context, String tableId,
Authorizations authorizations, int numQueryThreads) {
queryThreadPool = new SimpleThreadPool(numQueryThreads,
"batch scanner " + batchReaderInstance + "-");
// WARNING: do not rely upon finalize to close this class. Finalize is not guaranteed to be
// called.
log.warn(TabletServerBatchReader.class.getSimpleName()
+ " not shutdown; did you forget to call close()?", ex);
return new TabletServerBatchReaderIterator(context, tableId, authorizations, ranges, numThreads,
queryThreadPool, this, timeOut); | 0 |
@Parameter(names = {"--traceid"},
description = "The hex string id of a given trace, for example 16cfbbd7beec4ae3")
public void dump(Opts opts)
throws TableNotFoundException, AccumuloException, AccumuloSecurityException {
while (!conn.securityOperations().hasTablePermission(principal, table,
TablePermission.READ)) {
public static void main(String[] args)
throws TableNotFoundException, AccumuloException, AccumuloSecurityException { | 0 |
@SuppressWarnings("all") public class LoggerStatus implements org.apache.thrift.TBase<LoggerStatus, LoggerStatus._Fields>, java.io.Serializable, Cloneable { | 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.commons.bcel6.generic;
/**
* DSUB - Substract doubles
* <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -></PRE>
* ..., result.word1, result.word2
*
* @version $Id$
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class DSUB extends ArithmeticInstruction {
private static final long serialVersionUID = -5398969227995149466L;
/** Substract doubles
*/
public DSUB() {
super(org.apache.commons.bcel6.Constants.DSUB);
}
/**
* Call corresponding visitor method(s). The order is:
* Call visitor methods of implemented interfaces first, then
* call methods according to the class hierarchy in descending order,
* i.e., the most specific visitXXX() call comes last.
*
* @param v Visitor object
*/
@Override
public void accept( Visitor v ) {
v.visitTypedInstruction(this);
v.visitStackProducer(this);
v.visitStackConsumer(this);
v.visitArithmeticInstruction(this);
v.visitDSUB(this);
}
} | 1 |
private final String namespaceURI;
// ----------------------------------------------------------- Constructors
/**
* Build a new RuleSetBase with a null namespaceURI
*/
public RuleSetBase()
{
this( null );
}
/**
* Build a new RuleSetBase with the given namespaceURI
*
* @param namespaceURI The namespace URI that all Rule instances will be associated with.
* @since 3.0
*/
public RuleSetBase( String namespaceURI )
{
this.namespaceURI = namespaceURI;
} | 0 |
this.namespaces = new ArrayList<>(1);
this.attributes = new ArrayList<>(1);
List<String> prefixes = new ArrayList<>(1);
this.prefixNsList = new ArrayList<>(1); | 0 |
.filter(
Predicates.compose(Predicates.in(Tasks.ACTIVE_STATES), IScheduledTask::getStatus));
IScheduledTask::getStatus); | 0 |
setLocation(widgetElement, actionDefinition); | 0 |
/**
* {@inheritDoc} This implementation returns keys that either match the
* prefix or start with the prefix followed by a dot ('.'). So the call
* <code>getKeys("db");</code> will find the keys <code>db</code>,
* <code>db.user</code>, or <code>db.password</code>, but not the key
* <code>dbdriver</code>.
*/ | 0 |
import org.apache.beam.sdk.io.FileSystems;
FileSystems.setDefaultConfigInWorkers(options); | 0 |
* Copyright 2016 Seznam.cz, a.s. | 0 |
public AbstractMultiworkerIOReactor(long selectTimeout, int workerCount) throws IOException {
this.ioReactors[i] = new BaseIOReactor(selectTimeout); | 0 |
import org.apache.xml.security.utils.UnsyncByteArrayOutputStream;
private UnsyncByteArrayOutputStream buf = new UnsyncByteArrayOutputStream(); | 0 |
try {
ss.close();
} catch (IOException e) {
LOG.warn("Ignoring unexpected exception during close",e);
} | 0 |
UnaryFunction<LeftT, K> leftKeyExtractor,
UnaryFunction<RightT, K> rightKeyExtractor,
UnaryFunction<LeftT, K> leftKeyExtractor, UnaryFunction<RightT, K> rightKeyExtractor) { | 0 |
public void setConfiguration(final Configuration configuration)
final boolean booleanValue = configuration.getBoolean("test.boolean");
final boolean booleanValue = configuration.getBoolean("test.boolean.missing", true);
final Boolean booleanObject = configuration.getBoolean("test.boolean.missing", new Boolean(true));
final byte testValue = 10;
final byte byteValue = configuration.getByte("test.byte");
final double testValue = 10.25;
final double doubleValue = configuration.getDouble("test.double");
final double testValue = 10.25;
final double doubleValue = configuration.getDouble("test.double.missing", 10.25);
final float testValue = (float) 20.25;
final float floatValue = configuration.getFloat("test.float");
final float testValue = (float) 20.25;
final float floatValue = configuration.getFloat("test.float.missing", testValue);
final int intValue = configuration.getInt("test.integer");
final int intValue = configuration.getInt("test.integer.missing", 10);
final long longValue = configuration.getLong("test.long");
final long longValue = configuration.getLong("test.long.missing", 1000000);
final short shortValue = configuration.getShort("test.short");
final short shortValue = configuration.getShort("test.short.missing", (short) 1);
final List<?> list = configuration.getList("missing.list");
final Configuration subset = configuration.subset("test");
final Iterator<String> it = subset.getKeys();
final String key = it.next(); | 0 |
getDummyCluster();
ServiceComponentHost sch = hdfs.getServiceComponent(DATANODE).getServiceComponentHost(DummyHostname1);
} | 0 |
/** The key for the user name in the login context. */
String LOGIN_CONTEXT_USERNAME_KEY = "name";
/** The key for the user password in the login context. */
String LOGIN_CONTEXT_PASSWORD_KEY = "password"; | 0 |
handler.getSessionHandler().getSessionCookieConfig().setHttpOnly(true); | 0 |
import org.apache.sshd.common.SshdSocketAddress;
return SshdSocketAddress.LOCALHOST_NAME + ":" + displayNumber + "." + screen; | 0 |
if (closed.get()) {
break;
}
LOG.warn("{}: exception while fetching latest offset for partition {}. will be retried.",
this, p.topicPartition, e); | 0 |
* @version $Id: Soundex.java,v 1.9 2003/10/12 19:48:15 tobrien Exp $
while ((incount < str.length()) && (mapped = getMappingCode(str.charAt(incount++))) != 0 && (count < maxLength)) {
throw new EncoderException("Parameter supplied to Soundex encode is not of type java.lang.String"); | 0 |
public class ServletFileUploadTest extends FileUploadTestCase
/**
* Test for <a href="http://issues.apache.org/jira/browse/FILEUPLOAD-62">FILEUPLOAD</a>
*/
public void testFILEUPLOAD62() throws Exception {
final String contentType = "multipart/form-data; boundary=AaB03x";
final String request =
"--AaB03x\r\n" +
"content-disposition: form-data; name=\"field1\"\r\n" +
"\r\n" +
"Joe Blow\r\n" +
"--AaB03x\r\n" +
"content-disposition: form-data; name=\"pics\"\r\n" +
"Content-type: multipart/mixed; boundary=BbC04y\r\n" +
"\r\n" +
"--BbC04y\r\n" +
"Content-disposition: attachment; filename=\"file1.txt\"\r\n" +
"Content-Type: text/plain\r\n" +
"\r\n" +
"... contents of file1.txt ...\r\n" +
"--BbC04y\r\n" +
"Content-disposition: attachment; filename=\"file2.gif\"\r\n" +
"Content-type: image/gif\r\n" +
"Content-Transfer-Encoding: binary\r\n" +
"\r\n" +
"...contents of file2.gif...\r\n" +
"--BbC04y--\r\n" +
"--AaB03x--";
List fileItems = parseUpload(request.getBytes("US-ASCII"), contentType);
assertEquals(3, fileItems.size());
FileItem item0 = (FileItem) fileItems.get(0);
assertEquals("field1", item0.getFieldName());
assertNull(item0.getName());
assertEquals("Joe Blow", new String(item0.get()));
FileItem item1 = (FileItem) fileItems.get(1);
assertEquals("pics", item1.getFieldName());
assertEquals("file1.txt", item1.getName());
assertEquals("... contents of file1.txt ...", new String(item1.get()));
FileItem item2 = (FileItem) fileItems.get(2);
assertEquals("pics", item2.getFieldName());
assertEquals("file2.gif", item2.getName());
assertEquals("...contents of file2.gif...", new String(item2.get())); | 0 |
//noinspection UnnecessaryReturnStatement | 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 |
this.charset = Charset.forName(HttpProtocolParams.getHttpElementCharset(params)); | 0 |
import org.apache.hc.core5.http.HttpEntity;
import org.apache.hc.core5.http.entity.ContentType;
import org.apache.hc.core5.http.entity.EntityUtils;
Assert.assertEquals("text/plain; charset=ISO-8859-1", entity.getContentType());
Assert.assertEquals("application/octet-stream", entity.getContentType());
Assert.assertEquals("application/octet-stream", entity.getContentType());
Assert.assertEquals("application/octet-stream", entity.getContentType());
Assert.assertEquals("application/octet-stream", entity.getContentType());
Assert.assertEquals("application/json; charset=UTF-8", entity.getContentType());
Assert.assertEquals("identity", entity.getContentEncoding());
Assert.assertEquals("text/plain; charset=ISO-8859-1", entity.getContentType());
Assert.assertEquals("gzip", entity.getContentEncoding()); | 0 |
import java.util.List;
/**
* Homogeneously typed test value for ease of use with the wire format test utility.
*/
private static final Coder<KV<String, Integer>> TEST_CODER =
KvCoder.of(StringUtf8Coder.of(), VarIntCoder.of());
private static final List<KV<String, Integer>> TEST_VALUES = Arrays.asList(
KV.of("", -1),
KV.of("hello", 0),
KV.of("goodbye", Integer.MAX_VALUE));
/**
* Generated data to check that the wire format has not changed. To regenerate, see
* {@link com.google.cloud.dataflow.sdk.coders.PrintBase64Encodings}.
*/
private static final List<String> TEST_ENCODINGS = Arrays.asList(
"AP____8P",
"BWhlbGxvAA",
"B2dvb2RieWX_____Bw");
@Test
public void testWireFormatEncode() throws Exception {
CoderProperties.coderEncodesBase64(TEST_CODER, TEST_VALUES, TEST_ENCODINGS);
} | 0 |
SVGDescriptor toSVG(GraphicContext gc);
List getDefinitionSet(); | 0 |
* @version $Id$ | 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.hive20.internal.dto;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
/**
* DTO object to store the Table information
*/
public class TableInfo {
private String name;
private String type;
public TableInfo(String name, String type) {
this.name = name;
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TableInfo info = (TableInfo) o;
return new EqualsBuilder()
.append(getName(), info.getName())
.isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37)
.append(getName())
.toHashCode();
}
@Override
public String toString() {
return "TableInfo{" +
"name='" + name + '\'' +
", type='" + type + '\'' +
'}';
}
} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//io/src/test/org/apache/commons/io/FileUtilsTestCase.java,v 1.7 2003/11/22 21:06:41 jeremias Exp $
* $Revision: 1.7 $
* $Date: 2003/11/22 21:06:41 $
* @version $Id: FileUtilsTestCase.java,v 1.7 2003/11/22 21:06:41 jeremias Exp $
try {
FileUtils.contentEquals(getTestDirectory(), getTestDirectory());
fail("Comparing directories should fail with an IOException");
} catch (IOException ioe) {
//expected
} | 0 |
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value");
BasicCookie cookie = new BasicCookie("name", "value"); | 0 |
import org.apache.beam.dsls.sql.schema.BeamSqlRowType;
BeamSqlRowType beamSQLRowType = CalciteUtils.toBeamRowType(this.getRowType());
BeamSqlRow row = new BeamSqlRow(beamSQLRowType);
.setCoder(new BeamSqlRowCoder(beamSQLRowType)); | 0 |
* @param entityManagerProvider
* @param roleCommandOrderProvider
HostRoleCommandDAO hostRoleCommandDAO, HostRoleCommandFactory hostRoleCommandFactory,
RoleCommandOrderProvider roleCommandOrderProvider) {
this.roleCommandOrderProvider = roleCommandOrderProvider;
* Unit Test Constructor.
*
* @param sleepTimeMilliSec
* @param actionTimeoutMilliSec
* @param db
* @param actionQueue
* @param fsmObject
* @param maxAttempts
* @param hostsMap
* @param unitOfWork
* @param ambariEventPublisher
* @param configuration
* @param hostRoleCommandDAO
* @param hostRoleCommandFactory
*/
protected ActionScheduler(long sleepTimeMilliSec, long actionTimeoutMilliSec, ActionDBAccessor db,
ActionQueue actionQueue, Clusters fsmObject, int maxAttempts, HostsMap hostsMap,
UnitOfWork unitOfWork, AmbariEventPublisher ambariEventPublisher,
Configuration configuration, Provider<EntityManager> entityManagerProvider,
HostRoleCommandDAO hostRoleCommandDAO, HostRoleCommandFactory hostRoleCommandFactory) {
this(sleepTimeMilliSec, actionTimeoutMilliSec, db, actionQueue, fsmObject, maxAttempts, hostsMap, unitOfWork,
ambariEventPublisher, configuration, entityManagerProvider, hostRoleCommandDAO, hostRoleCommandFactory,
null);
}
/**
RoleCommandPair roleCommand = new
RoleCommandPair(Role.valueOf(command.getRole()), command.getRoleCommand());
Set<RoleCommandPair> roleCommandDependencies = rco.getDependencies().get(roleCommand);
// remove eventual references to the same RoleCommand
roleCommandDependencies.remove(roleCommand); | 0 |
import org.apache.accumulo.core.client.ClientInfo;
* <li>{@link AccumuloOutputFormat#setClientInfo(JobConf, ClientInfo)}
public static void setClientInfo(JobConf job, ClientInfo info) {
ClientInfo outInfo = OutputConfigurator.updateToken(job.getCredentials(), info);
OutputConfigurator.setClientInfo(CLASS, job, outInfo);
* @deprecated since 2.0.0, use {@link #setClientInfo(JobConf, ClientInfo)} instead.
* @deprecated since 2.0.0, use {@link #setClientInfo(JobConf, ClientInfo)} instead
* @deprecated since 2.0.0; Use {@link #setClientInfo(JobConf, ClientInfo)} instead. | 0 |
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument; | 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 Boolean(proxy == args[0]); | 0 |
@SuppressWarnings("deprecation")
private static org.apache.accumulo.core.client.ClientConfiguration.ClientProperty INSTANCE_ID = org.apache.accumulo.core.client.ClientConfiguration.ClientProperty.INSTANCE_ID;
@SuppressWarnings("deprecation")
private static org.apache.accumulo.core.client.ClientConfiguration.ClientProperty INSTANCE_NAME = org.apache.accumulo.core.client.ClientConfiguration.ClientProperty.INSTANCE_NAME;
@SuppressWarnings("deprecation")
private static org.apache.accumulo.core.client.ClientConfiguration.ClientProperty INSTANCE_ZK_HOST = org.apache.accumulo.core.client.ClientConfiguration.ClientProperty.INSTANCE_ZK_HOST;
@SuppressWarnings("deprecation")
private static org.apache.accumulo.core.client.ClientConfiguration.ClientProperty INSTANCE_ZK_TIMEOUT = org.apache.accumulo.core.client.ClientConfiguration.ClientProperty.INSTANCE_ZK_TIMEOUT;
@SuppressWarnings("deprecation")
private void mockIdConstruction(ClientConfiguration config) {
expect(config.get(INSTANCE_ID)).andReturn(IID_STRING);
expect(config.get(INSTANCE_NAME)).andReturn(null);
expect(config.get(INSTANCE_ZK_HOST)).andReturn("zk1");
expect(config.get(INSTANCE_ZK_TIMEOUT)).andReturn("30");
@SuppressWarnings("deprecation")
private void mockNameConstruction(ClientConfiguration config) {
expect(config.get(INSTANCE_ID)).andReturn(null);
expect(config.get(INSTANCE_NAME)).andReturn("instance");
expect(config.get(INSTANCE_ZK_HOST)).andReturn("zk1");
expect(config.get(INSTANCE_ZK_TIMEOUT)).andReturn("30");
@SuppressWarnings("deprecation")
expect(config.get(INSTANCE_ID)).andReturn(IID_STRING);
@SuppressWarnings("deprecation")
expect(config.get(INSTANCE_ID)).andReturn(null);
expect(config.get(INSTANCE_NAME)).andReturn(null);
expect(config.get(INSTANCE_ZK_HOST)).andReturn("zk1");
expect(config.get(INSTANCE_ZK_TIMEOUT)).andReturn("30"); | 0 |
* Represents an HTTP version. HTTP uses a "major.minor" numbering
* scheme to indicate versions of the protocol.
*
public static final HttpVersion HTTP_0_9 = new HttpVersion(0, 9);
public static final HttpVersion HTTP_1_0 = new HttpVersion(1, 0);
public static final HttpVersion HTTP_1_1 = new HttpVersion(1, 1);
* | 0 |
* @version $Id$
public void removeSelectionList(); | 0 |
beginRead(false);
beginWrite(false);
beginRead(false);
beginWrite(false);
beginRead(false);
beginWrite(false); | 0 |
AssertionError exc = assertionShouldFail(() ->
assertThat(KV.of(1, 2), SerializableMatchers.kv(not(anything()), anything())));
assertThat(exc.getMessage(), Matchers.containsString("key did not match"));
AssertionError exc = assertionShouldFail(() ->
assertThat(KV.of(1, 2), SerializableMatchers.kv(anything(), not(anything()))));
assertThat(exc.getMessage(), Matchers.containsString("value did not match"));
AssertionError exc = assertionShouldFail(() ->
assertThat(
KV.of("key", ImmutableList.of(1, 2, 3)),
SerializableMatchers.<String, Iterable<Integer>>kv(
anything(), containsInAnyOrder(1, 2, 3, 4))));
assertThat(exc.getMessage(), Matchers.containsString("value did not match"));
}
private static AssertionError assertionShouldFail(Runnable runnable) {
runnable.run();
} catch (AssertionError expected) {
return expected;
throw new AssertionError("Should have failed."); | 0 |
import static org.junit.Assert.assertEquals;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.UriInfo;
import org.apache.ambari.server.api.resources.ResourceInstance;
import org.apache.ambari.server.api.services.parsers.RequestBodyParser;
import org.apache.ambari.server.api.services.serializers.ResultSerializer; | 0 |
private final Object lock = new Object();
this.p = ValidateUtils.checkNotNull(p, "No target path", GenericUtils.EMPTY_OBJECT_ARRAY);
SftpFileSystem fs=p.getFileSystem();
sftp = fs.getClient(); | 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.
*/
private String dataLogDir;
this.dataLogDir=dataLogDir; | 0 |
/**
* {@link Operator} that serves as a wrapper between a {@link PCollection} and {@link Dataset}.
*/ | 0 |
import org.apache.cocoon.util.log.Log4JConfigurator;
import org.apache.log4j.LogManager;
* @version CVS $Id: CocoonServlet.java,v 1.30 2004/06/11 20:29:29 cziegeler Exp $
// let's configure log4j
final String log4jConfig = getInitParameter("log4j-config", null);
if ( log4jConfig != null ) {
final Log4JConfigurator configurator = new Log4JConfigurator(subcontext);
// test if this is a qualified url
InputStream is = null;
if ( log4jConfig.indexOf(':') == -1) {
is = this.servletContext.getResourceAsStream(log4jConfig);
if (is == null) is = new FileInputStream(log4jConfig);
} else {
final URL log4jURL = new URL(log4jConfig);
is = log4jURL.openStream();
}
configurator.doConfigure(is, LogManager.getLoggerRepository());
}
| 0 |
List<ServiceTestInvocation> listInvocations = new ArrayList<>();
Map<String, Object> mapRootProps = new LinkedHashMap<>();
Map<String, Object> mapCategoryProps = new LinkedHashMap<>();
HashMap<String, Object> mapRootProps = new HashMap<>();
HashMap<String, Object> mapCategoryProps = new HashMap<>();
Map<String, Map<String, Object>> propertyMap = new HashMap<>(); | 1 |
protected static class TextDecoration { | 0 |
public class TestNIOConnPool {
static class LocalSessionPool extends AbstractNIOConnPool<String, LocalPoolEntry> { | 0 |
Document doc = XMLUtils.parse(inputSource, false, secureValidation);
(Element) contextDocument.importNode(doc.getDocumentElement(), true); | 0 |
* Represents a callback(Service, ServiceReference) that is invoked on a Component implementation class.
public interface CbServiceRef<T, S> extends SerializableLambda {
* @param service first callback arg
* @param ref second callback arg
void accept(T instance, S service, ServiceReference<S> ref);
default CbServiceRef<T, S> andThen(CbServiceRef<? super T, S> after) {
return (T instance, S service, ServiceReference<S> ref) -> {
accept(instance, service, ref);
after.accept(instance, service, ref); | 0 |
Comparator<Cookie> comparator = new CookiePathComparator();
Comparator<Cookie> comparator = new CookiePathComparator();
Comparator<Cookie> comparator = new CookiePathComparator();
Comparator<Cookie> comparator = new CookiePathComparator();
Comparator<Cookie> comparator = new CookiePathComparator();
Comparator<Cookie> comparator = new CookiePathComparator(); | 0 |
* @version SVN $Id: JXTGStringTemplateParser.java 325986 2005-10-17 21:35:18Z
* lgawron $
if (buf.length() > 0)
substitutions.add(new Literal(buf.toString())); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.