Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
* TODO(maxim): Implement external configuration support: AURORA-1443. | 0 |
Copyright 2001,2003, 2006 The Apache Software Foundation
import java.util.ArrayList;
// myBounds= myBounds.union(newBound);
myBounds.add( newBound );
if (myBounds == null)
List vec = new ArrayList( srcs.size() );
// For arithmetic make sure they are all the same size...
zr.zeroRect(new Rectangle(wr.getMinX(), wr.getMinY(),
if ((r.x < crR.x) ||
(smR.x, smR.y, smR.width, smR.height,
(cm, wr.createWritableTranslatedChild(0,0),
if ((r.x < crR.x) ||
GraphicsUtil.coerceData(wr, cr.getColorModel(),
for (int i=0; i < b-1; i++)
return new DirectColorModel(cs, 8*b, masks[0], masks[1], | 0 |
* </p> | 0 |
import java.io.DataInput;
ConstantLong(DataInput file) throws IOException { | 0 |
package org.apache.beam.sdk.runners.inprocess;
import org.apache.beam.sdk.runners.inprocess.InProcessExecutionContext.InProcessStepContext;
import org.apache.beam.sdk.runners.inprocess.InProcessPipelineRunner.UncommittedBundle;
import org.apache.beam.sdk.transforms.AppliedPTransform;
import org.apache.beam.sdk.util.DoFnRunner;
import org.apache.beam.sdk.util.DoFnRunners.OutputManager;
import org.apache.beam.sdk.util.UserCodeException;
import org.apache.beam.sdk.util.WindowedValue;
import org.apache.beam.sdk.util.common.CounterSet;
import org.apache.beam.sdk.util.state.CopyOnAccessInMemoryStateInternals;
import org.apache.beam.sdk.values.PCollection;
import org.apache.beam.sdk.values.TupleTag; | 0 |
public static <E> void forEach(final Iterable<E> iterable, final Closure<? super E> closure) {
IteratorUtils.forEach(emptyIteratorIfNull(iterable), closure);
public static <E> E forEachButLast(final Iterable<E> iterable, final Closure<? super E> closure) {
return IteratorUtils.forEachButLast(emptyIteratorIfNull(iterable), closure);
public static <E, T extends E> int frequency(final Iterable<E> iterable, final T obj) { | 0 |
// TODO(ksweeney): Consider adding a Map<JobKey, JobConfiguration> to complement this.
// TODO(ksweeney): Refactor to take a JobKey
// TODO(ksweeney): Refactor to take a JobKey | 0 |
private final EvaluationContext context;
public EvaluatorKey(AppliedPTransform<?, ?, ?> transform, EvaluationContext context) { | 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/>.
*
*/
| 0 |
Iterable<Window> assigned = windowing.assignWindowsToElement(wel); | 0 |
entity.setSourceType(source.getType()); | 0 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger log = LoggerFactory.getLogger(CompactRange.class); | 0 |
package org.apache.beam.sdk.extensions.euphoria.operator.test.accumulators; | 0 |
if ( ! outputDir.exists() ) {
if ( ! outputDir.isDirectory() ) { | 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.
*/
package org.apache.aurora.scheduler.storage.db.migration;
import java.math.BigDecimal;
import org.apache.ibatis.migration.MigrationScript;
public class V008_CreateUpdateMetadataTable implements MigrationScript {
@Override
public BigDecimal getId() {
return BigDecimal.valueOf(8L);
}
@Override
public String getDescription() {
return "Create the job_update_metadata table.";
}
@Override
public String getUpScript() {
return "CREATE TABLE IF NOT EXISTS job_update_metadata("
+ "id IDENTITY,"
+ "update_row_id BIGINT NOT NULL REFERENCES job_updates(id) ON DELETE CASCADE,"
+ "key VARCHAR NOT NULL,"
+ "value VARCHAR NOT NULL"
+ ");";
}
@Override
public String getDownScript() {
return "DROP TABLE IF EXISTS job_update_metadata;";
}
} | 0 |
* @param schedulingFilter Filter to identify whether tasks may reside on given slaves.
private static final Function<IAssignedTask, String> TASK_TO_SLAVE_ID =
new Function<IAssignedTask, String>() {
@Override public String apply(IAssignedTask input) {
return input.getSlaveId();
}
};
IAssignedTask pendingTask) {
Set<String> hosts = FluentIterable.from(toPreemptTasks).transform(TASK_TO_HOST).toSet();
Set<SchedulingFilter.Veto> vetos = schedulingFilter.filter(
totalResource,
Iterables.getOnlyElement(hosts),
pendingTask.getTask(),
pendingTask.getTaskId());
// Group the tasks by slave id so they can be paired with offers from the same slave.
Multimap<String, IAssignedTask> slavesToActiveTasks =
Multimaps.index(activeTasks, TASK_TO_SLAVE_ID);
for (Map.Entry<String, Collection<IAssignedTask>> tasksOnSlave
: slavesToActiveTasks.asMap().entrySet()) {
Set<IAssignedTask> minimalSet = getTasksToPreempt(tasksOnSlave.getValue(), pendingTask); | 0 |
/**
* @since 4.3
*/
protected void onLease(final E entry) {
}
/**
* @since 4.3
*/
protected void onRelease(final E entry) {
}
onRelease(entry);
onLease(entry); | 0 |
private final FileObject containerFile;
public TestEntityResolver(final FileObject containerFile, FileObject sourceFile) {
this.containerFile = containerFile;
// System.out.println("resolving publicId=" + publicId + ", systemId=" + systemId);
if (/* fileName.equals("person.xsd") || */fileName.equals("name.xsd") || fileName.equals("address.xsd")) {
throw new IllegalStateException(
"Schema " + path + " not found in file " + containerFile + " parsing " + sourceFile); | 0 |
import static com.google.common.base.Charsets.UTF_8;
return Long.parseLong(new String(ZooReaderWriter.getRetryingInstance().getData(zTablePath, null), UTF_8));
return Long.parseLong(new String(ZooReaderWriter.getRetryingInstance().getData(zTablePath, null), UTF_8));
String[] tokens = new String(ZooReaderWriter.getRetryingInstance().getData(zTablePath, null), UTF_8).split(",");
ByteArrayInputStream bais = new ByteArrayInputStream(hex.decode(tokens[1].split("=")[1].getBytes(UTF_8))); | 0 |
import org.apache.accumulo.harness.AccumuloClusterHarness;
public class VisibilityIT extends AccumuloClusterHarness { | 0 |
public void testPositiveEmbedDependency() throws Exception
instructions.put( DependencyEmbedder.EMBED_DEPENDENCY, "*;classifier=;type=jar;scope=compile,"
+ "*;classifier=;type=jar;scope=runtime" );
assertEquals( ".,compile-1.0.jar,b-1.0.jar,runtime-1.0.jar", bcp );
assertEquals( "compile-1.0.jar;g=\"g\";a=\"compile\";v=\"1.0\"," + "b-1.0.jar;g=\"g\";a=\"b\";v=\"1.0\","
+ "runtime-1.0.jar;g=\"g\";a=\"runtime\";v=\"1.0\"", eas );
}
public void testNegativeEmbedDependency() throws Exception
{ | 0 |
* limitations under the License. | 0 |
InputStream read(String path, EnumSet<OpenMode> mode) throws IOException;
OutputStream write(String path, EnumSet<OpenMode> mode) throws IOException;
| 0 |
@Deprecated
@Deprecated
| 0 |
if (null != parserKey) {
// if a parser key was supplied in the parameters,
// use that to create the paraser
__entryParser =
__parserFactory.createFileEntryParser(parserKey);
} else {
// if no parserKey was supplied, check for a configuration
// in the params, and if non-null, use that.
__entryParser =
__parserFactory.createFileEntryParser(getSystemName());
} | 0 |
public <T extends Mutation> void binMutations(ClientContext context, List<T> mutations,
Map<String,TabletServerMutations<T>> binnedMutations, List<T> failures)
public List<Range> binRanges(ClientContext context, List<Range> ranges,
Map<String,Map<KeyExtent,List<Range>>> binnedRanges)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
TabletLocatorImpl.addRange(binnedRanges, rootTabletLocation.tablet_location,
RootTable.EXTENT, range);
ZooCache zooCache = zcf.getZooCache(instance.getZooKeepers(),
instance.getZooKeepersSessionTimeOut());
ZooCache zooCache = zcf.getZooCache(instance.getZooKeepers(),
instance.getZooKeepersSessionTimeOut());
log.trace("tid={} Looking up root tablet location in zookeeper.",
Thread.currentThread().getId());
log.trace("tid={} Found root tablet at {} in {}", Thread.currentThread().getId(),
(loc == null ? "null" : new String(loc)),
public TabletLocation locateTablet(ClientContext context, Text row, boolean skipRow,
boolean retry) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { | 0 |
import org.apache.sshd.common.session.impl.AbstractConnectionServiceRequestHandler; | 0 |
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final Logger LOG = LoggerFactory.getLogger(ConnectionInfo.class); | 1 |
return BasicLineFormatter.INSTANCE.formatRequestLine(null, this).toString(); | 0 |
// If the BouncyCastle provider is not installed, then try to load it
| 1 |
* @version CVS $Id$
* The version of the JVM for wich the code was written.
* i.e: 130 = Java 1.3, 140 = Java 1.4 and 150 = Java 1.5
*/
protected int compilerComplianceLevel;
/**
* Set the version of the java source code to be compiled
*
* @param sourceCodeVersion The version of the JVM for wich the code was written.
* i.e: 130 = Java 1.3, 140 = Java 1.4 and 150 = Java 1.5
*
* @since 2.1.7
*/
public void setCompilerComplianceLevel(int compilerComplianceLevel) {
this.compilerComplianceLevel = compilerComplianceLevel;
}
/**
// add compiler compliance level
/*arguments.add("-source");
switch (compilerComplianceLevel) {
case 150:
arguments.add("5");
break;
case 140:
//arguments.add("-target");
arguments.add("1.4");
break;
default:
//arguments.add("-target");
arguments.add("1.3");
}*/
args[i] = (String)arguments.get(i); | 0 |
for(final OCD ocd : metaData.getOCDs()) {
generateXML(ocd, contentHandler);
}
for(final Designate d : metaData.getDesignates()) {
generateXML(d, contentHandler);
final Iterator<AttributeDefinition> i = ocd.getProperties().iterator();
final AttributeDefinition ad = i.next();
for (Iterator<Map.Entry<String, String>> oi=ad.getOptions().entrySet().iterator(); oi.hasNext(); ) {
final Map.Entry<String, String> entry = oi.next();
IOUtils.addAttribute(ai, "value", entry.getKey());
IOUtils.addAttribute(ai, "label", entry.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 | 0 |
import org.apache.ambari.server.ldap.domain.AmbariLdapConfigurationKeys;
return AmbariLdapConfigurationKeys.GROUP_MEMBER_ATTRIBUTE.key(); | 0 |
import org.apache.ambari.server.security.SecurityHelper;
import org.springframework.security.core.GrantedAuthority;
import java.util.Collection;
import java.util.Collections;
TestSecurityHelper securityHelper = new TestSecurityHelper("user1");
ViewInstanceEntity viewInstanceDefinition = getViewInstanceEntity(securityHelper);
securityHelper.setUser("user2");
securityHelper.setUser("user1");
public static ViewInstanceEntity getViewInstanceEntity(SecurityHelper securityHelper)
viewInstanceEntity.setSecurityHelper(securityHelper);
protected static class TestSecurityHelper implements SecurityHelper {
public TestSecurityHelper(String user) {
public String getCurrentUserName() {
@Override
public Collection<? extends GrantedAuthority> getCurrentAuthorities() {
return Collections.emptyList();
} | 0 |
import java.util.Iterator;
/**
* Tests converting a configuration into a hierarchical one.
*/
public void testConvertToHierarchical()
{
Configuration conf = new BaseConfiguration();
for (int i = 0; i < 10; i++)
{
conf.addProperty("test" + i, "value" + i);
conf.addProperty("test.list", "item" + i);
}
HierarchicalConfiguration hc = ConfigurationUtils
.convertToHierarchical(conf);
for (Iterator it = conf.getKeys(); it.hasNext();)
{
String key = (String) it.next();
assertEquals("Wrong value for key " + key, conf.getProperty(key),
hc.getProperty(key));
}
}
/**
* Tests converting a configuration into a hierarchical one that is already
* hierarchical.
*/
public void testConvertHierarchicalToHierarchical()
{
Configuration conf = new HierarchicalConfiguration();
conf.addProperty("test", "yes");
assertSame("Wrong configuration returned", conf, ConfigurationUtils
.convertToHierarchical(conf));
}
/**
* Tests converting a null configuration to a hierarchical one. The result
* should be null, too.
*/
public void testConvertNullToHierarchical()
{
assertNull("Wrong conversion result for null config",
ConfigurationUtils.convertToHierarchical(null));
} | 0 |
package org.apache.accumulo.monitor.rest.api.xml;
import org.apache.accumulo.monitor.rest.api.master.MasterResource;
import org.apache.accumulo.monitor.rest.api.table.TablesResource;
import org.apache.accumulo.monitor.rest.api.tserver.TabletServer;
/**
*
* Responsible for generating an XML summary of the Monitor
*
* @since 2.0.0
*
*/
/**
* Generates an XML summary of the Monitor
*
* @return XML summary
*/
// Add Monitor information
// Add tserver information | 0 |
import java.io.Serializable;
* @version CVS $Id: FragmentExtractorGenerator.java,v 1.6 2004/03/28 05:29:04 antonio Exp $
public Serializable getKey() {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Could not lookup for component.", ce);
} | 0 |
* Map of PooledConnections for which close events are ignored.
* Connections are muted when they are being validated.
private Map validatingMap = new HashMap();
* @param validationQuery a query to use to {*link #validateObject validate} {*link Connection}s.
* Should return at least one row. May be <tt>null</tt>
* Creates a new {@link PooledConnectionAndInfo} from the given {@link UserPassKey}.
*
* @param key {@link UserPassKey} containing user credentials
* Closes the PooledConnection and stops listening for events from it.
try {
pc.removeConnectionEventListener(this);
} catch (Exception e) {
//ignore
}
pcMap.remove(pc);
/**
* Validates a pooled connection.
*
* @param key ignored
* @param obj {@link PooledConnectionAndInfo} containing the connection to validate
* @return true if validation suceeds
*/
validatingMap.put(pconn, null);
validatingMap.remove(pconn);
if (!validatingMap.containsKey(pc)) {
try {
pc.removeConnectionEventListener(this);
} catch (Exception e2) {
//ignore
}
pc.removeConnectionEventListener(this); | 0 |
collectorUri = "http://" + configuration.getProperty(COLLECTOR_HOST_PROPERTY) + ":" + configuration.getProperty(COLLECTOR_PORT_PROPERTY) + "/ws/v1/timeline/metrics";
Servers.parse(configuration.getProperty(configuration.getProperty(COLLECTOR_HOST_PROPERTY)), Integer.valueOf(configuration.getProperty(COLLECTOR_PORT_PROPERTY))); | 0 |
(host.getPort() > 0 ? Integer.valueOf(host.getPort()) : uri.startsWith("https") ? "443" : "80") + "\n");
(totalBytesSent > 0 ? nf2.format(totalBytesSent/1000/totalTimeSec) : Integer.valueOf(-1)) + " kb/s sent"); | 0 |
import org.apache.batik.ext.awt.g2d.GraphicContext;
import org.apache.batik.ext.awt.g2d.TransformType;
import org.apache.batik.ext.awt.g2d.TransformStackElement;
| 0 |
import org.apache.beam.sdk.schemas.Schema.LogicalType;
if (fieldType.getTypeName() == TypeName.LOGICAL_TYPE) {
return deepEquals(a, b, fieldType.getLogicalType().getBaseType());
} else if (fieldType.getTypeName() == Schema.TypeName.BYTES) {
if (fieldType.getTypeName() == TypeName.LOGICAL_TYPE) {
return deepHashCode(a, fieldType.getLogicalType().getBaseType());
} else if (fieldType.getTypeName() == Schema.TypeName.BYTES) {
// Values are attached. No verification is done, and no conversions are done. LogicalType
// values must be specified as the base type.
return verifyMap(value, type.getMapKeyType(), type.getMapValueType(), fieldName);
} else if (TypeName.LOGICAL_TYPE.equals(type.getTypeName())) {
return verifyLogicalType(value, type.getLogicalType(), fieldName);
private Object verifyLogicalType(Object value, LogicalType logicalType, String fieldName) {
return verify(logicalType.toBaseType(value), logicalType.getBaseType(), fieldName);
}
Object value, FieldType keyType, FieldType valueType, String fieldName) {
verifiedMap.put(verify(kv.getKey(), keyType, fieldName), null);
verify(kv.getKey(), keyType, fieldName), verify(kv.getValue(), valueType, fieldName)); | 0 |
public static final Long DEFAULT_PAGE_SIZE = new Long (20);
public static final Long DEFAULT_PAGE = new Long (0);
public static final String SCORE_FIELD = "_lucene-score_";
public static final String INDEX_FIELD = "_lucene-index_"; | 0 |
expect(infoMock.getQuota()).andReturn(QUOTA); | 0 |
public class H2StreamResetException extends IOException {
public H2StreamResetException(final H2Error error, final String message) {
public H2StreamResetException(final int code, final String message) { | 0 |
/**
* An optional class that substitutes values in attributes and body text. This may be null and so a null check is
* always required before use.
*/ | 0 |
/*
* $Id$
*
* 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 |
private Id tableId;
tableId = createInstance(tableInstance);
final String guid = tableId._getId();
final String guid = tableId._getId();
Id dbInstance = createInstance(databaseInstance);
String dbId = dbInstance._getId();
final String guid = tableId._getId();
final String guid = tableId._getId();
final String guid = tableId._getId();
final String guid = tableId._getId();
final String guid = tableId._getId();
return tableInstance; | 0 |
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Iterables;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Ordering; | 0 |
import org.apache.beam.sdk.transforms.ParDo.MultiOutput;
final MultiOutput<Long, Long> replacementParDo =
final MultiOutput<Long, Long> replacementParDo = | 0 |
import org.apache.cocoon.template.expression.Subst;
Subst expr = (Subst) subst; | 0 |
this.manager.removeServlet(service, ref); | 0 |
import com.google.inject.Inject;
wrappersLoaded = true;
skippable = false;
for (String host: commandsToSend.keySet()) {
for (ExecutionCommandWrapper wrapper : commandsToSend.get(host)) {
cmd.setRequestAndStage(requestId, stageId);
cmd.setRequestAndStage(requestId, stageId);
Map<String, HostRoleCommand> hrcMap = hostRoleCommands.get(hostName);
hostRoleCommands.put(hostName, hrcMap);
+ getActionId() + ", host=" + hostName + ", role=" + role);
List<ExecutionCommandWrapper> execCmdList = commandsToSend.get(hostName);
commandsToSend.put(hostName, execCmdList);
+ getActionId() + ", host=" + hostName + ", role=" + role+ ", event="+event);
for (String h : hostRoleCommands.keySet()) {
return hostRoleCommands.get(host).get(role).getLastAttemptTime();
return hostRoleCommands.get(host).get(role).getAttemptCount();
hostRoleCommands.get(hostname).get(role).incrementAttemptCount();
hostRoleCommands.get(host).get(role).setLastAttemptTime(t);
return hostRoleCommands.get(hostname).get(role).getStartTime();
hostRoleCommands.get(hostname).get(role).setStartTime(startTime);
return hostRoleCommands.get(hostname).get(role).getStatus();
hostRoleCommands.get(host).get(role).setStatus(status);
return hostRoleCommands.get(hostname).get(roleStr).getEvent();
hostRoleCommands.get(hostname).get(role).setExitCode(exitCode);
return hostRoleCommands.get(hostname).get(role).getExitCode();
hostRoleCommands.get(hostname).get(role).setStderr(stdErr);
hostRoleCommands.get(hostname).get(role).setStdout(stdOut);
for (HostRoleStatus status : statuses) {
if (hrc.getStatus().equals(status)) {
return true;
}
return commandsToSend;
return logDir; | 0 |
* @version CVS $Id: DefaultCopletFactory.java,v 1.5 2003/06/06 11:33:38 cziegeler Exp $
String id = null;
if ( copletDescription.createId() ) {
// TODO - create unique id
id = name + '-' + System.currentTimeMillis();
}
instanceDesc.setCreateId(copletsConf[i].getAttributeAsBoolean("create-id", true)); | 0 |
if (event.getType() == AbstractFileConfiguration.EVENT_RELOAD)
needsReloading = true;
if (null == envConfig)
envConfig = new EnvironmentConfiguration();
if (null == sysConfig)
sysConfig = new SystemConfiguration();
if (null == config || needsReloading)
synchronized (lock) {
if (needsReloading) {
loadConfiguration();
} else if (null == config) {
loadConfiguration();
}
needsReloading = false;
if (log.isDebugEnabled())
log.debug("Loading config file: " + mFile.getAbsolutePath());
if (!alreadyWarned)
log.warn("Unable to find metrics file: " + mFile.getAbsolutePath());
if (!alreadyWarned)
log.warn("ACCUMULO_HOME variable not found in environment. Metrics collection will be disabled.");
if (log.isDebugEnabled())
log.debug("Metrics collection enabled=" + enabled);
if (null == getMetricsConfiguration())
return false;
if (null == v)
v = config.getList(k); | 1 |
/**
* This bean is used to replicate a reasonably complex use case whose behaviour has changed from Digester 1.3 to 1.4.
*
public class ParamBean
{
public ParamBean()
{
}
public boolean isCool()
{
public void setCool( boolean cool )
{
public String getThis()
{
public String getThat()
{
public String setThisAndThat( String _this, String that )
{ | 1 |
* Wraps a <code>ResultSet</code> in an <code>Iterator<Object[]></code>. This is useful | 0 |
* Represents a file name. File names are immutable, and work correctly as
* keys in hash tables. | 0 |
* in which case it will be inferred using {@link FileBasedSource#getMaxEndOffset}. | 0 |
import org.apache.beam.sdk.transforms.PTransform; | 0 |
import org.apache.storm.metric.api.IMetricsConsumer; | 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.logfeeder.filter;
import java.util.Map;
import org.apache.ambari.logfeeder.LogFeederUtil;
import org.apache.ambari.logfeeder.input.InputMarker;
import org.apache.log4j.Logger;
public class JSONFilterCode extends Filter {
private static Logger logger = Logger.getLogger(JSONFilterCode.class);
@Override
public void apply(String inputStr, InputMarker inputMarker) {
Map<String, Object> jsonMap = LogFeederUtil.toJSONObject(inputStr);
// linenumber
Double lineNumberD = (Double) jsonMap.get("line_number");
if (lineNumberD != null) {
long lineNumber = lineNumberD.longValue();
jsonMap.put("line_number", lineNumber);
}
// logtime
String timeStampStr = (String) jsonMap.get("logtime");
if (timeStampStr != null && !timeStampStr.isEmpty()) {
String logtime = LogFeederUtil.getDate(timeStampStr);
jsonMap.put("logtime", logtime);
}
super.apply(jsonMap, inputMarker);
}
} | 0 |
private static final Logger log = Logger.getLogger(ConfigurationDocGen.class); | 0 |
SimpleTestBean bean = digester.parse(xmlTestReader());
SimpleTestBean bean = digester.parse(
SimpleTestBean bean = digester.parse(
SimpleTestBean bean = digester.parse(
SimpleTestBean bean = digester.parse(
SimpleTestBean bean = digester.parse(reader);
SimpleTestBean bean = digester.parse(reader);
SimpleTestBean bean = digester.parse(reader);
SimpleTestBean bean = digester.parse(reader); | 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 |
import org.apache.beam.vendor.grpc.v1_13_1.io.grpc.stub.CallStreamObserver;
import org.apache.beam.vendor.grpc.v1_13_1.io.grpc.stub.StreamObserver; | 0 |
if (iface.isAssignableFrom(getClass())) {
return true;
} else if (iface.isAssignableFrom(_res.getClass())) {
return true;
} else {
return _res.isWrapperFor(iface);
} | 0 |
import com.google.common.collect.ImmutableSet;
@Option(name = "scheduler_address", required = true,
usage = "Thrift service address for the scheduler.")
public InetSocketAddress schedulerAddress;
@Inject Coordinator updateCoordinator;
try {
updateCoordinator.run();
} catch (Exception e) {
LOG.log(Level.SEVERE, "Update failed.", e);
}
Iface scheduler = ThriftFactory.create(Iface.class)
.withMaxConnectionsPerEndpoint(5)
.build(ImmutableSet.of(options.schedulerAddress))
.builder()
.noRetries()
.withRequestTimeout(options.thriftTimeout)
.create();
bind(String.class).annotatedWith(UpdateToken.class).toInstance(options.updateToken); | 0 |
import static org.junit.Assert.*;
public class CanonicalizationMethodTest { | 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: XMLFileModule.java,v 1.17 2004/06/16 14:57:54 vgritsenko Exp $
/* (non-Javadoc)
* @see org.apache.avalon.framework.activity.Disposable#dispose()
*/
public void dispose() {
super.dispose();
if (this.manager != null) {
this.manager.release(this.resolver);
}
fileConf = modeConf.getChild("file", false);
if (fileConf == null) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Missing 'file' child element at " + modeConf.getLocation());
}
} else {
hasDynamicConf = true;
}
| 0 |
static class DoFnProcessContext<InputT, OutputT>
@Override
public WindowingInternals.KeyedState keyedState() {
return context.stepContext;
} | 0 |
import static org.hamcrest.Matchers.instanceOf;
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
thrown.expectMessage("duplicate");
public void testWindowParamOnTimer() throws Exception {
final String timerId = "some-timer-id";
DoFnSignature sig =
DoFnSignatures.INSTANCE.getSignature(new DoFn<String, String>() {
@TimerId(timerId)
private final TimerSpec myfield1 = TimerSpecs.timer(TimeDomain.EVENT_TIME);
@ProcessElement
public void process(ProcessContext c) {}
@OnTimer(timerId)
public void onTimer(BoundedWindow w) {}
}.getClass());
assertThat(sig.onTimerMethods().get(timerId).extraParameters().size(), equalTo(1));
assertThat(
sig.onTimerMethods().get(timerId).extraParameters().get(0),
instanceOf(DoFnSignature.Parameter.BoundedWindowParameter.class));
}
@Test
thrown.expectMessage("duplicate");
thrown.expectMessage("reference to");
thrown.expectMessage("different type");
thrown.expectMessage("reference to");
thrown.expectMessage("different type"); | 0 |
/**
* Return a list of known live collector nodes
* @return [ hostname ]
*/
List<String> getLiveInstances(); | 0 |
* @version $Id: NTFTPEntryParser.java,v 1.17 2004/07/28 05:01:47 dfs Exp $
f.setSize(Long.parseLong(size)); | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ambari.server.serveraction.kerberos;
import java.io.File;
import java.io.IOException;
/**
* KerberosConfigDataFileReader is an implementation of a KerberosConfigDataFile that is used to
* read existing KerberosConfigDataFiles.
* <p/>
* This class encapsulates a {@link org.apache.commons.csv.CSVParser} to read a CSV-formatted file.
*/
public class KerberosConfigDataFileReader extends AbstractKerberosDataFileReader {
/**
* Creates a new KerberosConfigDataFileReader
* <p/>
* The file is opened upon creation, so there is no need to manually open it unless manually
* closed before using.
*
* @param file a File declaring where to write the data
* @throws java.io.IOException
*/
public KerberosConfigDataFileReader(File file) throws IOException {
super(file);
}
} | 0 |
* Imports a table exported via exportTable and copied via hadoop distcp.
*
* @param tableName
* Name of a table to create and import into.
* @param importDir
* Directory that contains the files copied by distcp from exportTable
* @throws TableExistsException
* @throws AccumuloException
* @throws AccumuloSecurityException
*/
public void importTable(String tableName, String importDir) throws TableExistsException, AccumuloException, AccumuloSecurityException;
/**
* Exports a table. The tables data is not exported, just table metadata and a list of files to distcp. The table being exported must be offline and stay
* offline for the duration of distcp. To avoid losing access to a table it can be cloned and the clone taken offline for export.
*
* <p>
* See docs/examples/README.export
*
* @param tableName
* Name of the table to export.
* @param exportDir
* An empty directory in HDFS where files containing table metadata and list of files to distcp will be placed.
* @throws TableNotFoundException
* @throws AccumuloException
* @throws AccumuloSecurityException
*/
public void exportTable(String tableName, String exportDir) throws TableNotFoundException, AccumuloException, AccumuloSecurityException;
/** | 0 |
@Override | 0 |
package org.apache.bcel.generic;
super(org.apache.bcel.Const.ILOAD, org.apache.bcel.Const.ILOAD_0);
super(org.apache.bcel.Const.ILOAD, org.apache.bcel.Const.ILOAD_0, n); | 1 |
import org.apache.http.util.CharArrayBuffer; | 0 |
*
* <p> Concepts: Reading/writing BigQuery; counting a PCollection; user-defined PTransforms
*
* <p> Note: Before running this example, you must create a BigQuery dataset to contain your output
* table.
*
* <p> To execute this pipeline locally, specify general pipeline configuration:
* --project=<PROJECT ID>
* and the BigQuery table for the output:
* --output=<project_id>:<dataset_id>.<table_id>
*
* <p> To execute this pipeline using the Dataflow service, specify pipeline configuration:
* --project=<PROJECT ID>
* --stagingLocation=gs://<STAGING DIRECTORY>
* --runner=BlockingDataflowPipelineRunner
* and the BigQuery table for the output:
* --output=<project_id>:<dataset_id>.<table_id>
*
* <p> The BigQuery input table defaults to clouddataflow-readonly:samples.weather_stations and can
* be overridden with --input.
@Description("BigQuery table to write to, specified as "
+ "<project_id>:<dataset_id>.<table_id>. The dataset must already exist.") | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/AbstractShortArrayList.java,v 1.10 2003/08/31 12:59:57 scolebourne Exp $
* @version $Revision: 1.10 $ $Date: 2003/08/31 12:59:57 $
* @param mincap the minimum capacity for this list | 0 |
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.util.concurrent.ThreadFactoryBuilder; | 0 |
package org.apache.commons.digester3; | 1 |
@ManyToOne(cascade = {CascadeType.MERGE}) | 0 |
package org.apache.beam.sdk.util; | 0 |
/* ====================================================================
* Copyright (c) 2002-2004 The Apache Software Foundation. All rights
* @version $Revision: 1.6 $ $Date: 2004/01/14 21:43:03 $ | 0 |
* @version CVS $Id: CastorTransformer.java,v 1.8 2004/05/08 01:34:06 joerg Exp $
| 0 |
package org.apache.accumulo.server.rpc; | 1 |
import org.apache.sshd.util.test.NoIoTestCase;
import org.junit.experimental.categories.Category;
@Category({ NoIoTestCase.class }) | 0 |
import org.apache.commons.configuration.builder.FileBasedBuilderParametersImpl;
"org.apache.commons.configuration.builder.FileBasedBuilderParametersImpl";
* Returns the configuration builder with the given name. With this method a
* builder of a child configuration which was given a name in the
*
* @throws ConfigurationException if an error occurs setting up the
* definition configuration or no builder with this name exists
public synchronized ConfigurationBuilder<? extends Configuration> getNamedBuilder(
String name) throws ConfigurationException
ConfigurationBuilder<? extends Configuration> builder =
getSourceData().getNamedBuilder(name);
if (builder == null)
throw new ConfigurationException("Builder cannot be resolved: "
+ name);
* have the {@code config-name} attribute. If this attribute is present, the
* corresponding builder is assigned this name and can be directly accessed
* through the {@link #getNamedBuilder(String)} method. This method returns
* a collection with all available builder names.
*
* @throws ConfigurationException if an error occurs setting up the
* definition configuration
public synchronized Set<String> builderNames()
throws ConfigurationException
currentParameters = null;
FileBasedBuilderParametersImpl fileParams =
FileBasedBuilderParametersImpl.fromParameters(params);
setUpCurrentParameters();
ConfigurationSourceData data = getSourceData();
if (currentParameters == null)
{
setUpCurrentParameters();
}
(ConfigurationBuilderProvider) BeanHelper.createBean(decl)); | 0 |
private static final Logger LOG = LoggerFactory.getLogger(ServiceComponentHostTest.class);
LOG.debug("Calling service create, serviceName={}", svc); | 1 |
* @version $Revision$ | 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 TSampleNotPresentException extends TException implements org.apache.thrift.TBase<TSampleNotPresentException, TSampleNotPresentException._Fields>, java.io.Serializable, Cloneable, Comparable<TSampleNotPresentException> {
List<Object> list = new ArrayList<Object>();
boolean present_extent = true && (isSetExtent());
list.add(present_extent);
if (present_extent)
list.add(extent);
return list.hashCode(); | 0 |
import org.apache.ambari.logfeeder.conf.LogEntryCacheConfig;
LogFeederProps logFeederProps = new LogFeederProps();
LogEntryCacheConfig logEntryCacheConfig = new LogEntryCacheConfig();
logEntryCacheConfig.setCacheEnabled(false);
logEntryCacheConfig.setCacheSize(0);
logFeederProps.setLogEntryCacheConfig(logEntryCacheConfig);
outputManager.setLogFeederProps(logFeederProps);
logLevelFilterHandler.setLogFeederProps(logFeederProps);
input.init(logFeederProps);
input.getFirstFilter().init(logFeederProps); | 0 |
import java.util.concurrent.atomic.AtomicLong;
import org.apache.accumulo.core.client.IteratorSetting.Column;
import org.apache.accumulo.core.conf.DefaultConfiguration;
import org.apache.hadoop.io.Text;
public static final List<Column> COLNAMES = new ArrayList<Column>();
public static final Text CHECK_COLUMN_FAMILY = new Text("cf");
static {
for (int i = 0; i < COLS; i++) {
COLNAMES.add(new Column(CHECK_COLUMN_FAMILY, new Text(String.format("%03d", i))));
}
}
public static final Text MARKER_CF = new Text("marker");
private static final AtomicLong counter = new AtomicLong();
final Path dir = new Path("/tmp", "bulk_" + UUID.randomUUID().toString());
final Path fail = new Path(dir.toString() + "_fail");
final DefaultConfiguration defaultConfiguration = AccumuloConfiguration.getDefaultConfiguration();
final Random rand = (Random) state.get("rand");
final FileSystem fs = (FileSystem) state.get("fs");
final int parts = rand.nextInt(10) + 1;
String markerColumnFamily = Long.toString(counter.incrementAndGet());
log.debug("preparing bulk files with start rows " + printRows + " last row " + String.format(FMT, LOTS - 1) + " marker " + markerColumnFamily);
String fileName = dir + "/" + String.format("part_%d.", i) + RFile.EXTENSION;
FileSKVWriter f = FileOperations.getInstance().openWriter(fileName, fs, fs.getConf(), defaultConfiguration);
Text row = new Text(String.format(FMT, j));
for (Column col : COLNAMES) {
f.append(new Key(row, col.getColumnFamily(), col.getColumnQualifierf()), value);
f.append(new Key(row, MARKER_CF, new Text(markerColumnFamily)), value); | 0 |
* @version CVS $Id$
/* (non-Javadoc)
* @see org.apache.pluto.om.portlet.ContentTypeSet#get(java.lang.String)
*/
public ContentType get(String contentType) {
/* (non-Javadoc)
* @see org.apache.cocoon.portal.pluto.om.common.Support#postLoad(java.lang.Object)
*/
public void postLoad(Object parameter) throws Exception {
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
public String toString() {
public String toString(int indent) { | 0 |
if (s.isEmpty()) { | 0 |
import com.google.cloud.dataflow.sdk.io.Read;
* Translator for the {@code Read} {@code PTransform} for the Dataflow back-end.
public class ReadTranslator
implements DataflowPipelineTranslator.TransformTranslator<Read.Bound> {
Read.Bound transform, DataflowPipelineTranslator.TranslationContext context) { | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.