Diff stringlengths 5 2k | FaultInducingLabel int64 0 1 |
|---|---|
import org.apache.http.entity.BufferedHttpEntity;
static JsonNode parseResponse(HttpEntity responseEntity) throws IOException {
return mapper.readValue(responseEntity.getContent(), JsonNode.class);
static void checkForErrors(HttpEntity responseEntity, int backendVersion) throws IOException {
JsonNode searchResult = parseResponse(responseEntity);
return parseResponse(restClient.performRequest("GET", endpoint, params).getEntity());
Response response = restClient.performRequest("GET", endPoint, params, queryEntity);
JsonNode searchResult = parseResponse(response.getEntity());
JsonNode searchResult = parseResponse(response.getEntity());
interface RetryPredicate extends Predicate<HttpEntity>, Serializable {}
private static boolean errorCodePresent(HttpEntity responseEntity, int errorCode) {
JsonNode json = parseResponse(responseEntity);
LOG.warn("Could not extract error codes from responseEntity {}", responseEntity);
public boolean test(HttpEntity responseEntity) {
return errorCodePresent(responseEntity, errorCode);
HttpEntity responseEntity;
responseEntity = new BufferedHttpEntity(response.getEntity());
&& spec.getRetryConfiguration().getRetryPredicate().test(responseEntity)) {
responseEntity = handleRetry("POST", endPoint, Collections.emptyMap(), requestBody);
checkForErrors(responseEntity, backendVersion);
private HttpEntity handleRetry(
HttpEntity responseEntity;
responseEntity = new BufferedHttpEntity(response.getEntity());
if (!spec.getRetryConfiguration().getRetryPredicate().test(responseEntity)) {
return responseEntity;
JsonNode jsonNode = parseResponse(response.getEntity()); | 0 |
if (!"algorithms.HMACOutputLengthMin".equals(ex.getMsgID())) {
if (!"algorithms.HMACOutputLengthMin".equals(ex.getMsgID())) { | 0 |
final boolean valid = managedConn.isOpen();
} catch (final SocketException ex) { | 0 |
String page = req.getRequestURI();
String namespace = BasicServlet.getCookieValue(req, "namespaceDropdown." + BasicServlet.encode(page) + "." + BasicServlet.encode("tableList") + "."
+ "selected");
if (namespace == null) {
namespace = "*";
}
Tables.getNameToIdMap(Monitor.getContext().getInstance()).entrySet().stream().filter(matchesNamespace(namespace)).forEach(tableName_tableId -> {
});
private static Predicate<Entry<String,String>> matchesNamespace(String namespace) {
return new Predicate<Entry<String,String>>() {
public boolean test(Entry<String,String> t) {
if (namespace.equals("*")) {
return true;
} else if (namespace.equals("-")) {
return !t.getKey().contains(".");
}
return t.getKey().startsWith(namespace + ".");
};
};
}
private void doTableDetails(HttpServletRequest req, StringBuilder sb, Map<String,String> tidToNameMap, String tableId) { | 0 |
/** flag if close should be propagated */ | 0 |
final List<MimeFileObject> vfs = new ArrayList<>(); | 0 |
/** TODO: complete javadoc. */ | 0 |
if (Shell.isDebuggingEnabled())
for (ConstraintViolationSummary cvs : e.getConstraintViolationSummaries())
log.trace(cvs.toString());
if (Shell.isDebuggingEnabled())
for (ConstraintViolationSummary cvs : e.getConstraintViolationSummaries())
log.trace(cvs.toString()); | 1 |
return ((Integer) item).intValue() < 0;
assertThat("Comparing " + phs[i].getPhonemeText() + " to " + phs[j].getPhonemeText() + " should be negative", Integer.valueOf(c), | 0 |
key = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.SHIFT_DOWN_MASK);
key = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.SHIFT_DOWN_MASK);
key = KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.SHIFT_DOWN_MASK);
key = KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.SHIFT_DOWN_MASK);
key = KeyStroke.getKeyStroke(KeyEvent.VK_I, KeyEvent.CTRL_DOWN_MASK);
key = KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_DOWN_MASK);
key = KeyStroke.getKeyStroke(KeyEvent.VK_T, KeyEvent.CTRL_DOWN_MASK);
int mods = ie.getModifiersEx();
(mods & InputEvent.BUTTON1_DOWN_MASK) != 0 &&
(mods & InputEvent.CTRL_DOWN_MASK) != 0;
int mods = ie.getModifiersEx();
(mods & InputEvent.BUTTON3_DOWN_MASK) != 0 &&
(mods & InputEvent.SHIFT_DOWN_MASK) != 0;
int mods = ie.getModifiersEx();
(mods & InputEvent.BUTTON1_DOWN_MASK) != 0 &&
(mods & InputEvent.SHIFT_DOWN_MASK) != 0;
int mods = ie.getModifiersEx();
(mods & InputEvent.BUTTON3_DOWN_MASK) != 0 &&
(mods & InputEvent.CTRL_DOWN_MASK) != 0;
int mods = ie.getModifiersEx();
(mods & InputEvent.BUTTON3_DOWN_MASK) != 0 &&
(mods & InputEvent.SHIFT_DOWN_MASK) != 0 &&
(mods & InputEvent.CTRL_DOWN_MASK) != 0; | 0 |
public final void consume(final ByteBuffer src) throws IOException { | 0 |
package org.apache.hc.client5.http.entity.mime; | 0 |
package org.apache.accumulo.start;
public class Platform {
public static void main(String[] args) {
System.out.println(getPlatform());
}
public static String getPlatform()
{
return (System.getProperty("os.name") + "-" +
System.getProperty("os.arch") + "-" +
System.getProperty("sun.arch.data.model")).replace(' ', '_');
}
} | 1 |
// for (int i=0; i<newSize; i++) {
// System.err.println("GGIS["+i+"]: " + newGGIS[i].start + " -> " +
// newGGIS[i].end);
// } | 0 |
import org.apache.felix.sigil.eclipse.repository.ResolutionMonitorAdapter; | 0 |
Copyright 2000-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.http.util.Args;
Args.notNull(httphost, "HTTP host"); | 0 |
// int id = CompositeGraphicsNodeEvent.GRAPHICS_NODE_REMOVED;
// dispatchEvent(new CompositeGraphicsNodeEvent(this, id, oldNode));
// id = CompositeGraphicsNodeEvent.GRAPHICS_NODE_ADDED;
// dispatchEvent(new CompositeGraphicsNodeEvent(this, id, node));
// int id = CompositeGraphicsNodeEvent.GRAPHICS_NODE_ADDED;
// dispatchEvent(new CompositeGraphicsNodeEvent(this, id, node));
// int id = CompositeGraphicsNodeEvent.GRAPHICS_NODE_ADDED;
// dispatchEvent(new CompositeGraphicsNodeEvent(this, id, node));
// int id = CompositeGraphicsNodeEvent.GRAPHICS_NODE_REMOVED;
// dispatchEvent(new CompositeGraphicsNodeEvent(this, id, oldNode)); | 0 |
import org.apache.batik.util.CSSConstants; | 0 |
* <p></p>
* <p></p>
* <p></p>
* <p></p>
* <p></p> | 0 |
this.match = match.clone();
this.targets = targets.clone(); | 0 |
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at | 1 |
private XmlAttrStack xmlattrStack = new XmlAttrStack(false); | 0 |
package org.apache.beam.runners.dataflow;
import org.apache.beam.runners.dataflow.options.DataflowPipelineOptions;
import org.apache.beam.runners.dataflow.testing.TestDataflowPipelineOptions;
import org.apache.beam.runners.dataflow.util.MonitoringUtil; | 0 |
import org.apache.beam.sdk.extensions.sql.schema.BeamSqlRecordType;
import org.apache.beam.sdk.values.BeamRecord;
BeamSqlRecordType type = BeamSqlRecordType.create(fieldNames, fieldTypes);
BeamRecord row = new BeamRecord(type);
PCollection<BeamRecord> inputTable = PBegin.in(p).apply(Create.of(row)
.withCoder(type.getRecordCoder()));
PCollection<BeamRecord> outputStream = inputTable.apply(
MapElements.<BeamRecord, Void>via(new SimpleFunction<BeamRecord, Void>() {
public Void apply(BeamRecord input) {
PCollection<BeamRecord> outputStream2 =
PCollectionTuple.of(new TupleTag<BeamRecord>("CASE1_RESULT"), outputStream)
MapElements.<BeamRecord, Void>via(new SimpleFunction<BeamRecord, Void>() {
public Void apply(BeamRecord input) { | 0 |
* Provides a XML stream with embedded JSTL and XPath expression substitution
* access to data sent by Cocoon Flowscripts.
*
* Provides a XML stream with embedded JSTL and XPath expression substitution | 0 |
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1
* @since Commons IO 1.1 | 0 |
for (int i = 0; i < this.parts.size(); i++) {
final Part part = (Part) this.parts.get(i);
this.rootElementIndex = part.stripRootElement ? -1 : 0;
if (part.element != null) {
this.currentElement = part.element;
startElem(part.element);
} else {
this.currentElement = this.rootElement;
}
SourceUtil.parse(this.manager, part.source, this);
if (part.element != null) {
endElem(part.element);
endElem(this.rootElement);
this.contentHandler.endDocument();
| 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/Attic/EnumerationIterator.java,v 1.5 2002/08/15 20:04:31 pjack Exp $
* $Revision: 1.5 $
* $Date: 2002/08/15 20:04:31 $
/**
* Constructs a new <Code>EnumerationIterator</Code> that will not
* function until {@link #setEnumeration(Enumeration)} is called.
*/
/**
* Constructs a new <Code>EnumerationIterator</Code> that provides
* an iterator view of the given enumeration.
*
* @param enumeration the enumeration to use
*/
/**
* Constructs a new <Code>EnumerationIterator</Code> that will remove
* elements from the specified collection.
*
* @param enum the enumeration to use
* @param collection the collection to remove elements form
*/
/**
* Returns true if the underlying enumeration has more elements.
*
* @return true if the underlying enumeration has more elements
* @throws NullPointerException if the underlying enumeration is null
*/
/**
* Returns the next object from the enumeration.
*
* @return the next object from the enumeration
* @throws NullPointerException if the enumeration is null
*/
* If so, the first occurrence of the last returned object from this
* iterator will be removed from the collection.
/**
* Returns the underlying enumeration.
*
* @return the underlying enumeration
*/
/**
* Sets the underlying enumeration.
*
* @param enumeration the new underlying enumeration
*/ | 0 |
.addValues(inputRows.get(i).getInt32(0))
.addValues(inputRows.get(0).getInt32(0)) | 0 |
private final boolean eofOnClose;
public ChannelOutputStream(AbstractChannel channel, Window remoteWindow, Logger log, byte cmd, boolean eofOnClose) {
this(channel, remoteWindow, PropertyResolverUtils.getLongProperty(channel, WAIT_FOR_SPACE_TIMEOUT, DEFAULT_WAIT_FOR_SPACE_TIMEOUT), log, cmd, eofOnClose);
public ChannelOutputStream(AbstractChannel channel, Window remoteWindow, long maxWaitTimeout, Logger log, byte cmd, boolean eofOnClose) {
this.eofOnClose = eofOnClose;
public boolean isEofOnClose() {
return eofOnClose;
}
if (isEofOnClose()) {
channel.sendEof();
} | 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 |
assertEquals("", conf.getProperty("test.comment"));
assertEquals("", property);
* Tests handling of empty elements.
*/
public void testEmptyElements() throws ConfigurationException
{
assertTrue(conf.containsKey("empty"));
assertEquals("", conf.getString("empty"));
conf.addProperty("empty2", "");
conf.setProperty("empty", "no more empty");
conf.save(testSaveConf);
conf = new XMLConfiguration(testSaveConf);
assertEquals("no more empty", conf.getString("empty"));
assertEquals("", conf.getProperty("empty2"));
}
/** | 0 |
* @version $Id$
/**
* Tests the conversion of a configuration object to properties if scalar
* values are involved. This test is related to CONFIGURATION-432.
*/
public void testConfigurationToPropertiesScalarValue()
{
BaseConfiguration config = new BaseConfiguration();
config.addProperty("scalar", new Integer(42));
Properties props = ConfigurationConverter.getProperties(config);
assertEquals("Wrong value", "42", props.getProperty("scalar"));
}
| 0 |
Object o1 = clazz1.getDeclaredConstructor().newInstance();
Object o2 = clazz2.getDeclaredConstructor().newInstance();
Object o1 = clazz1.getDeclaredConstructor().newInstance();
Object o2 = clazz2.getDeclaredConstructor().newInstance(); | 0 |
private TarArchiveEntry entry;
void setTarEntry(final TarArchiveEntry entry) | 0 |
return null; | 0 |
System.arraycopy(lmHash, 0, keyBytes, 0, 8);
Arrays.fill(keyBytes, 8, keyBytes.length, (byte)0xbd);
int lmRespOffset = 76; // allocate space for the version
if (sessionKeyLen != 0)
addULong(sessionKeyOffset);
else
addULong(0); | 0 |
config.putAll(systemStoreConfig(options));
config.put(JobConfig.JOB_ID(), options.getJobInstance());
private static Map<String, String> systemStoreConfig(SamzaPipelineOptions options) {
ImmutableMap.Builder<String, String> configBuilder =
ImmutableMap.<String, String>builder()
.put(
"stores.beamStore.factory",
"org.apache.samza.storage.kv.RocksDbKeyValueStorageEngineFactory")
.put("stores.beamStore.key.serde", "byteSerde")
.put("stores.beamStore.msg.serde", "byteSerde")
.put("serializers.registry.byteSerde.class", ByteSerdeFactory.class.getName());
if (options.getStateDurable()) {
configBuilder.put("stores.beamStore.changelog", getChangelogTopic(options, "beamStore"));
configBuilder.put("job.host-affinity.enabled", "true");
}
return configBuilder.build();
}
static String getChangelogTopic(SamzaPipelineOptions options, String storeName) {
return String.format(
"%s-%s-%s-changelog", options.getJobName(), options.getJobInstance(), storeName); | 0 |
import java.nio.charset.StandardCharsets;
byte[] keyBytes = "abcdefghijklmnopqrstuvwx".getBytes(StandardCharsets.US_ASCII);
byte[] keyBytes = "abcdefghijklmnopqrstuvwxyz012345".getBytes(StandardCharsets.US_ASCII);
byte[] keyBytes = "abcdefghijklmnopqrstuvwx".getBytes(StandardCharsets.US_ASCII);
byte[] keyBytes = "abcdefghijklmnop".getBytes(StandardCharsets.US_ASCII);
byte[] keyBytes = "abcdefghijklmnop".getBytes(StandardCharsets.US_ASCII);
byte[] keyBytes = "abcdefghijklmnopqrstuvwx".getBytes(StandardCharsets.US_ASCII);
byte[] keyBytes = "abcdefghijklmnopqrstuvwxyz012345".getBytes(StandardCharsets.US_ASCII); | 0 |
storage.prepare();
stateMachine.transition(State.STORAGE_PREPARED);
dieOnError(Closures.filter(NOT_DEAD, prepareStorage)),
dieOnError(Closures.filter(NOT_DEAD, handleLeading)),
dieOnError(Closures.filter(NOT_DEAD, handleRegistered)),
private Closure<Transition<State>> dieOnError(final Closure<Transition<State>> closure) {
return new Closure<Transition<State>>() {
@Override public void execute(Transition<State> transition) {
try {
closure.execute(transition);
} catch (RuntimeException e) {
stateMachine.transition(State.DEAD);
throw e;
}
}
};
}
| 0 |
range = range.clip(new Range(RootTable.EXTENT.getMetadataEntry(), false, null, true)); | 0 |
Iterator iter = interpreterMap.values().iterator();
while (iter.hasNext()) {
Interpreter interpreter = (Interpreter)iter.next();
interpreter.dispose();
}
interpreterMap.clear();
| 0 |
final private static int BATCH_WRITER_MAX_LATENCY = 5;
final private static long SCHEDULE_PERIOD = 1000;
final private static long SCHEDULE_DELAY = 1000;
writer = new AtomicReference<BatchWriter>(this.connector.createBatchWriter(table, new BatchWriterConfig().setMaxLatency(BATCH_WRITER_MAX_LATENCY, TimeUnit.SECONDS)));
}, SCHEDULE_DELAY, SCHEDULE_PERIOD);
writer = connector.createBatchWriter(table, new BatchWriterConfig().setMaxLatency(BATCH_WRITER_MAX_LATENCY, TimeUnit.SECONDS)); | 0 |
* @version $Revision$ $Date$ | 0 |
values.put(CSS_MONOSPACE_VALUE, MONOSPACE_VALUE); | 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.refimpl.gvt;
import java.awt.Shape;
import java.awt.Graphics2D;
import java.awt.Paint;
import org.apache.batik.gvt.FillShapePainter;
import org.apache.batik.gvt.GraphicsNodeRenderContext;
/**
* The default implementation of the <tt>FillShapePainter</tt>.
*
* @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
* @version $Id$
*/
public class ConcreteFillShapePainter implements FillShapePainter {
/** The paint attribute used to fill the shape. */
protected Paint paint;
/**
* Constructs a new <tt>ShapePainter</tt> that can be used to fill
* a <tt>Shape</tt>.
*/
public ConcreteFillShapePainter() {}
public void setPaint(Paint newPaint) {
this.paint = newPaint;
}
public void paint(Shape shape,
Graphics2D g2d,
GraphicsNodeRenderContext ctx) {
if (paint != null) {
g2d.setPaint(paint);
g2d.fill(shape);
}
}
} | 1 |
if (request.getServiceName() == null || request.getComponentName() == null) {
// Ignore the exception if either the service name or component name are not specified.
// This is an artifact of how we get host_components and can happen in the case where
// we get all host_components for a host, for example.
LOG.debug("Ignoring not specified host_component ", e);
} else {
// Otherwise rethrow the exception and let the caller decide if it's an error condition.
// Logging the exception as debug since this does not necessarily indicate an error
// condition.
LOG.debug("ServiceComponentHost not found ", e); | 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.cocoon.core.container.spring.avalon.AvalonEnvironment;
import org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo;
// create a minimal Avalon Context (TODO)
DefaultContext avalonContext = new DefaultContext();
// DefaultContext avalonContext = CoreUtil.createContext(this.settings, osgiServletContext, contextPath); | 0 |
private int lastItemIndex = -1; | 0 |
* Gets a property of type {@link PropertyType#BYTES} or {@link PropertyType#MEMORY}, interpreting the value properly.
* @param property
* Property to get
* @throws IllegalArgumentException
* if the property is of the wrong type | 0 |
import java.util.Arrays;
System.arraycopy( wordMap, 0, ret, 0, ext );
Arrays.fill( ret, ext, sz, -1 );
float lineHeight = 1.0f; | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/BasicVariables.java,v 1.5 2003/03/11 00:59:11 dmitri Exp $
* $Revision: 1.5 $
* $Date: 2003/03/11 00:59:11 $
* Copyright (c) 1999-2003 The Apache Software Foundation. All rights
* @version $Revision: 1.5 $ $Date: 2003/03/11 00:59:11 $ | 0 |
import static org.junit.Assert.assertFalse;
@Test
public void testClusterRendererDefaults() throws Exception {
Renderer clusterBlueprintRenderer =
new ClusterBlueprintRenderer();
assertFalse("ClusterBlueprintRenderer should not require property provider input",
clusterBlueprintRenderer.requiresPropertyProviderInput());
}
| 0 |
* Copyright (c) OSGi Alliance (2004, 2008). All Rights Reserved.
* The <code>getSession</code> methods are used to open a session on a specified
* subtree of the DMT. A typical way of usage:
*
* constants in {@link DmtSession}). This determines whether the session can run
* in parallel with other sessions, and the kinds of operations that can be
* performed in the session. All Management Objects constituting the device
* management tree must support read operations on their nodes, while support
* for write operations depends on the Management Object. Management Objects
* supporting write access may support transactional write, non-transactional
* write or both. Users of <code>DmtAdmin</code> should consult the Management
* Object specification and implementation for the supported update modes. If
* Management Object definition permits, implementations are encouraged to
* support both update modes.
* environment, clients should register listeners through the Event Admin
*
* @version $Revision: 5673 $ | 0 |
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
public void processElement(ProcessContext c, BoundedWindow window) {
BeamSQLRow inputRecord = c.element();
List<Object> results = executor.execute(inputRecord);
outRow.updateWindowRange(inputRecord, window);
| 0 |
* Copyright 2001-2006 The Apache Software Foundation | 0 |
resource.getQuery().getInternalPredicate()); | 0 |
package org.apache.aurora.scheduler.events;
import org.aopalliance.intercept.MethodInterceptor;
import org.apache.aurora.scheduler.events.NotifyingSchedulingFilter.NotifyDelegate;
import org.apache.aurora.scheduler.events.PubsubEvent.EventSubscriber;
import org.apache.aurora.scheduler.events.PubsubEvent.Interceptors.SendNotification;
import org.apache.aurora.scheduler.filter.SchedulingFilter;
| 0 |
import org.apache.ambari.server.security.AmbariEntryPoint;
import org.springframework.security.web.AuthenticationEntryPoint;
bind(AuthenticationEntryPoint.class).to(AmbariEntryPoint.class).in(Scopes.SINGLETON);
| 0 |
package org.apache.hc.core5.testing.nio; | 0 |
import static org.junit.jupiter.api.Assertions.assertNull;
@org.junit.jupiter.api.Test | 0 |
return new PortalObjects((PortalService) this.manager.lookup(org.apache.cocoon.portal.PortalService.class.getName())); | 0 |
@SuppressWarnings("deprecation")
org.apache.accumulo.core.client.Connector conn = accumulo.getConnector("root", "superSecret");
org.apache.accumulo.core.client.Connector uconn = accumulo.getConnector("user1", "pass1");
@SuppressWarnings("deprecation")
org.apache.accumulo.core.client.Connector conn = accumulo.getConnector("root", "superSecret"); | 0 |
import cz.seznam.euphoria.core.client.dataset.partitioning.Partitioning; | 0 |
* The <code>JAffineTransformChooser</code> is a pane that contains
* make up an <code>AffineTransform</code>
* The <code>AffineTransform</code> value represented by the
* configure an <code>AffineTransform</code> | 0 |
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap; | 0 |
import org.apache.aurora.scheduler.storage.log.LogManager.DeduplicateSnapshots;
import static org.apache.aurora.scheduler.storage.log.LogManager.DeflateSnapshots;
import static org.apache.aurora.scheduler.storage.log.LogManager.LogEntryHashFunction;
import static org.apache.aurora.scheduler.storage.log.SnapshotDeduplicator.SnapshotDeduplicatorImpl;
@CmdLine(name = "deduplicate_snapshots",
help = "Write snapshots in deduplicated format. For details and backwards compatibility "
+ "concerns see docs/scheduler-storage.md.")
private static final Arg<Boolean> DEDUPLICATE_SNAPSHOTS = Arg.create(false);
bindConstant().annotatedWith(DeduplicateSnapshots.class).to(DEDUPLICATE_SNAPSHOTS.get());
bindConstant().annotatedWith(DeflateSnapshots.class).to(DEFLATE_SNAPSHOTS.get());
bind(HashFunction.class).annotatedWith(LogEntryHashFunction.class).toInstance(Hashing.md5());
bind(SnapshotDeduplicator.class).to(SnapshotDeduplicatorImpl.class); | 0 |
public static final String ERR_URI_IMAGE_INVALID = "uri.image.invalid";
* The error code when the bridge tries to read an image and the image
* url can't be opened or the contents aren't usable.
* <pre>
* {0} = the uri
* {1} = the reason it can't be opened.
* </pre>
public static final String ERR_URI_IMAGE_BROKEN = "uri.image.broken";
/**
* The error code when the bridge tries to read an image and the image
* url can't be opened:
* <pre>
* {0} = the reason it can't be opened.
* </pre>
*/
public static final String URI_IMAGE_ERROR = "uri.image.error";
| 0 |
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("count", count).append("average", avg).append("minimum", min)
.append("maximum", max).toString(); | 0 |
StringBuilder buffer = new StringBuilder("AggregateAlertRecalculateEvent{"); | 0 |
package org.apache.accumulo.examples.shard;
import java.util.Collections;
import java.util.Map.Entry;
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.BatchScanner;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.ZooKeeperInstance;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.IntersectingIterator;
import org.apache.hadoop.io.Text;
/**
* This program queries a set of terms in the shard table
* (populated by Index.java) using the intersecting iterator.
*
*/
public class Query {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
if(args.length < 6){
System.err.println("Usage : "+Query.class.getName()+" <instance> <zoo keepers> <table> <user> <pass> <term>{ <term>}");
System.exit(-1);
}
String instance = args[0];
String zooKeepers = args[1];
String table = args[2];
String user = args[3];
String pass = args[4];
ZooKeeperInstance zki = new ZooKeeperInstance(instance, zooKeepers);
Connector conn = zki.getConnector(user, pass.getBytes());
BatchScanner bs = conn.createBatchScanner(table, Constants.NO_AUTHS, 20);
Text columns[] = new Text[args.length - 5];
for(int i = 5; i < args.length; i++){
columns[i-5] = new Text(args[i]);
}
IteratorSetting ii = new IteratorSetting(20, "ii", IntersectingIterator.class);
ii.addOption(IntersectingIterator.columnFamiliesOptionName, IntersectingIterator.encodeColumns(columns));
bs.addScanIterator(ii);
bs.setRanges(Collections.singleton(new Range()));
for (Entry<Key,Value> entry : bs) {
System.out.println(" "+entry.getKey().getColumnQualifier());
}
}
} | 1 |
import org.apache.batik.gvt.text.GVTAttributedCharacterIterator;
import org.apache.batik.gvt.text.TextPaintInfo;
public static final
AttributedCharacterIterator.Attribute PAINT_INFO =
GVTAttributedCharacterIterator.TextAttribute.PAINT_INFO;
public void swapTextPaintInfo(TextPaintInfo newInfo,
TextPaintInfo oldInfo) {
fireGraphicsNodeChangeStarted();
invalidateGeometryCache();
oldInfo.set(newInfo);
fireGraphicsNodeChangeCompleted();
}
public void setAttributedCharacterIterator
(AttributedCharacterIterator newAci) { | 0 |
// backing VDF does not define the package version for any of the hosts, cannot install (allows a VDF with package-version)
for (Host host : hosts) {
if (StringUtils.isBlank(desiredVersionDefinition.getPackageVersion(host.getOsFamily()))) {
String msg = String.format("Ambari cannot install version %s. Version %s is already installed.",
desiredRepoVersion, clusterRepoVersion.getVersion());
throw new IllegalArgumentException(msg);
}
if (null != xml && StringUtils.isNotBlank(xml.getPackageVersion(osFamily))) {
params.put(KeyNames.PACKAGE_VERSION, xml.getPackageVersion(osFamily)); | 0 |
import java.util.List;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import com.google.common.collect.ImmutableList;
import org.apache.aurora.scheduler.config.CliOptions;
import org.apache.aurora.scheduler.http.api.security.HttpSecurityModule.Options.HttpAuthenticationMechanism;
@Parameters(separators = "=")
public static class Options {
@Parameter(names = "-shiro_realm_modules",
description = "Guice modules for configuring Shiro Realms.")
@SuppressWarnings("rawtypes")
public List<Class> shiroRealmModule = ImmutableList.of(IniShiroRealmModule.class);
@Parameter(names = "-shiro_after_auth_filter",
description = "Fully qualified class name of the servlet filter to be applied after the"
+ " shiro auth filters are applied.")
public Class<? extends Filter> shiroAfterAuthFilter;
public enum HttpAuthenticationMechanism {
/**
* No security.
*/
NONE,
/**
* HTTP Basic Authentication, produces {@link org.apache.shiro.authc.UsernamePasswordToken}s.
*/
BASIC,
/**
* Use GSS-Negotiate. Only Kerberos and SPNEGO-with-Kerberos GSS mechanisms are supported.
*/
NEGOTIATE,
}
@Parameter(names = "-http_authentication_mechanism",
description = "HTTP Authentication mechanism to use.")
public HttpAuthenticationMechanism httpAuthenticationMechanism =
HttpAuthenticationMechanism.NONE;
}
public HttpSecurityModule(CliOptions options) {
options.httpSecurity.httpAuthenticationMechanism,
MoreModules.instantiateAll(options.httpSecurity.shiroRealmModule, options),
Optional.ofNullable(options.httpSecurity.shiroAfterAuthFilter).map(Key::get).orElse(null)); | 0 |
* Copyright (c) 2001-2004 The Apache Software Foundation. All rights | 0 |
import com.twitter.aurora.scheduler.configuration.ConfigurationManager.TaskDescriptionException;
// TODO(Bill Farner): Avoid using StateManagerImpl.
throws ScheduleException {
JobConfiguration job = parsedConfiguration.getJobConfig();
if (manager.receiveJob(parsedConfiguration)) {
public synchronized void startCronJob(JobKey jobKey)
throws ScheduleException, TaskDescriptionException {
public synchronized Optional<String> initiateJobUpdate(
final ParsedConfiguration parsedConfiguration) throws ScheduleException {
final JobConfiguration job = parsedConfiguration.getJobConfig();
cronScheduler.updateJob(parsedConfiguration);
return Optional.of(
stateManager.registerUpdate(jobKey, parsedConfiguration.getTaskConfigs())); | 0 |
* <p>A file system can also implement {@link VfsComponent}.
*
* Returns the root file of this file system.
void setAttribute( String attrName, Object value )
throws FileSystemException; | 0 |
import org.apache.commons.jxpath.NodeSet;
if (result instanceof NodeSet) {
return new ValueIterator(((NodeSet) result).getPointers().iterator());
}
if (result instanceof NodeSet) {
return new PointerIterator(((NodeSet) result).getPointers().iterator(),
new QName(null, "value"),
context.getRootContext().getCurrentNodePointer().getLocale());
}
//to what method does the following comment refer?
return o instanceof Pointer ? o : NodePointer.newNodePointer(qname, o, locale); | 0 |
components.registerEnvironment(Environments.createDockerEnvironment("java"));
components.registerEnvironment(Environments.createDockerEnvironment("java"));
components.registerEnvironment(Environments.createDockerEnvironment("java"));
components.registerEnvironment(Environments.createDockerEnvironment("java"));
components.registerEnvironment(Environments.createDockerEnvironment("java"));
components.registerEnvironment(Environments.createDockerEnvironment("java")); | 0 |
keyPoints.add(keyPointCoord);
ret[j] = (Float) keyPoints.get(j); | 0 |
ServiceDirectory serviceDirectory = new CommonServiceDirectory(serviceFolder.getPath()); | 0 |
@Override
@Override
@Override
@Override
@Override
@Override
public ServiceReference<?>[] getAllServiceReferences( String arg0, String arg1 )
@Override
@Override
@Override
@Override
@Override
@Override
@Override
public ServiceReference<?> getServiceReference( String arg0 )
@Override
public ServiceReference<?>[] getServiceReferences( String arg0, String arg1 )
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override | 0 |
import com.google.cloud.dataflow.sdk.runners.inprocess.InMemoryWatermarkManager.TimerUpdate;
import com.google.cloud.dataflow.sdk.runners.inprocess.InMemoryWatermarkManager.TransformWatermarks; | 0 |
protected Class<?> getExpectedType() { | 0 |
* Since v4.1 only transformers which are considered to be safe are | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/comparators/BooleanComparator.java,v 1.5 2003/01/15 20:36:38 scolebourne Exp $
* @version $Revision: 1.5 $ $Date: 2003/01/15 20:36:38 $
*
* @param trueFirst when <code>true</code>, sort
* <code>true</code> {@link Boolean}s before
* <code>false</code> {@link Boolean}s.
* @return a cached BooleanComparator instance | 0 |
String CSS_LINE_HEIGHT_PROPERTY = "line-height"; | 0 |
* Stops the embedded Apache HTTP Server. | 0 |
protected void doParse() throws ParseException { | 0 |
resolveReferences();
resolveReferences();
resolveReferences();
resolveReferences();
resolveReferences();
resolveReferences();
resolveReferences();
resolveReferences();
resolveReferences();
AtlasBaseTypeDef typeDef = getTypeDefByGuid(guid);
if (guid != null) {
}
resolveReferences();
if (typeDef != null) {
deletedTypes.add(typeDef);
AtlasBaseTypeDef typeDef = getTypeDefByName(name);
if (name != null) {
}
resolveReferences();
if (typeDef != null) {
deletedTypes.add(typeDef); | 0 |
* {@link org.apache.http.conn.scheme.LayeredSchemeSocketFactory} mockup implementation. | 0 |
.put(FINISHED, EnumSet.of(KILLED, FINISHED))
.put("status", scheduledTask.getStatus())
.put("statusTimestamp", Tasks.getLatestEvent(scheduledTask).getTimestamp())
if (scheduledTask.getStatus() == ScheduleStatus.PENDING) { | 0 |
statusBuf.append("'files':0,'total':0");
String command = WebConsoleUtil.getParameter(req, "command"); | 0 |
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableSet; | 0 |
import org.apache.http.HttpResponseFactory;
protected final ByteBufferAllocator allocator;
protected final NHttpClientHandler handler;
protected final SSLContext sslcontext;
protected final SSLIOSessionHandler sslHandler;
protected final HttpParams params;
protected HttpResponseFactory createHttpResponseFactory() {
return new DefaultHttpResponseFactory();
}
createHttpResponseFactory(), | 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 |
* https://github.com/apache/beam/pull/1353.
* https://github.com/apache/beam/pull/1353. | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/SetPropertyRule.java,v 1.12 2003/08/16 18:18:26 craigmcc Exp $
* $Revision: 1.12 $
* $Date: 2003/08/16 18:18:26 $
* @version $Revision: 1.12 $ $Date: 2003/08/16 18:18:26 $ | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.