Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
import java.io.IOException;
this.log(LogService.LOG_ERROR, "cannot start rmi connector", e);
this.log(LogService.LOG_ERROR, "cannot stop rmi connector", e);
try {
// The first call to stop() will close any open connections, but will
// throw an exception if there were open connections.
this.connectorServer.stop();
}catch(IOException e){
// Exception probably thrown because there were open connections. When
// this exception is thrown, the server has already attempted to close
// all client connections, try stopping again.
this.connectorServer.stop();
} | 0 |
c14n.setWriter(os); | 0 |
import org.apache.mesos.v1.Protos.ExecutorID; | 0 |
AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME,
tableEntity.set(HiveDataModelGenerator.NAME, oldTable.getTableName().toLowerCase());
tableEntity.set(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, oldTableQFName);
newEntity.set(HiveDataModelGenerator.NAME, newTable.getTableName().toLowerCase());
newEntity.set(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, newTableQFName);
HiveDataTypes.HIVE_TABLE.getName(), AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME,
String dataSetQlfdName = (String) input.get(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME); | 0 |
Copyright (C) 1999-2004 The Apache Software Foundation. All rights reserved.
*
* replace-properties no|false,anything else
* xpath: xpath expression for context node
* unless-path: xpath expression that must return empty node set
* unless: (deprecated) xpath expression that must return empty node set
* if-prop: use path file only when project property is set
* remove: xpath expression to remove before adding nodes
* add-attribute: name of attribute to add to context node (requires value)
* value: value of attribute to add to context node (requires add-attribute)
* insert-before: xpath expression, add new nodes before
* insert-after: xpath expression, add new nodes after
*
* @version CVS $Revision: 1.13 $ $Date: 2004/02/15 21:28:51 $
* | 0 |
public static final Multiplicity COLLECTION = new Multiplicity(0, Integer.MAX_VALUE, false);
public static final Multiplicity SET = new Multiplicity(0, Integer.MAX_VALUE, true); | 1 |
referenceType, xmlSecStartElement);
processElementPath(internalSignatureReferenceVerifier.getStartElementPath(), inputProcessorChain,
internalSignatureReferenceVerifier.getStartElement(), referenceType);
ReferenceType referenceType, XMLSecStartElement startElement) throws XMLSecurityException {
private List<QName> startElementPath;
private XMLSecStartElement startElement;
ReferenceType referenceType, XMLSecStartElement startElement) throws XMLSecurityException {
if (this.elementCounter == 0 && xmlSecEndElement.getName().equals(startElement.getName())) {
public XMLSecStartElement getStartElement() {
public void setStartElement(XMLSecStartElement startElement) {
this.startElementPath = startElement.getElementPath();
public List<QName> getStartElementPath() {
return startElementPath;
} | 0 |
if (ex.getCause() != null && ex.getCause() instanceof BadLocationStateException) {
Map<Key,Value> future = new HashMap<Key,Value>();
Map<Key,Value> assigned = new HashMap<Key,Value>();
KeyExtent extent = new KeyExtent(row, new Value(new byte[] {0}));
Iterator<Entry<Key,Value>> iter = Iterators.concat(future.entrySet().iterator(), assigned.entrySet().iterator());
Entry<Key,Value> entry = iter.next();
MetadataTableUtil.addTablet(new KeyExtent(extent.getTableId(), null, extent.getPrevEndRow()), tdir, SystemCredentials.get(), timeType,
this.master.masterLock);
| 0 |
sb.append("<ingestMB>").append(summary.ingestByteRate / 1000000.0).append("</ingestMB>\n");
sb.append("<queryMB>").append(summary.queryByteRate / 1000000.0).append("</queryMB>\n");
sb.append("<scans>").append(summary.scans.running + summary.scans.queued).append("</scans>");
sb.append("<scansessions>").append(Monitor.getLookupRate()).append("</scansessions>\n");
sb.append("<holdtime>").append(status.holdTime).append("</holdtime>\n"); | 0 |
return false; | 0 |
Frame.setThis(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 | 0 |
assertEquals(11, resp.getUpgradePacks().size()); | 0 |
new StreamingModeExecutionStateRegistry(null); | 0 |
super(ImmutableSet.of(ALERTS_SUMMARY, ALERTS_SUMMARY_HOSTS));
Map<Long, Map<String, AlertSummaryDTO>> perHostSummaryMap = new HashMap<>();
Map<Long, AlertHostSummaryDTO> hostsSummaryMap = new HashMap<>();
Map<String, Cluster> resourcesClusterMap = new HashMap<>();
Map<String, Integer> map = new HashMap<>();
Map<AlertState, Integer> map = new HashMap<>();
Set<String> rejects = new HashSet<>(); | 1 |
import org.apache.accumulo.core.trace.TraceUtil;
import org.apache.htrace.Sampler;
import org.apache.htrace.Trace;
import org.apache.htrace.TraceScope;
TraceUtil.enableClientTraces("localhost", "testTrace", mac.getClientProperties());
long rootTraceId;
try (TraceScope root = Trace.startSpan("traceTest", Sampler.ALWAYS);
ConditionalWriter cw = client.createConditionalWriter(tableName,
new ConditionalWriterConfig())) {
rootTraceId = root.getSpan().getTraceId();
scanner.setRange(new Range(new Text(Long.toHexString(rootTraceId))));
int traceCount = TraceDump.printTrace(scanner, line -> {
try {
finalBuffer.append(line).append("\n");
} catch (Exception ex) {
throw new RuntimeException(ex); | 0 |
* @version $Id$ | 0 |
package org.apache.zookeeper.jmx.server.quorum; | 0 |
@RequiresSession
@RequiresSession | 0 |
zoo.putPersistentData(zkInstanceRoot + Constants.ZMONITOR, EMPTY_BYTE_ARRAY, NodeExistsPolicy.FAIL);
zoo.putPersistentData(zkInstanceRoot + Constants.ZMONITOR_LOCK, EMPTY_BYTE_ARRAY, NodeExistsPolicy.FAIL); | 0 |
final ZipConfigurationWriter pw = new ZipConfigurationWriter( zip );
addBinaries( pw );
final ConfigurationPrinter cp,
final String mode )
private void addBinaries( final ZipConfigurationWriter cf )
throws IOException
{
final String mode = ConfigurationPrinter.MODE_ZIP;
for ( Iterator cpi = getConfigurationPrinters().iterator(); cpi.hasNext(); )
{
// check if printer supports zip mode
final PrinterDesc desc = (PrinterDesc) cpi.next();
if ( desc.match(mode) )
{
// check if printer implements binary configuration printer
if ( desc.printer instanceof BinaryConfigurationPrinter )
{
final String[] names = ((BinaryConfigurationPrinter)desc.printer).getFilenames(mode);
if ( names != null )
{
for(int i = 0; i < names.length; i++)
{
final OutputStream os = cf.startFile(desc.printer.getTitle(), names[i]);
((BinaryConfigurationPrinter)desc.printer).writeFile(names[i], mode, os);
cf.end();
}
}
}
}
}
}
public OutputStream startFile( String title, String name)
{
final String path = MessageFormat.format( "{0,number,000}-{1}/{2}", new Object[]
{ new Integer( counter ), title, name } );
ZipEntry entry = new ZipEntry( path );
try
{
zip.putNextEntry( entry );
}
catch ( IOException ioe )
{
// should handle
}
return zip;
} | 0 |
DocumentBuilder documentBuilder = createDocumentBuilder();
Document signatureDocument = documentBuilder.newDocument(); | 0 |
import org.apache.beam.vendor.grpc.v1_13_1.io.grpc.ManagedChannel;
import org.apache.beam.vendor.grpc.v1_13_1.io.grpc.Server;
import org.apache.beam.vendor.grpc.v1_13_1.io.grpc.Status;
import org.apache.beam.vendor.grpc.v1_13_1.io.grpc.StatusRuntimeException;
import org.apache.beam.vendor.grpc.v1_13_1.io.grpc.inprocess.InProcessChannelBuilder;
import org.apache.beam.vendor.grpc.v1_13_1.io.grpc.inprocess.InProcessServerBuilder;
import org.apache.beam.vendor.grpc.v1_13_1.io.grpc.stub.CallStreamObserver;
import org.apache.beam.vendor.grpc.v1_13_1.io.grpc.stub.StreamObserver; | 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 |
when(listRequest.setPageToken(eq((String) null))).thenReturn(listRequest); | 0 |
import org.apache.ambari.server.api.MethodOverrideFilter;
root.addFilter(new FilterHolder(new MethodOverrideFilter()), "/api/*", 1);
root.addFilter(new FilterHolder(new MethodOverrideFilter()), "/proxy/*", 1); | 0 |
* Copyright 2002-2005 The Apache Software Foundation. | 0 |
import com.jcraft.jsch.JSch;
| 0 |
import javax.xml.XMLConstants;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
import org.apache.commons.io.FileUtils;
import org.xml.sax.SAXException;
public static final String PROPERTY_SCHEMA_PATH = "configuration-schema.xsd";
@Assisted OsFamily osFamily, @Assisted boolean validate,
MetainfoDAO metaInfoDAO,
if (validate) {
validateStackDirectory(stackRoot);
validateCommonServicesDirectory(commonServicesRoot);
}
Validator validator = getPropertySchemaValidator();
validateAllPropertyXmlsInFolderRecursively(stackRoot, validator);
}
public static Validator getPropertySchemaValidator() throws AmbariException {
SchemaFactory factory =
SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema;
ClassLoader classLoader = StackManager.class.getClassLoader();
try {
schema = factory.newSchema(classLoader.getResource(PROPERTY_SCHEMA_PATH));
} catch (SAXException e) {
throw new AmbariException(String.format("Failed to parse property schema file %s", PROPERTY_SCHEMA_PATH), e);
}
return schema.newValidator();
}
public static void validateAllPropertyXmlsInFolderRecursively(File stackRoot, Validator validator) throws AmbariException {
Collection<File> files = FileUtils.listFiles(stackRoot, new String[]{"xml"}, true);
for (File file : files) {
try {
if (file.getParentFile().getName().contains("configuration")) {
validator.validate(new StreamSource(file));
}
} catch (Exception e) {
String msg = String.format("File %s didn't pass the validation. Error message is : %s", file.getAbsolutePath(), e.getMessage());
LOG.error(msg);
throw new AmbariException(msg);
}
} | 0 |
MockAccumulo acu = null;
Map<String,MockBatchWriter> bws = null;
public MockMultiTableBatchWriter(MockAccumulo acu) {
this.acu = acu;
bws = new HashMap<String,MockBatchWriter>();
}
@Override
public BatchWriter getBatchWriter(String table) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
if (!bws.containsKey(table)) {
bws.put(table, new MockBatchWriter(acu, table));
return bws.get(table);
}
@Override
public void flush() throws MutationsRejectedException {}
@Override
public void close() throws MutationsRejectedException {}
@Override
public boolean isClosed() {
throw new UnsupportedOperationException();
} | 1 |
* $Revision: 1.7 $
* $Date: 2003/10/09 21:04:44 $
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
* permission of the Apache Software Foundation.
* @version $Id: PoolablePreparedStatement.java,v 1.7 2003/10/09 21:04:44 rdonkin Exp $ | 0 |
import org.apache.hc.core5.http.ProtocolVersion;
private final ReasonPhraseCatalog reasonCatalog;
public HttpResponse newHttpResponse(final ProtocolVersion transportVersion, final int status, final String reasonPhrase) {
final HttpResponse response = new BasicHttpResponse(status, reasonPhrase);
response.setVersion(transportVersion);
if (reasonPhrase != null) {
response.setReasonPhrase(reasonPhrase);
}
return response;
public HttpResponse newHttpResponse(final int status) {
return new BasicHttpResponse(status, this.reasonCatalog, null); | 0 |
for (String ignored_package : ignored_packages) {
if (class_name.startsWith(ignored_package)) { | 0 |
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>();
List<String> localNames = new ArrayList<>(); | 0 |
import akka.actor.ActorRef;
import org.apache.ambari.view.hive2.actor.message.job.SaveDagInformation;
private final ActorRef operationController;
IATSParser ats, ActorRef operationController) {
this.operationController = operationController;
saveJobInfoIfNeeded(atsHiveQuery, atsTezDag, viewJob, true);
saveJobInfoIfNeeded(hiveQueryId, tezDagId, viewJob, false);
}
protected void saveJobInfoIfNeeded(HiveQueryId hiveQueryId, TezDagId tezDagId, Job viewJob, boolean useActorSystem) throws ItemNotFound {
boolean updateDb = false;
String dagName = null;
String dagId = null;
String applicationId = null;
dagName = hiveQueryId.dagNames.get(0);
updateDb = true;
!viewJob.getStatus().equalsIgnoreCase(tezDagId.status)) {
dagId = tezDagId.entity;
applicationId = tezDagId.applicationId;
updateDb = true;
}
if(updateDb) {
if (useActorSystem) {
LOG.info("Saving DAG information via actor system for job id: {}", viewJob.getId());
operationController.tell(new SaveDagInformation(viewJob.getId(), dagName, dagId, applicationId), ActorRef.noSender());
} else {
viewJob.setDagName(dagName);
viewJob.setDagId(dagId);
viewJob.setApplicationId(applicationId);
viewJobResourceManager.update(viewJob, viewJob.getId());
} | 0 |
list.add(Integer.valueOf(1));
list.add(Integer.valueOf(2));
list.add(Integer.valueOf(3));
list.add(Integer.valueOf(4));
list.add(Integer.valueOf(5));
list.add(Integer.valueOf(1));
list.add(Integer.valueOf(2));
list.add(Integer.valueOf(3));
list.add(Integer.valueOf(4));
list.add(Integer.valueOf(5)); | 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.beam.sdk.extensions.protobuf;
import com.google.auto.service.AutoService;
import com.google.common.collect.ImmutableMap;
import com.google.protobuf.ByteString;
import java.util.Map;
import org.apache.beam.sdk.coders.CoderFactories;
import org.apache.beam.sdk.coders.CoderFactory;
import org.apache.beam.sdk.coders.CoderRegistrar;
/**
* A {@link CoderRegistrar} for standard types used with Google Protobuf.
*/
@AutoService(CoderRegistrar.class)
public class ProtobufCoderRegistrar implements CoderRegistrar {
@Override
public Map<Class<?>, CoderFactory> getCoderFactoriesToUseForClasses() {
return ImmutableMap.<Class<?>, CoderFactory>of(
ByteString.class, CoderFactories.forCoder(ByteStringCoder.of()));
}
}
| 0 |
/**
* Return the properties added by Maven.
* @return Returns a properties object or null if the properties can't be found/read.
*/
public static Properties getPOMProperties(String groupId, String versionId) {
final String resourceName = "META-INF/maven/" + groupId + "/" + versionId + "/pom.properties";
try {
final Properties p = new Properties();
p.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(resourceName));
return p;
} catch (IOException ignore) {
return null;
}
} | 0 |
import org.apache.hc.core5.io.Closer; | 0 |
import org.apache.beam.sdk.values.TypeDescriptor;
private static final TypeDescriptor<Long> TYPE_DESCRIPTOR = new TypeDescriptor<Long>() {};
@Override
public TypeDescriptor<Long> getEncodedTypeDescriptor() {
return TYPE_DESCRIPTOR;
}
| 0 |
* Copyright 2000-2009 The Apache Software Foundation | 0 |
import org.apache.sshd.util.test.JUnitTestSupport;
public class NumberUtilsTest extends JUnitTestSupport { | 0 |
import java.util.concurrent.CompletionStage;
ExecutorService executor =
List<CompletionStage<Void>> futures = new LinkedList<>();
futures.add(MoreFutures.runAsync(
() -> {
batch.execute();
},
executor));
MoreFutures.get(MoreFutures.allAsList(futures)); | 0 |
import org.apache.commons.vfs2.RandomAccessContent; | 0 |
String type = rm.getType();
String type = rm.getType();
byte inputBytes[] = resource.getBytes();
} | 0 |
import javax.servlet.http.HttpSession;
private HttpSession session;
this.session = request.getSession(false); | 0 |
*
*
*
* The SendmailAction class sends email. Please use the {@link Sendmail Sendmail}
* action instead. The action needs four parameters:
* Action attempts to get all of these parameters from the sitemap, but
* if they do not exist there it will read them from the request parameters.
*
* <p>It also supports all of the {@link Sendmail} action sitemap parameters.
* </p>
* @deprecated Please use the {@link Sendmail Sendmail} action instead.
* @version CVS $Id$
public Map act(Redirector redirector,
SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters)
throws Exception {
Request request = ObjectModelHelper.getRequest(objectModel);
if (!parameters.isParameter("from")) {
parameters.setParameter("from", request.getParameter("from"));
}
if (!parameters.isParameter("to")) {
parameters.setParameter("to", request.getParameter("to"));
}
if (!parameters.isParameter("subject")) {
parameters.setParameter("subject", request.getParameter("subject"));
}
if (!parameters.isParameter("body")) {
parameters.setParameter("body", request.getParameter("body"));
return super.act(redirector, resolver, objectModel, source, parameters);
}
} | 0 |
List<String> algorithms = new ArrayList<>(BuiltinDigests.VALUES.size());
try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port).verify(7L, TimeUnit.SECONDS).getSession()) {
session.addPasswordIdentity(getCurrentTestName());
session.auth().verify(5L, TimeUnit.SECONDS);
try (SftpClient sftp = session.createSftpClient()) {
CheckFileNameExtension file = assertExtensionCreated(sftp, CheckFileNameExtension.class);
try {
Pair<String, ?> result = file.checkFileName(srcFolder, algorithms, 0L, 0L, hashBlockSize);
fail("Unexpected success to hash folder=" + srcFolder + ": " + result.getFirst());
} catch (IOException e) { // expected - not allowed to hash a folder
assertTrue("Not an SftpException", e instanceof SftpException);
}
CheckFileHandleExtension hndl = assertExtensionCreated(sftp, CheckFileHandleExtension.class);
try (CloseableHandle dirHandle = sftp.openDir(srcFolder)) {
Pair<String, ?> result = hndl.checkFileHandle(dirHandle, algorithms, 0L, 0L, hashBlockSize);
fail("Unexpected handle success on folder=" + srcFolder + ": " + result.getFirst());
}
validateHashResult(file, file.checkFileName(srcPath, algorithms, 0L, 0L, hashBlockSize), algorithms.get(0), expectedHash);
try (CloseableHandle fileHandle = sftp.open(srcPath, SftpClient.OpenMode.Read)) {
validateHashResult(hndl, hndl.checkFileHandle(fileHandle, algorithms, 0L, 0L, hashBlockSize), algorithms.get(0), expectedHash); | 0 |
public void cleanup() | 0 |
package org.apache.commons.digester3;
/*
* 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.osgi.framework.BundleContext;
public void testLogSetup()
{
final MockBundleContext bundleContext = new MockBundleContext();
ConfigurationManager configMgr = createConfigurationManager( null );
// default value is 2
bundleContext.setProperty( "felix.cm.loglevel", null );
configMgr.start( bundleContext );
assertEquals( 2, getLogLevel( configMgr ) );
configMgr.stop( bundleContext );
// illegal number yields default value
bundleContext.setProperty( "felix.cm.loglevel", "not-a-number" );
configMgr.start( bundleContext );
assertEquals( 2, getLogLevel( configMgr ) );
configMgr.stop( bundleContext );
bundleContext.setProperty( "felix.cm.loglevel", "-100" );
configMgr.start( bundleContext );
assertEquals( -100, getLogLevel( configMgr ) );
configMgr.stop( bundleContext );
bundleContext.setProperty( "felix.cm.loglevel", "4" );
configMgr.start( bundleContext );
assertEquals( 4, getLogLevel( configMgr ) );
configMgr.stop( bundleContext );
}
throw ( IllegalArgumentException ) new IllegalArgumentException( "Cannot set logLevel field value" )
.initCause( ignore );
}
}
private static int getLogLevel( ConfigurationManager configMgr )
{
final String fieldName = "logLevel";
try
{
Field field = configMgr.getClass().getDeclaredField( fieldName );
field.setAccessible( true );
return field.getInt( configMgr );
}
catch ( Throwable ignore )
{
throw ( IllegalArgumentException ) new IllegalArgumentException( "Cannot get logLevel field value" )
.initCause( ignore );
throw ( IllegalArgumentException ) new IllegalArgumentException( "Cannot set logTracker field value" )
.initCause( ignore ); | 0 |
* @param requests the request object which defines the service to be created
* @param requests the request object which defines the component to be created
* @param requests the request object which defines the host to be created
* @param requests the request object which defines the host component to be created
* @param requests the request object which defines which service to
* @param requests the request object which defines which component to
* @param requests the request object which defines which host to
* @param requests the request object which defines which host component to
* @param requests the request object which identifies which service to delete
* @param requests the request object which identifies which component to delete
* @param requests the request object which identifies which host to delete
* @param requests the request object which identifies which host component to delete
| 0 |
import org.apache.cocoon.configuration.PropertyHelper; | 0 |
Copyright 2001-2003 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/ | 0 |
public FixedSizeSortedMapTest(final String testName) {
final SortedMap<K, V> map = new TreeMap<K, V>(); | 0 |
return this._constructionElement.getAttributeNS(null, Constants._ATT_ALGORITHM); | 0 |
*
// if not specified when creating an alert definition, the scope is
// assumed to be ANY
if (null == scope && bCreate) {
scope = Scope.ANY;
}
| 0 |
// ~ attached-windows are purged only when their trigger fires in which case
// the trigger itself get's clear; however, attached windows have
// maxTimestamp == Long.MAX_VALUE and we need to clean-up the registered
// clean-up trigger to avoid mem-leak in long running streams
ctx.deleteEventTimeTimer(window.maxTimestamp()); | 0 |
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at | 0 |
import org.apache.beam.vendor.guava.v20_0.com.google.common.collect.Iterators; | 0 |
super(LABEL, TITLE, CATEGORY_OSGI, CSS); | 0 |
import java.io.File;
if (!Server.run(SocketPort, new File(getTestDirectory()), 5000)) | 0 |
return Response.ok(ImmutableMap.of("scheduled", scheduled.build())).build(); | 0 |
* Transcodes the specified XML input in the specified output. All
* <tt>TranscoderException</tt> exceptions not catched previously
* are tagged as fatal errors (ie. call the <tt>fatalError</tt>
* method of the <tt>ErrorHandler</tt>).
*
try {
transcode(document, output);
} catch(TranscoderException ex) {
// at this time, all TranscoderExceptions are fatal errors
handler.fatalError(ex);
return;
} | 0 |
final String app = "tserver";
Accumulo.setupLogging(app); | 0 |
log.warn("notifyListener({}) failed ({}) to invoke {}: {}",
this, t.getClass().getSimpleName(), l, t.getMessage());
if (log.isDebugEnabled()) {
log.debug("notifyListener(" + this + ")[" + l + "] invocation failure details", t);
} | 0 |
public enum PropagationState { ACTIVE, DELETED } | 1 |
*
* @throws ParserConfigurationException if a DocumentBuilder cannot be created which satisfies the
* configuration requested.
* @see DocumentBuilderFactory#newDocumentBuilder()
* @throws ParserConfigurationException if a DocumentBuilder cannot be created which satisfies the
* configuration requested.
* @see DocumentBuilderFactory#newDocumentBuilder()
* {@inheritDoc} | 0 |
@Override | 0 |
import org.apache.cocoon.portal.event.coplet.CopletDefinitionRemovedEvent;
final String adapterName = instance.getCopletType().getCopletAdapterName();
final CopletAdapter adapter = this.portalService.getCopletAdapter(adapterName);
adapter.init( instance );
/**
* @see org.apache.cocoon.portal.services.CopletFactory#remove(org.apache.cocoon.portal.om.CopletDefinition)
*/
public void remove(CopletDefinition copletDefinition) {
if ( copletDefinition != null ) {
final String adapterName = copletDefinition.getCopletType().getCopletAdapterName();
final CopletAdapter adapter = this.portalService.getCopletAdapter(adapterName);
adapter.destroy( copletDefinition );
// send an event
this.portalService.getEventManager().send(new CopletDefinitionRemovedEvent(copletDefinition));
}
}
| 0 |
public static JobInfo create(
String jobId, String jobName, String retrievalToken, Struct pipelineOptions) {
return new AutoValue_JobInfo(jobId, jobName, retrievalToken, pipelineOptions);
public abstract String retrievalToken();
return ProvisionApi.ProvisionInfo.newBuilder()
.setRetrievalToken(retrievalToken()) | 0 |
import org.apache.http.impl.auth.HttpAuthenticator; | 0 |
import static com.google.common.base.Preconditions.checkNotNull;
Class<? extends PTransform> transformClass = application.getTransform().getClass();
TransformEvaluatorFactory factory =
checkNotNull(
factories.get(transformClass), "No evaluator for PTransform type %s", transformClass); | 0 |
public static Transformer getTransformer(
Transformer transformer, OutputStream outputStream, Map<String, Object> properties, String algorithm,
XMLSecurityConstants.DIRECTION direction) throws XMLSecurityException {
if (properties != null) {
childTransformer.setProperties(properties);
}
if (outputStream != null) {
childTransformer.setOutputStream(outputStream);
childTransformer.setTransformer(transformer); | 0 |
ParDo.MultiOutput<Long, Long> parDo =
ParDo.MultiOutput<Integer, Integer> pardo = ParDo.of(new SideOutputDummyFn(sideOutputTag))
ParDo.MultiOutput<String, String> parDo = ParDo | 0 |
public class HttpRequestParser extends AbstractMessageParser { | 0 |
import org.apache.zookeeper.CreateMode;
CreateMode.EPHEMERAL_SEQUENTIAL); | 0 |
import org.apache.beam.vendor.grpc.v1p21p0.io.grpc.stub.StreamObserver; | 0 |
package com.twitter.nexus.scheduler.persistence;
T t = null; | 0 |
import com.google.cloud.dataflow.sdk.util.WindowingInternals; | 0 |
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/decorators/Attic/UnmodifiableList.java,v 1.2 2003/05/05 23:25:22 rwaldhoff Exp $
* @version $Revision: 1.2 $ $Date: 2003/05/05 23:25:22 $ | 0 |
* @version $Id$ | 0 |
import java.io.InputStream;
Document importDoc = null;
try (InputStream is = new ByteArrayInputStream(xmlStr.getBytes("UTF8"))) {
importDoc = db.parse(is);
}
Document importDoc = null;
try (InputStream is = new ByteArrayInputStream(xmlStr.getBytes("UTF8"))) {
importDoc = db.parse(is);
}
Document importDoc = null;
try (InputStream is = new ByteArrayInputStream(xmlStr.getBytes("UTF8"))) {
importDoc = db.parse(is);
}
Document importDoc = null;
try (InputStream is = new ByteArrayInputStream(xmlStr.getBytes("UTF8"))) {
importDoc = db.parse(is);
}
Document importDoc = null;
try (InputStream is = new ByteArrayInputStream(xmlStr.getBytes("UTF8"))) {
importDoc = db.parse(is);
}
Document importDoc = null;
try (InputStream is = new ByteArrayInputStream(xmlStr.getBytes("UTF8"))) {
importDoc = db.parse(is);
} | 0 |
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
/**
* Returns a new {@link TimestampedValue} with the
* {@link BoundedWindow#TIMESTAMP_MIN_VALUE minimum timestamp}.
*/
public static <V> TimestampedValue<V> atMinimumTimestamp(V value) {
return of(value, BoundedWindow.TIMESTAMP_MIN_VALUE);
}
public Coder<T> getValueCoder() {
return valueCoder;
}
checkNotNull(timestamp, "timestamp must be non-null");
| 0 |
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override
@Override | 0 |
import org.apache.ambari.server.actionmanager.HostRoleStatus;
public boolean isAllTasksCompleted(long requestId) {
TypedQuery<Long> query = entityManagerProvider.get().createQuery(
"SELECT task.taskId FROM HostRoleCommandEntity task WHERE task.requestId = ?1 AND " +
"task.stageId=(select max(stage.stageId) FROM StageEntity stage WHERE stage.requestId=?1) " +
"AND task.status NOT IN ?2",
Long.class
);
query.setMaxResults(1); //we don't need all
return daoUtils.selectList(query, requestId, HostRoleStatus.getCompletedStates()).isEmpty();
}
@Transactional
public Long getLastStageId(long requestId) {
TypedQuery<Long> query = entityManagerProvider.get().createQuery("SELECT max(stage.stageId) " +
"FROM StageEntity stage WHERE stage.requestId=?1", Long.class);
return daoUtils.selectSingle(query, requestId);
}
@Transactional | 1 |
public class ApplicationManagerImpl implements ApplicationManager, ApplicationContextAware {
public void init() throws Exception { | 0 |
* Copyright (c) 2002, 2003 The Apache Software Foundation. All rights
* @version $Revision: 1.4 $ $Date: 2003/02/12 07:56:15 $ | 0 |
if (nf.isNodeInclude(currentNode)!=1) { | 0 |
* Validate a modulus check digit for a code.
* Convert an integer value to a check digit.
return Integer.toString(charValue); | 0 |
package org.apache.beam.sdk.util;
import org.apache.beam.sdk.coders.StringUtf8Coder;
import org.apache.beam.sdk.coders.VarIntCoder;
import org.apache.beam.sdk.testing.CoderProperties;
import org.apache.beam.sdk.transforms.windowing.GlobalWindow;
import org.apache.beam.sdk.util.TimerInternals.TimerData;
import org.apache.beam.sdk.util.state.StateNamespaces; | 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 |
* Saves the character encoding to be used by the FTP control connection.
* <p>
* Please note that this has to be set before the connection is established. | 0 |
public void testAlterNames() throws Exception {
InstanceConfig instanceConfig = InstanceConfigTest.getInstanceConfigs(xml_with_instance_label).get(0);
ViewEntity viewDefinition = ViewEntityTest.getViewEntity();
ViewInstanceEntity viewInstanceDefinition = new ViewInstanceEntity(viewDefinition, instanceConfig);
Assert.assertTrue(viewInstanceDefinition.alterNames());
viewInstanceDefinition.setAlterNames(false);
Assert.assertFalse(viewInstanceDefinition.alterNames());
viewInstanceDefinition.setAlterNames(true);
Assert.assertTrue(viewInstanceDefinition.alterNames());
}
@Test | 0 |
import org.apache.beam.vendor.grpc.v1p13p1.com.google.protobuf.ByteString; | 0 |
*
@Deprecated | 0 |
import org.apache.avalon.framework.service.ServiceException;
public void testNestedExpressions() throws PatternException, ServiceException {
context.enableLogging(getLogger());
VariableResolver resolver = VariableResolverFactory.getResolver(expr, manager);
public void testNestedModuleAndSitemapExpressions() throws PatternException, ServiceException {
context.enableLogging(getLogger());
VariableResolver resolver = VariableResolverFactory.getResolver(expr, manager);
context.enableLogging(getLogger());
VariableResolver resolver = VariableResolverFactory.getResolver(expr, manager);
context.enableLogging(getLogger());
VariableResolver resolver = VariableResolverFactory.getResolver(expr, manager);
context.enableLogging(getLogger());
VariableResolver resolver = VariableResolverFactory.getResolver(expr, manager);
context.enableLogging(getLogger());
VariableResolver resolver = VariableResolverFactory.getResolver(expr, manager);
context.enableLogging(getLogger());
VariableResolver resolver = VariableResolverFactory.getResolver(expr, manager);
context.enableLogging(getLogger());
VariableResolver resolver = VariableResolverFactory.getResolver(expr, manager);
context.enableLogging(getLogger());
VariableResolver resolver = VariableResolverFactory.getResolver(expr, manager);
context.enableLogging(getLogger());
VariableResolver resolver = VariableResolverFactory.getResolver(expr, manager);
context.enableLogging(getLogger());
VariableResolver resolver = VariableResolverFactory.getResolver(expr, manager);
context.enableLogging(getLogger());
VariableResolver resolver = VariableResolverFactory.getResolver(expr, manager);
context.enableLogging(getLogger());
VariableResolver resolver = VariableResolverFactory.getResolver(expr, manager); | 0 |
import org.apache.beam.sdk.transforms.PTransform; | 0 |
this.ascii = this.charset.equalsIgnoreCase(HTTP.US_ASCII)
|| this.charset.equalsIgnoreCase(HTTP.ASCII); | 0 |
import org.apache.batik.transcoder.SVGAbstractTranscoder;
public class PrintTranscoder extends SVGAbstractTranscoder
super();
| 0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.