Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
private static org.slf4j.Logger log =
org.slf4j.LoggerFactory.getLogger(Driver.class); | 1 |
import org.apache.accumulo.core.trace.ProbabilitySampler;
ProbabilitySampler sampler = new ProbabilitySampler(getConfiguration().getFraction(Property.GC_TRACE_PERCENT)); | 0 |
if (tableInfo != null && !tableState.equals(TableState.OFFLINE)) { | 0 |
KeyedWorkItem<String, KV<InputT, RestrictionT>>, OutputT> {
private final DoFnRunner<KeyedWorkItem<String, KV<InputT, RestrictionT>>, OutputT> underlying;
DoFnRunner<KeyedWorkItem<String, KV<InputT, RestrictionT>>, OutputT> underlying,
public DoFn<KeyedWorkItem<String, KV<InputT, RestrictionT>>, OutputT> getFn() {
public Iterable<WindowedValue<KeyedWorkItem<String, KV<InputT, RestrictionT>>>>
WindowedValue<KeyedWorkItem<String, KV<InputT, RestrictionT>>> windowedKWI) {
WindowedValue<KeyedWorkItem<String, T>> windowedKWI) {
private static <T> BoundedWindow getUnderlyingWindow(KeyedWorkItem<String, T> kwi) { | 0 |
Assert.assertFalse(cm.isContainer());
Assert.assertFalse(cm.isContainer());
Assert.assertFalse(cm.isContainer());
Assert.assertFalse(cm.isContainer());
cm = CreateMode.CONTAINER;
Assert.assertEquals(cm.toFlag(), 4);
Assert.assertFalse(cm.isEphemeral());
Assert.assertFalse(cm.isSequential());
Assert.assertTrue(cm.isContainer()); | 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.commons.pool2.KeyedObjectPool;
KeyedObjectPool pool = new GenericKeyedObjectPool(factory); | 0 |
private static final String AMBARI_HIVE_SERVICE_NAME = "HIVE";
private static final String USE_HIVE_INTERACTIVE_MODE = "use.hive.interactive.mode";
boolean useLLAP = Boolean.valueOf(context.getProperties().get(USE_HIVE_INTERACTIVE_MODE));
if (useLLAP) {
binaryPort = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, BINARY_PORT_KEY);
httpPort = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, HTTP_PORT_KEY);
}
.append(concatHostPorts);
if(!Strings.isNullOrEmpty(sessionParams)) {
builder.append(";").append(sessionParams);
}
boolean useLLAP = Boolean.valueOf(context.getProperties().get(USE_HIVE_INTERACTIVE_MODE));
if (useLLAP) {
if (Strings.isNullOrEmpty(sessionParams)) {
if (!sessionParams.contains(HS2_PROXY_USER)) {
if (!sessionParams.isEmpty()) {
sessionParams += ";";
}
sessionParams = sessionParams + HS2_PROXY_USER + "=" + context.getUsername();
}
if (sessionParams.isEmpty()) {
return formatted; | 0 |
package org.apache.felix.sigil.ui.eclipse.ui.util;
public class UIHelper
{
public static <T> IElementDescriptor<T> getDefaultElementDescriptor() {
return new IElementDescriptor<T>()
{
public String getLabel( T element )
{
return element == null ? "null" : element.toString();
}
public String getName( T element )
{
return getLabel( element );
}
};
}
public static <T> IFilter<T> getDefaultFilter() {
return new IFilter<T> () {
public boolean select( T element )
{
return true;
}
};
}
} | 0 |
private static class Collector<InputT, OutputT>
implements DoFnCollector.BeamCollector<InputT, OutputT, OutputT> {
@Nullable private final ExtractEventTime<InputT> eventTimeExtractor; | 0 |
private String revision;
if (revision != null)
{
// FIXME: hopefully if we have multiple bundles they all have the same version
getProject().setProperty(revision, bundle.getVersion());
}
public void setRevision(String revision)
{
this.revision = revision;
}
| 0 |
.apply(TextIO.write().to(resultPath)); | 0 |
import org.apache.beam.fn.harness.data.PTransformFunctionRegistry;
PTransformFunctionRegistry startFunctionRegistry = new PTransformFunctionRegistry();
PTransformFunctionRegistry finishFunctionRegistry = new PTransformFunctionRegistry();
startFunctionRegistry,
finishFunctionRegistry,
Iterables.getOnlyElement(startFunctionRegistry.getFunctions()).run();
assertThat(finishFunctionRegistry.getFunctions(), Matchers.empty()); | 0 |
return ps.stream()
.map((PartitionInfo p) -> {
if (p.leader().id() == -1) {
throw new IllegalStateException("Leader not available");
}
return new KafkaPartition(
brokerList, topicId, p.partition(),
config,
offs.getOrDefault(p.partition(), defaultOffsetTimestamp),
stopAtStamp);
})
.collect(Collectors.toList()); | 0 |
import org.apache.batik.ext.awt.RenderingHintsKeyExt;
import org.apache.batik.ext.awt.ColorSpaceHintKey;
rh.put(RenderingHintsKeyExt.KEY_COLORSPACE,
ColorSpaceHintKey.VALUE_COLORSPACE_ALPHA);
Object val = cr.getProperty(ColorSpaceHintKey.PROPERTY_COLORSPACE);
if (val == ColorSpaceHintKey.VALUE_COLORSPACE_ALPHA) | 0 |
import org.apache.aurora.common.quantity.Amount;
import org.apache.aurora.common.quantity.Time;
import org.apache.aurora.common.stats.Stats;
import org.apache.aurora.common.stats.StatsProvider;
import org.apache.aurora.common.testing.easymock.EasyMockTest;
import org.apache.aurora.common.util.Clock;
import org.apache.aurora.common.util.TruncatedBinaryBackoff; | 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 cz.seznam.euphoria.core.annotation.audience.Audience;
@Audience(Audience.Type.EXECUTOR) | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/java/org/apache/commons/beanutils/PropertyUtils.java,v 1.8 2001/08/21 23:05:08 craigmcc Exp $
* $Revision: 1.8 $
* $Date: 2001/08/21 23:05:08 $
* @version $Revision: 1.8 $ $Date: 2001/08/21 23:05:08 $
* @exception ArrayIndexOutOfBoundsException if the specified index
* is outside the valid range for the underlying array
* @exception ArrayIndexOutOfBoundsException if the specified index
* is outside the valid range for the underlying array
try {
return (readMethod.invoke(bean, subscript));
} catch (InvocationTargetException e) {
if (e.getTargetException() instanceof
ArrayIndexOutOfBoundsException)
throw (ArrayIndexOutOfBoundsException)
e.getTargetException();
else
throw e;
}
* @exception ArrayIndexOutOfBoundsException if the specified index
* is outside the valid range for the underlying array
* @exception ArrayIndexOutOfBoundsException if the specified index
* is outside the valid range for the underlying array
try {
writeMethod.invoke(bean, subscript);
} catch (InvocationTargetException e) {
if (e.getTargetException() instanceof
ArrayIndexOutOfBoundsException)
throw (ArrayIndexOutOfBoundsException)
e.getTargetException();
else
throw e;
} | 0 |
public Attribute copy(ConstantPool _constant_pool) {
c.constant_pool = _constant_pool; | 0 |
package org.apache.commons.digester3.plugins.strategies;
import org.apache.commons.digester3.Digester;
import org.apache.commons.digester3.plugins.PluginException;
import org.apache.commons.digester3.plugins.RuleFinder;
import org.apache.commons.digester3.plugins.RuleLoader; | 1 |
.collect(Collectors.toMap(Map.Entry::getKey, e -> ((PCollection) e.getValue()).getCoder()));
* @param transform the transform to check
return (T) pobjects.get(value); | 0 |
Copyright 2001 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 |
* Autogenerated by Thrift Compiler (0.9.3)
import javax.annotation.Generated;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2015-12-16")
public class ThriftTableOperationException extends TException implements org.apache.thrift.TBase<ThriftTableOperationException, ThriftTableOperationException._Fields>, java.io.Serializable, Cloneable, Comparable<ThriftTableOperationException> {
List<Object> list = new ArrayList<Object>();
boolean present_tableId = true && (isSetTableId());
list.add(present_tableId);
if (present_tableId)
list.add(tableId);
boolean present_tableName = true && (isSetTableName());
list.add(present_tableName);
if (present_tableName)
list.add(tableName);
boolean present_op = true && (isSetOp());
list.add(present_op);
if (present_op)
list.add(op.getValue());
boolean present_type = true && (isSetType());
list.add(present_type);
if (present_type)
list.add(type.getValue());
boolean present_description = true && (isSetDescription());
list.add(present_description);
if (present_description)
list.add(description);
return list.hashCode();
struct.op = org.apache.accumulo.core.client.impl.thrift.TableOperation.findByValue(iprot.readI32());
struct.type = org.apache.accumulo.core.client.impl.thrift.TableOperationExceptionType.findByValue(iprot.readI32());
struct.op = org.apache.accumulo.core.client.impl.thrift.TableOperation.findByValue(iprot.readI32());
struct.type = org.apache.accumulo.core.client.impl.thrift.TableOperationExceptionType.findByValue(iprot.readI32()); | 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.3 2003/05/20 14:32:37 cziegeler Exp $
par.put(Constants.COPLET_ID_KEY, coplet.getId()); | 0 |
import cz.seznam.euphoria.core.executor.TriggerScheduler;
public abstract class AbstractTriggerScheduler implements TriggerScheduler {
private static final Logger LOG = LoggerFactory.getLogger(AbstractTriggerScheduler.class);
public AbstractTriggerScheduler() {
.setNameFormat("trigger-%d")
.setDaemon(true)
.build();
AbstractTriggerScheduler.this.activeTasks.remove(window, this); | 0 |
if (ctx.isInteractive()) { | 0 |
IOUtils.closeQuietly(fout);
return null; | 0 |
import org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.ByteString;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Iterators; | 0 |
import org.apache.xml.security.test.stax.utils.UnixInputStream;
"org/apache/xml/security/c14n/in/default_ns_redefinition_c14n.xml"), true);
return getBytesFromResource(resource, false);
}
public static byte[] getBytesFromResource(URL resource, boolean unix) throws IOException {
if (unix) {
inputStream = new UnixInputStream(inputStream);
} | 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 |
* @author Apache Software Foundation | 0 |
store.saveJobUpdate(update, Optional.of(lock.getToken())); | 0 |
import org.apache.commons.logging.Log;
/** The ConfigurationInterpolator used by this object. */
private ConfigurationInterpolator interpolator;
/** The logger used by this instance. */
private Log logger;
* Returns the logger used by this object.
*
* @return the {@code Log}
* @since 2.0
*/
public Log getLogger()
{
return logger;
}
/**
* Sets the logger to be used by this object. If no logger is passed in, no
* log output is generated.
*
* @param logger the {@code Log}
* @since 2.0
public void setLogger(Log logger)
this.logger = logger;
}
/**
* Returns the {@code ConfigurationInterpolator} used by this object.
*
* @return the {@code ConfigurationInterpolator}
* @since 2.0
*/
public ConfigurationInterpolator getInterpolator()
{
return interpolator;
}
/**
* Sets the {@code ConfigurationInterpolator} to be used by this object.
*
* @param interpolator the {@code ConfigurationInterpolator} (may be
* <b>null</b>)
* @since 2.0
*/
public void setInterpolator(ConfigurationInterpolator interpolator)
{
this.interpolator = interpolator;
installSubstitutor(interpolator);
Log l = getLogger();
if (l != null)
{
l.debug("Error encountered evaluating " + result, e);
}
* Creates a {@code StrSubstitutor} object which uses the passed in
* {@code ConfigurationInterpolator} as lookup object.
* @param ip the {@code ConfigurationInterpolator} to be used
private void installSubstitutor(final ConfigurationInterpolator ip)
if (ip == null)
Object value = ip.resolve(key); | 0 |
ExecutionEnvironment environment =
new ExecutionEnvironment(mode, localEnv, registeredClasses); | 0 |
import java.util.*;
import org.apache.felix.utils.collections.MapToDictionary;
Dictionary propertyDict = new MapToDictionary(capability.getPropertiesAsMap());
return m_name.equals(capability.getName()) &&
m_filter.match(propertyDict) &&
(m_filter.toString().contains("(mandatory:<*") || propertyDict.get("mandatory:") == null); | 0 |
* http://www.apache.org/licenses/LICENSE-2.0 | 0 |
import java.io.DataInput;
ConstantValue(int name_index, int length, DataInput file, ConstantPool constant_pool) | 0 |
PipelineOptions options, MapTask mapTask, DataflowExecutionContext context) throws Exception {
static Operation createOperation(
PipelineOptions options,
ParallelInstruction instruction,
DataflowExecutionContext executionContext,
List<Operation> priorOperations,
String counterPrefix,
CounterSet.AddCounterMutator addCounterMutator,
StateSampler stateSampler)
throws Exception {
static ReadOperation createReadOperation(
PipelineOptions options,
ParallelInstruction instruction,
DataflowExecutionContext executionContext,
List<Operation> priorOperations,
String counterPrefix,
CounterSet.AddCounterMutator addCounterMutator,
StateSampler stateSampler)
throws Exception {
static ParDoOperation createParDoOperation(
PipelineOptions options,
ParallelInstruction instruction,
DataflowExecutionContext executionContext,
List<Operation> priorOperations,
String counterPrefix,
CounterSet.AddCounterMutator addCounterMutator,
StateSampler stateSampler)
throws Exception { | 0 |
import java.util.Collections;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.ambari.server.controller.AmbariManagementController;
import org.apache.ambari.server.controller.ganglia.GangliaReportPropertyProvider;
import org.apache.ambari.server.controller.spi.NoSuchParentResourceException;
import org.apache.ambari.server.controller.spi.NoSuchResourceException;
import org.apache.ambari.server.controller.spi.Predicate;
import org.apache.ambari.server.controller.spi.PropertyProvider;
import org.apache.ambari.server.controller.spi.ProviderModule;
import org.apache.ambari.server.controller.spi.Request;
import org.apache.ambari.server.controller.spi.Resource;
import org.apache.ambari.server.controller.spi.ResourceProvider;
import org.apache.ambari.server.controller.spi.SystemException;
import org.apache.ambari.server.controller.spi.UnsupportedPropertyException;
import org.apache.ambari.server.state.Cluster;
import com.google.inject.Inject;
providers.add(new AlertSummaryPropertyProvider(type,
"Clusters/cluster_name", null));
providers.add(new AlertSummaryPropertyProvider(type,
"ServiceInfo/cluster_name", "ServiceInfo/service_name"));
providers.add(new AlertSummaryPropertyProvider(type,
"Hosts/cluster_name", "Hosts/host_name")); | 0 |
* or more contributor license agreements. See the NOTICE file
* regarding copyright ownership. The ASF licenses this file
* with the License. You may obtain a copy of the License at
* KIND, either express or implied. See the License for the | 0 |
ClassPathItem[] classpath ) throws MojoExecutionException | 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 |
* any, must include the following acknowledgement:
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
* permission of the Apache Software Foundation. | 0 |
* 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 |
* @param input The input/output bytes
* @throws Exception
*/
void update(byte[] input) throws Exception;
/**
* Performs in-place encryption or decryption on the given data. | 0 |
* </p>
* </p>
* CheckDigit is used by the new generic @link CodeValidator} implementation.
* </p>
* | 0 |
public static StructTypeDefinition createStructTypeDef(String name, String description, String version, AttributeDefinition... attrDefs) {
return new StructTypeDefinition(name, description, version, attrDefs);
}
| 0 |
package org.apache.aurora.scheduler.quota;
import org.apache.aurora.scheduler.quota.QuotaManager.QuotaManagerImpl;
import org.apache.aurora.scheduler.state.JobFilter;
import org.apache.aurora.scheduler.storage.Storage; | 0 |
import org.apache.ambari.server.state.RepositoryType;
Mockito.when(m_repositoryVersion.getType()).thenReturn(RepositoryType.STANDARD);
} | 0 |
import org.apache.atlas.model.instance.AtlasEntity.Status;
import static org.apache.atlas.model.instance.AtlasEntity.Status.ACTIVE;
import static org.apache.atlas.repository.graph.GraphHelper.getClassificationEdges;
import static org.apache.atlas.type.AtlasStructType.AtlasAttribute.AtlasRelationshipEdgeDirection.OUT;
* Delete the specified relationship edge.
*
* @param edge
* @throws AtlasBaseException
*/
public void deleteRelationship(AtlasEdge edge) throws AtlasBaseException {
deleteRelationships(Collections.singleton(edge));
}
/**
return deleteEdgeReference(edge, typeCategory, isOwned, forceDeleteStructTrait, OUT, vertex);
final String typeName = GraphHelper.getTypeName(outVertex);
final String outId = GraphHelper.getGuid(outVertex);
final Status state = getState(outVertex);
// Delete external references to this vertex - incoming edges from lineage or glossary term edges
Iterable<AtlasEdge> incomingEdges = instanceVertex.getEdges(AtlasEdgeDirection.IN);
for (AtlasEdge edge : incomingEdges) {
Status edgeState = getState(edge);
if (edgeState == ACTIVE) {
if (isRelationshipEdge(edge)) {
deleteRelationship(edge);
} else {
AtlasVertex outVertex = edge.getOutVertex();
AtlasVertex inVertex = edge.getInVertex();
AtlasAttribute attribute = getAttributeForEdge(edge.getLabel());
deleteEdgeBetweenVertices(outVertex, inVertex, attribute);
}
List<AtlasEdge> classificationEdges = getClassificationEdges(instanceVertex);
for (AtlasEdge edge : classificationEdges) {
AtlasVertex classificationVertex = edge.getInVertex();
removeTagPropagation(classificationVertex);
deleteEdgeReference(edge, CLASSIFICATION, false, false, instanceVertex); | 0 |
* @version CVS $Id: ExtendedComponentSelector.java,v 1.6 2003/11/06 14:30:01 cziegeler Exp $
protected ExtendedComponentSelector parentSelector;
final Component component = this.parentSelector.select(hint);
if ( this.parentSelector != null &&
this.parentSelector.canRelease(component) ) {
this.parentSelector = (ExtendedComponentSelector) locator.lookup();
/* (non-Javadoc)
* @see org.apache.avalon.excalibur.component.ExcaliburComponentSelector#canRelease(org.apache.avalon.framework.component.Component)
*/
protected boolean canRelease(Component component) {
if ( this.parentSelector != null &&
this.parentSelector.canRelease(component) ) {
return true;
}
return super.canRelease(component);
}
| 0 |
final User user = users.getUser(username);
users.getUserAuthorities(user.getUserName())); | 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.
*/
@Override
public void visit(State state, Properties props) throws Exception {
Connector conn = state.getConnector();
Random rand = (Random) state.get("rand");
@SuppressWarnings("unchecked")
List<String> tableNames = (List<String>) state.get("tables");
String tableName = tableNames.get(rand.nextInt(tableNames.size()));
// TODO need to sometimes do null start and end ranges
TreeSet<Text> range = new TreeSet<Text>();
range.add(new Text(String.format("%016x", Math.abs(rand.nextLong()))));
range.add(new Text(String.format("%016x", Math.abs(rand.nextLong()))));
try {
conn.tableOperations().merge(tableName, range.first(), range.last());
log.debug("merged " + tableName);
} catch (TableOfflineException toe) {
log.debug("merge " + tableName + " failed, table is not online");
} catch (TableNotFoundException tne) {
log.debug("merge " + tableName + " failed, doesnt exist");
} | 0 |
log.error("{}", ex.getMessage(), ex); | 0 |
import static org.junit.Assert.assertEquals;
public class XMLSecurityEventWriterTest {
assertEquals(
} | 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: ComponentsSelector.java,v 1.13 2004/07/16 12:36:45 sylvain Exp $ | 0 |
import java.util.Arrays;
protected void onChildrenChanged(FileName child, FileType newType) throws Exception
((AbstractFileObject) destFile).handleCreate(getType());
notifyParent(this.getName(), newType);
notifyParent(this.getName(), FileType.IMAGINARY);
* @deprecated use {@link #childrenChanged(FileName, FileType)}
childrenChanged(null, null);
}
/**
* Notifies the file that its children have changed.
*/
protected void childrenChanged(FileName childName, FileType newType) throws Exception
{
if (children != null)
{
if (childName != null && newType != null)
{
// TODO - figure out if children[] can be replaced by list
ArrayList list = new ArrayList(Arrays.asList(children));
if (newType.equals(FileType.IMAGINARY))
{
list.remove(childName);
}
else
{
list.add(childName);
}
children = new FileName[list.size()];
list.toArray(children);
}
}
// removeChildrenCache();
onChildrenChanged(childName, newType);
private void notifyParent(FileName childName, FileType newType) throws Exception
parent.childrenChanged(childName, newType);
if (type != null && type != FileType.IMAGINARY) | 0 |
import java.io.IOException;
import java.io.InputStream;
try {
InputStream is = url.openStream();
available = (is != null);
is.close();
} catch (IOException ioe) {
available = false;
} | 0 |
import org.apache.accumulo.server.zookeeper.DistributedWorkQueue;
new DistributedWorkQueue(ZooUtil.getRoot(master.getInstance()) + Constants.ZRECOVERY).addWork(file, source.getBytes());
case NodeDeleted:
Path finished = new Path(Constants.getRecoveryDir(master.getSystemConfiguration()) + "/" + file, "finished"); | 1 |
package org.apache.atlas.security;
return String.format("/target/atlas-webapp-%s.war", | 1 |
* Minimal implementation of {@link CloseableHttpClient}. This client is
* optimized for HTTP/1.1 message transport and does not support advanced
* HTTP protocol functionality such as request execution via a proxy, state
* management, authentication and request redirects.
* <p>
* Concurrent message exchanges executed by this client will get assigned to
* separate connections leased from the connection pool.
* </p>
@Contract(threading = ThreadingBehavior.SAFE_CONDITIONAL)
if (!execRuntime.isEndpointAcquired()) {
execRuntime.acquireEndpoint(route, null, clientContext);
if (!execRuntime.isEndpointConnected()) {
execRuntime.connectEndpoint(clientContext);
execRuntime.releaseEndpoint();
execRuntime.discardEndpoint();
execRuntime.discardEndpoint();
execRuntime.discardEndpoint(); | 0 |
package org.apache.felix.sigil.ui.eclipse.ui.util; | 0 |
* A subclass of {@link org.apache.beam.sdk.io.common.TestRow} to be used with {@link
* org.apache.hadoop.mapreduce.lib.db.DBInputFormat}.
id = in.readInt();
name = in.readUTF();
public void setParameters(TestRow element, PreparedStatement statement) throws SQLException { | 1 |
import org.apache.beam.sdk.values.reflect.DefaultRowTypeFactory;
import org.apache.beam.sdk.values.reflect.RowTypeFactory;
RowTypeFactory factory = new DefaultRowTypeFactory();
RowTypeFactory factory = new DefaultRowTypeFactory(); | 0 |
* Basic implementation of an {@link HttpRouteDirector HttpRouteDirector}.
* This implementation is stateless and therefore thread-safe.
public class BasicRouteDirector implements HttpRouteDirector {
} // class BasicRouteDirector | 0 |
public static final String QUEUE_SIZE = CONF_PREFIX + "queueSize";
private static final int queueSizeDefault = 10000;
public String queryId;
public String queryStr;
public Long queryStartTime;
private static final HiveConf hiveConf;
int queueSize = atlasProperties.getInt(QUEUE_SIZE, queueSizeDefault);
new LinkedBlockingQueue<Runnable>(queueSize),
hiveConf = new HiveConf();
event.queryId = hookContext.getQueryPlan().getQueryId();
event.queryStr = hookContext.getQueryPlan().getQueryStr();
event.queryStartTime = hookContext.getQueryPlan().getQueryStartTime();
event.jsonPlan = getQueryPlan(hookContext.getConf(), hookContext.getQueryPlan());
HiveMetaStoreBridge dgiBridge = new HiveMetaStoreBridge(hiveConf, atlasProperties, event.user, event.ugi);
LOG.warn("Failed to deduct new name for " + event.queryStr);
if (event.queryId == null) {
String queryStr = normalize(event.queryStr);
processReferenceable.set("startTime", event.queryStartTime);
processReferenceable.set("queryId", event.queryId);
private JSONObject getQueryPlan(HiveConf hiveConf, QueryPlan queryPlan) throws Exception {
explain.initialize(hiveConf, queryPlan, null);
List<Task<?>> rootTasks = queryPlan.getRootTasks();
return explain.getJSONPlan(null, null, rootTasks, queryPlan.getFetchTask(), true, false, false); | 0 |
Resource resource = cap.getResource();
if(resource == null)
{
return new HashSet<Capability>();
}
OpenHashMap<Capability, Set<Capability>> sources = resourcePkgMap.get(resource).m_sources;
if(sources == null)
{
return new HashSet<Capability>();
}
Set<Capability> packageSources = sources.get(cap);
if(packageSources == null)
{
return new HashSet<Capability>();
}
return packageSources; | 0 |
import cz.seznam.euphoria.core.client.operator.hint.OutputHint;
import cz.seznam.euphoria.core.executor.graph.DAG;
import cz.seznam.euphoria.shadow.com.google.common.collect.Sets;
import java.util.Set;
public Dataset<ELEM> output(OutputHint... outputHints) {
public Dataset<ELEM> output(OutputHint... outputHints) {
name, flow, input, mapper, windowing, Sets.newHashSet(outputHints));
@Nullable Windowing<IN, W> windowing,
Set<OutputHint> outputHints) {
super(name, flow, input, mapper, windowing, outputHints); | 0 |
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
public BeamSqlPrimitive<Boolean> evaluate(BeamRecord inputRow, BoundedWindow window) {
Object leftValue = operands.get(0).evaluate(inputRow, window).getValue();
Object rightValue = operands.get(1).evaluate(inputRow, window).getValue(); | 0 |
import org.apache.accumulo.server.security.SystemCredentials;
import org.apache.accumulo.trace.instrument.Tracer;
tsStats.addAll(client.getTabletStats(Tracer.traceInfo(), SystemCredentials.get().getAsThrift(), tableId));
historical = client.getHistoricalStats(Tracer.traceInfo(), SystemCredentials.get().getAsThrift());
opHistoryDetails.addRow("Major Compaction", total.majors.num, total.majors.fail, total.majors.num != 0 ? (total.majors.queueTime / total.majors.num)
: null, majorQueueStdDev, total.majors.num != 0 ? (total.majors.elapsed / total.majors.num) : null, majorStdDev, total.majors.elapsed);
opHistoryDetails.addRow("Minor Compaction", total.minors.num, total.minors.fail, total.minors.num != 0 ? (total.minors.queueTime / total.minors.num)
: null, minorQueueStdDev, total.minors.num != 0 ? (total.minors.elapsed / total.minors.num) : null, minorStdDev, total.minors.elapsed); | 1 |
return m_serviceProperties; | 0 |
* @version CVS $Id$
public RedirectToURINode(VariableResolver uri,
boolean createSession,
boolean global,
boolean permanent ) { | 0 |
return Arrays.copyOf(password, password.length); | 0 |
* RepeaterJXPathBinding provides an implementation of a {@link Binding}
* repeating structures in the back-end object model.
*
* @version CVS $Id: RepeaterJXPathBinding.java,v 1.15 2004/01/11 20:51:16 vgritsenko Exp $
public RepeaterJXPathBinding(JXpathBindingBuilderBase.CommonAttributes commonAtts,
String repeaterId, String repeaterPath,
String uniqueRowId, String uniqueRowPath,
public RepeaterJXPathBinding(JXpathBindingBuilderBase.CommonAttributes commonAtts,
String repeaterId, String repeaterPath,
String uniqueRowId, String uniqueRowPath,
Convertor convertor, Locale convertorLocale,
this.deleteRowBinding.setParent(this);
* Binds the unique-id of the repeated rows, and narrows the context on
* objectModelContext and Repeater to the repeated rows before handing
* Uses the mapped unique-id of each row to detect if rows have been
//create list of rows to insert at end
// iterate rows...
//if rowIdValue != null --> iterate nodes to find match
}
//again iterate nodes for deletion
}
}
this.insertRowBinding.enableLogging(logger); | 0 |
*
*
*
/**
* @version $Revision: 1.4 $
return createTestSuite(TestJelly.class, "suite.jelly"); | 1 |
import org.apache.http.io.SessionOutputBuffer;
SessionOutputBuffer datatransmitter = new HttpDataTransmitterMockup();
SessionOutputBuffer datatransmitter = new HttpDataTransmitterMockup();
SessionOutputBuffer datatransmitter = new HttpDataTransmitterMockup();
SessionOutputBuffer datatransmitter = new HttpDataTransmitterMockup();
SessionOutputBuffer datatransmitter = new HttpDataTransmitterMockup();
SessionOutputBuffer datatransmitter = new HttpDataTransmitterMockup();
SessionOutputBuffer datatransmitter = new HttpDataTransmitterMockup(); | 0 |
Copyright 2001,2003 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 |
* @since 2.6.0
*/
public TransactionRegistry getTransactionRegistry() {
return transactionRegistry;
}
/** | 0 |
authToLocalPerClusterMap.put(Long.valueOf(clusterTopology.getClusterId()), clusterTopology.getAmbariContext().getController().getKerberosHelper().getKerberosDescriptor(cluster, false).getAllAuthToLocalProperties()); | 0 |
import com.google.common.collect.FluentIterable;
public Slaves(@ClusterName String clusterName, Storage storage) {
private static final Function<HostAttributes, Slave> TO_SLAVE =
new Function<HostAttributes, Slave>() {
@Override public Slave apply(HostAttributes attributes) {
return new Slave(attributes);
template.setAttribute("slaves",
FluentIterable.from(getHostAttributes()).transform(TO_SLAVE).toImmutableList());
final HostAttributes attributes;
Slave(HostAttributes attributes) {
this.attributes = attributes;
return attributes.getHost();
public String getId() {
return attributes.getSlaveId();
return attributes.getMode();
return Joiner.on(", ").join(
Iterables.transform(ATTR_ORDER.sortedCopy(attributes.getAttributes()), ATTR_TO_STRING)); | 0 |
private ClusterConfigEntity clusterConfigEntity;
@Id
}
@ManyToOne
@JoinColumns({
@JoinColumn(name = "cluster_id", referencedColumnName = "cluster_id", nullable = false, insertable = false, updatable = false),
@JoinColumn(name = "config_type", referencedColumnName = "type_name", nullable = false, insertable = false, updatable = false),
@JoinColumn(name = "config_tag", referencedColumnName = "version_tag", nullable = false, insertable = false, updatable = false)
})
public ClusterConfigEntity getClusterConfigEntity() {
return clusterConfigEntity;
}
public void setClusterConfigEntity(ClusterConfigEntity clusterConfigEntity) {
this.clusterConfigEntity = clusterConfigEntity;
}
| 1 |
/**
* @author <a href="mailto:[email protected]">Felix Project Team</a>
*/
// System.out.println("BCI:Listener " + listener.getClass().getName() + " filter " + filter);
// System.out.println("BCI:Listener " + listener.getClass().getName() + " without filter"); | 0 |
return SVGPreserveAspectRatioSupport.getPreserveAspectRatio(this); | 0 |
* Copyright 2001-2005 The Apache Software Foundation
import org.apache.commons.net.ftp.FTPClientConfig;
* @version $Id: VMSVersioningFTPEntryParser.java,v 1.10 2005/01/02 03:17:50 scohen Exp $
this(null);
}
/**
* This constructor allows the creation of a VMSVersioningFTPEntryParser
* object with something other than the default configuration.
*
* @param config The {@link FTPClientConfig configuration} object used to
* configure this parser.
* @exception IllegalArgumentException
* Thrown if the regular expression is unparseable. Should not be seen
* under normal conditions. It it is seen, this is a sign that
* <code>REGEX</code> is not a valid regular expression.
* @since 1.4
*/
public VMSVersioningFTPEntryParser(FTPClientConfig config)
{
configure(config);
}
| 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.aurora.common.zookeeper.Encoding;
static final Codec<ServiceInstance> CODEC = Encoding.JSON_CODEC;
groupMonitor = new CuratorServiceGroupMonitor(groupCache, memberSelector, Encoding.JSON_CODEC); | 0 |
if (fs != null) {
return fs.foo();
}
return false;
if (fs != null) {
return fs.fooProps();
}
return null; | 0 |
import org.apache.aurora.scheduler.storage.entities.IJobStats;
public static IJobStats getJobStats(Iterable<IScheduledTask> tasks) {
return IJobStats.build(stats); | 0 |
implements ChildrenCallback, StringCallback, VoidCallback
zk.getChildren("/", new NullWatcher(), this, results); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//beanutils/src/java/org/apache/commons/beanutils/converters/ByteArrayConverter.java,v 1.4 2003/01/15 21:59:40 rdonkin Exp $
* $Revision: 1.4 $
* $Date: 2003/01/15 21:59:40 $
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
* @version $Revision: 1.4 $ $Date: 2003/01/15 21:59:40 $ | 0 |
import java.util.*;
Dictionary<String, String> properties = new Hashtable<String, String>(); | 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 com.google.cloud.dataflow.sdk.transforms.windowing.GlobalWindows;
Arrays.asList(GlobalWindows.GlobalWindow.INSTANCE)); | 0 |
@SuppressWarnings("rawtypes")
private static final ImmutableList EMPTY_LIST = new ImmutableList();
@SuppressWarnings("unchecked")
return elements.length == 0 ? EMPTY_LIST : new ImmutableList<E>(elements);
@SuppressWarnings("unchecked")
return elements.isEmpty() ? EMPTY_LIST : new ImmutableList<E>(elements);
private ImmutableList()
{
this.elements = new Object[0];
}
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked")
@SuppressWarnings("unchecked") | 0 |
TServerInstance tsi = new TServerInstance(fakeAddress, cString);
TServerInstance tsi = new TServerInstance(fakeAddress, cString); | 0 |
import org.apache.sshd.common.session.Session;
Session session = getSession(); | 0 |
import java.util.Arrays;
import org.apache.zookeeper.ZKTestCase;
import org.apache.zookeeper.test.ClientBase.CountdownWatcher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class QuorumTest extends ZKTestCase { | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.