Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
import javax.persistence.EntityManager;
import org.apache.ambari.server.H2DatabaseCleaner;
H2DatabaseCleaner.clearDatabase(m_injector.getProvider(EntityManager.class).get()); | 0 |
public class TestUnmodifiableIterator<E> extends AbstractTestIterator<E> {
protected List<E> testList;
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
protected void setUp() throws Exception {
super.setUp();
testList = new ArrayList<E>(Arrays.asList((E[]) testArray));
public Iterator<E> makeEmptyIterator() {
return UnmodifiableIterator.decorate(Collections.<E>emptyList().iterator());
}
public Iterator<E> makeObject() {
Iterator<E> it = makeObject();
| 0 |
public final class BooleanConverter extends AbstractConverter { | 0 |
public void testValidator420() {
UrlValidator validator = new UrlValidator();
assertFalse(validator.isValid("http://example.com/serach?address=Main Avenue"));
assertTrue(validator.isValid("http://example.com/serach?address=Main%20Avenue"));
assertTrue(validator.isValid("http://example.com/serach?address=Main+Avenue"));
}
| 0 |
* @param configTags a Map of configuration tags to set for this command - if null, no
* configurations will be available for the command
@Nullable Map<String, Map<String,String>> configTags,
addServerActionCommand(actionName, role, command, clusterName, StageUtils.getHostName(), event,
commandParams, commandDetail, configTags, timeout, retryAllowed);
* @param configTags a Map of configuration tags to set for this command - if null, no
* configurations will be available for the command
* @param retryAllowed indicates whether retry after failure is allowed
@Nullable Map<String, Map<String,String>> configTags,
Map<String, Map<String, String>> configurations = new TreeMap<String, Map<String, String>>();
cmd.setConfigurations(configurations);
Map<String, Map<String, Map<String, String>>> configurationAttributes = new TreeMap<String, Map<String, Map<String, String>>>();
cmd.setConfigurationAttributes(configurationAttributes);
if (configTags == null) {
configTags = new TreeMap<String, Map<String, String>>();
}
cmd.setConfigurationTags(configTags);
| 0 |
import org.apache.ambari.server.controller.internal.AmbariServerConfigurationHandler;
private final AmbariServerConfigurationHandler ambariServerConfigurationHandler;
AmbariMetaInfo metaInfo, AmbariServerConfigurationHandler ambariServerConfigurationHandler) throws IOException {
this.ambariServerConfigurationHandler = ambariServerConfigurationHandler;
requestId, saRunner, metaInfo, ambariServerConfigurationHandler);
requestId, saRunner, metaInfo, ambariServerConfigurationHandler);
requestId, saRunner, metaInfo, ambariServerConfigurationHandler);
requestId, saRunner, metaInfo, ambariServerConfigurationHandler);
requestId, saRunner, metaInfo, ambariServerConfigurationHandler);
requestId, saRunner, metaInfo, ambariServerConfigurationHandler); | 0 |
package org.apache.cocoon.forms.validation;
import org.w3c.dom.Element;
* A {@link WidgetValidator} that can recieve a configuration {@link Element}
*
public interface ConfigurableWidgetValidator extends WidgetValidator {
/**
* Set the configuration Element
*/
void setConfiguration(Element element) throws Exception; | 0 |
protected SideInputReader getSideInputReader(Iterable<? extends SideInputInfo> sideInputInfos) {
protected SideInputReader getSideInputReaderForViews(
Iterable<? extends PCollectionView<?>> views) { | 0 |
private static final long serialVersionUID = 1L;
private static final Logger log = Logger.getLogger(StopLogger.class);
private String logger;
public StopLogger(String logger) {
this.logger = logger;
}
@Override
public long isReady(long tid, Master environment) throws Exception {
return 0;
}
@Override
public Repo<Master> call(long tid, Master m) throws Exception {
InetSocketAddress addr = AddressUtil.parseAddress(logger, 0);
MutationLogger.Iface client = ThriftUtil.getClient(new MutationLogger.Client.Factory(), addr, ServerConfiguration.getSystemConfiguration());
try {
client.halt(null, SecurityConstants.getSystemCredentials());
log.info("logger asked to halt " + logger);
} catch (Exception ex) {
log.error("Unable to talk to logger at " + addr);
} finally {
ThriftUtil.returnClient(client);
return null;
}
@Override
public void undo(long tid, Master m) throws Exception {}
| 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. | 0 |
/*
* $Header: /cvshome/build/ee.foundation/src/java/io/PushbackInputStream.java,v 1.6 2006/03/14 01:20:23 hargrave Exp $
*
* (C) Copyright 2001 Sun Microsystems, Inc.
* Copyright (c) OSGi Alliance (2001, 2005). 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.
*/
package java.io;
public class PushbackInputStream extends java.io.FilterInputStream {
public PushbackInputStream(java.io.InputStream var0) { super((java.io.InputStream) null); }
public PushbackInputStream(java.io.InputStream var0, int var1) { super((java.io.InputStream) null); }
public int available() throws java.io.IOException { return 0; }
public void close() throws java.io.IOException { }
public boolean markSupported() { return false; }
public int read() throws java.io.IOException { return 0; }
public int read(byte[] var0, int var1, int var2) throws java.io.IOException { return 0; }
public long skip(long var0) throws java.io.IOException { return 0l; }
public void unread(byte[] var0) throws java.io.IOException { }
public void unread(byte[] var0, int var1, int var2) throws java.io.IOException { }
public void unread(int var0) throws java.io.IOException { }
protected byte[] buf;
protected int pos;
}
| 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/test/org/apache/commons/beanutils/BeanUtilsTestCase.java,v 1.15 2002/12/09 22:17:12 rwaldhoff Exp $
* $Revision: 1.15 $
* $Date: 2002/12/09 22:17:12 $
import junit.framework.TestCase;
* @version $Revision: 1.15 $
/** See http://issues.apache.org/bugzilla/show_bug.cgi?id=15170 */
public void testSetPropertyOnPrimitavieWrappers() throws Exception {
BeanUtils.setProperty(bean,"intProperty", new Integer(1));
assertEquals(1,bean.getIntProperty());
} | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.ambari.logsearch.model.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
@ApiModel
public class GraphDataListResponse {
@ApiModelProperty
protected List<GraphData> graphData;
public List<GraphData> getGraphData() {
return graphData;
}
public void setGraphData(List<GraphData> graphData) {
this.graphData = graphData;
}
} | 0 |
import org.apache.beam.sdk.state.TimeDomain; | 0 |
@Override | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/map/ReferenceMap.java,v 1.2 2003/12/05 20:23:57 scolebourne Exp $
import org.apache.commons.collections.keyvalue.DefaultMapEntry;
* @version $Revision: 1.2 $ $Date: 2003/12/05 20:23:57 $ | 0 |
* Represents an integer.
int INTEGER = 24;
* represents a real number.
*/
int REAL = 54;
/**
null, | 0 |
private static final Logger log =
LoggerFactory.getLogger(CachingHDFSSecretKeyEncryptionStrategy.class);
Key plaintextKey =
cipher.unwrap(params.getEncryptedKey(), params.getAlgorithmName(), Cipher.SECRET_KEY);
String pathToKeyName =
params.getAllOptions().get(Property.CRYPTO_DEFAULT_KEY_STRATEGY_KEY_LOCATION.getKey()); | 0 |
import org.apache.ambari.server.state.svccomphost.ServiceComponentHostDisableEvent;
// disabled
sch.handleEvent(new ServiceComponentHostDisableEvent(sch.getServiceComponentName(),
assertEquals(sch.getServiceComponentName(), State.DISABLED, | 0 |
super.deactivate(m_bundles.removeLast()); | 0 |
try (BatchScanner bs = client.createBatchScanner(table3)) { | 0 |
getVariantCacheEntriesReturns(new HashMap<String,Variant>());
Map<String,Variant> variants = new HashMap<String,Variant>();
variants.put("\"etag1\"", new Variant("A","B",variant1));
variants.put("\"etag2\"", new Variant("C","D",variant2));
variants.put("\"etag3\"", new Variant("E","F",variant3));
Map<String,Variant> variants = new HashMap<String,Variant>();
variants.put("\"etag1\"", new Variant("A","B",variant1));
variants.put("\"etag2\"", new Variant("C","D",variant2));
variants.put("\"etag3\"", new Variant("E","F",variant3));
private void getVariantCacheEntriesReturns(Map<String,Variant> result) throws IOException {
private void conditionalVariantRequestBuilderReturns(Map<String,Variant> variantEntries, HttpRequest validate) | 0 |
private final int tid;
private final int seq;
| 0 |
/**
* Create a new NodeNameTest.
* @param qname name to match
*/
/**
* Create a new NodeNameTest.
* @param qname name to match
* @param namespaceURI uri to match
*/
/**
* Get the node name.
* @return QName
*/
/**
* Get the ns URI.
* @return String
*/
/**
* Learn whether this is a wildcard test.
* @return <code>true</code> if the node name is "*".
*/
/**
* {@inheritDoc}
*/ | 0 |
}catch(Exception e){
public abstract TestReport runImpl() throws Exception; | 0 |
InputStream readFrom(String spec) throws IOException;
InputStream readFrom(String spec, String requestMethod, String params) throws IOException; | 0 |
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkState; | 0 |
v.visitNameSignatureInstruction(this); | 0 |
doc.println("<!-- WARNING: Do not edit this file. It is a generated file"
+ " that is copied from Accumulo build (from core/target/generated-docs)" + " -->");
doc.println("Below are properties set in `accumulo-client.properties`"
+ " that configure [Accumulo clients]({{ page.docs_baseurl"
+ " }}/getting-started/clients#connecting). All properties have been part"
+ " of the API since 2.0.0 (unless otherwise specified):\n"); | 0 |
import java.util.Map;
public class JobsPropertyMap<T extends JobProperties<T>> implements JobExecutionListener {
private final Map<String, T> propertyMap;
public JobsPropertyMap(Map<String, T> propertyMap) {
T defaultProperties = propertyMap.get(jobName);
properties.validate(jobName); | 0 |
import org.apache.batik.util.DoublyIndexedTable; | 0 |
Scope.Frame frame = context instanceof TemplateContext
Scope.Frame frame = context instanceof TemplateContext
Scope.Frame frame = script.createFrame((Object[]) null);
Scope.Frame frame = script.createFrame(args);
private final Scope.Frame frame;
protected TemplateContext(JexlContext jcontext, Scope.Frame jframe,
public Scope.Frame getFrame() { | 0 |
import static org.easymock.EasyMock.aryEq;
dbAccessor.dropFKConstraint(eq(UpgradeCatalog242.HOST_GROUP_TABLE), eq("FK_hg_blueprint_name"));
dbAccessor.dropFKConstraint(eq(UpgradeCatalog242.BLUEPRINT_CONFIGURATION), eq("FK_cfg_blueprint_name"));
dbAccessor.dropFKConstraint(eq(UpgradeCatalog242.BLUEPRINT_SETTING), eq("FK_blueprint_setting_name"));
dbAccessor.addFKConstraint(eq(UpgradeCatalog242.HOST_GROUP_TABLE), eq("FK_hg_blueprint_name"),
aryEq(new String[]{"blueprint_name"}), eq(UpgradeCatalog242.BLUEPRINT_TABLE), aryEq(new String[]{"blueprint_name"}), eq(false));
dbAccessor.addFKConstraint(eq(UpgradeCatalog242.BLUEPRINT_CONFIGURATION), eq("FK_cfg_blueprint_name"),
aryEq(new String[]{"blueprint_name"}), eq(UpgradeCatalog242.BLUEPRINT_TABLE), aryEq(new String[]{"blueprint_name"}), eq(false));
dbAccessor.addFKConstraint(eq(UpgradeCatalog242.BLUEPRINT_SETTING), eq("FK_blueprint_setting_name"),
aryEq(new String[]{"blueprint_name"}), eq(UpgradeCatalog242.BLUEPRINT_TABLE), aryEq(new String[]{"blueprint_name"}), eq(false)); | 0 |
public HostStatus getNodeStatus() {
return nodeStatus;
}
public void setNodeStatus(HostStatus nodeStatus) {
this.nodeStatus = nodeStatus;
} | 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. | 0 |
* by Spark, and then submitting the job to Spark to be executed. If we wanted to run a Beam | 0 |
Set<Long> ids = new HashSet<>(); | 0 |
package org.apache.http.impl.nio; | 0 |
@Test
public void testDoFilter_stackAdvisorCalls() throws Exception {
final Table<String, String, Boolean> urlTests = HashBasedTable.create();
urlTests.put("/api/v1/stacks/HDP/versions/2.3/validations", "POST", true);
urlTests.put("/api/v1/stacks/HDP/versions/2.3/recommendations", "POST", true);
performGeneralDoFilterTest("user1", new int[] { PermissionEntity.CLUSTER_OPERATE_PERMISSION }, urlTests, false);
performGeneralDoFilterTest("admin", new int[] { PermissionEntity.AMBARI_ADMIN_PERMISSION }, urlTests, false);
}
| 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 |
<T> void runTestWrite(T[] elems, Coder<T> coder, String header, String footer) throws Exception {
<T> void runTestWrite(T[] elems, String header, String footer, Coder<T> coder, int numShards)
write = TextIO.Write.to(baseFilename).withCoder(coder);
final String header,
final String footer,
Coder<T> coder,
.transform(removeHeaderAndFooter(header, footer))
assertTrue(Iterables.all(actual, haveProperHeaderAndFooter(header, footer)));
}
private static Function<List<String>, List<String>> removeHeaderAndFooter(final String header,
final String footer) {
return new Function<List<String>, List<String>>() {
@Nullable
@Override
public List<String> apply(List<String> lines) {
ArrayList<String> newLines = Lists.newArrayList(lines);
if (header != null) {
newLines.remove(0);
}
if (footer != null) {
int last = newLines.size() - 1;
newLines.remove(last);
}
return newLines;
}
};
}
private static Predicate<List<String>> haveProperHeaderAndFooter(final String header,
final String footer) {
return new Predicate<List<String>>() {
public boolean apply(List<String> fileLines) {
return (header == null || fileLines.get(0).equals(header))
&& (footer == null || fileLines.get(last).equals(footer));
}; | 0 |
* Basic implementation of {@link HttpAsyncRequestConsumer}. Please note that
* this consumer buffers request content in memory and should be used for
* relatively small request messages.
* | 0 |
public Number convert(String obj, Type targetType, Object root, Object[] key) throws Exception {
public Long convert(Integer obj, Type targetType, Object root, Object[] key) throws Exception {
public Object convert(List t, Type type, Object root, Object[] key) throws Exception {
(v,t,o,k) -> v.toString());
(v,t,o,k) -> null,
(v,t,o,k) -> "arraylist");
(v,t,o,k) -> null,
(v,t,o,k) -> "list");
(v,t,o,k) -> {snooped.put(v,t); return null;}, null);
(i, t, o, k) -> { MyCustomDTO dto = new MyCustomDTO(); dto.field = "" + i.value(); return dto; }));
(b, t, o, k) -> { MyCustomDTO dto = new MyCustomDTO(); dto.field = b.getValue(); return dto; }));
public String convert(Number obj, Type targetType, Object root, Object[] key) throws Exception {
public Number convert(String obj, Type targetType, Object root, Object[] key) throws Exception {
public Map convert(MyDTO6 obj, Type targetType, Object root, Object[] keys) throws Exception { | 0 |
import org.easymock.EasyMock;
import com.twitter.mesos.scheduler.CronJobManager.CronScheduler;
private CronScheduler cronScheduler;
cronScheduler = createMock(CronScheduler.class);
cron = new CronJobManager(storage, cronScheduler, delayExecutor);
JobConfiguration job = makeJob();
expect(cronScheduler.schedule(eq(job.getCronSchedule()), EasyMock.<Runnable>anyObject()))
.andReturn("key");
JobConfiguration job = makeJob();
expect(cronScheduler.schedule(eq(job.getCronSchedule()), EasyMock.<Runnable>anyObject()))
.andReturn("key");
JobConfiguration job = makeJob();
expect(cronScheduler.schedule(eq(job.getCronSchedule()), EasyMock.<Runnable>anyObject()))
.andReturn("key");
JobConfiguration job = makeJob();
expect(cronScheduler.schedule(eq(job.getCronSchedule()), EasyMock.<Runnable>anyObject()))
.andReturn("key");
@Test
public void testUpdate() throws Exception {
JobConfiguration job = makeJob();
JobConfiguration updated = makeJob().setCronSchedule("1 2 3 4 5");
expect(cronScheduler.schedule(eq(job.getCronSchedule()), EasyMock.<Runnable>anyObject()))
.andReturn("key");
cronScheduler.deschedule("key");
expect(cronScheduler.schedule(eq(updated.getCronSchedule()), EasyMock.<Runnable>anyObject()))
.andReturn("key2");
control.replay();
cron.receiveJob(job);
cron.updateJob(updated);
}
| 0 |
* Flink Beam runner exemple.
package org.apache.beam.runners.flink.examples.streaming; | 0 |
import java.awt.Shape;
import java.awt.Stroke; | 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: ElementEnd.java,v 1.2 2004/03/05 10:07:24 bdelacretaz Exp $ | 0 |
return ftpClient != null && ftpClient.isConnected(); | 0 |
//rootLogger.removeHandler(handler); | 0 |
Capture<String> capturedTezViewUpdate = newCapture();
expect(dbAccessor.executeUpdate(capture(capturedTezViewUpdate))).andReturn(1).once();
Assert.assertNotNull(capturedTezViewUpdate.getValue());
Assert.assertEquals("UPDATE viewinstanceproperty SET name = 'yarn.ats.url' where name = 'yarn.timeline-server.url'",
capturedTezViewUpdate.getValue()); | 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 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/java/org/apache/commons/beanutils/ResultSetDynaClass.java,v 1.6 2002/12/07 23:34:40 craigmcc Exp $
* $Revision: 1.6 $
* $Date: 2002/12/07 23:34:40 $
* @version $Revision: 1.6 $ $Date: 2002/12/07 23:34:40 $
* into the result set metadata.</p> | 0 |
Buffer buffer = session.createBuffer(SshConstants.SSH_MSG_CHANNEL_REQUEST); | 0 |
import java.util.HashMap;
public void flush(Class targetClazz, Object lock) throws Exception
{
if (System.getSecurityManager() != null)
{
Actions actions = (Actions) m_actions.get();
actions.set(Actions.FLUSH_FIELD_ACTION, targetClazz, lock);
try
{
AccessController.doPrivileged(actions, m_acc);
}
catch (PrivilegedActionException e)
{
throw e.getException();
}
}
else
{
_flush(targetClazz, lock);
}
}
private static void _flush(Class targetClazz, Object lock) throws Exception
{
synchronized (lock)
{
Field[] fields = targetClazz.getDeclaredFields();
// reset cache
for (int i = 0; i < fields.length; i++)
{
if (Modifier.isStatic(fields[i].getModifiers()) &&
((fields[i].getType() == Hashtable.class) || (fields[i].getType() == HashMap.class)))
{
fields[i].setAccessible(true);
if (fields[i].getType() == Hashtable.class)
{
Hashtable cache = (Hashtable) fields[i].get(null);
if (cache != null)
{
cache.clear();
}
}
else
{
HashMap cache = (HashMap) fields[i].get(null);
if (cache != null)
{
cache.clear();
}
}
}
}
}
}
public static final int FLUSH_FIELD_ACTION = 40;
else if (action == FLUSH_FIELD_ACTION)
{
_flush(((Class) arg1), arg2);
} | 0 |
package cz.seznam.euphoria.operator.test;
import cz.seznam.euphoria.core.client.dataset.windowing.Window;
class IntWindow extends Window {
private int val;
IntWindow(int val) {
this.val = val;
}
public int getValue() {
return val;
}
@Override
public boolean equals(Object o) {
if (o instanceof IntWindow) {
IntWindow that = (IntWindow) o;
return this.val == that.val;
}
return false;
}
@Override
public int hashCode() {
return val;
}
} | 0 |
List<ConfigurationRequest> cr = getConfigurationRequests("Hosts", properties);
hostRequest.setDesiredConfigs(cr);
if (null != request.getClusterName() && null != request.getDesiredConfigs()) {
for (ConfigurationRequest cr : request.getDesiredConfigs()) {
if (null != cr.getProperties() && cr.getProperties().size() > 0) {
LOG.info(MessageFormat.format("Applying configuration with tag ''{0}'' to host ''{1}'' in cluster ''{2}''",
cr.getVersionTag(),
request.getHostname(),
request.getClusterName()));
cr.setClusterName(c.getClusterName());
controller.createConfiguration(cr);
}
Config baseConfig = c.getConfig(cr.getType(), cr.getVersionTag());
if (null != baseConfig) {
String authName = controller.getAuthName();
DesiredConfig oldConfig = h.getDesiredConfigs(c.getClusterId()).get(cr.getType());
if (h.addDesiredConfig(c.getClusterId(), cr.isSelected(), authName, baseConfig)) {
Logger logger = LoggerFactory.getLogger("configchange");
logger.info("cluster '" + c.getClusterName() + "', "
+ "host '" + h.getHostName() + "' "
+ "changed by: '" + authName + "'; "
+ "type='" + baseConfig.getType() + "' "
+ "version='" + baseConfig.getVersion() + "'"
+ "tag='" + baseConfig.getTag() + "'"
+ (null == oldConfig ? "" : ", from='" + oldConfig.getTag() + "'"));
} | 0 |
Optional<IHostAttributes> attributes = getHostAttributes(Iterables.getOnlyElement(hosts));
if (!attributes.isPresent()) {
missingAttributes.incrementAndGet();
return Optional.absent();
}
| 0 |
FileInstall.refresh(bundles); | 0 |
import org.apache.cocoon.woody.event.WidgetEvent;
import org.apache.cocoon.woody.event.ValueChangedEvent;
public void broadcastEvent(WidgetEvent event) {
this.definition.fireValueChangedEvent((ValueChangedEvent)event);
} | 0 |
classLoader.close();
}
if (fileSystem != null) {
fileSystem.close(); | 0 |
import java.util.ArrayList;
import java.util.List;
public class FlinkWindowAssigner<T, GROUP, LABEL>
extends WindowAssigner<MultiWindowedElement<GROUP, LABEL, T>, FlinkWindow<GROUP, LABEL>> {
private final Windowing<?, GROUP, LABEL, ? extends WindowContext<GROUP, LABEL>> windowing;
Windowing<?, GROUP, LABEL, ? extends WindowContext<GROUP, LABEL>> windowing,
public Collection<FlinkWindow<GROUP, LABEL>> assignWindows(
MultiWindowedElement<GROUP, LABEL, T> element,
List<FlinkWindow<GROUP, LABEL>> ws = new ArrayList<>(element.windows().size());
for (WindowID<GROUP, LABEL> window : element.windows()) {
ws.add(new FlinkWindow<>(windowing.createWindowContext(window)));
}
return ws;
public Trigger<MultiWindowedElement<GROUP, LABEL, T>, FlinkWindow<GROUP, LABEL>> getDefaultTrigger(
public TypeSerializer<FlinkWindow<GROUP, LABEL>> getWindowSerializer(ExecutionConfig executionConfig) {
return new KryoSerializer<>((Class) FlinkWindow.class, executionConfig); | 0 |
@Test(timeout=60*1000) | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ | 0 |
import org.apache.hc.client5.http.impl.sync.HttpClients;
import org.apache.hc.client5.http.sync.methods.HttpGet; | 0 |
scheduler.cancelHostRoleCommands(EasyMock.<Collection<HostRoleCommand>>anyObject(),EasyMock.anyObject(String.class));
Capture<Collection<HostRoleCommand>> cancelCommandList = EasyMock.newCapture(); | 0 |
package org.apache.felix.fileinstall.internal;
import org.apache.felix.fileinstall.internal.DirectoryWatcher;
import org.apache.felix.fileinstall.internal.FileInstall; | 0 |
import java.io.FileFilter;
import java.io.UnsupportedEncodingException;
import java.util.List;
//-----------------------------------------------------------------------
* Reads the contents of a file line by line to a List of Strings.
* </p>
* <p>
* There is no readLines method without encoding parameter because
* the default encoding can differ between platforms and therefore results
* in inconsistent results.
* </p>
*
* @param file the file to read
* @param encoding the encoding to use
* @return the list of Strings representing each line in the file
* @throws IOException in case of an I/O error
* @throws UnsupportedEncodingException if the encoding is not supported by the VM
* @since 1.1
*/
public static List readLines(File file, String encoding) throws IOException {
InputStream in = new FileInputStream(file);
try {
return IOUtils.readLines(in, encoding);
} finally {
IOUtils.closeQuietly(in);
}
}
//-----------------------------------------------------------------------
/**
* <p> | 1 |
private byte[] data;
int[] offsets = new int[numIndexEntries]; | 0 |
* function is a lot like that of the class in Java. Users of the Cocoon Forms framework
* @version CVS $Id: WidgetDefinition.java,v 1.2 2004/03/11 02:56:33 joerg Exp $ | 0 |
*
* http://www.apache.org/licenses/LICENSE-2.0
*
/**
* Provider class that provides KafkaNotification for Guice.
*/
| 0 |
import org.apache.beam.integration.nexmark.model.Auction;
import org.apache.beam.integration.nexmark.model.Bid;
import org.apache.beam.integration.nexmark.model.Person;
public class NexmarkDriver<OptionT extends NexmarkOptions> { | 0 |
* An exception was caught and the session will be closed
* (if not already so). <B>Note:</B> the code makes no guarantee
* that at this stage {@link #sessionClosed(Session)} will be called
* or perhaps has already been called
*
* @param session The referenced {@link Session}
* @param t The caught exception
*/
void sessionException(Session session, Throwable t);
/** | 0 |
import org.apache.http.nio.NHttpMessageWriter;
/**
* Default {@link NHttpMessageWriter} implementation for {@link HttpResponse}s.
*
* @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
*
* @version $Revision$
*/ | 0 |
(String) null, Collections.emptyMap());
Collections.emptyMap()); | 0 |
import org.apache.atlas.utils.AtlasPerfTracer;
private static final Logger PERF_LOG = AtlasPerfTracer.getPerfLogger("rest.LineageResource");
AtlasPerfTracer perf = null;
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "LineageResource.inputsGraph(" + guid + ")");
}
} finally {
AtlasPerfTracer.log(perf);
AtlasPerfTracer perf = null;
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "LineageResource.outputsGraph(" + guid + ")");
}
} finally {
AtlasPerfTracer.log(perf);
AtlasPerfTracer perf = null;
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "LineageResource.schema(" + guid + ")");
}
} finally {
AtlasPerfTracer.log(perf); | 0 |
public CliCommand parse(String[] cmdArgs) throws CliParseException {
try {
cl = parser.parse(options, cmdArgs);
} catch (ParseException ex) {
throw new CliParseException(ex);
}
throw new CliParseException(getUsageStr());
public boolean exec() throws CliException {
List<ACL> acl;
try {
acl = zk.getACL(path, stat);
} catch (KeeperException|InterruptedException ex) {
throw new CliWrapperException(ex);
}
| 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 |
@NamedQuery(name = "AlertCurrentEntity.findByCluster", query = "SELECT alert FROM AlertCurrentEntity alert JOIN alert.alertHistory history WHERE history.clusterId = :clusterId"),
@NamedQuery(name = "AlertCurrentEntity.findByService", query = "SELECT alert FROM AlertCurrentEntity alert JOIN alert.alertHistory history WHERE history.clusterId = :clusterId AND history.serviceName = :serviceName AND history.alertDefinition.scope IN :inlist"),
@NamedQuery(name = "AlertCurrentEntity.findByHost", query = "SELECT alert FROM AlertCurrentEntity alert JOIN alert.alertHistory history WHERE history.clusterId = :clusterId AND history.hostName = :hostName AND history.alertDefinition.scope IN :inlist"), | 0 |
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at | 0 |
* @version CVS $Id: URICopletAdapter.java,v 1.6 2003/05/26 09:52:59 cziegeler Exp $
final String uri = (String)coplet.getCopletData().getAttribute("uri"); | 0 |
import org.apache.commons.jelly.JellyTagException;
public void doTag(XMLOutput output) throws JellyTagException { | 0 |
@SuppressWarnings({"unchecked", "serial", "rawtypes", "unused"}) public class BatchScanOptions implements org.apache.thrift.TBase<BatchScanOptions, BatchScanOptions._Fields>, java.io.Serializable, Cloneable, Comparable<BatchScanOptions> {
public enum _Fields implements org.apache.thrift.TFieldIdEnum { | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/plugins/PluginCreateRule.java,v 1.5 2003/10/28 23:31:08 rdonkin Exp $
* $Revision: 1.5 $
* $Date: 2003/10/28 23:31:08 $
Log log = LogUtils.getLogger(digester);
boolean debug = log.isDebugEnabled();
if (debug) {
log.debug("PluginCreateRule.postRegisterInit" +
": rule registered for pattern [" + pattern + "]");
}
Log log = digester.getLogger();
boolean debug = log.isDebugEnabled();
if (debug) {
if (debug) {
if (debug) {
if (debug) {
if (debug) {
Log log = digester.getLogger();
Log log = digester.getLogger();
Log log = digester.getLogger(); | 0 |
new HierarchicalTypeDefinition<>(ClassType.class, HiveDataTypes.HIVE_STORAGEDESC.getName(), null,
new HierarchicalTypeDefinition<>(ClassType.class, HiveDataTypes.HIVE_DB.getName(), null,
new HierarchicalTypeDefinition<>(ClassType.class, HiveDataTypes.HIVE_TYPE.getName(), null, null,
new HierarchicalTypeDefinition<>(ClassType.class, HiveDataTypes.HIVE_COLUMN.getName(), null,
new HierarchicalTypeDefinition<>(ClassType.class, HiveDataTypes.HIVE_PARTITION.getName(), null,
new HierarchicalTypeDefinition<>(ClassType.class, HiveDataTypes.HIVE_TABLE.getName(), null,
new HierarchicalTypeDefinition<>(ClassType.class, HiveDataTypes.HIVE_ROLE.getName(), null, null,
new HierarchicalTypeDefinition<>(ClassType.class, HiveDataTypes.HIVE_PROCESS.getName(), null, | 0 |
package org.apache.beam.sdk.nexmark.model; | 0 |
*
*
*
*
* | 1 |
/* $Id: DigesterLoaderRulesTest.java,v 1.3 2004/05/07 01:30:00 skitching Exp $
* | 0 |
* to pump the streams and also to check if the shell is alive.
/**
* default buffer size for the IO pumps.
*/
ThreadUtils.newSingleThreadExecutor("shell[" + Integer.toHexString(shell.hashCode()) + "]"),
true,
bufferSize); | 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. | 0 |
* <li>Digester will call the <code>addRuleInstances()</code> method of your RuleSet to configure the
* necessary rules.</li> | 0 |
package org.apache.felix.karaf.shell.commands;
import org.apache.felix.karaf.shell.console.OsgiCommandSupport; | 0 |
import org.apache.accumulo.core.client.Accumulo;
try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) {
try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) {
try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) { | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ | 0 |
final Connector conn = instance.getConnector("root", new PasswordToken("")); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/test/org/apache/commons/validator/RequiredNameTest.java,v 1.13 2003/09/06 05:17:59 rleland Exp $
* $Revision: 1.13 $
* $Date: 2003/09/06 05:17:59 $
* @version $Revision: 1.13 $ $Date: 2003/09/06 05:17:59 $
public class RequiredNameTest extends TestCommon {
loadResources("validator-name-required.xml"); | 0 |
import org.apache.accumulo.core.util.DeprecationUtil;
import org.apache.accumulo.shell.commands.DeleteScanIterCommand;
import org.apache.accumulo.shell.commands.SetScanIterCommand;
if (!options.isFake()) {
DistributedTrace.enable(InetAddress.getLocalHost().getHostName(), "shell", clientConf);
}
Command[] iteratorCommands = {new DeleteIterCommand(), new DeleteScanIterCommand(), new ListIterCommand(), new SetIterCommand(), new SetScanIterCommand(),
new SetShellIterCommand(), new ListShellIterCommand(), new DeleteShellIterCommand()};
if (options.isFake()) {
instance = DeprecationUtil.makeMockInstance("fake");
String instanceName, hosts;
if (options.isHdfsZooInstance()) {
instanceName = hosts = null;
} else if (options.getZooKeeperInstance().size() > 0) {
List<String> zkOpts = options.getZooKeeperInstance();
instanceName = zkOpts.get(0);
hosts = zkOpts.get(1);
} else {
instanceName = options.getZooKeeperInstanceName();
hosts = options.getZooKeeperHosts();
}
final ClientConfiguration clientConf;
try {
clientConf = options.getClientConfiguration();
} catch (ConfigurationException | FileNotFoundException e) {
throw new IllegalArgumentException("Unable to load client config from " + options.getClientConfigFile(), e);
}
instance = getZooInstance(instanceName, hosts, clientConf); | 0 |
* @version $Revision$ $Date$ | 0 |
DefaultListDelimiterHandler listHandler = new DefaultListDelimiterHandler(',');
config.setListDelimiterHandler(listHandler);
Parameters.xml().setExpressionEngine(engine)
.setListDelimiterHandler(listHandler)));
assertEquals("OK-1", config.getString("buttons/name"));
assertEquals(3, config.getMaxIndex("buttons/name"));
config.addProperty("listDelimiterTest", "1,2,3");
assertEquals("List delimiter not detected", "1", config.getString("listDelimiterTest")); | 0 |
import org.apache.ambari.controller.rest.resources.StackResource;
import org.apache.ambari.controller.rest.resources.StacksResource; | 0 |
{
}
{
}
{
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.