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.
*/
package org.apache.felix.ipojo.test.scenarios.component;
import java.util.Properties;
import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
public class NullableFooProvider implements FooService {
public boolean foo() {
return false;
}
public Properties fooProps() {
return null;
}
public boolean getBoolean() {
return false;
}
public double getDouble() {
return -1;
}
public int getInt() {
return -1;
}
public long getLong() {
return -1;
}
public Boolean getObject() {
return null;
}
} | 0 |
*
* @param maxConnLifetimeMillis
* The maximum lifetime in milliseconds.
* The disconnection SQL codes.
* @see #getDisconnectionSqlCodes() | 0 |
CounterSet.AddCounterMutator addCounterMutator,
StateSampler stateSampler)
executionContext, addCounterMutator, stateSampler);
addCounterMutator,
stateSampler);
CounterSet.AddCounterMutator addCounterMutator,
StateSampler stateSampler) {
addCounterMutator,
stateSampler); | 0 |
package com.google.cloud.dataflow.examples.complete; | 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 |
protected Class<?> getDefaultType() {
protected <T> T convertToType(Class<T> type, Object value) throws Throwable {
// We have to support Object, too, because this class is sometimes
// used for a standard to Object conversion
if (String.class.equals(type) || Object.class.equals(type)) {
return type.cast(value.toString());
}
throw conversionException(type, value); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/iterators/ArrayIterator.java,v 1.7 2003/11/14 22:58:27 scolebourne Exp $
* @version $Revision: 1.7 $ $Date: 2003/11/14 22:58:27 $
public class ArrayIterator implements ResettableIterator { | 0 |
final ServletDTO dto = build(handler.getServletInfo(), reason);
public static ServletDTO build(final ServletInfo info, final int reason)
final ServletDTO dto = (reason != -1 ? new FailedServletDTO() : new ServletDTO());
if ( reason != -1 )
{
((FailedServletDTO)dto).failureReason = reason;
}
| 0 |
package org.apache.commons.configuration;
* @version $Id: BasePropertiesConfiguration.java,v 1.10 2004/06/15 11:49:25 ebourg Exp $
throw new ConfigurationRuntimeException("Unable to parse unicode value: " + unicode, nfe); | 0 |
import java.util.Properties;
import org.apache.commons.configuration.MapConfiguration;
// Interpolated items need to be careful, as JVM properties could be updates and we may want that propogated when those changes occur.
// Currently only VFS_CLASSLOADER_CACHE_DIR, which isn't ZK mutable, is interpolated, so this shouldn't be an issue as java.io.tmpdir
// also shouldn't be changing.
Properties systemProperties = System.getProperties();
synchronized (systemProperties) {
pconf.append(new MapConfiguration(systemProperties));
} | 0 |
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.apache.accumulo.core.util.ContextFactory;
ctx = ContextFactory.createTaskAttemptContext(conf);
WikipediaInputSplit split = new WikipediaInputSplit(new FileSplit(p, 0, f.length(), null), 0);
WikipediaInputSplit split = new WikipediaInputSplit(new FileSplit(p, 0, f.length(), null), 0);
WikipediaInputSplit split = new WikipediaInputSplit(new FileSplit(p, 0, f.length(), null), 0);
WikipediaInputSplit split = new WikipediaInputSplit(new FileSplit(p, 0, f.length(), null), 0);
WikipediaInputSplit split = new WikipediaInputSplit(new FileSplit(p, 0, f.length(), null), 0);
WikipediaInputSplit split = new WikipediaInputSplit(new FileSplit(p, 0, f.length(), null), 0);
WikipediaInputSplit split = new WikipediaInputSplit(new FileSplit(p, 0, f.length(), null), 0); | 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 | 1 |
import org.apache.http.impl.nio.DefaultServerIOEventDispatch;
import org.apache.http.nio.NHttpServiceHandler;
private void execute(final NHttpServiceHandler serviceHandler) throws IOException {
IOEventDispatch ioEventDispatch = new DefaultServerIOEventDispatch(
serviceHandler,
this.params);
public void start(final NHttpServiceHandler serviceHandler) {
this.thread = new IOReactorThread(serviceHandler);
private final NHttpServiceHandler serviceHandler;
public IOReactorThread(final NHttpServiceHandler serviceHandler) {
this.serviceHandler = serviceHandler;
execute(this.serviceHandler); | 0 |
public class HttpAssets {
GuicedProcess.registerHttpAsset(binder, "/js/mootools-core.js", HttpAssets.class,
GuicedProcess.registerHttpAsset(binder, "/js/mootools-more.js", HttpAssets.class,
GuicedProcess.registerHttpAsset(binder, "/js/tit.js", HttpAssets.class,
GuicedProcess.registerHttpAsset(binder, "/css/global.css", HttpAssets.class,
private HttpAssets() { | 0 |
private static final long serialVersionUID = -8536341322669578097L;
| 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;
/**
* Marker interface for portal event.
*
* @version $Id$
*/
public interface ConvertableEvent extends Event {
/**
* Return the event data as a String.
* If for any reason, the event is not convertable it can return null instead.
* @return The event data as a String or null.
*/
String asString();
} | 0 |
List<Task> realTasks = new ArrayList<>();
Set<String> hosts = new HashSet<>(); | 1 |
public final void setProperty(String key, Object value)
setPropertyInternal(key, value);
* Actually sets the value of a property. This method is called by
* {@code setProperty()}. It provides a default implementation of this
* functionality by clearing the specified key and delegating to
* {@code addProperty()}. Subclasses should override this method if they can
* provide a more efficient algorithm for setting a property value.
*
* @param key the property key
* @param value the new property value
* @since 2.0
*/
protected void setPropertyInternal(String key, Object value)
{
setDetailEvents(false);
try
{
clearProperty(key);
addProperty(key, value);
}
finally
{
setDetailEvents(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
*
* 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.hive.utils;
public class HiveClientFormattedException extends ServiceFormattedException {
public HiveClientFormattedException(Throwable exception) {
super(exception.getMessage(), exception);
}
} | 0 |
String uri = "caching:http://slashdot.org/?cocoon:cache-expires=1";
// Source is cached -- same meta data
assertSame(meta1, meta2);
// Source is still cached -- still same meta data
assertSame(meta1, meta3);
// Source is refreshed -- but meta data should not change
assertNotSame(meta1, meta4);
assertEquals(meta1.getContentLength(), meta4.getContentLength());
testRefreshURI("caching", "http://slashdot.org/");
// testRefreshURI("async-caching", "http://slashdot.org/");
assertSame(meta1, meta2);
assertEquals(meta1.getContentLength(), meta2.getContentLength());
assertEquals(meta1.getLastModified(), meta2.getLastModified());
assertNotSame(meta1, meta3);
assertEquals(meta1.getContentLength(), meta3.getContentLength()); | 0 |
private char[] array;
this.array = new char[capacity];
final char[] newArray = new char[Math.max(this.array.length << 1, newlen)];
System.arraycopy(this.array, 0, newArray, 0, this.len);
this.array = newArray;
if (newlen > this.array.length) {
System.arraycopy(b, off, this.array, this.len, len);
if (newlen > this.array.length) {
s.getChars(0, strlen, this.array, this.len);
append(b.array, off, len);
append(b.array,0, b.len);
if (newlen > this.array.length) {
this.array[this.len] = ch;
if (newlen > this.array.length) {
this.array[i2] = (char) (b[i1] & 0xff);
append(b.array(), off, len);
System.arraycopy(this.array, 0, b, 0, this.len);
return this.array[i];
public char[] array() {
return this.array;
return this.array.length;
final int available = this.array.length - this.len;
if (len < 0 || len > this.array.length) {
throw new IndexOutOfBoundsException("len: "+len+" < 0 or > buffer len: "+this.array.length);
return this.len == this.array.length;
if (this.array[i] == ch) {
return new String(this.array, beginIndex, endIndex - beginIndex);
while (beginIndex0 < endIndex && isWhitespace(this.array[beginIndex0])) {
while (endIndex0 > beginIndex0 && isWhitespace(this.array[endIndex0 - 1])) {
return new String(this.array, beginIndex0, endIndex0 - beginIndex0);
return CharBuffer.wrap(this.array, beginIndex, endIndex);
return new String(this.array, 0, this.len); | 0 |
"\t-L - use lenient future dates (server dates may be up to 1 day into future)\n" +
boolean lenient = false;
else if (args[base].equals("-L")) {
lenient = true;
}
if (lenient) {
FTPClientConfig config = new FTPClientConfig();
config.setLenientFutureDates(true);
ftp.configure(config );
}
| 0 |
* Get the custom {@link org.apache.cocoon.portal.om.Renderer} for this layout. | 0 |
/** Parse Javadocs? */
protected final boolean parseJavadocs;
/** Process Annotations? */
protected final boolean processAnnotations;
* @param excludeString The exclude information for sources
* @param parseJavadocs Should the javadocs be parsed?
* @param processAnnotations Should the annotations be processed?
final String[] annotationTagProviders,
final String excludeString,
final boolean parseJavadocs,
final boolean processAnnotations)
this.processAnnotations = processAnnotations;
this.parseJavadocs = parseJavadocs;
descs[i] = this.getJavaClassDescription(className);
if (this.processAnnotations && getAnnotationTagProviderManager().hasScrPluginAnnotation(clazz)) {
} else if ( this.parseJavadocs ) { | 0 |
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.svggen.font.table;
import java.io.*;
/**
*
* @author <a href="mailto:david@steadystate.co.uk">David Schweinsberg</a>
* @version $Id$
*/
public class CoverageFormat1 extends Coverage {
private int glyphCount;
private int[] glyphIds;
/** Creates new CoverageFormat1 */
protected CoverageFormat1(RandomAccessFile raf) throws IOException {
glyphCount = raf.readUnsignedShort();
glyphIds = new int[glyphCount];
for (int i = 0; i < glyphCount; i++) {
glyphIds[i] = raf.readUnsignedShort();
}
}
public int getFormat() {
return 1;
}
public int findGlyph(int glyphId) {
for (int i = 0; i < glyphCount; i++) {
if (glyphIds[i] == glyphId) {
return i;
}
}
return -1;
}
} | 0 |
* @version CVS $Id: Form.java,v 1.13 2003/12/29 17:52:12 stefano Exp $ | 0 |
* @version $Revision: 1.51 $ $Date: 2004/12/19 16:56:30 $
/**
* Returns an unmodifiable copy of the map.
*/
public static Map unmodifiableMapCopy(Map map) {
if (map == null) throw new IllegalArgumentException("null not permitted.");
Map copy = new HashMap(map.size(), 1.0f);
copy.putAll(map);
return MapUtils.unmodifiableMap(copy);
} | 0 |
import org.apache.hc.core5.http2.HttpVersionPolicy;
final MinimalHttpAsyncClient client = HttpAsyncClients.createMinimal(
HttpVersionPolicy.FORCE_HTTP_2, H2Config.DEFAULT, null, ioReactorConfig); | 0 |
HDFSFileSource.from(
file.toString(), SequenceFileInputFormat.class, IntWritable.class, Text.class);
assertEquals(file.length(), source.getEstimatedSizeBytes(null));
assertThat(expectedResults, containsInAnyOrder(readFromSource(source, options).toArray()));
}
@Test
public void testFullyReadSingleFileWithSpaces() throws Exception {
PipelineOptions options = PipelineOptionsFactory.create();
List<KV<IntWritable, Text>> expectedResults = createRandomRecords(3, 10, 0);
File file = createFileWithData("tmp data.seq", expectedResults);
HDFSFileSource<KV<IntWritable, Text>, IntWritable, Text> source =
HDFSFileSource.from(
file.toString(), SequenceFileInputFormat.class, IntWritable.class, Text.class); | 0 |
/**
* 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 static com.google.common.base.Preconditions.checkState;
checkState(uses.size() > 0, "Unknown transform: " + transform);
checkState(uses.size() <= 1, "Transform used multiple times: " + transform); | 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.collect.ImmutableMap; | 0 |
public Attribute copy(ConstantPool _constant_pool) {
c.constant_pool = _constant_pool; | 0 |
* @version $Revision$, $Date$
public class OptionGroup implements Serializable
{
* Set the selected option of this group to <code>name</code>.
*
if (selected == null || selected.equals(option.getOpt()))
selected = option.getOpt();
return required;
* Returns the stringified version of this OptionGroup.
* | 0 |
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.IteratorSetting.Column;
IteratorSetting cfg = new IteratorSetting(50, StatusCombiner.class);
Combiner.setColumns(cfg, Collections.singletonList(new Column(StatusSection.NAME)));
combiner.init(new DevNull(), cfg.getOptions(), new IteratorEnvironment() { | 0 |
@Transactional
public void removeAllByGroup(Long groupId) {
TypedQuery<Long> query = entityManagerProvider.get().createQuery
("DELETE FROM ConfigGroupConfigMappingEntity configs WHERE configs" +
".configGroupId = ?1", Long.class);
daoUtils.executeUpdate(query, groupId);
entityManagerProvider.get().flush();
} | 0 |
* @version $Id$
public class ComparableComparatorTest extends AbstractComparatorTest<Integer> {
public ComparableComparatorTest(String testName) { | 0 |
public static void main(String[] args) throws Exception {
HttpHost target = new HttpHost("jakarta.apache.org", 80, "http");
// some general setup
SchemeRegistry supportedSchemes = new SchemeRegistry();
// one operator can be used for many connections
ClientConnectionOperator scop = new DefaultClientConnectionOperator(supportedSchemes);
HttpRequest req = new BasicHttpRequest("OPTIONS", "*", HttpVersion.HTTP_1_1);
HttpContext ctx = new BasicHttpContext();
OperatedClientConnection conn = scop.createConnection();
try {
System.out.println("opening connection to " + target);
scop.openConnection(conn, target, null, ctx, params);
System.out.println("sending request");
conn.sendRequestHeader(req);
// there is no request entity
conn.flush();
System.out.println("receiving response header");
HttpResponse rsp = conn.receiveResponseHeader();
System.out.println("----------------------------------------");
System.out.println(rsp.getStatusLine());
Header[] headers = rsp.getAllHeaders();
for (int i = 0; i < headers.length; i++) {
System.out.println(headers[i]);
}
System.out.println("----------------------------------------");
} finally {
System.out.println("closing connection");
conn.close();
}
} | 0 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(JobUpdateControllerImpl.class);
LOG.debug(
"Job update {} has been pulsed. Timeout of {} msec is reset.",
state.getPulseTimeoutMs());
LOG.error("Error while processing job update pulse: " + e);
LOG.error("Update " + key + " does not have a lock");
LOG.info("Update {} is now in state {}", key, status);
LOG.warn("Uncaught exception: " + e, e);
LOG.info("Coordinated update {} pulse expired: {}", key, result);
LOG.info("Suppressing duplicate update {} for instance {}.", action, instanceId); | 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
* 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 |
Assert.assertEquals(zookeepers, info.getZooKeepers()); | 0 |
BatchModeExecutionContext context = BatchModeExecutionContext.fromOptions(options);
BatchModeExecutionContext context =
BatchModeExecutionContext.fromOptions(options); | 0 |
import org.apache.beam.fn.harness.data.PCollectionConsumerRegistry;
PCollectionConsumerRegistry pCollectionConsumerRegistry,
pCollectionConsumerRegistry.register(
| 0 |
/*
* Copyright 2000-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.bcel.generic;
| 0 |
@Override | 0 |
* @version CVS $Id$
* @param interpreterId id of interpreter invoking continuation creation
String interpreterId,
* @param interpreterId Id of an interpreter that queries for
* the continuation
*
* @return a <code>WebContinuation</code> object, null if no such
* <code>WebContinuation</code> could be found. Also null if
* <code>WebContinuation</code> was found but interpreter id does
* not match the one that the continuation was initialy created for.
public WebContinuation lookupWebContinuation(String id, String interpreterId); | 0 |
@Override | 0 |
* Displays a message in the User Agent interface.
*/
public void displayMessage(String message) {
statusBar.setMainMessage(message);
}
/**
* Informs the user agent to change the cursor.
* @param cursor the new cursor
*/
public void setSVGCursor(Cursor cursor) {
canvas.setCursor(cursor);
}
/** | 0 |
import org.apache.felix.ipojo.util.SecurityHelper;
// Security Check
if (SecurityHelper.hasPermissionToRegisterService(ManagedService.class.getName(),
getInstanceManager().getContext())) {
m_sr = getInstanceManager().getContext().registerService(ManagedService.class.getName(), this, props);
} else {
error("Cannot register the ManagedService - The bundle "
+ getInstanceManager().getContext().getBundle().getBundleId()
+ " does not have the permission to register the service");
} | 0 |
import org.apache.cocoon.acting.ServiceableAction;
* @version CVS $Id: LogoutAction.java,v 1.5 2003/10/15 20:47:14 cziegeler Exp $
extends ServiceableAction
this.manager.release( authManager ); | 0 |
import org.junit.Assert; | 0 |
Configuration classPathConfig = null;
if ( componentConfig != null ) {
// before we pass the configuration we have to strip the
// additional configuration parts, like classpath as these
// are not configurations for the component container
final DefaultConfiguration c = new DefaultConfiguration(componentConfig.getName(),
componentConfig.getLocation(),
componentConfig.getNamespace(),
"");
c.addAll(componentConfig);
classPathConfig = c.getChild("classpath", false);
if ( classPathConfig != null ) {
c.removeChild(classPathConfig);
}
componentConfig = c;
}
// Create class loader
this.itsClassLoader = factory.createClassLoader(itsContext, classPathConfig);
this.itsBeanFactory = factory.createBeanFactory(this.itsClassLoader, this.getLogger(), componentConfig, itsContext, this.processor.getSourceResolver(), settings); | 0 |
* @version CVS $Id: SessionContextProviderImpl.java,v 1.6 2004/01/09 11:20:23 cziegeler Exp $
manager.release( (Component)portal); | 0 |
package cz.seznam.euphoria.core.client.operator;
import cz.seznam.euphoria.core.client.functional.UnaryFunction;
import java.util.Objects;
/**
* Class to be extended by operator builders that want to make use
* of `applyIf` call.
* @param BUILDER the class of the builder that extends this class
*/
public abstract class OptionalMethodBuilder<BUILDER> {
@SuppressWarnings("unchecked")
public BUILDER applyIf(boolean cond, UnaryFunction<BUILDER, BUILDER> apply) {
Objects.requireNonNull(apply);
return cond ? apply.apply((BUILDER) this) : (BUILDER) this;
}
} | 0 |
* @version $Revision$ | 0 |
/* ====================================================================
* Copyright (c) 2002-2004 The Apache Software Foundation. All rights
* @version $Revision: 1.8 $ $Date: 2004/01/14 21:43:04 $ | 0 |
* An {@code ExternalIterable}, that is stored in memory. Use this class with care, because it might
* cause OOME or other performance issues. | 0 |
import static org.junit.Assert.assertFalse;
public static int countRFiles(Connector c, String tableName) throws Exception {
Scanner scanner = c.createScanner(MetadataTable.NAME, Authorizations.EMPTY);
String tableId = c.tableOperations().tableIdMap().get(tableName);
scanner.setRange(MetadataSchema.TabletsSection.getRange(tableId));
scanner.fetchColumnFamily(MetadataSchema.TabletsSection.DataFileColumnFamily.NAME);
return count(scanner);
}
| 1 |
}}, new HashMap<String, Map<String, String>>());
Config config3 = cf.createNew(cluster, "yarn-site",
new HashMap<String, String>() {{
put("test.password", "supersecret");
}}, new HashMap<String, Map<String,String>>());
config3.setTag("version1");
cluster.addConfig(config3);
put("pwd", "SECRET:yarn-site:1:test.password");
Assert.assertTrue(commandParametersStage.containsKey("pwd"));
Assert.assertEquals(commandParametersStage.get("pwd"), "supersecret");
Assert.assertTrue(commandParametersStage.containsKey("pwd"));
Assert.assertEquals(commandParametersStage.get("pwd"), "supersecret");
put("test.password", "SECRET:hdfs-site:1:test.password");
put("test.password", "SECRET:hdfs-site:666:test.password");
put("test.password", "SECRET:hdfs-site:4:test.password");
assertEquals("Error when parsing secret reference. Cluster: foo1 ConfigType: hdfs-site ConfigVersion: 4 does not contain property 'test.password'",
String secretName = "SECRET:hdfs-site:"+resp.getVersion().toString()+":test.password"; | 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 |
public interface MissingGetter extends PipelineOptions {
public interface MissingMultipleGetters extends MissingGetter {
public interface MissingSetter extends PipelineOptions {
public interface MissingMultipleSetters extends MissingSetter {
public interface MissingGettersAndSetters extends MissingGetter {
public interface GetterSetterTypeMismatch extends PipelineOptions {
public interface MultiGetterSetterTypeMismatch extends GetterSetterTypeMismatch {
public interface CombinedObject extends MissingGetter, MissingSetter {
public interface ExtraneousMethod extends PipelineOptions {
public interface ReturnTypeConflict extends CombinedObject {
public interface MultiReturnTypeConflictBase extends CombinedObject {
public interface MultiReturnTypeConflict extends MultiReturnTypeConflictBase {
public interface SetterWithJsonIgnore extends PipelineOptions {
public interface MultiSetterWithJsonIgnore extends SetterWithJsonIgnore {
public interface GetterWithJsonIgnore extends PipelineOptions {
private interface MultiGetters extends PipelineOptions {
private interface MultipleGettersWithInconsistentJsonIgnore extends PipelineOptions {
public interface Primitives extends PipelineOptions {
public interface Objects extends PipelineOptions {
public interface Arrays extends PipelineOptions {
public interface Lists extends PipelineOptions {
public interface Maps extends PipelineOptions { | 0 |
public BufferOverflowException(final String message) {
public BufferOverflowException(final String message, final Throwable exception) { | 0 |
* {@inheritDoc} This method is overridden to adapt the return type.
*/
@Override
public ReloadingCombinedConfigurationBuilder configure(BuilderParameters... params)
{
super.configure(params);
return this;
}
/** | 0 |
* logging namespaces by specifying
* {@code --workerLogLevelOverrides=Name1#Level1,Name2#Level2,...}. For example, by specifying
* {@code --workerLogLevelOverrides=com.google.cloud.dataflow.examples.DebuggingWordCount#DEBUG}
* "DEBUG" or higher level logs for the DebuggingWordCount class in addition to the default
* "INFO" or higher level logs. In addition, the default Dataflow worker logging
* configuration can be overridden by specifying | 0 |
import java.io.Serializable;
public class TimelineMetric implements Comparable<TimelineMetric>, Serializable {
private String instanceId = null; | 0 |
import org.apache.aurora.gen.ExplicitReconciliationSettings;
import org.apache.aurora.scheduler.reconciliation.TaskReconciler;
private TaskReconciler taskReconciler;
taskReconciler = createMock(TaskReconciler.class);
auditMessages,
taskReconciler));
public void testExplicitTaskReconciliationWithNoBatchSize() throws Exception {
ExplicitReconciliationSettings settings = new ExplicitReconciliationSettings();
taskReconciler.triggerExplicitReconciliation(Optional.absent());
expectLastCall();
control.replay();
assertOkResponse(thrift.triggerExplicitTaskReconciliation(settings));
}
@Test
public void testExplicitTaskReconciliationWithValidBatchSize() throws Exception {
ExplicitReconciliationSettings settings = new ExplicitReconciliationSettings();
settings.setBatchSize(10);
taskReconciler.triggerExplicitReconciliation(Optional.of(settings.getBatchSize()));
expectLastCall();
control.replay();
assertOkResponse(thrift.triggerExplicitTaskReconciliation(settings));
}
@Test
public void testExplicitTaskReconciliationWithNegativeBatchSize() throws Exception {
ExplicitReconciliationSettings settings = new ExplicitReconciliationSettings();
settings.setBatchSize(-1000);
control.replay();
assertResponse(INVALID_REQUEST, thrift.triggerExplicitTaskReconciliation(settings));
}
@Test
public void testExplicitTaskReconciliationWithZeroBatchSize() throws Exception {
ExplicitReconciliationSettings settings = new ExplicitReconciliationSettings();
settings.setBatchSize(0);
control.replay();
assertResponse(INVALID_REQUEST, thrift.triggerExplicitTaskReconciliation(settings));
}
@Test
public void testImplicitTaskReconciliation() throws Exception {
taskReconciler.triggerImplicitReconciliation();
expectLastCall();
control.replay();
assertOkResponse(thrift.triggerImplicitTaskReconciliation());
}
@Test | 0 |
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.PasswordToken; | 0 |
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.junit.Assert.assertEquals;
@Test
public void testAllZooKeepersAreUsed() {
final String zookeepers = "zk1,zk2,zk3", instanceName = "accumulo";
ZooCacheFactory factory = createMock(ZooCacheFactory.class);
expect(factory.getZooCache(zookeepers, 30000)).andReturn(zc).anyTimes();
replay(factory);
ClientConfiguration cfg = ClientConfiguration.loadDefault().withInstance(instanceName).withZkHosts(zookeepers);
ZooKeeperInstance zki = new ZooKeeperInstance(cfg, factory);
assertEquals(zookeepers, zki.getZooKeepers());
assertEquals(instanceName, zki.getInstanceName());
} | 0 |
import org.apache.ambari.server.api.query.QueryImplTest;
ComponentServiceTest.class, HostComponentServiceTest.class, ReadHandlerTest.class, QueryImplTest.class, | 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 $Revision: 1.8 $ $Date: 2004/02/18 00:59:50 $ | 0 |
} else if (((Set<?>) session.get(CommandSessionImpl.CONSTANTS)).contains(token.toString()) | 0 |
import org.apache.sshd.client.session.ClientConnectionService;
import org.apache.sshd.deprecated.UserAuthPassword;
import org.apache.sshd.deprecated.ClientUserAuthServiceOld;
client.setServiceFactories(Arrays.asList(
new ClientUserAuthServiceOld.Factory(),
new ClientConnectionService.Factory()
));
ClientSession s = client.connect("smx", "localhost", port).await().getSession();
s.getService(ClientUserAuthServiceOld.class)
.auth(new UserAuthPassword((ClientSessionImpl) s, "ssh-connection", "buggy"));
client.setServiceFactories(Arrays.asList(
new ClientUserAuthServiceOld.Factory(),
new ClientConnectionService.Factory()
));
ClientSession s = client.connect("smx", "localhost", port).await().getSession();
authFuture = s.getService(ClientUserAuthServiceOld.class)
.auth(new UserAuthPassword((ClientSessionImpl) s, "ssh-connection", "buggy")); | 0 |
// Adds dependencies (except named dependencies, which are managed by the lifecycle handler).
addUnamedDependencies(b, dm, service, srvMeta, depsMeta); | 0 |
import org.apache.ambari.server.orm.DBAccessor;
import java.util.ArrayList;
import java.util.List;
private static final String KERBEROS_DESCRIPTOR_TABLE = "kerberos_descriptor";
private static final String KERBEROS_DESCRIPTOR_NAME_COLUMN = "kerberos_descriptor_name";
private static final String KERBEROS_DESCRIPTOR_COLUMN = "kerberos_descriptor";
addKerberosDescriptorTable();
}
private void addKerberosDescriptorTable() throws SQLException {
List<DBAccessor.DBColumnInfo> columns = new ArrayList<DBAccessor.DBColumnInfo>();
columns.add(new DBAccessor.DBColumnInfo(KERBEROS_DESCRIPTOR_NAME_COLUMN, String.class, 255, null, false));
columns.add(new DBAccessor.DBColumnInfo(KERBEROS_DESCRIPTOR_COLUMN, char[].class, null, null, false));
LOG.debug("Creating table [ {} ] with columns [ {} ] and primary key: [ {} ]", KERBEROS_DESCRIPTOR_TABLE, columns, KERBEROS_DESCRIPTOR_NAME_COLUMN);
dbAccessor.createTable(KERBEROS_DESCRIPTOR_TABLE, columns, KERBEROS_DESCRIPTOR_NAME_COLUMN); | 0 |
package org.apache.accumulo.server.fs;
import org.apache.accumulo.core.spi.common.ServiceEnvironment;
import org.apache.hadoop.fs.FileSystem;
public interface VolumeChooserEnvironment {
public Text getEndRow();
public boolean hasTableId();
public TableId getTableId();
/**
* @since 2.0.0
*/
public ChooserScope getScope();
/**
* @since 2.0.0
*/
public ServiceEnvironment getServiceEnv();
/**
* @since 2.0.0
*/
public FileSystem getFileSystem(String option); | 0 |
val = coder.decode(new ByteArrayInputStream(bcast.value())); | 0 |
log.trace(String.format("Splitting at %6.2f instead of .5, row at .5 is same as end row%n", keys.firstKey())); | 0 |
/** The required options and groups expected to be found when parsing the command line. */
for (OptionGroup group : options.getOptionGroups())
for (String argument : arguments)
handleToken(argument);
List<String> matchingOpts = options.getMatchingOptions(token);
handleOption(options.getOption(matchingOpts.get(0)));
List<String> matchingOpts = options.getMatchingOptions(opt);
Option option = options.getOption(matchingOpts.get(0));
// no equal sign found (-xxx)
// equal sign found (-xxx=yyy)
option = option.clone(); | 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* KIND, either express or implied. See the License for the | 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 |
* @param propType The bean property type that this column needs to be | 0 |
Mockito.anyInt(),
final int connectTimeout, | 0 |
List<Component> services = new ArrayList<Component>(dm.getComponents());
List<Component> services = new ArrayList(dm.getComponents()); | 0 |
*
* @deprecated since 2.0. This class maintained for backwards compatibility please do not remove.
* New users see org.apache.accumulo.hadoop.mapreduce.AccumuloInputFormat
@Deprecated | 0 |
public ClassConverterTestCase(final String name) {
final Converter converter = new ClassConverter();
final Converter converter = new ClassConverter();
} catch (final ConversionException e) {
} catch (final ConversionException e) {
final Converter converter = new ClassConverter(Object.class);
final Converter converter = new ClassConverter(null);
final Converter converter = new ClassConverter();
final Converter converter = new ClassConverter();
} catch (final ConversionException e) {
final Converter converter = new ClassConverter();
} catch (final ConversionException cex) { | 0 |
private static SiteConfiguration siteConfig = SiteConfiguration.create();
scf = new ServerConfigurationFactory(context, siteConfig); | 0 |
import org.apache.beam.runners.core.StateMerging; | 0 |
* Copyright 2000-2009 The Apache Software Foundation | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestAll.java,v 1.17 2002/02/25 23:15:29 morgand Exp $
* $Revision: 1.17 $
* $Date: 2002/02/25 23:15:29 $
* @version $Id: TestAll.java,v 1.17 2002/02/25 23:15:29 morgand Exp $
suite.addTest(TestFilterIterator.suite()); | 0 |
MasterClient.executeVoid(ctx, new ClientExec<MasterClientService.Client>() { | 0 |
* Simple {@link Credentials} implementation based on a user name / password
* pair. | 0 |
public final class BooleanConverter implements Converter { | 0 |
* @version $Revision$ | 1 |
import static org.junit.jupiter.api.Assertions.assertTrue;
@org.junit.jupiter.api.Test
assertTrue(coreValidity, "Signature failed core validation"); | 0 |
import org.apache.ambari.logfeeder.conf.LogFeederProps;
public void init(LogFeederProps logFeederProps) throws Exception {
super.init(logFeederProps); | 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.environment.internal;
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.cocoon.Processor;
import org.apache.cocoon.environment.Environment;
/**
* Experimental code for cleaning up the environment handling
* This is an internal class, and it might change in an incompatible way over time.
* For developing your own components/applications based on Cocoon, you shouldn't
* really need it.
*
* @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
* @version CVS $Id: EnvironmentInfo.java,v 1.1 2004/05/25 07:28:25 cziegeler Exp $
* @since 2.2
*/
public class EnvironmentInfo {
public final Processor processor;
public final int oldStackCount;
public final ServiceManager manager;
public final Environment environment;
public EnvironmentInfo(Processor processor,
int oldStackCount,
ServiceManager manager,
Environment environment) {
this.processor = processor;
this.oldStackCount = oldStackCount;
this.manager = manager;
this.environment = environment;
}
}
| 0 |
* <pre>{@code
* }</pre>
* --project=YOUR_PROJECT_ID
* --dataset=YOUR_DATASET_ID
* --output=[YOUR_LOCAL_FILE | gs://YOUR_OUTPUT_PATH] | 0 |
// Check the count again to ensure that nobody else has just
// obtained the service again
if (usage.m_count.get() <= 0)
if (usage.m_svcHolderRef.compareAndSet(holder, null))
{
// Remove reference from usages array.
((ServiceRegistrationImpl.ServiceReferenceImpl) ref)
.getRegistration().ungetService(bundle, svc);
} | 0 |
private final int n; | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.