Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
package com.twitter.aurora.scheduler;
import com.twitter.aurora.gen.ScheduleStatus;
import com.twitter.aurora.scheduler.async.OfferQueue;
import com.twitter.aurora.scheduler.base.Conversions;
import com.twitter.aurora.scheduler.base.Query;
import com.twitter.aurora.scheduler.base.SchedulerException;
import com.twitter.aurora.scheduler.state.StateManager; | 1 |
loadPlugins(this.latestDefinition); | 0 |
upgradeEntity.setUpgradePackStackId(new StackId((String) null)); | 0 |
* @version $Revision$ | 0 |
/* ====================================================================
* Copyright (c) 2001-2004 The Apache Software Foundation. All rights
* @version $Revision: 1.2 $ $Date: 2004/01/14 21:43:09 $ | 0 |
/*
* Copyright 1999-2005 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.
*/
package org.apache.cocoon.components;
import org.apache.avalon.framework.CascadingRuntimeException;
/**
* The exception thrown when the ContextHelper can't find the necessary
* resource.
*/
public final class ContextResourceNotFoundException extends CascadingRuntimeException
{
public ContextResourceNotFoundException(String message)
{
super(message, null);
}
public ContextResourceNotFoundException(String message, Throwable cause)
{
super(message, cause);
}
} | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/Digester.java,v 1.69 2002/12/16 02:14:15 craigmcc Exp $
* $Revision: 1.69 $
* $Date: 2002/12/16 02:14:15 $
import java.lang.reflect.InvocationTargetException;
* @version $Revision: 1.69 $ $Date: 2002/12/16 02:14:15 $
if ((e != null) &&
(e instanceof InvocationTargetException)) {
Throwable t = ((InvocationTargetException) e).getTargetException();
if ((t != null) && (t instanceof Exception)) {
e = (Exception) t;
}
}
if (e instanceof InvocationTargetException) {
Throwable t = ((InvocationTargetException) e).getTargetException();
if ((t != null) && (t instanceof Exception)) {
e = (Exception) t;
}
} | 0 |
private final InstructionFactory _factory;
private final ConstantPoolGen _cp;
private final ClassGen _cg; | 0 |
private String getUserToRunAs() {
String user = viewContext.getProperties().get(PROPERTY_SLIDER_USER);
if (user == null || user.trim().length() < 1) {
return "yarn";
} else if ("${username}".equals(user)) {
return viewContext.getUsername();
} else {
return user;
}
}
boolean securityEnabled = Boolean.valueOf(viewContext.getProperties().get(PROPERTY_SLIDER_SECURITY_ENABLED));
UserGroupInformation sliderUser;
if (securityEnabled) {
String viewPrincipal = viewContext.getProperties().get(PROPERTY_VIEW_PRINCIPAL);
String viewPrincipalKeytab = viewContext.getProperties().get(PROPERTY_VIEW_PRINCIPAL_KEYTAB);
UserGroupInformation ambariUser = UserGroupInformation.loginUserFromKeytabAndReturnUGI(viewPrincipal, viewPrincipalKeytab);
sliderUser = UserGroupInformation.createProxyUser(getUserToRunAs(), ambariUser);
} else {
sliderUser = UserGroupInformation.getBestUGI(null, getUserToRunAs());
}
T value = sliderUser.doAs(
boolean securedCluster = Boolean.getBoolean(viewContext.getProperties().get(PROPERTY_SLIDER_SECURITY_ENABLED));
if (securedCluster) {
String rmPrincipal = viewContext.getProperties().get(PROPERTY_YARN_RM_PRINCIPAL);
String nnPrincipal = viewContext.getProperties().get(PROPERTY_HDFS_NN_PRINCIPAL);
yarnConfig.set("yarn.resourcemanager.principal", rmPrincipal);
yarnConfig.set("dfs.namenode.kerberos.principal", nnPrincipal);
yarnConfig.set("hadoop.security.authorization", "true");
yarnConfig.set("hadoop.security.authentication", "kerberos");
yarnConfig.set("slider.security.enabled", "true");
} | 0 |
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
public static Document parseXml(File file) throws IOException, SAXException {
InputStream is = null;
try {
is = new BufferedInputStream(new FileInputStream(file));
return parseXml(is);
} finally {
if ( is != null ) {
try {
is.close();
} catch (IOException ignore) {
// ignore
}
}
}
}
| 0 |
public class Window extends AbstractLoggingBean implements java.nio.channels.Channel, ChannelHolder, PropertyResolver {
private final AbstractChannel channelInstance;
this.channelInstance = ValidateUtils.checkNotNull(channel, "No channel provided");
this.suffix = (client ? "client" : "server") + "/" + (local ? "local" : "remote");
return getChannel();
}
@Override // co-variant return
public AbstractChannel getChannel() {
return channelInstance;
AbstractChannel channel = getChannel();
return getClass().getSimpleName() + "[" + suffix + "](" + String.valueOf(getChannel()) + ")"; | 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.commons.digester.annotations.providers;
import java.lang.reflect.Method;
import org.apache.commons.digester.CallMethodRule;
import org.apache.commons.digester.annotations.AnnotationRuleProvider;
import org.apache.commons.digester.annotations.rules.CallMethod;
/**
* Provides instances of {@code CallMethodRule}
*
* @version $Id$
* @since 2.1
*/
public final class CallMethodRuleProvider implements AnnotationRuleProvider<CallMethod, Method, CallMethodRule> {
private String methodName;
private Class<?>[] parameterTypes;
/**
* {@inheritDoc}
*/
public void init(CallMethod annotation, Method element) {
this.methodName = element.getName();
this.parameterTypes = element.getParameterTypes();
}
/**
* {@inheritDoc}
*/
public CallMethodRule get() {
return new CallMethodRule(this.methodName,
this.parameterTypes.length,
this.parameterTypes);
}
} | 0 |
if (sock.connect(addr)) {
sendThread.primeConnection();
} | 0 |
//reverse iteration -> From current element namespaces to parent namespaces
for (int i = comparableNamespaceList.size() - 1; i >= 0; i--) { | 0 |
import org.apache.ambari.server.actionmanager.StageFactoryImpl;
import org.apache.ambari.server.stageplanner.RoleGraphFactory;
import org.apache.ambari.server.stageplanner.RoleGraphFactoryImpl;
/**
* Bind classes to their Factories, which can be built on-the-fly.
* Often, will also have to edit AgentResourceTest.java
*/
bind(StageFactory.class).to(StageFactoryImpl.class);
bind(RoleGraphFactory.class).to(RoleGraphFactoryImpl.class);
| 0 |
import org.apache.ambari.server.topology.GPLLicenseNotAcceptedException;
} catch (InvalidTopologyException | GPLLicenseNotAcceptedException e) { | 0 |
package org.apache.ambari.view.filebrowser.utils; | 0 |
new AuthorizeHeaderToken("Basic " + ALADDIN_OPEN_SESAME); | 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 |
Key key = source.getTopKey(); | 0 |
package org.apache.beam.sdk.extensions.sql.interpreter.operator.string;
import org.apache.beam.sdk.extensions.sql.interpreter.BeamSqlFnExecutorTestBase;
import org.apache.beam.sdk.extensions.sql.interpreter.operator.BeamSqlExpression;
import org.apache.beam.sdk.extensions.sql.interpreter.operator.BeamSqlPrimitive; | 0 |
import com.twitter.aurora.scheduler.storage.entities.IQuota;
IQuota currentUsage = Quotas.fromProductionTasks(
IQuota additionalRequested = Quotas.subtract(Quotas.fromJob(job), currentUsage); | 0 |
* Get additional properties.
protected Properties getAdditionalProperties(Element rootElement)
final Element[] properties = DomHelper.getChildElements(rootElement, rootElement.getNamespaceURI(), "property");
if ( properties != null && properties.length > 0 ) {
variables = new Properties();
for(int i=0; i<properties.length; i++) {
variables.setProperty(DomHelper.getAttribute(properties[i], "name"), DomHelper.getAttribute(properties[i], "value"));
final boolean useDefaultIncludes = Boolean.valueOf(this.getAttributeValue(element, "useDefaultIncludes", "true")).booleanValue();
final Properties additionalProps = this.getAdditionalProperties(element);
if ( additionalProps != null ) {
def.getPropertyValues().addPropertyValue("additionalProperties", additionalProps);
final List includes = this.getPropertyIncludes(element);
if ( element.hasChildNodes() ) {
final Element[] includeElements = DomHelper.getChildElements(element, element.getNamespaceURI(), "include-beans"); | 0 |
import org.apache.commons.configuration.builder.ConfigurationBuilderEvent;
import org.apache.commons.configuration.event.EventListener;
defBuilder.addEventListener(ConfigurationBuilderEvent.RESET,
new EventListener<ConfigurationBuilderEvent>()
@Override
public void onEvent(ConfigurationBuilderEvent event) {
synchronized (CombinedConfigurationBuilder.this) {
private EventListener<ConfigurationBuilderEvent> changeListener;
b.removeEventListener(ConfigurationBuilderEvent.RESET,
changeListener);
builder.addEventListener(ConfigurationBuilderEvent.RESET,
changeListener);
changeListener = new EventListener<ConfigurationBuilderEvent>()
public void onEvent(ConfigurationBuilderEvent event) { | 0 |
* This package contains implementations for the {@link java.util.Queue Queue} interface.
* <p>
* The following implementations are provided in the package:
* <ul>
* <li>CircularFifoQueue - implements a queue with a fixed size that discards oldest when full
* </ul> | 0 |
* ResponseServer is responsible for adding <code>Server</code> header. This
* interceptor is recommended for server side protocol processors.
* The following parameters can be used to customize the behavior of this
* class:
*
public void process(final HttpResponse response, final HttpContext context)
| 0 |
@GraphTransaction | 0 |
@SuppressWarnings("rawtypes") | 0 |
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
assertNotNull("Could not get table ID", tableId);
assertTrue("File archive directory didn't exist", fs.exists(fileArchiveDir));
assertTrue("File doesn't exists in archive directory: " + archivedFile,
assertNotNull("Could not get table ID", tableId);
assertTrue("File archive directory didn't exist", fs.exists(fileArchiveDir));
assertTrue("File doesn't exists in archive directory: " + archivedFile,
assertNotNull("Could not get table ID", tableId);
assertTrue("File archive directory didn't exist", fs.exists(fileArchiveDir));
assertTrue("File doesn't exists in archive directory: " + archivedFile,
assertTrue("File archive directory didn't exist", fs.exists(fileArchiveDir));
assertTrue("File doesn't exists in archive directory: " + finalArchivedFile, | 0 |
out = new ChannelOutputStream(this, remoteWindow, log, SshConstants.SSH_MSG_CHANNEL_DATA); | 0 |
boolean canWrite = WalkingSecurity.get(state).canWrite(WalkingSecurity.get(state).getTabAuthInfo(), tableName);
// For now, just wait a second and go again if they can write!
if (!canWrite)
return;
| 0 |
import org.apache.beam.model.fnexecution.v1.BeamFnApi; | 0 |
private static Method getMostSpecific(List<Method> methods, Class<?>[] classes)
Class<?>[] appArgs = app.getParameterTypes();
private static int moreSpecific(Class<?>[] c1, Class<?>[] c2) {
private static LinkedList<Method> getApplicables(List<Method> methods, Class<?>[] classes) {
private static boolean isApplicable(Method method, Class<?>[] classes) {
Class<?>[] methodArgs = method.getParameterTypes();
Class<?> lastarg = methodArgs[methodArgs.length - 1];
Class<?> vararg = lastarg.getComponentType();
private static boolean isConvertible(Class<?> formal, Class<?> actual,
private static boolean isStrictConvertible(Class<?> formal, Class<?> actual,
} | 0 |
@Override
@Override | 0 |
import java.text.SimpleDateFormat;
import java.util.Date;
import org.quartz.CronTrigger;
import org.quartz.SimpleTrigger;
* @version CVS $Id: QuartzJobSchedulerEntry.java,v 1.3 2003/09/05 10:22:21 giacomo Exp $
/** The data map */
private final JobDataMap m_data;
/** The detail */
private final JobDetail m_detail;
/** The date formatter */
private final SimpleDateFormat m_formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
* @param name The name of the job
* @param scheduler The QuartzJobScheduler
*
* @throws SchedulerException in case of failures
public QuartzJobSchedulerEntry(final String name, final Scheduler scheduler)
throws SchedulerException {
if (null == name) {
/* (non-Javadoc)
* @see org.apache.cocoon.components.cron.JobSchedulerEntry#isRunning()
*/
public boolean isRunning() {
Boolean runs = (Boolean)m_data.get(QuartzJobExecutor.DATA_MAP_KEY_ISRUNNING);
if (null != runs) {
return runs.booleanValue();
}
return false;
}
/* (non-Javadoc)
* @see org.apache.cocoon.components.cron.JobSchedulerEntry#getSchedule()
*/
public String getSchedule() {
if (m_trigger instanceof CronTrigger) {
return "cron: " + ((CronTrigger)m_trigger).getCronExpression();
} else if (m_trigger instanceof SimpleTrigger) {
if (((SimpleTrigger)m_trigger).getRepeatInterval() == 0) {
return "once: at " + m_formatter.format(m_trigger.getFinalFireTime());
}
return "periodic: every " + (((SimpleTrigger)m_trigger).getRepeatInterval() / 1000) + "s";
} else {
return "next: " + m_formatter.format(m_trigger.getNextFireTime());
}
} | 0 |
"Incompatible data version " + dataVersion); | 0 |
/* ====================================================================
* Copyright (c) 2001-2004 The Apache Software Foundation. All rights
* @version $Revision: 1.6 $ $Date: 2004/01/14 21:34:34 $ | 0 |
@SuppressWarnings("deprecation")
AccumuloOutputFormat.setConnectorInfo(job, user, tokenFile);
try (PrintStream out = new PrintStream(tf)) {
getClientInfo().getProperties().store(out, "Credentials for " + getClass().getName()); | 0 |
public class ApexStateInternals<K> implements StateInternals {
public <T extends State> T state(StateNamespace namespace, StateTag<T> address) {
StateNamespace namespace, StateTag<T> address, final StateContext<?> c) {
return address.bind(new ApexStateBinder(namespace, address, c));
private class ApexStateBinder implements StateBinder {
private ApexStateBinder(StateNamespace namespace, StateTag<?> address,
StateTag<ValueState<T>> address, Coder<T> coder) {
final StateTag<BagState<T>> address, Coder<T> elemCoder) {
StateTag<SetState<T>> address,
StateTag<MapState<KeyT, ValueT>> spec,
StateTag<CombiningState<InputT, AccumT, OutputT>> address,
public WatermarkHoldState bindWatermark(
StateTag<WatermarkHoldState> address,
StateTag<CombiningState<InputT, AccumT, OutputT>> address,
protected final StateTag<? extends State> address;
StateTag<? extends State> address,
StateTag<ValueState<T>> address,
StateTag<WatermarkHoldState> address,
StateTag<CombiningState<InputT, AccumT, OutputT>> address,
StateTag<BagState<T>> address, | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//digester/src/java/org/apache/commons/digester/Digester.java,v 1.80 2003/08/02 09:54:06 rdonkin Exp $
* $Revision: 1.80 $
* $Date: 2003/08/02 09:54:06 $
* @version $Revision: 1.80 $ $Date: 2003/08/02 09:54:06 $
* Add a "call parameter" rule that sets a parameter from the current
* <code>Digester</code> matching path.
* This is sometimes useful when using rules that support wildcards.
*
* @param pattern the pattern that this rule should match
* @param paramIndex The zero-relative parameter number
* @see CallMethodRule
*/
public void addCallParamPath(String pattern,int paramIndex) {
addRule(pattern, new PathCallParamRule(paramIndex));
}
/** | 0 |
try (AccumuloClient c = createAccumuloClient()) { | 0 |
authState.reset();
authState.reset();
authState.reset();
authState.reset();
authState.reset(); | 0 |
import org.apache.accumulo.core.data.impl.KeyExtent; | 1 |
/*
* ====================================================================
* 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/>.
*
*/
/**
* Thread-safety annotations based on JCIP-ANNOTATIONS
* <br/>
* Copyright (c) 2005 Brian Goetz and Tim Peierls.
* See http://www.jcip.net
*/
package org.apache.http.annotation; | 0 |
out(4, "Major Compacting %d", info.majors == null ? 0 : info.majors.running);
out(4, "Queued for Major Compaction %d", info.majors == null ? 0 : info.majors.queued);
out(4, "Minor Compacting %d", info.minors == null ? 0 : info.minors.running);
out(4, "Queued for Minor Compaction %d", info.minors == null ? 0 : info.minors.queued); | 0 |
hdfs.close();
| 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 |
* 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 |
/**
* 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 |
private XMLSignatureInput input = null;
/**
* @param filename
public ResolverAnonymous(String filename) throws FileNotFoundException, IOException {
this.input = new XMLSignatureInput(new FileInputStream(filename));
}
/**
* @param is
public ResolverAnonymous(InputStream is) {
this.input = new XMLSignatureInput(is);
}
/** @inheritDoc */
public XMLSignatureInput engineResolve(Attr uri, String BaseURI) {
return this.input;
}
/**
* @inheritDoc
*/
public boolean engineCanResolve(Attr uri, String BaseURI) {
if (uri == null) {
return true;
}
return false;
}
/** @inheritDoc */
public String[] engineGetPropertyKeys() {
return new String[0];
} | 0 |
import org.apache.felix.das.util.Util;
import org.apache.felix.dm.Component;
import org.apache.felix.dm.DependencyActivatorBase;
import org.apache.felix.dm.DependencyManager;
private void startDeviceManager() {
final String driverFilter = Util.createFilterString( "(%s=%s)", new String[]
{ org.osgi.service.device.Constants.DRIVER_ID, "*" } );
final String deviceFilter = Util.createFilterString( "(|(%s=%s)(&(%s=%s)(%s=%s)))", new String[]
{
Constants.OBJECTCLASS, Device.class.getName(),
Constants.OBJECTCLASS, "*",
org.osgi.service.device.Constants.DEVICE_CATEGORY, "*"
} );
Component svc = createComponent();
svc.add( createServiceDependency().setService( DriverSelector.class ).setRequired( false ).setAutoConfig( false )
.setCallbacks( "selectorAdded", "selectorRemoved" ) );
svc.add( createServiceDependency().setService( Driver.class, driverFilter ).setRequired( false )
.setCallbacks( "driverAdded", "driverRemoved" ) );
svc.add( createServiceDependency().setService( deviceFilter ).setRequired( false )
.setCallbacks( "deviceAdded", "deviceModified", "deviceRemoved" ) );
| 0 |
MASTER_MINTHREADS("master.server.threads.minimum", "2", PropertyType.COUNT, "The minimum number of threads to use to handle incoming requests."),
+ " limits the number of long running scans that can run concurrently per tserver."),
TSERV_MINTHREADS("tserver.server.threads.minimum", "2", PropertyType.COUNT, "The minimum number of threads to use to handle incoming requests."),
"minimum ratio of total input size to maximum input file size for running a major compaction. When adjusting this property you may want to also adjust table.file.max. Want to avoid the situation where only merging minor compactions occur."),
TABLE_SPLIT_THRESHOLD("table.split.threshold", "1G", PropertyType.MEMORY, "When combined size of files exceeds this amount a tablet is split."),
"Determines how large index blocks can be in files that support multilevel indexes. The maximum value for this is " + Integer.MAX_VALUE), | 0 |
public static final String SERVER_HTTP_REQUEST_HEADER_SIZE = "server.http.request.header.size";
public static final String SERVER_HTTP_RESPONSE_HEADER_SIZE = "server.http.response.header.size";
public static final int SERVER_HTTP_REQUEST_HEADER_SIZE_DEFAULT = 64*1024;
public static final int SERVER_HTTP_RESPONSE_HEADER_SIZE_DEFAULT = 64*1024;
/**
* @return Custom property for request header size
*/
public int getHttpRequestHeaderSize() {
return Integer.parseInt(properties.getProperty(
SERVER_HTTP_REQUEST_HEADER_SIZE, String.valueOf(SERVER_HTTP_REQUEST_HEADER_SIZE_DEFAULT)));
}
/**
* @return Custom property for response header size
*/
public int getHttpResponseHeaderSize() {
return Integer.parseInt(properties.getProperty(
SERVER_HTTP_RESPONSE_HEADER_SIZE, String.valueOf(SERVER_HTTP_RESPONSE_HEADER_SIZE_DEFAULT)));
}
| 0 |
//position now be between -1 and 1 | 0 |
lst.add(s.getBytes()); | 1 |
import org.apache.hc.core5.annotation.Immutable;
import org.apache.hc.core5.http.HttpHost;
import org.apache.hc.core5.util.Args;
import org.apache.hc.core5.util.LangUtils; | 0 |
Injector injector = Guice.createInjector(new ControllerModule()); | 0 |
constraintViolated(o, "Referenced method '"+o.getMethodName(cpg)+"' with expected signature not found in class '"+jc.getClassName()+"'. The native verifier does allow the method to be declared in some superinterface, which the Java Virtual Machine Specification, Second Edition does not.");
constraintViolated(o, "Referenced method '"+o.getMethodName(cpg)+"' with expected signature not found in class '"+jc.getClassName()+"'. The native verifier does allow the method to be declared in some superclass or implemented interface, which the Java Virtual Machine Specification, Second Edition does not.");
constraintViolated(o, "Referenced method '"+o.getMethodName(cpg)+"' with expected signature not found in class '"+jc.getClassName()+"'. The native verifier does allow the method to be declared in some superclass or implemented interface, which the Java Virtual Machine Specification, Second Edition does not."); | 0 |
* @since 3.0
* @since 3.1
* @since 3.1
* @since 3.1 | 0 |
public void testCallParamRule() throws Exception {
URL rules = ClassLoader.getSystemResource
("org/apache/commons/digester/xmlrules/test-call-param-rules.xml");
String xml = "<?xml version='1.0' ?>"
+ "<root><foo attr='long'><bar>short</bar><foobar><ping>tosh</ping></foobar></foo></root>";
CallParamTestObject testObject = new CallParamTestObject();
DigesterLoader.load(
rules,
getClass().getClassLoader(),
new StringReader(xml),
testObject);
assertEquals("Incorrect left value", "long", testObject.getLeft());
assertEquals("Incorrect middle value", "short", testObject.getMiddle());
assertEquals("Incorrect right value", "", testObject.getRight());
} | 0 |
class IntWindow extends Window<IntWindow> { | 0 |
import org.junit.Ignore;
@Ignore("https://issues.apache.org/jira/browse/BEAM-6352") | 0 |
((DelegatingConnection<?>) c[0]).getDelegate().close();
DelegatingConnection<?> con = (DelegatingConnection<?>) ds.getConnection();
DelegatingConnection<Connection> con2 = new DelegatingConnection<>(inner); | 0 |
* Get the synclimit
* Set the synclimit | 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.ambari.server.state.stack.RepoTag;
ArrayNode tagsNode = factory.arrayNode();
for (RepoTag repoTag : repo.getTags()) {
tagsNode.add(repoTag.toString());
}
repoElement.put(PropertyHelper.getPropertyName(
RepositoryResourceProvider.REPOSITORY_TAGS_PROPERTY_ID), tagsNode);
| 0 |
import cz.seznam.euphoria.core.client.operator.state.State;
import cz.seznam.euphoria.core.client.operator.state.ListStateStorage;
import cz.seznam.euphoria.core.client.operator.state.StateStorageProvider;
import org.apache.flink.shaded.com.google.common.collect.Lists;
//testBatchSort(),
final ListStateStorage<Integer> data;
SortState(Collector<Integer> c, StateStorageProvider storageProvider) {
super(c, storageProvider);
this.data = storageProvider.getListStorageFor(Integer.class);
List<Integer> list = Lists.newArrayList(data.get());
Collections.sort(list);
for (Integer i : list) {
ret = new SortState(state.getCollector(), state.getStorageProvider());
ret.data.addAll(state.data.get()); | 0 |
public class NestedZipTestCase extends AbstractProviderTestConfig {
public static Test suite() throws Exception {
public void prepare(final DefaultFileSystemManager manager) throws Exception {
public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception { | 1 |
public CPDSConnectionFactory(final ConnectionPoolDataSource cpds,
final String validationQuery,
final int validationQueryTimeout,
final boolean rollbackAfterValidation,
final String username,
final String password) {
public void setPool(final ObjectPool<PooledConnectionAndInfo> pool) {
public void destroyObject(final PooledObject<PooledConnectionAndInfo> p) throws Exception {
private void doDestroyObject(final PooledConnectionAndInfo pci) throws Exception{
public boolean validateObject(final PooledObject<PooledConnectionAndInfo> p) {
public void passivateObject(final PooledObject<PooledConnectionAndInfo> p)
public void activateObject(final PooledObject<PooledConnectionAndInfo> p)
public void connectionClosed(final ConnectionEvent event) {
public void connectionErrorOccurred(final ConnectionEvent event) {
public void invalidate(final PooledConnection pc) throws SQLException {
public synchronized void setPassword(final String password) {
public void setMaxConnLifetimeMillis(final long maxConnLifetimeMillis) {
public void closePool(final String username) throws SQLException {
private void validateLifetime(final PooledObject<PooledConnectionAndInfo> p) | 0 |
* @param <K> the type of the keys in the map
* @param <V> the type of the values in the map
* | 0 |
KeyPairProvider provider = Objects.requireNonNull(getKeyPairProvider(), "No host keys provider"); | 0 |
import org.apache.commons.vfs.VFS;
if (VFS.isUriStyle())
{
if (stat.charAt(0) == 'd' && nameBuf.charAt(nameBuf.length()-1) != '/')
{
nameBuf.append("/");
}
}
if (name.equals(".") || name.equals("..") || name.equals("./") || name.equals("../"))
| 0 |
*
* @version $Id: FTPFileList.java,v 1.13 2004/04/21 23:30:33 scohen Exp $
* @deprecated This class is deprecated as of version 1.2 and will be
public class FTPFileList
* @param stream The input stream created by reading the socket on which
*
}
*
*
*
*
* @return vector containing all the raw input lines returned from the FTP
* create an iterator over this list using the parser with which this list
*
*
* @param parser The user-supplied parser with which the list is to be
*
* returns an array of FTPFile objects for all the files in the directory
* @return an array of FTPFile objects for all the files in the directory | 0 |
package org.apache.felix.fileinstall.internal;
import org.apache.felix.fileinstall.internal.BundleTransformer; | 0 |
Objects.requireNonNull(location, "No location to update"); | 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 |
@Override
private static final ParDoFnFactory parDoFnFactory = new CombineValuesFn.Factory();
return parDoFnFactory.create( | 0 |
public void multipleErrorPagesForSameErrorCodeChoosenByServiceRankingRules() throws InterruptedException
assertEquals(0, defaultContext.errorPageDTOs[1].errorCodes.length);
assertEquals(0, failedErrorPageDTO.exceptions.length); | 0 |
shutdownForwarder = service != forwardService || isShutdownOnExit(); | 0 |
/*
* Copyright 2016-2018 Seznam.cz, a.s. | 0 |
* href="http://commons.apache.org/lang">Commons Lang</a>. By extending
* href="http://commons.apache.org/configuration/team-list.html">Commons | 0 |
package org.apache.xml.security.stax.ext;
import org.apache.xml.security.stax.ext.stax.XMLSecEvent;
import org.apache.xml.security.stax.ext.stax.XMLSecStartElement; | 0 |
if ( ref.getCardinality() == null ) {
ref.setCardinality("1..1");
}
if ( ref.getPolicy() == null ) {
ref.setPolicy("static");
}
// if this is a field with a single cardinality,
// we look for the bind/unbind methods
if ( ref.getCardinality().equals("0..1") || ref.getCardinality().equals("1..1") ) {
boolean createBind = false;
boolean createUnbind = false;
// Only create method if no bind name has been specified
if ( bindValue == null && ref.findMethod(ref.getBind()) == null ) {
// create bind method
createBind = true;
}
if ( unbindValue == null && ref.findMethod(ref.getUnbind()) == null ) {
// create unbind method
createUnbind = true;
}
if ( createBind || createUnbind ) {
((ModifiableJavaClassDescription)component.getJavaClassDescription()).addMethods(name, type, createBind, createUnbind);
} | 0 |
import static org.apache.beam.sdk.io.common.FileBasedIOITHelper.readFileBasedIOITPipelineOptions;
import org.apache.beam.sdk.io.common.FileBasedIOTestPipelineOptions;
FileBasedIOTestPipelineOptions options = readFileBasedIOITPipelineOptions();
PCollection<String> testFiles = pipeline
.apply("Generate sequence", GenerateSequence.from(0).to(numberOfRecords))
.setCoder(AvroCoder.of(SCHEMA))
.apply("Map records to strings",
MapElements.into(strings()).via(
(SerializableFunction<GenericRecord, String>) record -> String
.valueOf(record.get("row")))) | 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 |
final Set<Map<String, Object>> propertySet = new LinkedHashSet<>();
final Map<String, Object> properties = new LinkedHashMap<>();
final Set<Map<String, Object>> propertySet = new LinkedHashSet<>();
final Map<String, Object> properties = new LinkedHashMap<>();
final Set<Map<String, Object>> propertySet = new LinkedHashSet<>();
final Map<String, Object> properties = new LinkedHashMap<>(); | 0 |
throw new RuntimeException(I18n.translate("endorsed.jdk1.4.0")/*,*/+ex); | 0 |
return ValueConstants.CSS_FONT_FAMILY_PROPERTY; | 0 |
actorSystem = ActorSystem.create("TestingActorSystem");
expect(jobImpl.getDateSubmitted()).andReturn(0L).times(1);
expect(jobImpl.getDateSubmitted()).andReturn(0L).times(2); | 0 |
TWO_HOURS_OF_MILLISECONDS, | 0 |
import java.io.File;
import java.net.URL;
| 0 |
public void testBinary() {
Text colf = new Text();
Text colq = new Text();
for (int i = 0; i < 256; i++) {
colf.append(new byte[] {(byte) i}, 0, 1);
colq.append(new byte[] {(byte) (255 - i)}, 0, 1);
runTest(colf, colq);
runTest(colf);
}
public void testBasic() {
runTest(new Text("colf1"), new Text("cq2"));
runTest(new Text("colf1"));
}
private void runTest(Text colf) {
String encodedCols;
PerColumnIteratorConfig ac3 = new PerColumnIteratorConfig(colf, "com.foo.SuperAgg");
encodedCols = ac3.encodeColumns();
PerColumnIteratorConfig ac4 = PerColumnIteratorConfig.decodeColumns(encodedCols, "com.foo.SuperAgg");
assertEquals(colf, ac4.getColumnFamily());
assertNull(ac4.getColumnQualifier());
}
private void runTest(Text colf, Text colq) {
PerColumnIteratorConfig ac = new PerColumnIteratorConfig(colf, colq, "com.foo.SuperAgg");
String encodedCols = ac.encodeColumns();
PerColumnIteratorConfig ac2 = PerColumnIteratorConfig.decodeColumns(encodedCols, "com.foo.SuperAgg");
assertEquals(colf, ac2.getColumnFamily());
assertEquals(colq, ac2.getColumnQualifier());
}
| 1 |
* @deprecated (3.3) Use {@link #_openDataConnection_(FTPCmd, String)} instead | 0 |
import java.net.Socket;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSession;
public SSLSession getSSLSession() {
if (!isOpen())
return null;
SSLSession result = null;
Socket sock = wrappedConnection.getSocket();
if (sock instanceof SSLSocket) {
result = ((SSLSocket)sock).getSession();
}
return result;
}
// non-javadoc, see interface ManagedClientConnection | 0 |
package org.apache.accumulo.shell.commands;
import org.apache.accumulo.shell.Shell;
import org.apache.accumulo.shell.Shell.Command; | 0 |
/**
* @since Mar 14, 2002
* @version CVS $Id: Context.java,v 1.2 2003/03/16 17:49:04 vgritsenko Exp $ | 0 |
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE}) | 0 |
import org.apache.aurora.GuavaUtils;
import org.apache.aurora.scheduler.AppStartup;
import org.apache.aurora.scheduler.app.LifecycleModule;
injector.getInstance(Key.get(GuavaUtils.ServiceManagerIface.class, AppStartup.class))
.startAsync().awaitHealthy(); | 0 |
import org.apache.accumulo.core.client.admin.SamplerConfiguration;
List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, AtomicBoolean interruptFlag, SamplerConfiguration samplerConfig, long batchTimeOut)
throws IOException {
ScanDataSource dataSource = new ScanDataSource(this, authorizations, this.defaultSecurityLabel, columns, ssiList, ssio, interruptFlag, samplerConfig,
batchTimeOut);
Map<String,Map<String,String>> ssio, boolean isolated, AtomicBoolean interruptFlag, SamplerConfiguration samplerConfig, long batchTimeOut) {
ScanOptions opts = new ScanOptions(num, authorizations, this.defaultSecurityLabel, columns, ssiList, ssio, interruptFlag, isolated, samplerConfig,
batchTimeOut); | 1 |
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Lists; | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.