Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
public static CheckDescription DRUID_HA_WARNING = new CheckDescription( "DRUID_HA", PrereqCheckType.SERVICE, "Druid Downtime During Upgrade", new ImmutableMap.Builder<String, String>() .put( AbstractCheckDescriptor.DEFAULT, "High Availability is not enabled for Druid. Druid Service may have some downtime during upgrade. Deploy multiple instances of %s in the Cluster to avoid any downtime." ) .build() );
0
public void testDirectoryBeginningWithNumberFollowedBySpaces() throws Exception { FTPFile f = getParser().parseFTPEntry("12-03-96 06:38AM <DIR> 123 xyz"); assertEquals("name", "123 xyz", f.getName()); f = getParser().parseFTPEntry("12-03-96 06:38AM <DIR> 123 abc xyz"); assertNotNull(f); assertEquals("name", "123 abc xyz", f.getName()); }
0
import org.apache.commons.jexl3.JexlInfoHandle; public final class SandboxUberspect extends Uberspect { private final Sandbox sandbox; public JexlMethod getConstructor(Object ctorHandle, Object[] args, JexlInfoHandle info) { public JexlMethod getMethod(Object obj, String method, Object[] args, JexlInfoHandle info) { public JexlPropertyGet getPropertyGet(Object obj, Object identifier, JexlInfoHandle info) { public JexlPropertySet getPropertySet(final Object obj, final Object identifier, Object arg, JexlInfoHandle info) {
1
package com.twitter.mesos.scheduler.httphandlers; import java.io.StringWriter; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; import org.antlr.stringtemplate.StringTemplate; import com.twitter.common.base.Closure; import com.twitter.common.util.templating.StringTemplateHelper; import com.twitter.common.util.templating.StringTemplateHelper.TemplateException; /** * Base class for common functions needed in a jersey stringtemplate servlet. */ abstract class JerseyTemplateServlet { private final StringTemplateHelper templateHelper; JerseyTemplateServlet(String templatePath) { templateHelper = new StringTemplateHelper(getClass(), templatePath, true); } protected final Response fillTemplate(Closure<StringTemplate> populator) { StringWriter output = new StringWriter(); try { templateHelper.writeTemplate(output, populator); } catch (TemplateException e) { throw new WebApplicationException(e); } return Response.ok(output.toString()).build(); } }
0
* * * * * * * *
0
value = tokenParser.parseToken(buf, cursor, delimSet);
0
private static Random numberGenerator; Random ng = numberGenerator; // FELIX-2771 Secure Random not available on Mika try { ng = new SecureRandom(); } catch ( Throwable t ) { // fall back to Random ng = new Random(); }
0
import org.apache.beam.runners.core.metrics.MetricsPusher; MetricsPusher.getInstance().pushMetrics();
0
private final List<byte[]> elements; private final Coder<OUT> coder; public FlinkStreamingCreateFunction(List<byte[]> elements, Coder<OUT> coder) { this.elements = elements; this.coder = coder; } @Override public void flatMap(IN value, Collector<WindowedValue<OUT>> out) throws Exception { @SuppressWarnings("unchecked") OUT voidValue = (OUT) VoidCoderTypeSerializer.VoidValue.INSTANCE; for (byte[] element : elements) { ByteArrayInputStream bai = new ByteArrayInputStream(element); OUT outValue = coder.decode(bai, Coder.Context.OUTER); if (outValue == null) { out.collect(WindowedValue.of(voidValue, Instant.now(), GlobalWindow.INSTANCE, PaneInfo.NO_FIRING)); } else { out.collect(WindowedValue.of(outValue, Instant.now(), GlobalWindow.INSTANCE, PaneInfo.NO_FIRING)); } } out.close(); }
0
@Override @Override @Override @Override @Override @Override
0
* * * * * * * *
1
package org.apache.zookeeper.server; import org.apache.jute.Record; import org.apache.zookeeper.Watcher; import org.apache.zookeeper.data.Id; import org.apache.zookeeper.proto.ReplyHeader; import org.apache.zookeeper.proto.WatcherEvent;
0
* Provides {@link CommittedBundle bundles} that will be provided to the * {@link PTransform PTransforms} that are at the root of a {@link Pipeline}. interface RootInputProvider { * produced by {@link TransformEvaluatorFactory#forApplication(AppliedPTransform, * CommittedBundle)}, all of the elements contained in the source are eventually produced.
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
return "searches each row, column family, column qualifier and value, in" + " parallel, on the server side (using a java Matcher, so put .* before" + " and after your term if you're not matching the whole element)"; "forces the use of the find() expression matcher, causing substring" + " matches to return true");
0
import org.apache.beam.sdk.transforms.OldDoFn; return input.apply(ParDo.of(new OldDoFn<TimestampedValue<T>, T>() {
0
* @author Bernhard Huber * @since 23. Oktober 2002 * @version CVS $Id: MailCommands.java,v 1.2 2003/03/11 19:04:59 vgritsenko Exp $
0
" <label>Label 1.</label>\n" + " <placeholder>Placeholder 1.</placeholder>\n" + " <default-value>Default value 1.</default-value>\n" +
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/test/org/apache/commons/jxpath/ri/model/dom/DOMModelTest.java,v 1.4 2002/11/26 01:20:08 dmitri Exp $ * $Revision: 1.4 $ * $Date: 2002/11/26 01:20:08 $ import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; * @version $Revision: 1.4 $ $Date: 2002/11/26 01:20:08 $
0
prefix = saslParams + ":";
0
m_logger.log(
0
package org.apache.http.client.utils; import org.apache.http.impl.cookie.DateParseException; public void testMalformedDate() { Assert.assertNull(DateUtils.parseDate("Fri, 14 Oct 2005 00:00:00 GMT", new String[] {}, null)); } @Test
0
* {@link PipelineVisitor#visitPrimitiveTransform} and
0
public InputStream getInputStream() throws IOException createStream();
0
if ("".equals(namespaceURI)) { // Map global namespace from StAX to DOM namespaceURI = null; } if ("".equals(namespaceURI)) { // Map global namespace from StAX to DOM namespaceURI = null; }
0
* Notify about the occurrence of an event
0
import java.util.Set; Type type = new TypeToken<Map<String, Set<String>>>() {}.getType(); Type type = new TypeToken<Map<String, Set<String>>>() {}.getType(); Map<String, Set<String>> clusterHostInfo1 = StageUtils.getGson().fromJson(CLUSTER_HOST_INFO, type); Map<String, Set<String>> clusterHostInfo2 = StageUtils.getGson().fromJson(CLUSTER_HOST_INFO_UPDATED, type);
0
import com.google.common.base.Optional; import com.twitter.mesos.gen.JobKey; public void removeJob(JobKey jobKey) { checkNotNull(jobKey); // TODO(ksweeney): Remove this delegation as part of MESOS-2403. removeJob(Tasks.jobKey(jobKey)); } @Override public Optional<JobConfiguration> fetchJob(String managerId, JobKey jobKey) { checkNotNull(jobKey); // TODO(ksweeney): Remove this delegation as part of MESOS-2403. return Optional.fromNullable(fetchJob(managerId, Tasks.jobKey(jobKey))); } @Override
0
* Simple utility class that creates a map for string-based keys by extending * <tt>TreeMap</tt>. This map can be set to use case-sensitive or * case-insensitive comparison when searching for the key. Any keys put into * this map will be converted to a <tt>String</tt> using the * <tt>toString()</tt> method, since it is only intended to compare strings. * @author <a href="mailto:felix-dev@incubator.apache.org">Felix Project Team</a> */ /** * serialVersionUID. */ private static final long serialVersionUID = 6948801857034259744L; /** * * * Put a record in the map. * @param key : key * @param value : value * @return an object. * Check if the map is case-sensitive. * /** * Is the map case sensitive? */ * * Compare to object. * @param o1 : first object to compare * @param o2 : second object to compare * @return the comparison result * Check if the comparator is case sensitive. * * Does not support cloning. * @return The current map return this;
0
} catch (SingletonService.LeadException e) { throw new IllegalStateException("Failed to lead service.", e);
0
@Parameter(names = "--sleep", description = "the time to wait between queries", converter = TimeConverter.class) Scanner scanner = ContinuousUtil.createScanner(conn, clientOpts.getTableName(), clientOpts.auths);
0
public NodeGet() { }
0
String[] st = commandLine.split("//s"); String command = st.length > 1? st[1]: HELP_CMD; String arg = (st.length > 2) ? st[2] : null; if (command.equals(HELP_CMD)) help(out, arg); private void help(PrintStream out, String command)
0
final Map<String, String> variants = new HashMap<>();
0
package org.apache.felix.sigil.eclipse.internal.repository.manager;
0
String MAX_CONCURRENT_SESSIONS = "max-concurrent-sessions"; String SERVER_IDENTIFICATION = "server-identification"; String MAX_AUTH_REQUESTS = "max-auth-requests"; String WELCOME_BANNER = "welcome-banner"; String AUTH_METHODS = "auth-methods"; String COMMAND_EXIT_TIMEOUT = "command-exit-timeout"; String REKEY_BYTES_LIMIT = "rekey-bytes-limit"; String REKEY_TIME_LIMIT = "rekey-time-limit"; String MODULI_URL = "moduli-url";
0
import org.apache.felix.service.threadio.ThreadIO;
0
* Sets the color of the selection overlay to the specified color. * * @param color the new color of the selection overlay */ public void setSelectionOverlayColor(Color color) { textSelectionManager.setSelectionOverlayColor(color); } /** * Returns the color of the selection overlay. */ public Color getSelectionOverlayColor() { return textSelectionManager.getSelectionOverlayColor(); } /** * Sets the color of the outline of the selection overlay to the specified * color. * * @param color the new color of the outline of the selection overlay */ public void setSelectionOverlayStrokeColor(Color color) { textSelectionManager.setSelectionOverlayStrokeColor(color); } /** * Returns the color of the outline of the selection overlay. */ public Color getSelectionOverlayStrokeColor() { return textSelectionManager.getSelectionOverlayStrokeColor(); } /** * Sets whether or not the selection overlay will be painted in XOR mode, * depending on the specified parameter. * * @param state true implies the selection overlay will be in XOR mode */ public void setSelectionOverlayXORMode(boolean state) { textSelectionManager.setSelectionOverlayXORMode(state); } /** * Returns true if the selection overlay is painted in XOR mode, false * otherwise. */ public boolean isSelectionOverlayXORMode() { return textSelectionManager.isSelectionOverlayXORMode(); } /**
0
private final HashMap<String,Long> prevGcTime = new HashMap<>();
1
* Copyright (c) 2004 The Apache Software Foundation. All rights * @versionn $Id: NTFTPEntryParserTest.java,v 1.8 2004/01/01 21:04:19 scohen Exp $
0
RepositoryVersionState.INSTALLING);
0
import org.apache.beam.runners.core.construction.RehydratedComponents; import org.apache.beam.runners.core.construction.WindowingStrategyTranslation; import org.apache.beam.sdk.values.WindowingStrategy; import org.apache.beam.vendor.grpc.v1_13_1.com.google.protobuf.InvalidProtocolBufferException; public static WindowingStrategy getWindowingStrategy( String pCollectionId, RunnerApi.Components components) { RunnerApi.WindowingStrategy windowingStrategyProto = components.getWindowingStrategiesOrThrow( components.getPcollectionsOrThrow(pCollectionId).getWindowingStrategyId()); final WindowingStrategy<?, ?> windowingStrategy; try { return WindowingStrategyTranslation.fromProto( windowingStrategyProto, RehydratedComponents.forComponents(components)); } catch (InvalidProtocolBufferException e) { throw new IllegalStateException( String.format( "Unable to hydrate windowing strategy %s for %s.", windowingStrategyProto, pCollectionId), e); } }
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList;
0
public Set<String> getRequestedPorts() { return task.getRequestedPorts();
0
return input.length() == 1 && contains(bContent, input.charAt(0)) == shouldMatch; return input.length() > 0 && contains(bContent, input.charAt(0)) == shouldMatch; return input.length() > 0 && contains(bContent, input.charAt(input.length() - 1)) == shouldMatch;
0
* <p> * </p> * <p> * </p>
0
import org.apache.beam.sdk.io.GenerateSequence; import org.joda.time.Duration; pipeline.apply(GenerateSequence.fromTo(0, numElements)); // Use withMaxReadTime to force unbounded mode. pipeline.apply( GenerateSequence.fromTo(0, numElements).withMaxReadTime(Duration.standardDays(1)));
0
getLog().warn( "Unable to merge Maven manifest: " + e.getLocalizedMessage() );
0
@Test public void testWritePartialUpdate() throws Exception { elasticsearchIOTestCommon.setPipeline(pipeline); elasticsearchIOTestCommon.testWritePartialUpdate(); }
0
import org.apache.beam.sdk.transforms.reflect.DoFnSignature; private static void rejectStateAndTimers(DoFn<?, ?> doFn) { DoFnSignature signature = DoFnSignatures.getSignature(doFn.getClass()); if (signature.stateDeclarations().size() > 0) { throw new UnsupportedOperationException( String.format( "Found %s annotations on %s, but %s cannot yet be used with state in the %s.", DoFn.StateId.class.getSimpleName(), doFn.getClass().getName(), DoFn.class.getSimpleName(), SparkRunner.class.getSimpleName())); } if (signature.timerDeclarations().size() > 0) { throw new UnsupportedOperationException( String.format( "Found %s annotations on %s, but %s cannot yet be used with timers in the %s.", DoFn.TimerId.class.getSimpleName(), doFn.getClass().getName(), DoFn.class.getSimpleName(), SparkRunner.class.getSimpleName())); } } rejectStateAndTimers(doFn); rejectStateAndTimers(doFn);
0
/* * Copyright (C) 2014 Google Inc. * * 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 com.google.cloud.dataflow.sdk.testing; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import java.util.concurrent.TimeUnit; /** Tests for {@link FastNanoClockAndSleeper}. */ @RunWith(JUnit4.class) public class FastNanoClockAndSleeperTest { @Rule public FastNanoClockAndSleeper fastNanoClockAndSleeper = new FastNanoClockAndSleeper(); @Test public void testClockAndSleeper() throws Exception { long sleepTimeMs = TimeUnit.SECONDS.toMillis(30); long sleepTimeNano = TimeUnit.MILLISECONDS.toNanos(sleepTimeMs); long fakeTimeNano = fastNanoClockAndSleeper.nanoTime(); long startTimeNano = System.nanoTime(); fastNanoClockAndSleeper.sleep(sleepTimeMs); long maxTimeNano = startTimeNano + TimeUnit.SECONDS.toNanos(1); // Verify that actual time didn't progress as much as was requested assertTrue(System.nanoTime() < maxTimeNano); // Verify that the fake time did go up by the amount requested assertEquals(fakeTimeNano + sleepTimeNano, fastNanoClockAndSleeper.nanoTime()); } }
0
* Copyright 2001-2005 The Apache Software Foundation * Bear in mind that Sets require immutable objects to function correctly. * @version $Revision: 1.8 $ $Date$ * @author Tom Dunham * If it is present, then the old version is removed. Object removed = super.set(index, object); return removed; // the object is already in the uniq list // (and it hasn't been swapped with itself) super.remove(pos); // remove the duplicate by index set.remove(removed); // remove the item deleted by the set return removed; // return the item deleted by the set
0
// to all fields. If the input type of the DoFn is already Row, then no need to do // anything special.
0
import org.apache.hc.core5.http.config.Http1Config; conn = new DefaultBHttpClientConnection(Http1Config.DEFAULT,
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.request.impl.query; import io.swagger.annotations.ApiParam; import org.apache.ambari.logsearch.model.request.impl.ServiceLogHostComponentRequest; import javax.ws.rs.QueryParam; public class ServiceLogHostComponentQueryRequest extends ServiceLogQueryRequest implements ServiceLogHostComponentRequest { @QueryParam("hostName") @ApiParam String hostName; @Override public String getHostName() { return hostName; } @Override public void setHostName(String hostName) { this.hostName = hostName; } }
0
package org.apache.accumulo.server.util; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; public class NamingThreadFactory implements ThreadFactory { private ThreadFactory dtf = Executors.defaultThreadFactory(); private int threadNum = 1; private String name; public NamingThreadFactory(String name){ this.name = name; } public Thread newThread(Runnable r) { Thread thread = dtf.newThread(r); thread.setName(name+" "+threadNum++); return thread; } }
1
@Rule public ExpectedException thrown = ExpectedException.none(); public void encode(KV<String, Long> kv, OutputStream out) throws IOException { public KV<String, Long> decode(InputStream inStream) throws IOException { return other instanceof MyCustomCoder && key.equals(((MyCustomCoder) other).key); Assert.assertEquals(KV.of("key", 3L), CoderUtils.decodeFromByteArray(coder, encoded2));
1
* @author William Farner
0
final Instance inst = conn.getInstance(); MetadataServicer.forTableId(inst, credentials, tableId).getTabletLocations(tabletLocations); checkTabletServer(inst, conf.getConfiguration(), new Credentials(opts.principal, opts.getToken()), entry, failures); private static void checkTabletServer(Instance inst, AccumuloConfiguration conf, Credentials creds, Entry<String,List<KeyExtent>> entry, HashSet<KeyExtent> failures) throws ThriftSecurityException, TException, NoSuchScanIDException { InitialMultiScan is = client.startMultiScan(tinfo, creds.toThrift(inst), batch, emptyListColumn, emptyListIterInfo, emptyMapSMapSS,
0
import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathFactory; import org.apache.xml.security.samples.DSNamespaceContext; XPathFactory xpf = XPathFactory.newInstance(); XPath xpath = xpf.newXPath(); xpath.setNamespaceContext(new DSNamespaceContext()); String expression = "//ds:Signature[@Id='SignatureToBeOmitted']//ds:Transforms"; (Element) xpath.evaluate(expression, doc, XPathConstants.NODE);
0
/** Tests for {@link ApexTimerInternals}. */ TimerData timerData0 = TimerData.of("timerData0", StateNamespaces.global(), instant0, TimeDomain.EVENT_TIME); TimerData timerData1 = TimerData.of("timerData1", StateNamespaces.global(), instant1, TimeDomain.EVENT_TIME); timerInternals.fireReadyTimers( instant1.getMillis(), timerProcessor, TimeDomain.PROCESSING_TIME); assertEquals( Sets.newHashSet(timerData0), Sets.newHashSet(firedTimers.values().iterator().next())); assertEquals( Sets.newHashSet(timerData1), Sets.newHashSet(firedTimers.values().iterator().next())); TimerData timerData0 = TimerData.of("timerData0", StateNamespaces.global(), instant0, TimeDomain.EVENT_TIME); TimerData timerData1 = TimerData.of("timerData1", StateNamespaces.global(), instant1, TimeDomain.EVENT_TIME); timerInternals.deleteTimer( timerData1.getNamespace(), timerData1.getTimerId(), TimeDomain.PROCESSING_TIME); timerInternals.deleteTimer( timerData1.getNamespace(), timerData1.getTimerId(), TimeDomain.EVENT_TIME); TimerData timerData = TimerData.of( "arbitrary-id", StateNamespaces.global(), new Instant(0), TimeDomain.EVENT_TIME);
1
@Override public String writeGetTableConstraints(String databaseName, String tableName) { // pg_class: http://www.postgresql.org/docs/9.4/static/catalog-pg-class.html // pg_constraint: http://www.postgresql.org/docs/9.4/static/catalog-pg-constraint.html // pg_namespace: http://www.postgresql.org/docs/9.4/static/catalog-pg-namespace.html StringBuilder statement = new StringBuilder() .append("SELECT ") .append("c.conname as CONSTRAINT_NAME,") .append("c.contype as CONSTRAIN_TYPE ") .append("FROM pg_catalog.pg_constraint as c ") .append("JOIN pg_catalog.pg_namespace as namespace ") .append("on namespace.oid = c.connamespace ") .append("JOIN pg_catalog.pg_class as class ") .append("on class.oid = c.conrelid ") .append("where (namespace.nspname='").append(databaseName).append("' or namespace.nspname='public')") .append("and class.relname='").append(tableName).append("'"); return statement.toString(); } @Override public StringBuilder writeDropPrimaryKeyStatement(StringBuilder builder, String constraintName){ return builder.append("DROP CONSTRAINT ").append(constraintName); }
0
* Ignores non-BASE64 bytes. @Test assertEncoded("Hello World", "S?G!V%sbG 8g\rV\t\n29ybGQ*=");
0
verifyDeterministic(this, "ListCoder.elemCoder must be deterministic", getElemCoder());
0
/** Specify the password for authentication. */ /** Specify the encrypted password used for authentication. */ * Specify the password decrypter used to decrypt the encrypted password. It delayed the /** Specify the password used for authentication. */ /** Specify the encrypted password used for authentication. */ * Specify the password decrypter used to decrypt the encrypted password. It delayed the
0
* * @see <a href="https://tools.ietf.org/html/rfc1945">RFC1945 (HTTP/1.0)</a> * @see <a href="https://tools.ietf.org/html/rfc2616">RFC2616 (HTTP/1.1)</a> * @see <a href="https://tools.ietf.org/html/rfc2518">RFC2518 (WebDAV)</a> * @see <a href="https://tools.ietf.org/html/rfc7540">RFC7540 (HTTP/2)</a>
0
return parentNode; parentNode = v; previousSibling = v; return previousSibling; nextSibling = v; return nextSibling;
1
import org.apache.sshd.common.SshConstants; port = SshConstants.DEFAULT_PORT; return getFileSystemIdentifier(addr.toString(), SshConstants.DEFAULT_PORT, username); + ((port <= 0) ? SshConstants.DEFAULT_PORT : port) + ':'
0
public void onClassificationUpdatedToEntity(String entityId, List<AtlasClassification> classifications) throws AtlasBaseException { // Since the classification attributes are updated in the graph, we need to recursively remap the entityText doFullTextMapping(entityId); ITypedReferenceableInstance entity = toITypedReferenceable(entityId); List<ITypedStruct> traits = toITypedStructs(classifications); if (entity == null || CollectionUtils.isEmpty(traits)) { return; } for (EntityChangeListener listener : entityChangeListeners) { try { listener.onTraitsUpdated(entity, traits); } catch (AtlasException e) { throw new AtlasBaseException(AtlasErrorCode.NOTIFICATION_FAILED, e); } } }
0
/* $Id$ * @version $Revision$ $Date$
0
// get full decoded path for dispatching final RequestInfo requestInfo = new RequestInfo(pr.servletPath, pr.pathInfo, null, req.getRequestURI());
0
* * * import org.apache.avalon.framework.thread.ThreadSafe; implements Parameterizable, ThreadSafe {
0
m_n = n; m_t = t; m_v = v; p.setAttribute( "n", getN() ); if ( getT() != null ) p.setAttribute( "t", getT() ); if ( getV() != null ) p.setAttribute( "v", getV() );
0
import org.apache.felix.ipojo.PrimitiveInstanceDescription; PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ref)).getInstanceDescription(); // id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription(); //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription(); // id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
0
// Maps from the our unique job identifier (<role>/<jobName>) to the unique identifier used
0
void runAll(OptionT options, NexmarkRunner runner) { throw new RuntimeException("Execution was not successful"); errors = new ArrayList<>(); NexmarkRunner<NexmarkOptions> runner = new NexmarkRunner<>(options); new NexmarkDriver<>().runAll(options, runner);
0
Set<VertexInfo> compositeVertices = graphHelper.getCompositeVertices(instanceVertex); Iterator<Edge> edges = graphHelper.getOutGoingEdgesByLabel(instanceVertex, edgeLabel); Edge edge = graphHelper.getEdgeForLabel(outVertex, edgeLabel); edge = graphHelper.getEdgeForLabel(outVertex, edgeLabel);
1
* The prior alert firmness. */ private final AlertFirmness m_fromFirmness; /** * @param currentAlert * @param fromState * @param fromFirmness AlertCurrentEntity currentAlert, AlertState fromState, AlertFirmness fromFirmness) { m_fromFirmness = fromFirmness; * Gets the prior firmness of the alert. * * @return the prior firmness of the alert. */ public AlertFirmness getFromFirmness() { return m_fromFirmness; } /**
0
import org.apache.ambari.spi.upgrade.UpgradeType;
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 V001_CreateAppcImagesTable implements MigrationScript { @Override public BigDecimal getId() { return BigDecimal.valueOf(1L); } @Override public String getDescription() { return "Create the task_config_appc_images table."; } @Override public String getUpScript() { return "CREATE TABLE IF NOT EXISTS task_config_appc_images(" + "id IDENTITY," + "task_config_id BIGINT NOT NULL REFERENCES task_configs(id) ON DELETE CASCADE," + "name VARCHAR NOT NULL," + "image_id VARCHAR NOT NULL," + "UNIQUE(task_config_id)" + ");"; } @Override public String getDownScript() { return "DROP TABLE IF EXISTS task_config_appc_images;"; } }
0
@Override @Override @Override
0
* @see MultiKeyIdentityProvider int numProviders = GenericUtils.size(providers); if (numProviders <= 0) { return EMPTY_KEYS_PROVIDER; } else if (numProviders == 1) { return GenericUtils.head(providers); } else { return new MultiKeyIdentityProvider(providers); } int numProviders = GenericUtils.size(providers); if (numProviders <= 0) { return Collections.emptyList(); } else if (numProviders == 1) { KeyIdentityProvider p = GenericUtils.head(providers); return p.loadKeys(); } else { return new Iterable<KeyPair>() { @Override public Iterator<KeyPair> iterator() { return new MultiKeyIdentityIterator(providers); } @Override public String toString() { return Iterable.class.getSimpleName() + "[of(providers)]"; } }; }
0
import org.apache.accumulo.core.data.TableId; private final TableId tableId; public VolumeChooserEnvironment(TableId tableId, Text endRow, ServerContext context) { public TableId getTableId() {
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. */ package org.apache.commons.digester3; /** * A module is the Digester rule bindings provider. */ public interface RulesModule { /** * Configure the Digester rules binding via the given rules binder. * * @param rulesBinder The binder instance used to configure rules bindings. */ void configure(RulesBinder rulesBinder); }
0
throw new FileSystemException("vfs.impl/unknown-scheme.error", scheme, uri); throw new FileSystemException("vfs.impl/unknown-scheme.error", scheme, uri); throw new FileSystemException("vfs.impl/unknown-provider.error", scheme, file); throw new FileSystemException("vfs.impl/unknown-scheme.error", scheme); throw new FileSystemException("vfs.impl/unknown-scheme.error", scheme);
0
* @version $Revision: 1.2 $, $Date: 2004/01/18 16:18:56 $
0
import org.apache.accumulo.core.data.TableId; TableId id = TableId.of(tableId);
0
import org.eclipse.persistence.exceptions.EclipseLinkException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.persistence.PersistenceException; import java.sql.SQLException; private static final Logger LOG = LoggerFactory.getLogger(AmbariJpaLocalTxnInterceptor.class); //commit transaction only if rollback didn't occur detailedLogForPersistenceError(e); } catch (Exception e) { detailedLogForPersistenceError(e); throw e; if (null != didWeStartWork.get()) { private void detailedLogForPersistenceError(Exception e) { if (e instanceof PersistenceException) { PersistenceException rbe = (PersistenceException) e; Throwable cause = rbe.getCause(); if (cause != null && cause instanceof EclipseLinkException) { EclipseLinkException de = (EclipseLinkException) cause; LOG.error("[DETAILED ERROR] Rollback reason: ", cause); Throwable internal = de.getInternalException(); int exIndent = 1; if (internal != null && internal instanceof SQLException) { SQLException exception = (SQLException) internal; while (exception != null) { LOG.error("[DETAILED ERROR] Internal exception (" + exIndent + ") : ", exception); // Log the exception exception = exception.getNextException(); exIndent++; } } } } } * @param e The exception to test for rollback * @param txn A JPA Transaction to issue rollbacks on @Transactional private static class Internal { }
0
@Deprecated
0
import org.apache.hc.core5.annotation.Contract; import org.apache.hc.core5.annotation.ThreadingBehavior; import org.apache.hc.core5.http.ClassicHttpResponse; import org.apache.hc.core5.http.io.entity.EntityUtils; * org.apache.hc.core5.http.ClassicHttpRequest, org.apache.hc.client5.http.sync.ResponseHandler)}, @Contract(threading = ThreadingBehavior.IMMUTABLE) public String handleResponse(final ClassicHttpResponse response) throws IOException {
0
import java.util.Properties; import org.apache.accumulo.core.trace.TraceUtil; TraceUtil.enableClientTraces(null, name, new Properties()); TraceUtil.disable();
0
* useful, ready made
0
import org.apache.batik.css.engine.value.ValueManager;
1
package org.apache.bcel.data; import java.lang.annotation.*; @Retention(RetentionPolicy.RUNTIME) public @interface MarkerAnnotation { }
0
* @version CVS $Id: ClassJXPathBindingBuilder.java,v 1.3 2004/02/03 12:26:21 joerg Exp $ extends JXPathBindingBuilderBase { CommonAttributes commonAtts = JXPathBindingBuilderBase.getCommonAttributes(bindingElm);
0
MacroContext macroContext, Event startEvent, Event endEvent) public String getQname() {
0
import java.io.FileInputStream; import java.util.Properties; final String configFile = params.getParameter("config-file", "/TestDiskCache.ccf"); final String regionName = params.getParameter("region-name", "indexedRegion1"); final String groupName = params.getParameter("group-name", "indexedDiskCache"); this.setup(configFile, regionName, groupName); } catch (CacheException ce) { throw new ParameterException("JCS unable to run setup with region: " + regionName); throw new ParameterException("Unable to get handle on JCS Config file: " + configFile , ioe); //super.m_JCS = null;
0
// testing the behavior for runSmokeTest flag // piggybacking on this test to avoid setting up the mock cluster testRunSmokeTestFlag(mapRequestProps, amc, serviceRequests); // should be able to add the host component back componentHostRequests.clear(); componentHostRequests.add(new ServiceComponentHostRequest("c1", null, "NAMENODE", "host1", null, null)); amc.createHostComponents(componentHostRequests); namenodes = cluster.getService("HDFS").getServiceComponent("NAMENODE").getServiceComponentHosts(); assertEquals(2, namenodes.size()); } private void testRunSmokeTestFlag(Map<String, String> mapRequestProps, AmbariManagementController amc, Set<ServiceRequest> serviceRequests) throws AmbariException { RequestStatusResponse response;//Starting HDFS service. No run_smoke_test flag is set, smoke
0
/***************************************************************************** * Copyright (C) The Apache Software Foundation. All rights reserved. * * ------------------------------------------------------------------------- * * This software is published under the terms of the Apache Software License * * version 1.1, a copy of which has been included with this distribution in * * the LICENSE file. * *****************************************************************************/ package org.apache.batik.test.refimpl.parser; import java.io.*; import org.apache.batik.parser.*; import org.apache.batik.refimpl.parser.*; /** * To test the points parser. * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a> * @version $Id$ */ public class PointsParserTest { /** * The application main method. * @param args The command-line arguments. */ public static void main(String[] args) throws Exception { PointsParser parser = new ConcretePointsParser(); parser.setPointsHandler(new TestPointsHandler()); parser.parse(new StringReader("1 2")); parser.parse(new StringReader("1,2 3,4")); parser.parse(new StringReader("1-2+3-4")); parser.parse(new StringReader(" 1e-2+3-4e+5-6 ")); System.out.println(" ***** TEST OK *****"); } static class TestPointsHandler implements PointsHandler { public void startPoints() throws ParseException { System.out.println(" %%% start"); } public void endPoints() throws ParseException { System.out.println(" %%% end"); } public void point(float x, float y) throws ParseException { System.out.println(x + " " + y); } } }
1
SourceResolver resolver = null; FormManager formManager = null; formManager = (FormManager) getComponent(FormManager.ROLE); releaseComponent(resolver); releaseComponent(formManager); protected String showForm(Form form, String uri) { return showForm(form, uri, new VarMap()); } SourceResolver resolver = null; BindingManager bindingManager = null; resolver = (SourceResolver) getComponent(SourceResolver.ROLE); bindingManager = (BindingManager) getComponent(BindingManager.ROLE); releaseComponent(resolver);
0