Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
import org.apache.ambari.server.controller.spi.Resource;
| 0 |
import org.apache.ambari.server.view.configuration.InstanceConfig;
import org.apache.ambari.server.view.configuration.InstanceConfigTest;
import org.apache.ambari.server.view.configuration.ViewConfig;
import org.apache.ambari.server.view.configuration.ViewConfigTest;
@Test
public void testInstallViewInstance() throws Exception {
ViewRegistry registry = ViewRegistry.getInstance();
ViewDefinition viewDefinition = ViewDefinitionTest.getViewDefinition();
InstanceConfig instanceConfig = InstanceConfigTest.getInstanceConfigs().get(0);
ViewInstanceDefinition viewInstanceDefinition = ViewRegistry.installViewInstance(viewDefinition, instanceConfig);
Collection<ViewInstanceDefinition> viewInstanceDefinitions = registry.getInstanceDefinitions(viewDefinition);
Assert.assertEquals(1, viewInstanceDefinitions.size());
Assert.assertEquals(viewInstanceDefinition, viewInstanceDefinitions.iterator().next());
}
| 0 |
public CompositeCollection(final Collection<E> compositeCollection) {
public CompositeCollection(final Collection<E> compositeCollection1, final Collection<E> compositeCollection2) {
public CompositeCollection(final Collection<E>[] compositeCollections) {
for (final Collection<E> item : all) {
for (final Collection<? extends E> item : all) {
public boolean contains(final Object obj) {
for (final Collection<? extends E> item : all) {
final IteratorChain<E> chain = new IteratorChain<E>();
for (final Collection<? extends E> item : all) {
for (final Iterator<E> it = iterator(); it.hasNext(); i++) {
public <T> T[] toArray(final T[] array) {
final int size = size();
for (final Collection<? extends E> item : all) {
for (final E e : item) {
public boolean add(final E obj) {
public boolean remove(final Object obj) {
public boolean containsAll(final Collection<?> coll) {
for (final Object item : coll) {
public boolean addAll(final Collection<? extends E> coll) {
public boolean removeAll(final Collection<?> coll) {
for (final Collection<? extends E> item : all) {
for (final Collection<? extends E> item : all) {
for (final Collection<? extends E> coll : all) {
public void setMutator(final CollectionMutator<E> mutator) {
public void addComposited(final Collection<E> compositeCollection) {
public void addComposited(final Collection<E> compositeCollection1, final Collection<E> compositeCollection2) {
public void addComposited(final Collection<E>[] compositeCollections) {
public void removeComposited(final Collection<E> coll) { | 0 |
public class ClassPath {
private static abstract class PathEntry { | 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 | 0 |
@Override
@Override
@Override
@Override | 0 |
private String clientIPAddress;
public String getClientIPAddress() {
return clientIPAddress;
}
public void setClientIPAddress(String clientIPAddress) {
this.clientIPAddress = clientIPAddress;
}
| 0 |
* Copyright (c) OSGi Alliance (2005, 2008). All Rights Reserved. | 0 |
upgrade.setRequestEntity(requestEntity); | 0 |
import java.util.Collections;
public ComponentDescriptionDTO getComponentDescriptionDTO(Bundle bundle, String name) {
if ( holder != null )
{
return holderToDescription(holder);
}
else
{
return null;
}
if ( description == null)
{
return Collections.emptyList();
}
private ComponentHolder<?> getHolderFromDescription( | 0 |
public class DefaultNotifyingBuilder implements NotifyingBuilder { | 0 |
@Value("${logsearch.authr.file.enable:false}")
@LogSearchPropertyDescription(
name = "logsearch.authr.file",
description = "A boolean property to enable/disable file based authorization",
examples = {"true"},
defaultValue = "false",
sources = {LOGSEARCH_PROPERTIES_FILE}
)
private boolean fileAuthorization;
@Value("${logsearch.authr.role.file:roles.json}")
@LogSearchPropertyDescription(
name = "logsearch.authr.role.file",
description = "Simple file that contains user/role mappings.",
examples = {"logsearch-roles.json"},
defaultValue = "roles.json",
sources = {LOGSEARCH_PROPERTIES_FILE}
)
private String roleFile;
public boolean isFileAuthorization() {
return fileAuthorization;
}
public void setFileAuthorization(boolean fileAuthorization) {
this.fileAuthorization = fileAuthorization;
}
public String getRoleFile() {
return roleFile;
}
public void setRoleFile(String roleFile) {
this.roleFile = roleFile;
} | 0 |
* @version $Revision$ $Date$ | 0 |
FileObject[] findFiles( FileSelector selector ) throws FileSystemException; | 0 |
* @version $Revision$ | 0 |
import org.apache.accumulo.core.security.Credentials;
return readTokenFile(implementingClass, conf).getToken().getClass().getName();
return Base64.decodeBase64(token.getBytes(Constants.UTF8));
return AuthenticationTokenSerializer.serialize(readTokenFile(implementingClass, conf).getToken());
private static Credentials readTokenFile(Class<?> implementingClass, Configuration conf) {
while (fileScanner.hasNextLine()) {
Credentials creds = Credentials.deserialize(fileScanner.nextLine());
if (principal.equals(creds.getPrincipal())) {
return creds;
throw new IllegalArgumentException("Couldn't find token for user \"" + principal + "\" in file \"" + tokenFile + "\""); | 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.beam.sdk.options;
import com.google.auto.service.AutoService;
import com.google.common.collect.ImmutableList;
/**
* A registrar containing the default SDK options.
*/
@AutoService(PipelineOptionsRegistrar.class)
public class DefaultPipelineOptionsRegistrar implements PipelineOptionsRegistrar {
@Override
public Iterable<Class<? extends PipelineOptions>> getPipelineOptions() {
return ImmutableList.<Class<? extends PipelineOptions>>builder()
.add(PipelineOptions.class)
.add(ApplicationNameOptions.class)
.add(StreamingOptions.class)
.add(BigQueryOptions.class)
.add(GcpOptions.class)
.add(GcsOptions.class)
.add(GoogleApiDebugOptions.class)
.add(PubsubOptions.class)
.build();
}
} | 0 |
AtlasSearchResult searchResult2 = discoveryService.searchUsingDslQuery(query.replace("where", " "), 25, 0);
assertSearchResult(searchResult2, expected);
queryAssert(query, expected);
//queryAssert(query.replace("where", " "), expected);
}
private void queryAssert(String query, int expected) throws AtlasBaseException {
queryAssert(query, expected);
queryAssert(query.replace("where", " "), expected);
queryAssert(query, expected);
queryAssert(query.replace("where", " "), expected);
queryAssert(query, expected);
queryAssert(query.replace("where", " "), expected);
@Test(dataProvider = "likeQueriesProvider")
public void likeQueries(String query, int expected) throws AtlasBaseException {
queryAssert(query, expected);
queryAssert(query.replace("where", " "), expected);
}
queryAssert(query, fv);
queryAssert(query.replace("where", " "), fv);
}
private void queryAssert(String query, FieldValueValidator fv) throws AtlasBaseException {
private void assertSearchResult(AtlasSearchResult searchResult, FieldValueValidator expected) {
assertNotNull(searchResult);
assertNull(searchResult.getEntities());
assertEquals(searchResult.getAttributes().getName().size(), expected.getFieldNamesCount());
for (int i = 0; i < searchResult.getAttributes().getName().size(); i++) {
String s = searchResult.getAttributes().getName().get(i);
assertEquals(s, expected.fieldNames[i]);
}
assertEquals(searchResult.getAttributes().getValues().size(), expected.values.size()); | 0 |
import org.apache.hc.core5.http.nio.command.RequestExecutionCommand;
ioSession.enqueue(new RequestExecutionCommand(new AsyncClientExchangeHandler() { | 0 |
FnApiControlClient client = pool.getSource().get();
pool.getSource().get(); | 0 |
import org.apache.bcel.verifier.exc.AssertionViolatedException;
import org.apache.bcel.verifier.exc.LocalVariableInfoInconsistentException; | 0 |
public TaskStatusResponse(HostRoleCommand hostRoleCommand) {
this.requestId = hostRoleCommand.getRequestId(); | 1 |
byte[] origin = getBytesFromFile(new File("target/test-classes/test/ClusterDaemon.class"));
manipulator.prepare(origin);
byte[] clazz = manipulator.manipulate(origin);
byte[] origin = getBytesFromFile(new File("target/test-classes/test/SimplePojo.class"));
manipulator.prepare(origin);
byte[] clazz = manipulator.manipulate(origin);
byte[] origin = getBytesFromFile(new File("target/test-classes/test/NonSunClass.class"));
manipulator.prepare(origin);
byte[] clazz = manipulator.manipulate(origin);
byte[] origin = getBytesFromFile(new File("target/test-classes/test/Child.class"));
manipulator.prepare(origin);
byte[] clazz = manipulator.manipulate(origin);
byte[] origin = getBytesFromFile(new File("target/test-classes/test/Child.class"));
manipulator.prepare(origin);
byte[] clazz = manipulator.manipulate(origin);
byte[] origin = getBytesFromFile(new File("target/test-classes/test/NoValidConstructor.class"));
manipulator.prepare(origin);
byte[] clazz = manipulator.manipulate(origin);
Assert.assertTrue(clazz.length > origin.length);
byte[] origin = getBytesFromFile(new File("target/test-classes/test/ConstructorCheck.class"));
manipulator.prepare(origin);
byte[] clazz = manipulator.manipulate(origin);
byte[] origin = getBytesFromFile(new File("target/test-classes/test/DoubleArray.class"));
manipulator.prepare(origin);
byte[] clazz = manipulator.manipulate(origin);
Assert.assertTrue(clazz.length > origin.length); | 0 |
if (isClosed()) {
throw new IllegalStateException("Can not start the client again");
} | 0 |
* Autogenerated by Thrift Compiler (0.12.0)
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)")
@org.apache.thrift.annotation.Nullable | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/decorators/Attic/CompositeCollection.java,v 1.3 2003/12/03 11:37:44 scolebourne Exp $
import org.apache.commons.collections.list.UnmodifiableList;
* @version $Revision: 1.3 $ $Date: 2003/12/03 11:37:44 $
return UnmodifiableList.decorate(Arrays.asList(this.all)); | 0 |
// Opportunity to just 'update' the existing shape painters... | 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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.hc.core5.testing.nio;
import org.apache.hc.core5.function.Decorator;
import org.apache.hc.core5.reactor.IOSession;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class LoggingIOSessionDecorator implements Decorator<IOSession> {
public final static LoggingIOSessionDecorator INSTANCE = new LoggingIOSessionDecorator();
private final Logger wireLog = LogManager.getLogger("org.apache.hc.core5.http.wire");
private LoggingIOSessionDecorator() {
}
@Override
public IOSession decorate(final IOSession ioSession) {
final Logger sessionLog = LogManager.getLogger(ioSession.getClass());
return new LoggingIOSession(ioSession, sessionLog, wireLog);
}
} | 0 |
getQueryHint(startTime), outputTableName, tableName, startTime, endTime)); | 0 |
* </p>
* </p> | 0 |
import static com.google.common.base.Charsets.UTF_8;
Mutation m = ContinuousIngest.genMutation(rowId, r.nextInt(maxColF), r.nextInt(maxColQ), cv, ingestInstanceId.getBytes(UTF_8), count, null, r, false); | 0 |
import org.apache.cocoon.portal.util.AbstractBean; | 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 |
public class Query10 extends NexmarkQueryTransform<Done> {
private final NexmarkConfiguration configuration;
super("Query10");
this.configuration = configuration;
@Override
public PCollection<Done> expand(PCollection<Event> events) { | 0 |
package org.apache.ambari.server.agent.stomp.dto;
/**
* Is used to contain hash code in request from agent
*/
public class Hash {
private String hash;
public Hash(String hash) {
this.hash = hash;
public Hash() {
public String getHash() {
return hash;
public void setHash(String hash) {
this.hash = hash; | 1 |
fieldVisibility = Visibility.NONE,
getterVisibility = Visibility.NONE,
setterVisibility = Visibility.NONE) | 0 |
* Creates a new MalformedCookieException with a {@code null} detail message.
* @param cause the {@code Throwable</tt> that caused this exception, or <tt>null}
* if the cause is unavailable, unknown, or not a {@code Throwable} | 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 |
public <R,P> R accept(NodeVisitor<? extends R, ? super P> visitor, P data)
{
return visitor.visit(this, data);
} | 0 |
import org.apache.sshd.util.test.CommonTestSupportUtils;
CommonTestSupportUtils.deleteRecursive(serverDir); | 0 |
MaintenanceModeTypeHandler.class,
TaskConfigTypeHandler.class); | 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 |
* @version $Revision: 1.2 $ $Date: 2002/10/21 02:52:40 $ | 0 |
public DecimalLocaleConverter(final boolean locPattern) {
public DecimalLocaleConverter(final Locale locale) {
public DecimalLocaleConverter(final Locale locale, final boolean locPattern) {
public DecimalLocaleConverter(final Locale locale, final String pattern) {
public DecimalLocaleConverter(final Locale locale, final String pattern, final boolean locPattern) {
public DecimalLocaleConverter(final Object defaultValue) {
public DecimalLocaleConverter(final Object defaultValue, final boolean locPattern) {
public DecimalLocaleConverter(final Object defaultValue, final Locale locale) {
public DecimalLocaleConverter(final Object defaultValue, final Locale locale, final boolean locPattern) {
public DecimalLocaleConverter(final Object defaultValue, final Locale locale, final String pattern) {
public DecimalLocaleConverter(final Object defaultValue, final Locale locale, final String pattern, final boolean locPattern) {
protected Object parse(final Object value, final String pattern) throws ParseException {
final DecimalFormat formatter = (DecimalFormat) DecimalFormat.getInstance(locale); | 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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.hc.core5.http;
/**
* A name / value pair parameter used as an element of HTTP messages.
*
* @since 4.0
*/
public interface NameValuePair {
String getName();
String getValue();
} | 1 |
throws ProcessingException {
try {
return prepare( objectModel, configs );
} catch (ConfigurationException ce) {
throw new ProcessingException("Exception during handler configuration.", ce);
} | 0 |
m.put("six-prop", "987");
m.put("seven$.prop", "3.141");
assertEquals((short) 987, dto.six$_$prop);
dto.seven$$_$prop = 3.141; | 0 |
/*
* Copyright 2002, 2003,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 |
throw new IllegalArgumentException(
"multiple extent types not allowed " + ttype + " " + type(extent)); | 0 |
*
*
* Decodes a byte array and returns the results as a byte array.
*
*
} | 1 |
FlatMap<InputT, OutputT> operator, TranslationContext context) {
public PCollection<?> translate(FlatMap operator, TranslationContext context) { | 0 |
* A factory for creating, initializing and connecting sockets.
throws IOException;
* the cipher suite chosen for the connection.
throws IllegalArgumentException; | 0 |
throw new SAXException("Portlet couldn't be loaded: " + coplet.getId());
final String value = this.getResponse(res);
IncludingHTMLSerializer.addPortlet(coplet.getId(), value);
attr.addCDATAAttribute("portlet", coplet.getId());
protected String getResponse(HttpServletResponse response) {
return response.toString();
} | 0 |
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at | 0 |
import org.apache.http.cookie.CookieRestrictionViolationException;
throw new CookieRestrictionViolationException("Cookie domain may not be null");
throw new CookieRestrictionViolationException("Domain attribute \""
throw new CookieRestrictionViolationException("Domain attribute \""
throw new CookieRestrictionViolationException("Domain attribute \""
throw new CookieRestrictionViolationException(
throw new CookieRestrictionViolationException("Domain attribute \"" | 0 |
boolean expanded=false;
byte []result=new byte[length];
if (!expanded) {
byte newResult[]=new byte[3*length];
System.arraycopy(result, 0, newResult, 0, out);
result=newResult;
expanded=true;
}
if (expanded) {
byte newResult[]=new byte[out];
System.arraycopy(result, 0, newResult, 0, out);
result=newResult;
}
return result; | 0 |
/*
* $Id: ResourceImpl.java 44 2007-07-13 20:49:41Z [email protected] $
*
* Copyright (c) OSGi Alliance (2002, 2006, 2007). All Rights Reserved.
*
* 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.
*/
VersionRange version;
VersionRange version) {
if ( version == null)
this.version = new VersionRange("0");
setVersion(new VersionRange("0"));
setVersion(new VersionRange(v));
version = new VersionRange("0");
return version.low;
void setVersion(VersionRange version) {
this.version = new VersionRange("0");
public synchronized String getId() {
if ( id == null )
id = symbolicName + "/" + version; | 0 |
import org.apache.beam.sdk.coders.Coder;
* This is a hack for transforming a {@link org.apache.beam.sdk.transforms.Create} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/model/dynamic/DynamicPointerFactory.java,v 1.1 2002/11/28 01:01:30 dmitri Exp $
* $Revision: 1.1 $
* $Date: 2002/11/28 01:01:30 $
package org.apache.commons.jxpath.ri.model.dynamic;
import org.apache.commons.jxpath.ri.model.beans.NullPointer;
* @version $Revision: 1.1 $ $Date: 2002/11/28 01:01:30 $ | 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 |
*
* @since 2.0 | 0 |
/**
* The label used to display the tab name (or section) where the properties are displayed. Example: "Printer Service".
* @return The label used to display the tab name where the properties are displayed.
*/
String heading() default "";
/**
* A human readable description of the PID this annotation is associated with. Example: "Configuration for the PrinterService bundle".
* @return A human readable description of the PID this annotation is associated with.
*/
String description() default "";
/**
* The list of properties types used to expose properties in web console.
* @return The list of properties types used to expose properties in web console.
*/
PropertyMetaData[] properties() default {}; | 0 |
options.setRunner(BlockingDataflowPipelineRunner.class);
options.setRunner(BlockingDataflowPipelineRunner.class); | 0 |
Assert.assertEquals("TEST", authscheme.toString()); | 0 |
import java.security.Security;
@Test
public void testBuildWithProvider() throws Exception {
final URL resource1 = getClass().getResource("/test-server.keystore");
final String storePassword = "nopassword";
final String keyPassword = "nopassword";
final SSLContext sslContext=SSLContextBuilder.create()
.setProvider(Security.getProvider("SunJSSE"))
.loadKeyMaterial(resource1, storePassword.toCharArray(), keyPassword.toCharArray())
.build();
Assert.assertTrue(sslContext.getProvider().getName().equals("SunJSSE"));
}
| 0 |
new PropertyInfo("yarn.QueueMetrics.Queue=(.+).AvailableMB", true, false));
uriBuilder.addParameter("metricNames", "yarn.QueueMetrics.Queue=root.AvailableMB");
Number[][] val = (Number[][]) res.getPropertyValue("metrics/yarn/Queue/root/AvailableMB"); | 0 |
import org.apache.cocoon.util.log.DeprecationLogger;
DeprecationLogger.logger = this.loggerManager.getLoggerForCategory("deprecation"); | 0 |
package org.apache.atlas.bridge; | 0 |
import org.apache.cocoon.thread.RunnableManager; | 0 |
public ReferenceIdentityMapTest(final String testName) {
final IterableMap<K, V> map = new ReferenceIdentityMap<K, V>(ReferenceStrength.HARD, ReferenceStrength.HARD);
final IterableMap<K, V> map = new ReferenceIdentityMap<K, V>(ReferenceStrength.HARD, ReferenceStrength.HARD);
final Map.Entry<K, V> entry1 = map.entrySet().iterator().next();
final Iterator<Map.Entry<K, V>> it = map.entrySet().iterator();
final Map.Entry<K, V> entry2 = it.next();
final Map.Entry<K, V> entry3 = it.next();
} catch (final NullPointerException ex) {}
} catch (final NullPointerException ex) {}
} catch (final NullPointerException ex) {}
final K key = (K) new Object();
final V value = (V) new Object();
final Map<K, V> testMap = new ReferenceIdentityMap<K, V>(ReferenceStrength.WEAK, ReferenceStrength.HARD, true);
final Map<K, V> testMap = buildRefMap();
final
final byte[][] tooLarge = new byte[1000000000][1000000000];
} catch (final OutOfMemoryError ex) { | 0 |
import cz.seznam.euphoria.core.client.operator.AssignEventTime;
import cz.seznam.euphoria.core.client.operator.ExtractEventTime;
import java.util.Objects;
* A convenience method to create a data set from the given source and
* assign the elements event time using the user defined function.
*
* @param <T> the type of elements of the created input data set
*
* @param source the data source to represent as a data set
* @param evtTimeFn the user defined event time extraction function
*
* @return a data set representing the specified source of data with assigned
* event time assigned
*/
public <T> Dataset<T> createInput(DataSource<T> source, ExtractEventTime<T> evtTimeFn) {
Dataset<T> input = createInput(source);
return AssignEventTime.of(input).using(Objects.requireNonNull(evtTimeFn)).output();
}
/** | 0 |
@Override
@Override
@Override | 0 |
Assert.assertTrue(check.getFailedDetail().isEmpty());
Assert.assertFalse(check.getFailedDetail().isEmpty()); | 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 |
private String tableName;
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName; | 0 |
package org.apache.beam.sdk.runners.inprocess; | 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.cocoon.portal.om.CopletInstance; | 0 |
public static final Object updateProperty(Session session, String name, long value) {
public static final Object updateProperty(FactoryManager manager, String name, long value) {
return updateProperty(manager.getProperties(), name, value);
public static final Object updateProperty(Map<String,Object> props, String name, long value) {
return updateProperty(props, name, Long.valueOf(value));
public static final Object updateProperty(Session session, String name, int value) {
return updateProperty(session.getFactoryManager(), name, value);
public static final Object updateProperty(FactoryManager manager, String name, int value) {
return updateProperty(manager.getProperties(), name, value);
public static final Object updateProperty(Map<String,Object> props, String name, int value) {
return updateProperty(props, name, Integer.valueOf(value));
public static final Object updateProperty(Session session, String name, boolean value) {
return updateProperty(session.getFactoryManager(), name, value);
public static final Object updateProperty(FactoryManager manager, String name, boolean value) {
return updateProperty(manager.getProperties(), name, value);
public static final Object updateProperty(Map<String,Object> props, String name, boolean value) {
return updateProperty(props, name, Boolean.valueOf(value));
public static Object updateProperty(Session session, String name, Object value) {
public static Object updateProperty(FactoryManager manager, String name, Object value) {
* specified property is <U>removed</U> from the properties map
public static Object updateProperty(Map<String,Object> props, String name, Object value) {
if ((value == null) || ((value instanceof CharSequence) && GenericUtils.isEmpty((CharSequence) value))) { | 0 |
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
@Override
@Test
@Test
@Test
@Test
@Test
@Test
@Test
List<ConfigurationNode> nds = config.getExpressionEngine().query(config.getRoot(),
return nds.get(0); | 0 |
import org.apache.batik.dom.svg.SVGDOMImplementation;
import org.apache.batik.test.PerformanceTest;
| 0 |
public Integer running = null;
public Integer queued = null;
public CompactionsList() {} | 0 |
@Parameter(names = {"-a", "--address"}, description = "address to bind to")
} | 0 |
configTypes,
dereference,
scope,
bundle | 0 |
import org.apache.batik.util.XMLConstants; | 0 |
PCollectionConsumerRegistry consumers = new PCollectionConsumerRegistry(
metricsContainerRegistry, mock(ExecutionStateTracker.class));
PCollectionConsumerRegistry consumers = new PCollectionConsumerRegistry(
metricsContainerRegistry, mock(ExecutionStateTracker.class));
PCollectionConsumerRegistry consumers = new PCollectionConsumerRegistry(
metricsContainerRegistry, mock(ExecutionStateTracker.class));
PCollectionConsumerRegistry consumers = new PCollectionConsumerRegistry(
metricsContainerRegistry, mock(ExecutionStateTracker.class));
PCollectionConsumerRegistry consumers = new PCollectionConsumerRegistry(
metricsContainerRegistry, mock(ExecutionStateTracker.class)); | 0 |
import java.awt.Composite;
// Opacity
CSSPrimitiveValue opacityVal =
(CSSPrimitiveValue)cssDecl.getPropertyCSSValue(ATTR_OPACITY);
if (opacityVal != null) {
Composite composite =
CSSUtilities.convertOpacityToComposite(opacityVal);
result.put(GVTAttributedCharacterIterator.TextAttribute.OPACITY,
composite);
}
| 0 |
import org.junit.Assert;
}
final String[] expectedDefault = new String[] {"row cf:cq [] 1234abcd", "row cf1:cq1 [] 9876fedc", "row2 cf:cq [] 13579bdf",
"row2 cf1:cq [] 2468ace"};
final String[] expectedFormatted = new String[] {"row cf:cq [] 0x31 0x32 0x33 0x34 0x61 0x62 0x63 0x64",
"row cf1:cq1 [] 0x39 0x38 0x37 0x36 0x66 0x65 0x64 0x63", "row2 cf:cq [] 0x31 0x33 0x35 0x37 0x39 0x62 0x64 0x66",
"row2 cf1:cq [] 0x32 0x34 0x36 0x38 0x61 0x63 0x65"};
return new String[] {"table test", "insert row cf cq 1234abcd", "insert row cf1 cq1 9876fedc", "insert row2 cf cq 13579bdf", "insert row2 cf1 cq 2468ace",
"scan", "formatter -t test -f org.apache.accumulo.core.util.shell.command.FormatterCommandTest$HexFormatter", "scan"};
* <p>
* Simple <code>Formatter</code> that will convert each character in the Value from decimal to hexadecimal. Will automatically skip over characters in the
* value which do not fall within the [0-9,a-f] range.
* </p>
* <p>
* Example: <code>'0'</code> will be displayed as <code>'0x30'</code>
* </p>
private Iterator<Entry<Key,Value>> iter = null;
final Entry<Key,Value> entry = iter.next();
final StringBuilder sb = new StringBuilder(key.length() + v.getSize() * 5);
public void remove() {}
| 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 |
} catch (KeeperException.NoNodeException e) {
System.out.println("Could not set ACL on " + znode + ". Reason: " + e.getMessage()); | 0 |
public DecoderException(final String message) {
public DecoderException(final String message, final Throwable cause) {
public DecoderException(final Throwable cause) { | 1 |
import java.io.IOException;
import org.apache.commons.io.input.NullInputStream;
import org.apache.commons.io.input.NullReader;
import org.apache.commons.io.output.NullOutputStream;
import org.apache.commons.io.output.NullWriter;
/**
* Test Copying file > 2GB - see issue# IO-84
*/
public void testCopy_inputStreamToOutputStream_IO84() throws Exception {
long size = (long)Integer.MAX_VALUE + (long)1;
InputStream in = new NullInputStream(size);
OutputStream out = new NullOutputStream();
// Test copy() method
try {
IOUtils.copy(in, out);
fail("Expected copy() to throw an ArithmeticException");
} catch (ArithmeticException ae) {
// expected result
}
// reset the input
in.close();
// Test copyLarge() method
assertEquals("copyLarge()", size, IOUtils.copyLarge(in, out));
}
/**
* Test Copying file > 2GB - see issue# IO-84
*/
public void testCopy_readerToWriter_IO84() throws Exception {
long size = (long)Integer.MAX_VALUE + (long)1;
Reader reader = new NullReader(size);
Writer writer = new NullWriter();
// Test copy() method
try {
IOUtils.copy(reader, writer);
fail("Expected copy() to throw an ArithmeticException");
} catch (ArithmeticException ae) {
// expected result
}
// reset the input
reader.close();
// Test copyLarge() method
assertEquals("copyLarge()", size, IOUtils.copyLarge(reader, writer));
}
| 0 |
config.put(MITKerberosOperationHandler.KERBEROS_ENV_KADMIN_PRINCIPAL_NAME, "kadmin/kdc.example.com"); | 0 |
import java.util.List;
import org.apache.hc.core5.reactor.ExceptionEvent;
import org.apache.logging.log4j.Logger;
final List<ExceptionEvent> exceptionLog = server.getExceptionLog();
if (!exceptionLog.isEmpty()) {
final Logger log = LogManager.getLogger(getClass());
for (final ExceptionEvent event: exceptionLog) {
final Throwable cause = event.getCause();
log.error("Unexpected " + cause.getClass() + " at " + event.getTimestamp(), cause);
}
}
final List<ExceptionEvent> exceptionLog = requester.getExceptionLog();
if (!exceptionLog.isEmpty()) {
final Logger log = LogManager.getLogger(getClass());
for (final ExceptionEvent event: exceptionLog) {
final Throwable cause = event.getCause();
log.error("Unexpected " + cause.getClass() + " at " + event.getTimestamp(), cause);
}
} | 0 |
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.KeeperException.NotReadOnlyException;
import org.apache.zookeeper.Watcher.Event.KeeperState;
boolean success = false;
for (int i = 0; i < 30; i++) {
try {
zk.create("/test", "test".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
CreateMode.PERSISTENT);
success=true;
break;
} catch(KeeperException.ConnectionLossException e) {
Thread.sleep(1000);
}
}
Assert.assertTrue("Did not succeed in connecting in 30s", success); | 0 |
public MultiFileConfigurationBuilder(Class<? extends T> resCls,
public MultiFileConfigurationBuilder(Class<? extends T> resCls,
public MultiFileConfigurationBuilder(Class<? extends T> resCls) | 0 |
if (LOG.isTraceEnabled()) {
ZooTrace.logTraceMessage(LOG, ZooTrace.EVENT_DELIVERY_TRACE_MASK,
"Deliver event " + event + " to 0x"
+ Long.toHexString(this.sessionId)
+ " through " + this);
} | 0 |
* A {@code KeyedState} is a mutable mapping
* from {@link CodedTupleTag CodedTupleTag<T>}
* to {@code T}. | 0 |
* @param upgradeInformation
* the upgrade type, direction, services, repository versions, etc.
UpgradeActionOperations getOperations(ClusterInformation clusterInformation,
UpgradeInformation upgradeInformation) throws UpgradeActionException; | 0 |
import java.util.Arrays;
if (args[0].equals("-h") || args[0].equals("-help") || args[0].equals("--help")) {
printUsage();
System.exit(1);
}
System.out.println("Invalid argument: Java <main class> '" + className + "' was not found. Please use the wholly qualified package name.");
printUsage();
public static void printCommand(KeywordExecutable ke) {
System.out.printf(" %-30s %s\n", ke.usage(), ke.description());
}
public static void printUsage() {
Map<String,KeywordExecutable> executableMap = new TreeMap<>(getExecutables(getClassLoader()));
System.out.println("\nUsage: accumulo <command> (<argument> ...)\n\nCore Commands:");
System.out.println(" create-config Create Accumulo configuration");
System.out.println(" build-native Build Accumulo native libraries");
for (String cmd : Arrays.asList("init", "shell", "classpath", "version", "admin", "info", "help", "jar")) {
printCommand(executableMap.remove(cmd));
}
System.out.println(" <main class> args Run Java <main class> located on Accumulo classpath");
System.out.println("\nProcess Commands:");
for (String cmd : Arrays.asList("gc", "master", "monitor", "minicluster", "proxy", "tserver", "tracer", "zookeeper")) {
printCommand(executableMap.remove(cmd));
}
System.out.println("\nAdvanced Commands:");
for (Map.Entry<String,KeywordExecutable> entry : executableMap.entrySet()) {
printCommand(entry.getValue());
System.out.println(); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.