Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
int bytesRead; do { bytesRead = this.responseParser.fillBuffer(this.session.channel()); if (bytesRead > 0) { this.inTransportMetrics.incrementBytesTransferred(bytesRead); } this.response = (HttpResponse) this.responseParser.parse(); } while (bytesRead > 0 && this.response == null);
0
import org.apache.http.conn.routing.HttpRoute;
0
LogEntry log = new LogEntry(RootTable.EXTENT, System.currentTimeMillis(), tabletSession.hostPort(), filename.toString()); final byte[] node; try { node = log.toBytes(); } catch (IOException e) { throw new RuntimeException("Failed to write to byte array", e); } rw.putPersistentData(path.toString(), node, NodeExistsPolicy.OVERWRITE); byte[] data = rw.getData(root + "/" + child, null); LogEntry entry = LogEntry.fromBytes(data); logs.add(new Path(entry.filename));
0
* http://www.apache.org/licenses/LICENSE-2.0
0
package org.apache.commons.beanutils2; import org.apache.commons.beanutils2.expression.Resolver;
1
import org.apache.xml.security.stax.securityEvent.KeyNameTokenSecurityEvent; } else if (tokenType == XMLSecurityConstants.KeyNameToken) { tokenSecurityEvent = new KeyNameTokenSecurityEvent();
0
* Abstract class for SecurityHeaderHandlers with parse LOGic for the xml structures
0
* {@code ClientConnectionPoolManager} maintains a pool of * {@code ClientConnectionPoolManager} maintains a maximum limit of connection
0
* Copyright 1999-2004 The Apache Software Foundation. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
import org.apache.beam.learning.katas.util.Log;
0
package org.apache.hc.client5.http.classic.methods;
0
package org.apache.accumulo.core.util.shell.commands; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import org.apache.accumulo.core.util.shell.Shell; import org.apache.accumulo.core.util.shell.Shell.Command; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options; public class HistoryCommand extends Command{ private Option clearHist; @Override public int execute(String fullCommand, CommandLine cl, Shell shellState) throws Exception { String histDir = System.getenv("HOME") + "/.accumulo"; int counter = 0; if(cl.hasOption(clearHist.getOpt())){ try { FileWriter outFile = new FileWriter(histDir + "/shell_history.txt"); PrintWriter out = new PrintWriter(outFile); out.close(); } catch (IOException e) { e.printStackTrace(); } } else{ try { BufferedReader in = new BufferedReader(new FileReader (histDir + "/shell_history.txt")); String Line; try { Line = in.readLine(); while(Line != null){ shellState.getReader().printString(counter + " " + Line); shellState.getReader().printNewline(); counter ++; Line = in.readLine(); } } catch (IOException e) { e.printStackTrace(); } } catch (FileNotFoundException e) { e.printStackTrace(); } } return 0; } @Override public String description() { return ("Generates a list of commands previously executed"); } @Override public int numArgs(){ return 0; } @Override public Options getOptions() { Options o = new Options(); clearHist = new Option("c", "Clears History, takes no arguments.", false, "Clears History File"); clearHist.setArgName(""); clearHist.setRequired(false); clearHist.setArgs(0); o.addOption(clearHist); return o; } }
1
import org.apache.accumulo.core.data.TableId; ReplicationTarget target = new ReplicationTarget("cluster1", "table1", TableId.of("1")); ReplicationTarget target = new ReplicationTarget("cluster1", "table1", TableId.of("1"));
0
@Deprecated
0
package org.apache.http.impl.client; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.apache.http.client.HttpClient; import org.apache.http.client.protocol.HttpClientContext; private FutureRequestExecutionService httpAsyncClientWithFuture; final HttpClient httpClient = HttpClientBuilder.create() .setMaxConnPerRoute(5) .build(); final ExecutorService executorService = Executors.newFixedThreadPool(5); httpAsyncClientWithFuture = new FutureRequestExecutionService(httpClient, executorService); final HttpRequestFutureTask<Boolean> task = httpAsyncClientWithFuture.execute( new HttpGet(uri), HttpClientContext.create(), new OkidokiHandler()); final HttpRequestFutureTask<Boolean> task = httpAsyncClientWithFuture.execute( new HttpGet(uri), HttpClientContext.create(), new OkidokiHandler()); final HttpRequestFutureTask<Boolean> task = httpAsyncClientWithFuture.execute( new HttpGet(uri), HttpClientContext.create(), new OkidokiHandler());
0
import org.apache.ambari.common.rest.entities.agent.ConfigFile; action4.setBluePrintName("blueprint"); action4.setBluePrintRevision("0.1"); action4.setUser("hdfs"); action4.setKind(Kind.WRITE_FILE_ACTION); String owner ="hdfs"; String group = "hadoop"; String permission = "0700"; String path = "$prefix/config"; String umask = "022"; String data = "Content of the file"; action4.setFile(new ConfigFile(owner, group, permission, path, umask, data)); Action action5 = new Action(); action5.setKind(Kind.DELETE_STRUCTURE_ACTION); action5.setComponent("hdfs"); action5.setRole("datanode");
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.felix.scr.integration.components.felix3680_2; public class G { }
0
import org.apache.http.impl.client.HttpClients;
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.bridge; import org.apache.batik.util.SVGConstants; /** * The base bridge class for SVG elements. * * @author <a href="mailto:[email protected]">Thierry Kormann</a> * @version $Id$ */ public abstract class AbstractSVGBridge implements Bridge, SVGConstants { /** * Constructs a new abstract bridge for SVG elements. */ protected AbstractSVGBridge() {} /** * Returns the SVG namespace URI. */ public String getNamespaceURI() { return SVG_NAMESPACE_URI; } }
0
Collection<String> reported = (vers == null) ? null : vers.getVersions(); continue; // debug breakpoint
0
expect(dao.findByForeignKeys(eq(foreignKeys))).andReturn(entities).once(); expect(dao.findByNameAndForeignKeys(eq("test-artifact"), eq(foreignKeys))).andReturn(entity).once(); expect(dao.findByNameAndForeignKeys(eq("test-artifact2"), eq(foreignKeys))).andReturn(entity2).once();
0
import com.google.cloud.dataflow.sdk.coders.CollectionCoder; import com.google.cloud.dataflow.sdk.coders.ListCoder; import com.google.cloud.dataflow.sdk.coders.SetCoder; import com.google.common.collect.ImmutableSet; import java.util.Collection; import java.util.Set; public void testFlattenIterablesLists() { Pipeline p = TestPipeline.create(); PCollection<List<String>> input = p.apply(Create.<List<String>>of(LINES).withCoder(ListCoder.of(StringUtf8Coder.of()))); PCollection<String> output = input.apply(Flatten.<String>iterables()); DataflowAssert.that(output).containsInAnyOrder(LINES_ARRAY); p.run(); } @Test @Category(RunnableOnService.class) public void testFlattenIterablesSets() { Pipeline p = TestPipeline.create(); Set<String> linesSet = ImmutableSet.copyOf(LINES); PCollection<Set<String>> input = p.apply(Create.<Set<String>>of(linesSet).withCoder(SetCoder.of(StringUtf8Coder.of()))); PCollection<String> output = input.apply(Flatten.<String>iterables()); DataflowAssert.that(output).containsInAnyOrder(LINES_ARRAY); p.run(); } @Test @Category(RunnableOnService.class) public void testFlattenIterablesCollections() { Pipeline p = TestPipeline.create(); Set<String> linesSet = ImmutableSet.copyOf(LINES); PCollection<Collection<String>> input = p.apply(Create.<Collection<String>>of(linesSet) .withCoder(CollectionCoder.of(StringUtf8Coder.of()))); PCollection<String> output = input.apply(Flatten.<String>iterables()); DataflowAssert.that(output).containsInAnyOrder(LINES_ARRAY); p.run(); } @Test @Category(RunnableOnService.class)
0
import org.apache.beam.runners.dataflow.DataflowRunner.CombineGroupedValues; TransformTranslator translator = getTransformTranslator(transform.getClass()); checkState( translator != null, "no translator registered for primitive transform %s", transform); DataflowRunner.CombineGroupedValues.class, new TransformTranslator<CombineGroupedValues>() { public void translate(CombineGroupedValues transform, TranslationContext context) { final CombineGroupedValues<K, InputT, OutputT> primitiveTransform, Combine.GroupedValues<K, InputT, OutputT> originalTransform = primitiveTransform.getOriginalCombine(); StepTranslationContext stepContext = context.addStep(primitiveTransform, "CombineValues"); stepContext, context.getInput(primitiveTransform), originalTransform.getSideInputs(), context); originalTransform.getAppliedFn( context.getInput(primitiveTransform).getPipeline().getCoderRegistry(), context.getInput(primitiveTransform).getCoder(), context.getInput(primitiveTransform).getWindowingStrategy()); stepContext.addOutput(context.getOutput(primitiveTransform));
0
@Nullable private String strippedTableSpec; this.strippedTableSpec = null; public String getStrippedTableSpec() { if (strippedTableSpec == null) { int index = tableSpec.lastIndexOf('$'); strippedTableSpec = (index == -1) ? tableSpec : tableSpec.substring(0, index); } return strippedTableSpec; }
0
public static <A extends Appendable> A appendNonEmptyValues(A sb, String name, Object... values) throws IOException { public static void writeHostConfigEntries(Path path, Collection<? extends HostConfigEntry> entries, OpenOption... options) throws IOException {
0
import java.io.File; /** * Returns the disk size of the volume which holds the working directory. * <p> * Identical to: * <pre> * freeSpaceKb(new File(".").getAbsolutePath()) * </pre> * @return the amount of free drive space on the drive or volume in kilobytes * @throws IllegalStateException if an error occurred in initialisation * @throws IOException if an error occurs when finding the free space */ public static long freeSpaceKb() throws IOException { return freeSpaceKb(new File(".").getAbsolutePath()); }
0
import org.apache.batik.refimpl.gvt.text.ConcreteTextSelector; initSelectors(); new ConcreteTextSelector(nodeRenderContext); node.addGraphicsNodeMouseListener( (GraphicsNodeMouseListener) selector);
0
HostComponentResourceProvider(controller);
0
import org.apache.felix.dm.service.ServiceStateListener; Service service = m_manager.createService() for (int i = 0; i < m_stateListeners.size(); i ++) { service.addStateListener((ServiceStateListener) m_stateListeners.get(i)); } return service;
0
public void testHTTPCLIENT_1031() throws Exception { BasicClientCookie2 orig = new BasicClientCookie2("name", "value"); orig.setDomain("domain"); orig.setPath("/"); orig.setAttribute("attrib", "stuff"); BasicClientCookie2 clone = (BasicClientCookie2) orig.clone(); Assert.assertEquals(orig.getName(), clone.getName()); Assert.assertEquals(orig.getValue(), clone.getValue()); Assert.assertEquals(orig.getDomain(), clone.getDomain()); Assert.assertEquals(orig.getPath(), clone.getPath()); Assert.assertEquals(orig.getAttribute("attrib"), clone.getAttribute("attrib")); Assert.assertNull(clone.getPorts()); } @Test
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.infra.model; import javax.validation.constraints.NotNull; import javax.ws.rs.PathParam; import javax.ws.rs.QueryParam; public class JobExecutionStopRequest { @PathParam("jobExecutionId") @NotNull private Long jobExecutionId; @QueryParam("operation") @NotNull private JobOperationParams.JobStopOrAbandonOperationParam operation; public Long getJobExecutionId() { return jobExecutionId; } public void setJobExecutionId(Long jobExecutionId) { this.jobExecutionId = jobExecutionId; } public JobOperationParams.JobStopOrAbandonOperationParam getOperation() { return operation; } public void setOperation(JobOperationParams.JobStopOrAbandonOperationParam operation) { this.operation = operation; } }
0
* * */ * @return The converted value * @throws ParseException if an error occurs parsing a String to a Number
0
AccumuloInputFormat.setConnectionInfo(job, getConnectionInfo()); AccumuloOutputFormat.setConnectionInfo(job, getConnectionInfo());
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
0
package org.apache.batik.anim.dom;
0
package org.apache.beam.sdk.runners.inprocess; import org.apache.beam.sdk.transforms.PTransform; import org.apache.beam.sdk.values.PInput; import org.apache.beam.sdk.values.POutput;
0
import org.apache.atlas.model.metrics.AtlasMetrics; import org.apache.atlas.services.MetricsService; private MetricsService metricsService; public AdminResource(ServiceState serviceState, MetricsService metricsService) { this.metricsService = metricsService; @GET @Path("metrics") @Produces(Servlets.JSON_MEDIA_TYPE) public AtlasMetrics getMetrics() { if (LOG.isDebugEnabled()) { LOG.debug("==> AdminResource.getMetrics()"); } AtlasMetrics metrics = metricsService.getMetrics(); if (LOG.isDebugEnabled()) { LOG.debug("<== AdminResource.getMetrics()"); } return metrics; }
0
package org.apache.felix.upnp.sample.binaryLight.actions; import org.apache.felix.upnp.sample.binaryLight.LightModel;
0
/* * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.hc.core5.function; /** * Abstract decorator. * * @since 5.0 */ public interface Decorator<T> { T decorate(T object); }
0
// Consume response content entity.consumeContent();
0
package org.apache.accumulo.core.client.mock; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.Property; class MockConfiguration extends AccumuloConfiguration { Map<String, String> map; MockConfiguration(Map<String, String> settings) { map = settings; } public void put(String k, String v) { map.put(k, v); } @Override public String get(Property property) { return map.get(property.getKey()); } @Override public Iterator<Entry<String, String>> iterator() { return map.entrySet().iterator(); } }
1
import org.apache.http.message.HttpPostRequest;
0
/* $Id: CallParamRule.java,v 1.23 2004/11/30 03:08:55 skitching Exp $ * <p>Note that if the element is empty the an <i>empty string</i> is * passed to the target method, not null. And if automatic type conversion * is being applied (ie if the target function takes something other than * a string as a parameter) then the conversion will fail if the converter * class does not accept an empty string as valid input.</p> * * <p>Note that if the element is empty the an <i>empty string</i> is * passed to the target method, not null. And if automatic type conversion * is being applied (ie if the target function takes something other than * a string as a parameter) then the conversion will fail if the converter * class does not accept an empty string as valid input.</p> *
0
import org.apache.felix.http.proxy.AbstractProxyListener; this.servletContext.addListener(new AbstractProxyListener() { protected void stopTracking() { ProxyServletContextListener.this.stopTracking(); protected void startTracking(final Object bundleContextAttr) { ProxyServletContextListener.this.startTracking(bundleContextAttr); protected EventDispatcherTracker getEventDispatcherTracker() { return eventDispatcherTracker; } private void stopTracking() { if (eventDispatcherTracker != null) eventDispatcherTracker.close(); eventDispatcherTracker = null; } protected void startTracking(final Object bundleContextAttr) { eventDispatcherTracker = new EventDispatcherTracker(bundleContext); eventDispatcherTracker.open(); this.stopTracking();
0
// Term can't be deleted if it is assigned to any entity if (CollectionUtils.isNotEmpty(storeObject.getAssignedEntities())) { throw new AtlasBaseException(AtlasErrorCode.TERM_HAS_ENTITY_ASSOCIATION, storeObject.getGuid(), String.valueOf(storeObject.getAssignedEntities().size())); }
0
import org.apache.sshd.common.NamedResource; default boolean canExtractKeyPairs(NamedResource resourceKey, List<String> lines)
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.annotations; import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; import org.apache.commons.digester3.DigesterLoader; import org.apache.commons.digester3.RulesBinder; /** * A {@code DigesterLoaderHandler} intercept a {@code Class} visit performed by * the {@link DigesterLoader} and performs the * {@link AnnotationHandler#handle(Annotation, AnnotatedElement, FromAnnotationsRuleSet)} * method. */ public interface AnnotationHandler<A extends Annotation, E extends AnnotatedElement> { /** * Handles the current visited element with the related current annotation. * * @param annotation the current visited annotation. * @param element the current visited element. * @param ruleModule the annotations {@code RulesModule} where providers have to be * added. */ void handle(A annotation, E element, RulesBinder rulesBinder); }
0
import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly; import java.io.FileNotFoundException; try { if (!fs.getFileStatus(ret).isDirectory()) { throw new AccumuloException(kind + " import " + type + " directory " + dir + " is not a directory!"); } } catch (FileNotFoundException fnf) {
0
package cz.seznam.euphoria.core.client.dataset.windowing;
0
bytes = JavaUtils.getBytesFromStream(inputOctetStreamProxy); inputOctetStreamProxy.close(); return bytes;
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. */ public static void checkSeps(String... s) { Text t = KeyUtil.buildNullSepText(s); String[] rets = KeyUtil.splitNullSepText(t); int length = 0; for (String str : s) length += str.length(); assertEquals(t.getLength(), length + s.length - 1); assertEquals(rets.length, s.length); for (int i = 0; i < s.length; i++) assertEquals(s[i], rets[i]); } public void testNullSep() { checkSeps("abc", "d", "", "efgh"); checkSeps("ab", ""); checkSeps("abcde"); checkSeps(""); checkSeps("", ""); }
0
writeRead(16, (12 + 4) * (int) (Math.ceil(25.0 / 12) + Math.ceil(31.0 / 12))); blockOut.close(); assertEquals(16 * 8, baos.toByteArray().length); } @Test public void testGiantWrite() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); int blockSize = 16; // buffer will be size 12 BlockedOutputStream blockOut = new BlockedOutputStream(baos, blockSize, blockSize); Random r = new Random(22); int size = 1024 * 1024 * 128; byte[] giant = new byte[size]; r.nextBytes(giant); blockOut.write(giant); blockOut.flush(); baos.close(); int blocks = (int) Math.ceil(size / (blockSize - 4.0)); assertEquals(blocks * 16, baos.toByteArray().length);
0
public StringMap getIdentifiers() {
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.http; import com.google.common.net.HostAndPort; /** * The HTTP service provided by the application. */ public interface HttpService { /** * Gets the address that can be used by clients to access the service. * * @return Service address. */ HostAndPort getAddress(); }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/test/org/apache/commons/digester/TestRuleSet.java,v 1.3 2002/01/09 20:22:51 sanders Exp $ * $Revision: 1.3 $ * $Date: 2002/01/09 20:22:51 $ * Copyright (c) 1999-2002 The Apache Software Foundation. All rights * @version $Revision: 1.3 $ $Date: 2002/01/09 20:22:51 $
0
* @version CVS $Id: WidgetReplacingPipe.java,v 1.14 2003/11/17 04:27:48 antonio Exp $ private static final String REPEATER_SIZE = "repeater-size"; private static final String REPEATER_WIDGET_LABEL = "repeater-widget-label"; private static final String WIDGET_LABEL = "widget-label"; private static final String WIDGET = "widget"; private static final String LOCATION = "location"; private static final String REPEATER_WIDGET = "repeater-widget"; private static final String FORM_TEMPLATE_EL = "form-template"; private static final String STYLING_EL = "styling"; protected boolean gotStylingElement; public void init(Widget newContextWidget, WoodyTemplateTransformer newPipeContext) { contextWidget = newContextWidget; pipeContext = newPipeContext; if (localName.equals(WIDGET) || localName.equals(REPEATER_WIDGET)) { repeaterWidget = localName.equals(REPEATER_WIDGET); } else if (localName.equals(WIDGET_LABEL)) { } else if (localName.equals(REPEATER_WIDGET_LABEL)) { } else if (localName.equals(REPEATER_SIZE)) { String formJXPath = attributes.getValue(LOCATION); attrsCopy.removeAttribute(attributes.getIndex(LOCATION)); } catch (JXPathException e) { /* do nothing */ } throw new SAXException("WoodyTemplateTransformer: Unsupported element: " + localName); && (localName.equals(WIDGET) || localName.equals(REPEATER_WIDGET))) { if (localName.equals(WIDGET_LABEL) || localName.equals(REPEATER_WIDGET_LABEL) || localName.equals(REPEATER_SIZE) || localName.equals(CONTINUATION_ID)) { private int elementNesting; private SaxBuffer saxBuffer;
0
import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.UriInfo; import org.apache.ambari.server.api.resources.ResourceInstance; import org.apache.ambari.server.api.services.parsers.RequestBodyParser; import org.apache.ambari.server.api.services.serializers.ResultSerializer;
0
* Copyright (c) 2002 The Apache Software Foundation. All rights
0
for (Method method : methods) {
0
static SerializedMutation create(String tableName, byte[] key, byte[] bytes) {
1
import org.apache.aurora.common.application.ShutdownStage; import org.apache.aurora.common.base.Command; import org.apache.aurora.common.quantity.Amount; import org.apache.aurora.common.quantity.Time; import org.apache.aurora.common.stats.StatsProvider; import org.apache.aurora.common.util.Clock; import org.apache.aurora.common.util.testing.FakeClock;
0
import org.apache.hadoop.metrics2.util.Servers;
0
@Override protected void setUp() throws Exception { @Override protected void tearDown() throws Exception {
0
outStream.write(value); } } /** * Encodes the provided {@code value} with the identical encoding to {@link #encode}, but with * optimizations that take ownership of the value. * * <p>Once passed to this method, {@code value} should never be observed or mutated again. */ public void encodeAndOwn(byte[] value, OutputStream outStream, Context context) throws IOException, CoderException { if (!context.isWholeStream) { VarInt.encode(value.length, outStream); outStream.write(value); } else {
0
stateTimestampNs = System.nanoTime();
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
public static final String ACCUMULO_CLUSTER_CLIENT_CONF_KEY = "accumulo.it.cluster.clientconf"; String clusterTypeValue = null, clientConf = null; clientConf = fileProperties.getProperty(ACCUMULO_CLUSTER_CLIENT_CONF_KEY); if (null == clientConf) { clientConf = systemProperties.getProperty(ACCUMULO_CLUSTER_CLIENT_CONF_KEY); } // we'll let no client conf pass through and expect that the caller will set it after MAC is started if (null == clientConf) { throw new RuntimeException("Expected client configuration to be provided: " + ACCUMULO_CLUSTER_CLIENT_CONF_KEY); } File clientConfFile = new File(clientConf); if (!clientConfFile.exists() || !clientConfFile.isFile()) { throw new RuntimeException("Client configuration should be a normal file: " + clientConfFile); } return new StandaloneAccumuloClusterConfiguration(clientConfFile);
0
private static final String SCR_SERVICE = "org.apache.felix.scr.ScrService"; private static final String META_TYPE_NAME = "org.osgi.service.metatype.MetaTypeService"; private static final String CONFIGURATION_ADMIN_NAME = "org.osgi.service.cm.ConfigurationAdmin";
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/SetNextRule.java,v 1.6 2001/08/20 18:28:40 craigmcc Exp $ * $Revision: 1.6 $ * $Date: 2001/08/20 18:28:40 $ * @version $Revision: 1.6 $ $Date: 2001/08/20 18:28:40 $ /** * Render a printable version of this Rule. */ public String toString() { StringBuffer sb = new StringBuffer("SetNextRule["); sb.append("methodName="); sb.append(methodName); sb.append(", paramType="); sb.append(paramType); sb.append("]"); return (sb.toString()); }
0
import org.apache.accumulo.core.rpc.ThriftUtil;
1
* Copyright 1999-2004 The Apache Software Foundation. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
public class Log { public static final String PREFIX = "Sigil: "; private static final boolean highlight = false; public static void error( String msg ) { if ( highlight ) Message.deprecated( PREFIX + "[error] " + msg ); Message.error( PREFIX + msg ); } public static void warn( String msg ) { if ( highlight ) Message.deprecated( PREFIX + "[warn] " + msg ); else Message.warn( PREFIX + msg ); } public static void info( String msg ) { if ( highlight ) Message.deprecated( PREFIX + "[info] " + msg ); else Message.info( PREFIX + msg ); } public static void verbose( String msg ) { Message.verbose( PREFIX + "[verbose] " + msg ); } public static void debug( String msg ) { if ( highlight ) Message.deprecated( PREFIX + "[debug] " + msg ); else Message.debug( PREFIX + msg ); }
0
public void write(final byte[] b, final int off, final int len) throws IOException { int chunk = len; if (chunk > max) { chunk = (int) max; this.out.write(b, off, chunk); this.total += chunk;
0
import static org.easymock.EasyMock.anyString; import static org.easymock.EasyMock.getCurrentArguments; import org.easymock.IAnswer; static Method methodGetExecutable; methodGetExecutable = KerberosOperationHandler.class.getDeclaredMethod("getExecutable", String.class); KDCKerberosOperationHandler handler = createMockedHandler(methodExecuteCommand, methodGetExecutable); expect(handler.getExecutable(anyString())) .andAnswer(new IAnswer<String>() { @Override public String answer() throws Throwable { Object[] args = getCurrentArguments(); return args[0].toString(); } }).anyTimes(); return handler; expect(handler.executeCommand(arrayContains("kinit"), anyObject(Map.class), anyObject(KDCKerberosOperationHandler.InteractivePasswordHandler.class))) expect(handler.executeCommand(arrayContains("kinit"), anyObject(Map.class), anyObject(KDCKerberosOperationHandler.InteractivePasswordHandler.class)))
0
import org.apache.sshd.util.test.NoIoTestCase; import org.junit.experimental.categories.Category; @Category({ NoIoTestCase.class })
0
import org.apache.beam.sdk.extensions.sql.RowSqlTypes; import org.apache.beam.sdk.schemas.Schema.TypeName; private static final Map<Class, TypeName> JAVA_CLASS_TO_FIELDTYPE = ImmutableMap .<Class, TypeName>builder() .put(Byte.class, TypeName.BYTE) .put(Short.class, TypeName.INT16) .put(Integer.class, TypeName.INT32) .put(Long.class, TypeName.INT64) .put(Float.class, TypeName.FLOAT) .put(Double.class, TypeName.DOUBLE) .put(BigDecimal.class, TypeName.DECIMAL) .put(String.class, TypeName.STRING) .put(DateTime.class, TypeName.DATETIME) .put(Boolean.class, TypeName.BOOLEAN) private static final Schema ROW_TYPE = RowSqlTypes.builder() FieldType.of(JAVA_CLASS_TO_FIELDTYPE.get(exp.getValue().getClass()))))
0
JobKeys::from; query -> Optional.fromNullable(query.get().getSlaveHosts()); private final Function<IScheduledTask, Task> toTask = task -> new Task(task, configInterner); private static final Function<Task, IScheduledTask> TO_SCHEDULED = task -> task.storedTask;
0
Copyright 2002-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
public abstract class HttpRequestBase extends AbstractHttpMessage
0
* @version $Revision$ $Date$
0
initialValue = 0
0
User, Stack, StackVersion, OperatingSystem, Repository, StackService, StackConfiguration, StackServiceComponent
0
import org.apache.beam.sdk.coders.Coder; import org.apache.beam.sdk.coders.Coder.Context; import org.apache.beam.sdk.coders.StringUtf8Coder; import org.apache.beam.sdk.coders.VoidCoder; import org.apache.beam.sdk.io.Read.Bounded; import org.apache.beam.sdk.options.PipelineOptions; import org.apache.beam.sdk.transforms.PTransform; import org.apache.beam.sdk.transforms.display.DisplayData; import org.apache.beam.sdk.util.IOChannelUtils; import org.apache.beam.sdk.util.MimeTypes; import org.apache.beam.sdk.values.PCollection; import org.apache.beam.sdk.values.PDone; import org.apache.beam.sdk.values.PInput;
0
/** {@inheritDoc} */
0
import org.apache.cocoon.servlet.RequestUtil; getLogger().error("Problem in multipart filter. Unable to create request.", e); RequestUtil.manageException(request, response, null, null, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Problem in creating the Request", null, null, e, this.settings, getLogger(), this); getLogger().error("MultipartFilter got an exception while trying to cleanup the uploaded files.", e); filterChain.doFilter(request, response);
0
final HttpHost target = new HttpHost("https", "somehost", 443); mgr.connect(endpoint1, TimeValue.ofMilliseconds(123), context); Mockito.verify(plainSocketFactory, Mockito.times(1)).connectSocket(TimeValue.ofMilliseconds(123), socket, target, final HttpHost target = new HttpHost("https", "somehost", 443); mgr.connect(endpoint1, TimeValue.ofMilliseconds(123), context); Mockito.verify(plainsf, Mockito.times(1)).connectSocket(TimeValue.ofMilliseconds(123), mockSock, proxy,
0
org.apache.accumulo.core.data.thrift.TConstraintViolationSummary _elem2; // optional org.apache.accumulo.core.data.thrift.TConstraintViolationSummary _elem7; // optional
0
* Core HTTP transport component APIs.
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */
0
import org.apache.sshd.util.test.NoIoTestCase; import org.junit.experimental.categories.Category; @Category({ NoIoTestCase.class })
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
import org.apache.beam.runners.dataflow.options.DataflowPipelineOptions; import com.google.api.services.bigquery.model.TableSchema;
0
* Factory for poolable blocking connections.
0
import java.nio.channels.ClosedChannelException; } catch (ClosedChannelException ex) { throw new LogClosedException();
0
* @param <K> the key type * @param <V> the value type * @param <K> the key type * @param <V> the value type * @param <K> the key type * @param <V> the value type
0
import org.apache.commons.lang3.math.NumberUtils;
0
import org.apache.avalon.framework.service.ServiceSelector; * @version CVS $Id$ ServiceSelector inputSelector = null; ServiceSelector outputSelector = null; inputSelector=(ServiceSelector) this.manager.lookup(INPUT_MODULE_SELECTOR); if (inputName != null && inputSelector != null && inputSelector.isSelectable(inputName)){ outputSelector=(ServiceSelector) this.manager.lookup(OUTPUT_MODULE_SELECTOR); if (outputName != null && outputSelector != null && outputSelector.isSelectable(outputName)){
0
import org.apache.hadoop.metadata.typesystem.ITypedReferenceableInstance; import org.apache.hadoop.metadata.typesystem.Referenceable; import org.apache.hadoop.metadata.typesystem.json.InstanceSerialization; import org.apache.hadoop.metadata.typesystem.json.Serialization; public ITypedReferenceableInstance getEntity(String guid) throws MetadataServiceException { JSONObject jsonResponse = callAPI(API.GET_ENTITY, null, guid); try { String entityInstanceDefinition = jsonResponse.getString(MetadataServiceClient.RESULTS); return Serialization.fromJson(entityInstanceDefinition); } catch (JSONException e) { throw new MetadataServiceException(e); } public JSONArray rawSearch(String typeName, String attributeName, Object attributeValue) throws MetadataServiceException { // String gremlinQuery = String.format( // "g.V.has(\"typeName\",\"%s\").and(_().has(\"%s.%s\", T.eq, \"%s\")).toList()", // typeName, typeName, attributeName, attributeValue); // return searchByGremlin(gremlinQuery); String dslQuery = String.format("%s where %s = \"%s\"", typeName, attributeName, attributeValue); return searchByDSL(dslQuery); public JSONArray searchByDSL(String query) throws MetadataServiceException { JSONObject result = callAPIWithResource(API.SEARCH_DSL, resource); try { return result.getJSONObject("results").getJSONArray("rows"); } catch (JSONException e) { throw new MetadataServiceException(e); }
0
private final String OS_MAPPING = "mapping"; private final String OS_ALIASES = "aliases"; private JsonOsFamilyRoot jsonOsFamily = null; Type type = new TypeToken<JsonOsFamilyRoot>() {}.getType(); jsonOsFamily = gson.fromJson(new InputStreamReader(inputStream), type); osMap = jsonOsFamily.getMapping();
0
import org.apache.aurora.scheduler.mesos.TaskExecutors; ResourceSlot.from(TASK, TaskExecutors.NO_OVERHEAD_EXECUTOR),
0