Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
log.info("splits : {}", splits); | 0 |
import org.apache.ambari.server.agent.stomp.AgentConfigsHolder;
@Inject
private AgentConfigsHolder agentConfigsHolder;
executionCommandEvent.setRequiredConfigTimestamp(agentConfigsHolder.getCurrentData(hostId).getTimestamp()); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/decorators/Attic/OrderedSet.java,v 1.1 2003/09/09 22:28:35 scolebourne Exp $
* Decorates a <code>Set</code> to ensure that the order of addition
* is retained and used by the iterator.
* @version $Revision: 1.1 $ $Date: 2003/09/09 22:28:35 $
public class OrderedSet extends AbstractSetDecorator implements Set {
* Factory method to create an ordered set.
return new OrderedSet(set);
protected OrderedSet(Set set) {
return new OrderedSetIterator(setOrder.iterator(), collection);
protected static class OrderedSetIterator extends AbstractIteratorDecorator {
private OrderedSetIterator(Iterator iterator, Collection set) { | 0 |
String content = XMLUtils.getFullTextChildrenFromNode(oaepParamsElements.item(0)); | 0 |
public int getStatus() {
return this.ioReactor.getStatus();
}
public void join(long timeout) throws InterruptedException {
if (this.thread != null) {
this.thread.join(timeout);
}
}
public Exception getException() {
if (this.thread != null) {
return this.thread.getException();
} else {
return null;
}
}
join(500);
private volatile Exception ex;
this.ex = ex;
} catch (RuntimeException ex) {
this.ex = ex;
public Exception getException() {
return this.ex;
} | 0 |
import org.osgi.service.component.ComponentConstants;
m_componentManager.reactivate( ComponentConstants.DEACTIVATION_REASON_REFERENCE );
m_componentManager.reactivate( ComponentConstants.DEACTIVATION_REASON_REFERENCE );
m_componentManager.deactivateInternal( ComponentConstants.DEACTIVATION_REASON_REFERENCE );
m_componentManager.deactivateInternal( ComponentConstants.DEACTIVATION_REASON_REFERENCE );
m_componentManager.activate();
m_componentManager.deactivateInternal( ComponentConstants.DEACTIVATION_REASON_REFERENCE ); | 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.
*/
package org.apache.cocoon.template.jxtg.script.event;
import org.apache.cocoon.template.jxtg.expression.JXTExpression;
public class StartOut extends StartInstruction {
public StartOut(StartElement raw, JXTExpression expr, Boolean lenient) {
super(raw);
this.compiledExpression = expr;
this.lenient = lenient;
}
public JXTExpression getCompiledExpression() {
return compiledExpression;
}
public Boolean getLenient() {
return lenient;
}
private final JXTExpression compiledExpression;
private final Boolean lenient; | 0 |
* Copyright 2000-2009 The Apache Software Foundation | 0 |
private final SftpClientFactory factory;
this(client, null, selector);
}
public SftpFileSystemProvider(SshClient client, SftpClientFactory factory, SftpVersionSelector selector) {
this.factory = factory;
fileSystem = new SftpFileSystem(this, id, session, factory, selector);
fileSystem = new SftpFileSystem(this, id, session, factory, getSftpVersionSelector()); | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/test/org/apache/commons/jxpath/ri/model/dynabeans/DynaBeanModelTest.java,v 1.2 2003/01/20 00:00:29 dmitri Exp $
* $Revision: 1.2 $
* $Date: 2003/01/20 00:00:29 $
import junit.framework.TestSuite;
* @version $Revision: 1.2 $ $Date: 2003/01/20 00:00:29 $
public class DynaBeanModelTest extends BeanModelTestCase {
public DynaBeanModelTest(String name) {
public static TestSuite suite() {
return new TestSuite(DynaBeanModelTest.class);
// TestSuite s = new TestSuite();
// s.addTest(new DynaBeanModelTest("testAxisParent"));
// return s;
protected Object createContextBean() {
protected AbstractFactory getAbstractFactory() { | 0 |
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkArgument;
import org.apache.beam.vendor.guava.v20_0.com.google.common.annotations.VisibleForTesting;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableList;
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.ImmutableMap;
import org.apache.beam.vendor.guava.v20_0.com.google.common.util.concurrent.Uninterruptibles; | 0 |
/*
* @formatter:off If a minor compaction starts after a tablet opens, this indicates a log recovery occurred. This recovered data must be minor
* compacted.
* 1) The log recovery code does not handle data written to the tablet on multiple tablet servers. 2) The log recovery code does not block if memory is
* full. Therefore recovering lots of tablets that use a lot of memory could run out of memory. 3) The minor compaction finish event did not make it to
* the logs (the file will be in metadata, preventing replay of compacted data)... but do not want a majc to wipe the file out from metadata and then
* have another process failure... this could cause duplicate data to replay.
* | 0 |
public PrintReplicationRecords(Connector conn, PrintStream out) {
} | 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 |
@Test(timeout = 4 * 60 * 1000) | 0 |
List<UpgradeCatalog> upgradeCatalogs = new ArrayList<>();
List<UpgradeCatalog> candidateCatalogs = new ArrayList<>(allUpgradeCatalogs);
/**
* Returns minimal version of available {@link UpgradeCatalog}
*
* @return string representation of minimal version of {@link UpgradeCatalog}
*/
private String getMinimalUpgradeCatalogVersion(){
List<UpgradeCatalog> candidateCatalogs = new ArrayList<>(allUpgradeCatalogs);
Collections.sort(candidateCatalogs, new AbstractUpgradeCatalog.VersionComparator());
if (candidateCatalogs.isEmpty()) {
return null;
}
return candidateCatalogs.iterator().next().getTargetVersion();
}
/**
* Checks if source version meets minimal requirements for upgrade
*
* @param minUpgradeVersion min allowed version for the upgrade, could be obtained via {@link SchemaUpgradeHelper.getMinimalUpgradeCatalogVersion}
* @param sourceVersion current version of the Database, which need to be upgraded
*
* @return true if upgrade is allowed or false if not
*/
private boolean verifyUpgradePath(String minUpgradeVersion, String sourceVersion){
if (null == minUpgradeVersion){
return false;
}
return VersionUtils.compareVersions(sourceVersion, minUpgradeVersion) >= 0;
}
String minimalRequiredUpgradeVersion = schemaUpgradeHelper.getMinimalUpgradeCatalogVersion();
if (!schemaUpgradeHelper.verifyUpgradePath(minimalRequiredUpgradeVersion, sourceVersion)){
throw new AmbariException(String.format("Database version does not meet minimal upgrade requirements. Expected version should be not less than %s, current version is %s",
minimalRequiredUpgradeVersion, sourceVersion));
}
| 0 |
static final String SHA384 = | 0 |
public String getSourceName() {
return "Reference";
}
@Override | 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.http.client.cache;
/**
* @since 4.1
*/
public class InputLimit {
private final long value;
private boolean reached;
public InputLimit(long value) {
super();
this.value = value;
this.reached = false;
}
public long getValue() {
return this.value;
}
public void reached() {
this.reached = true;
}
public boolean isReached() {
return this.reached;
}
} | 0 |
public void setName(String name) {
this.name = name;
}
public Package() { } | 0 |
throw new InvalidKeySpecException("Unexpected key type: " + keyType); | 0 |
interceptor.process(null, null, context);
interceptor.process(request, null, context);
interceptor.process(request, null, context); | 0 |
public void testInvalidInput() throws Exception {
HeaderUtils.parseHeaders(null);
// expected | 0 |
* @param big <code>BigInteger</code> to be converted
* @param bitlen <code>int</code> the desired length in bits of the representation | 0 |
throw new SkipException(String.format("createTypes: '%s' could not be loaded.", fileName));
throw new SkipException(String.format("createTypes: '%s' could not be loaded.", fileName));
throw new SkipException(String.format("createAtlasEntity: could not loaded '%s'.", atlasEntity.getEntity().getTypeName())); | 0 |
@Deprecated | 0 |
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.DataFileColumnFamily;
import org.junit.Assert;
put(tm1, "2;m", TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN, "/t1");
put(tm1, "2;m", DataFileColumnFamily.NAME, "/t1/file1", "1,1");
put(tm1, "2;m", TabletsSection.BulkFileColumnFamily.NAME, "/t1/file1", "5");
put(tm1, "2;m", TabletsSection.BulkFileColumnFamily.NAME, "/t1/file3", "7");
put(tm1, "2;m", TabletsSection.BulkFileColumnFamily.NAME, "/t1/file4", "9");
put(tm1, "2<", TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN, "/t2");
put(tm1, "2<", DataFileColumnFamily.NAME, "/t2/file2", "1,1");
put(tm1, "2<", TabletsSection.BulkFileColumnFamily.NAME, "/t2/file6", "5");
put(tm1, "2<", TabletsSection.BulkFileColumnFamily.NAME, "/t2/file7", "7");
put(tm1, "2<", TabletsSection.BulkFileColumnFamily.NAME, "/t2/file8", "9");
put(tm1, "2<", TabletsSection.BulkFileColumnFamily.NAME, "/t2/fileC", null);
put(tm1, "2;m", TabletsSection.BulkFileColumnFamily.NAME, "/t1/file5", "8");
put(tm1, "2<", TabletsSection.BulkFileColumnFamily.NAME, "/t2/file9", "8");
put(tm1, "2<", TabletsSection.BulkFileColumnFamily.NAME, "/t2/fileA", "2");
public void registerSideChannel(SortedKeyValueIterator<Key,Value> iter) {}
| 1 |
package org.apache.beam.sdk.transforms.windowing;
import static org.apache.beam.sdk.testing.WindowFnTestUtils.runWindowFn;
import static org.apache.beam.sdk.testing.WindowFnTestUtils.set;
import org.apache.beam.sdk.testing.WindowFnTestUtils; | 0 |
* Creates a collection of task wrappers based on the set of hosts they are allowed to run on
*
*
* @return the task wrappers, one for each task that is passed with {@code tasks} | 0 |
import org.apache.hc.core5.http.config.CharCodingConfig;
private final CharCodingConfig charCodingConfig;
final CharCodingConfig charCodingConfig,
this.charCodingConfig = charCodingConfig != null ? charCodingConfig : CharCodingConfig.DEFAULT;
charCodingConfig, h2Config, connectionListener, streamListener); | 0 |
// When aborting an upgrade, the suspend flag must be present to indicate
// if the upgrade is merely being paused (suspended=true) or aborted to initiate a downgrade (suspended=false).
if (status == HostRoleStatus.ABORTED && !propertyMap.containsKey(UPGRADE_SUSPENDED)){
} else if (status == HostRoleStatus.ABORTED) {
// When the status of the upgrade's request is changing, we also update the suspended flag. | 0 |
import java.util.Set;
/***
* List events for given time range where classifications have been added, deleted or updated.
* @param fromTimestamp from timestamp
* @param toTimestamp to timestamp
* @return events that match the range
* @throws AtlasBaseException
*/
Set<String> getEntitiesWithTagChanges(long fromTimestamp, long toTimestamp) throws AtlasBaseException; | 0 |
/*
* Copyright 2016-2018 Seznam.cz, a.s. | 0 |
* @version $Revision: 1.5 $ $Date: 2002/11/20 23:57:13 $
final FileObject[] files = rootFile.findFiles( Selectors.SELECT_FILES );
for ( int j = 0; j < files.length; j++ )
final FileObject srcFile = files[ j ];
final FileObject[] allDestFiles = destFolder.findFiles( Selectors.SELECT_FILES );
for ( int i = 0; i < allDestFiles.length; i++ )
final FileObject destFile = allDestFiles[ i ];
if ( ! destFiles.contains( destFile ) )
{
handleMissingSourceFile( destFile );
} | 0 |
import org.apache.batik.gvt.GraphicsNodeRenderContext;
GraphicsNodeRenderContext rc =
bridgeContext.getGraphicsNodeRenderContext();
rc, | 0 |
hostRoleCommandEntity.setOpsDisplayName("opsDisplayName");
propertyIds.add(TaskResourceProvider.TASK_COMMAND_OPS_DISPLAY_NAME);
Assert.assertEquals("opsDisplayName",resource.getPropertyValue(TaskResourceProvider
.TASK_COMMAND_OPS_DISPLAY_NAME));
hostRoleCommandEntity.setOpsDisplayName("opsDisplayName");
propertyIds.add(TaskResourceProvider.TASK_COMMAND_OPS_DISPLAY_NAME);
Assert.assertEquals("opsDisplayName",resource.getPropertyValue(TaskResourceProvider
.TASK_COMMAND_OPS_DISPLAY_NAME)); | 0 |
import java.io.OutputStream;
import java.net.MalformedURLException;
import org.apache.cocoon.components.CocoonComponentManager;
import org.apache.cocoon.environment.background.BackgroundEnvironment;
import org.apache.cocoon.util.NullOutputStream;
* @version CVS $Id: QuartzJobExecutor.java,v 1.6 2004/03/11 15:38:31 sylvain Exp $
/** Shared instance (no state, as it does nothing) */
static final OutputStream NULL_OUTPUT = new NullOutputStream();
ServiceManager manager = (ServiceManager)data.get(QuartzJobScheduler.DATA_MAP_MANAGER);
org.apache.cocoon.environment.Context envContext =
(org.apache.cocoon.environment.Context)data.get(QuartzJobScheduler.DATA_MAP_ENV_CONTEXT);
BackgroundEnvironment env;
try {
env = new BackgroundEnvironment(logger, envContext, manager);
} catch (MalformedURLException mue) {
// Unlikely to happen
throw new JobExecutionException(mue);
}
CocoonComponentManager.enterEnvironment(env, env.getManager(), env.getProcessor());
CocoonComponentManager.leaveEnvironment(); | 0 |
import com.google.inject.persist.Transactional;
* Create a new role authorization.
*
* @param roleAuthorizationEntity entity to store
*/
@Transactional
public void create(RoleAuthorizationEntity roleAuthorizationEntity) {
entityManagerProvider.get().persist(roleAuthorizationEntity);
}
/** | 0 |
* @version $Id$ | 0 |
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* | 0 |
import java.net.URL;
import java.util.Enumeration;
import org.apache.felix.framework.Logger;
* The default name used for the default configuration properties file.
**/
private static final String DEFAULT_PROPERTIES_FILE = "default.properties";
public static String getDefaultProperty(Logger logger, String prop)
{
URL propURL = Util.class.getClassLoader().getResource(DEFAULT_PROPERTIES_FILE);
if (propURL != null)
{
InputStream is = null;
try
{
// Load properties from URL.
is = propURL.openConnection().getInputStream();
Properties props = new Properties();
props.load(is);
is.close();
// Perform variable substitution for system properties.
for (Enumeration e = props.propertyNames(); e.hasMoreElements(); )
{
String name = (String) e.nextElement();
props.setProperty(name,
Util.substVars(props.getProperty(name), name, null, props));
}
// Return system packages property.
return props.getProperty(prop);
}
catch (Exception ex)
{
// Try to close input stream if we have one.
try
{
if (is != null) is.close();
}
catch (IOException ex2)
{
// Nothing we can do.
}
logger.log(
Logger.LOG_ERROR, "Unable to load any configuration properties.", ex);
}
}
return "";
}
/** | 0 |
FileSKVWriter f = FileOperations.getInstance().newWriterBuilder().forFile(fileName, fs, fs.getConf()).withTableConfiguration(defaultConfiguration)
.build(); | 0 |
import java.util.Collection;
private Collection<HostComponentConfigMappingEntity> configMappingEntities;
@OneToMany(mappedBy = "hostComponentStateEntity", cascade = CascadeType.ALL)
public Collection<HostComponentConfigMappingEntity> getHostComponentConfigMappingEntities() {
return configMappingEntities;
}
public void setHostComponentConfigMappingEntities(Collection<HostComponentConfigMappingEntity> entities) {
configMappingEntities = entities;
}
| 1 |
@Command(scope = "features", name = "install", description = "Installs a feature with the specified name and version.")
@Argument(index = 0, name = "name", description = "The name of the feature", required = true, multiValued = false)
@Argument(index = 1, name = "version", description = "The version of the feature", required = false, multiValued = false) | 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 |
* @deprecated This interface will be removed in upcoming versions as it is unused.
| 0 |
UserEntity userEntity = userDAO.findUserByName(principalName); | 0 |
return line.startsWith(IMAP_CONTINUATION_PREFIX);
*
private static final String UNTAGGED_RESPONSE = "^\\* (\\S+).*";
*
* | 0 |
assertFalse(
TestStreams.withOnNext(null)
.withIsReady(() -> isReadyWasCalled.getAndSet(true))
.build()
.isReady()); | 0 |
import java.util.Map;
private static Map<String, AuthenticationProvider> authenticationProviders = | 0 |
* @version CVS $Id$ | 0 |
@Override
public void updated(final Dictionary<String, ?> properties) throws ConfigurationException | 0 |
* Copyright 2002,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.
* @version $Revision: 1.4 $ | 0 |
ClientContext context = getClientContext();
ClientContext context = getClientContext(); | 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 |
while (current != ']' && current != -1) { | 0 |
import org.apache.accumulo.core.security.Authorizations;
serverSideIteratorList, serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Authorizations.EMPTY, false, instance.getConfiguration());
serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Authorizations.EMPTY, false, instance.getConfiguration());
TabletServerBatchReaderIterator.doLookup(tserver, tabletsRanges, failures, unscanned, rr, columns, credentials, opts, Authorizations.EMPTY, | 0 |
* @throws IOException If failed to gain access to the remote directory path
* all entries have been exhausted | 0 |
* Autogenerated by Thrift Compiler (0.8.0)
* @generated | 0 |
import org.apache.cocoon.acting.ServiceableAction;
* @version CVS $Id: MailAction.java,v 1.5 2003/10/15 20:47:15 cziegeler Exp $
public class MailAction extends ServiceableAction implements ThreadSafe { | 0 |
import org.xml.sax.Attributes;
* @version CVS $Id: AttributesImpl.java,v 1.3 2004/01/29 11:13:16 cziegeler Exp $
/**
* Constructor
*/
public AttributesImpl() {
super();
}
/**
* Constructor
*/
public AttributesImpl(Attributes attr) {
super(attr);
}
| 0 |
import org.apache.beam.sdk.testutils.metrics.TimeMonitor;
import org.apache.beam.sdk.testutils.publishing.ConsoleResultPublisher; | 0 |
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import java.util.HashSet;
import java.util.Set;
| 0 |
* Intended to be used with the JUnit Category annotation on integration test classes. The Category annotation should be placed at the class-level. Test class
* names should still be suffixed with 'IT' as the rest of the integration tests. | 0 |
* <i>hidden</i>, otherwise {@code false}. | 0 |
import java.io.InputStream;
import java.io.PrintStream;
* <p/>
* @author aqute
public interface ThreadIO
{
/**
* Associate this streams with the current thread.
* <p/>
* Ensure that when output is performed on System.in, System.out, System.err it
* will happen on the given streams.
* <p/>
* The streams will automatically be canceled when the bundle that has gotten
* this service is stopped or returns this service.
*
* @param in InputStream to use for the current thread when System.in is used
* @param out PrintStream to use for the current thread when System.out is used
* @param err PrintStream to use for the current thread when System.err is used
*/
void setStreams(InputStream in, PrintStream out, PrintStream err);
/**
* Cancel the streams associated with the current thread.
* <p/>
* This method will not do anything when no streams are associated.
*/ | 0 |
return new CompositeFileEntryParser(new FTPFileEntryParser[]
{
new OS400FTPEntryParser(),
new UnixFTPEntryParser()
}); | 0 |
MetricsPusher.pushMetrics(); | 0 |
* Set of <script> elements that have already been executed.
* Loads the scripts contained in the <script> elements.
* Executes the specified <script> element, if it hasn't been | 0 |
import org.apache.beam.sdk.extensions.sql.schema.BeamRecordSqlType;
private static BeamRecordSqlType genRowType() { | 0 |
package org.apache.bcel.generic;
super(org.apache.bcel.Const.IMPDEP2, (short) 1); | 1 |
import org.w3c.dom.Document;
Node fakeDocElement = node.getOwnerDocument().getDocumentElement().cloneNode(false);
fakeDocElement.appendChild(virtualNode);
rowContext = JXPathContext.newContext(repeaterContext, fakeDocElement);
Document document = rowNode.getOwnerDocument();
virtualNode = document.createElementNS(null, "virtual");
Node fakeDocElement = document.getDocumentElement().cloneNode(false);
fakeDocElement.appendChild(virtualNode);
rowContext = JXPathContext.newContext(repeaterContext, fakeDocElement);
rowContext = rowContext.getRelativeContext(rowContext.getPointer("virtual")); | 0 |
* @version CVS $Id: Redirector.java,v 1.4 2004/05/25 07:28:24 cziegeler Exp $
* Send a content-less response with the given status code. | 0 |
DataflowRunnerInfo dataflowRunnerInfo = DataflowRunnerInfo.getDataflowRunnerInfo();
String version = dataflowRunnerInfo.getVersion();
newJob.getEnvironment().setUserAgent((Map) dataflowRunnerInfo.getProperties()); | 0 |
package org.apache.commons.ognl; | 0 |
* Returns true if the windowing strategy of the current {@code PCollection} is a merging
* WindowFn. If true, the trigger execution needs to keep enough information to support the
* possibility of {@link Trigger#onMerge} being called. If false, {@link Trigger#onMerge} will
* never be called.
*/
boolean isMerging();
/** | 0 |
for (int j = 100; j < 200; j++) {
id.setId("1.1.1."+j);
id.setScheme("ip");
id.setId("1.1.1."+j);
id.setScheme("ip"); | 0 |
* Exception thrown by {@link WindowFn#verifyCompatibility(WindowFn)} if two compared WindowFns are
* not compatible, including the explanation of incompatibility. | 1 |
public Object getObject(int i, Map<String, Class<?>> map) throws SQLException {
public Object getObject(String parameterName, Map<String,Class<?>> map) throws SQLException {
@Override
public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException {
return null;
}
@Override
public <T> T getObject(String parameterName, Class<T> type) throws SQLException {
return null;
} | 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.http.base.internal;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import javax.servlet.ServletConfig;
import java.io.IOException;
public final class DispatcherServlet
extends HttpServlet
{
private final HttpServiceController controller;
public DispatcherServlet(HttpServiceController controller)
{
this.controller = controller;
}
@Override
public void init(ServletConfig config)
throws ServletException
{
super.init(config);
this.controller.register(getServletContext());
}
@Override
public void destroy()
{
this.controller.unregister();
super.destroy();
}
@Override
protected void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
this.controller.getDispatcher().dispatch(req, res);
}
} | 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.
*/
package org.apache.cocoon.woody.datatype.convertor;
import org.apache.cocoon.woody.Constants;
import org.apache.cocoon.woody.util.DomHelper;
import org.w3c.dom.Element;
/**
* Builds {@link EnumConvertor}s.
*
* @version CVS $Id: EnumConvertorBuilder.java,v 1.6 2004/03/09 13:54:15 reinhard Exp $
*/
public class EnumConvertorBuilder implements ConvertorBuilder {
/* (non-Javadoc)
* @see org.apache.cocoon.woody.datatype.convertor.ConvertorBuilder#build(org.w3c.dom.Element)
*/
public Convertor build(Element configElement) throws Exception {
if (configElement == null) {
return null;
}
Element enumEl = DomHelper.getChildElement(configElement,
Constants.WD_NS, "enum", true);
String clazz = enumEl.getFirstChild().getNodeValue();
return new EnumConvertor(clazz);
}
} | 0 |
import java.util.Map.Entry;
import org.apache.ambari.server.orm.dao.HostVersionDAO;
import org.apache.ambari.server.orm.entities.HostVersionEntity;
import org.apache.commons.collections.CollectionUtils;
@Inject
HostVersionDAO hostVersionDAO;
final Set<RepositoryVersionState> forbiddenToDeleteStates = Sets.newHashSet(
List<HostVersionEntity> hostVersions = hostVersionDAO.findByRepositoryAndStates(
entity, forbiddenToDeleteStates);
if (CollectionUtils.isNotEmpty(hostVersions)) {
Map<RepositoryVersionState, Set<String>> hostsInUse = new HashMap<>();
for (HostVersionEntity hostVersion : hostVersions) {
if (!hostsInUse.containsKey(hostVersion.getState())) {
hostsInUse.put(hostVersion.getState(), new HashSet<String>());
}
hostsInUse.get(hostVersion.getState()).add(hostVersion.getHostName());
Set<String> errors = new HashSet<>();
for (Entry<RepositoryVersionState, Set<String>> entry : hostsInUse.entrySet()) {
errors.add(String.format("%s on %s", entry.getKey(), StringUtils.join(entry.getValue(), ", ")));
}
throw new SystemException(
String.format("Repository version can't be deleted as it is used by the following hosts: %s",
StringUtils.join(errors, ';'))); | 0 |
AsyncCallableService<Boolean> asyncService = new AsyncCallableService<>(testSubject, 5000, 500, "test", t -> {}); | 0 |
/**
*
* @version $Id$
*/ | 0 |
private List<Stack> stacks = new ArrayList<>();
private List<Extension> extensions = new ArrayList<>();
private Set<String> errorSet = new HashSet<>(); | 1 |
if (GenericUtils.size(env) > 0) {
Map<String,String> procEnv = builder.environment();
procEnv.putAll(env);
log.warn("Could not set environment for command=" + GenericUtils.join(cmds, ' '), e);
try {
process.destroy();
} finally {
process = null;
} | 0 |
package org.apache.http.impl.auth;
/**
* @since 4.3
*/ | 0 |
import org.apache.cocoon.configuration.Settings;
import org.apache.cocoon.core.Core;
final Settings settings = Core.getSettings(context);
ConfigurationBuilder builder = new ConfigurationBuilder(settings); | 0 |
Operator<WindowedElement<?, Pair>, ?> reduced = tuples
(WindowedElement<?, Pair> we) -> {
Comparable key = (Comparable) we.get().getKey();
return key;
},
implements KeySelector<WindowedElement<?, ? extends Pair<KEY, ?>>,
WindowedElement<?, ? extends Pair<KEY, ?>> value) {
implements ReduceFunction<WindowedElement<?, Pair>>,
ResultTypeQueryable<WindowedElement<?, Pair>>
public WindowedElement<?, Pair>
reduce(WindowedElement<?, Pair> p1, WindowedElement<?, Pair> p2) {
WindowID<?> wid = p1.getWindowID();
public TypeInformation<WindowedElement<?, Pair>> getProducedType() { | 0 |
/** Name of the digester validator rules file */
private static final String VALIDATOR_RULES = "digester-rules.xml";
URL rulesUrl = this.getClass().getResource(VALIDATOR_RULES);
if (rulesUrl == null) {
// Fix for Issue# VALIDATOR-195
rulesUrl = ValidatorResources.class.getResource(VALIDATOR_RULES);
}
if (getLog().isDebugEnabled()) {
getLog().debug("Loading rules from '" + rulesUrl + "'");
} | 0 |
* Test class for MetricsHttpSink.
public class MetricsHttpSinkTest {
MetricsHttpSink metricsHttpSink = new MetricsHttpSink("dummyUrl");
String serializeMetrics = metricsHttpSink.serializeMetrics(metricQueryResults);
"Errror in serialization", | 0 |
VolatileTaskState() {
this.resources = null; | 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.fileupload;
/**
* Enhanced access to the request information needed for file uploads,
* which fixes the Content Length data access in {@link RequestContext}.
*
* @since 1.3
*/
public interface UploadContext extends RequestContext {
/**
* Retrieve the content length of the request.
*
* @return The content length of the request.
* @since 1.3
*/
long contentLength();
} | 0 |
import java.net.URL;
import javax.mail.internet.InternetAddress;
// host address
// email address
conf.addProperty("email.string", "[email protected]");
conf.addProperty("email.string.interpolated", "${email.string}");
conf.addProperty("email.object", new InternetAddress("[email protected]"));
public void testGetInternetAddress() throws Exception
{
InternetAddress expected = new InternetAddress("[email protected]");
// address as string
assertEquals(expected, conf.get(InternetAddress.class, "email.string"));
// address object
assertEquals(expected, conf.get(InternetAddress.class, "email.object"));
// interpolated value
assertEquals(expected, conf.get(InternetAddress.class, "email.string.interpolated"));
conf.setProperty("email.invalid", "ebourg@apache@org");
try
{
conf.get(InternetAddress.class, "email.invalid");
fail("ConversionException should be thrown for invalid emails");
}
catch (ConversionException e)
{
// expected
}
}
try
{
conf.get(InternetAddress.class, "key1");
fail("getInternetAddress didn't throw a ConversionException");
}
catch (ConversionException e)
{
// expected
} | 0 |
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import org.apache.beam.sdk.PipelineResult; | 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.http.io;
import org.apache.http.HttpMessage;
/**
* Factory for {@link HttpMessageWriter} instances.
*
* @since 4.3
*/
public interface HttpMessageWriterFactory<T extends HttpMessage> {
HttpMessageWriter<T> create(SessionOutputBuffer buffer);
} | 0 |
* @version CVS $Id: StringBufferContentHandler.java,v 1.1 2004/03/10 12:58:08 stephan Exp $ | 0 |
* Copyright 2001-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.
* @version $Revision: 1.6 $ $Date: 2004/02/28 13:18:37 $ | 0 |
Map<String,Path> paths = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); | 0 |
Path csv = Files.createFile(Paths.get(csvFile));
Files.setPosixFilePermissions(Paths.get(csvFile), getCsvPermissions()); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.