Diff
stringlengths 5
2k
| FaultInducingLabel
int64 0
1
|
---|---|
@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 | 0 |
* http://www.apache.org/licenses/LICENSE-2.0 | 0 |
import org.apache.hc.core5.annotation.Contract;
import org.apache.hc.core5.annotation.ThreadingBehavior;
@Contract(threading = ThreadingBehavior.IMMUTABLE) | 0 |
* A style reference describes which GraphicsNode and which property
* of this GraphicsNode should be updated when a style element (for
* example a filter) changes due to a modification of the DOM.
* @version $Id$ */
| 0 |
* <br/>
* <b>WARNING:</b> Handling of default parameters is currently
* subject to discussions, and may be changed signifcantly.
public class BasicHttpParams extends AbstractHttpParams
implements HttpParams, Serializable {
static final long serialVersionUID = 4571099216197814749L;
private HashMap parameters;
* Removes all parameters from this collection.
* This method is called from {@link #copy()}. | 0 |
BaseHierarchicalConfiguration hc =
(BaseHierarchicalConfiguration) ConfigurationUtils
.convertToHierarchical(conf);
HierarchicalConfiguration hc = ConfigurationUtils
HierarchicalConfiguration hc = ConfigurationUtils
HierarchicalConfiguration hc = ConfigurationUtils | 0 |
/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved. *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in *
* the LICENSE file. *
*****************************************************************************/
package org.apache.batik.css;
import org.w3c.dom.css.CSSStyleDeclaration;
/**
* This interface must be implemented by an element that contains
* non-CSS presentational hints, like the 'align' attribute in HTML.
*
* @author <a href="mailto:[email protected]">Stephane Hillion</a>
* @version $Id$
*/
public interface ElementNonCSSPresentationalHints {
/**
* Returns the translation of the non-CSS hints to the corresponding
* CSS rules. The result can be null.
*/
CSSStyleDeclaration getNonCSSPresentationalHints();
} | 1 |
assertEquals(POJO_SCHEMA, new AvroRecordSchema().schemaFor(TypeDescriptor.of(AvroPojo.class))); | 0 |
import java.util.Collection;
import org.apache.ambari.server.metrics.system.impl.AbstractMetricsSource;
public interface MetricsService{
void start();
/**
* Get Configured sources
* @return
*/
Collection<AbstractMetricsSource> getSources(); | 0 |
import org.apache.http.nio.reactor.SessionInputBuffer; | 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 |
* @see org.apache.felix.inventory.ZipAttachmentProvider#addAttachments(java.util.zip.ZipOutputStream,
* java.lang.String)
public void addAttachments(final ZipOutputStream zos, final String namePrefix) throws IOException
((ZipAttachmentProvider) printer).addAttachments(zos, namePrefix); | 0 |
import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.repository;
mavenBundle().groupId("org.ow2.chameleon").artifactId("transaction-geronimo").version(asInProject()),
),
repository("http://maven.ow2.org/maven2-snapshot/"),
osgi.waitForService(TransactionManager.class.getName(), null, 5000); | 0 |
this.localServer = new LocalTestServer(null, null);
this.localServer.registerDefaultHandlers();
this.localServer.start();
this.httpclient = new DefaultHttpClient();
response = this.httpclient.execute(httpget);
response = this.httpclient.execute(target, httpget); | 0 |
boolean completed = false;
completed = true;
if (completed) {
throw new IOReactorException(ex.getMessage(), ex);
} | 0 |
private MetadataTime time;
public MetadataTime getTime() {
te.time = MetadataTime.parse(val); | 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.sling.osgi.console.web;
import java.io.PrintWriter;
public interface ConfigurationPrinter {
static final String SERVICE = ConfigurationPrinter.class.getName();
String getTitle();
void printConfiguration(PrintWriter printWriter);
} | 0 |
*
*
*
if (formDefinition != null) {
classDefinition = formDefinition.getWidgetDefinition(getId());
if (classDefinition == null) { // not found in local form, try library
}
}
if (classDefinition == null && getEnclosingLibrary() != null) { // not found in form's library, so ask enclosing library
classDefinition = getEnclosingLibrary().getDefinition(getId());
if (classDefinition == null) {
}
if (!(classDefinition instanceof ClassDefinition)) {
}
return (ClassDefinition) classDefinition;
if (definition instanceof UnionDefinition) {
break;
}
if (definition == this) {
throw new Exception("NewDefinition: Non-terminating recursion detected in widget definition : " +
parent.getId() + " (" + getLocation() + ")");
}
| 0 |
* @author <a href="mailto:[email protected]">Christian Haul</a>
* @version CVS $Id: FormValidatorAction.java,v 1.4 2004/02/15 21:30:00 haul Exp $ | 0 |
public final class ByteConverter extends NumberConverter<Byte> {
protected Class<Byte> getDefaultType() { | 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 |
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 Response startJobUpdate(JobUpdateRequest request, String message, SessionKey session)
return delegate.startJobUpdate(request, message, session);
public Response pauseJobUpdate(JobUpdateKey key, String message, SessionKey session)
throws TException {
return delegate.pauseJobUpdate(key, message, session);
public Response resumeJobUpdate(JobUpdateKey key, String message, SessionKey session)
return delegate.resumeJobUpdate(key, message, session);
public Response abortJobUpdate(JobUpdateKey key, String message, SessionKey session)
throws TException {
return delegate.abortJobUpdate(key, message, session); | 0 |
options.getGcpCredential(), ImmutableList.of(404), new UploadIdResponseInterceptor())) | 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 |
DataflowExecutionContext<?> executionContext, | 0 |
import java.util.HashSet; | 0 |
*
public static boolean deploy(InputStream inputStream,
jin = new JarInputStream(inputStream); | 0 |
import org.kohsuke.args4j.spi.ExplicitBooleanOptionHandler;
usage = "When true, remove each job's staged artifacts when it completes",
// Allows setting boolean parameters to false which default to true
handler = ExplicitBooleanOptionHandler.class)
private boolean cleanArtifactsPerJob = true; | 0 |
LoggingUtils.generateMnemonicMap(SshAgentConstants.class, f -> {
String name = f.getName();
return !name.startsWith("SSH_AGENT_CONSTRAIN")
&& (name.startsWith("SSH_AGENT") || name.startsWith("SSH2_AGENT"));
});
private LazyMessagesMapHolder() {
throw new UnsupportedOperationException("No instance allowed");
} | 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.
*/ | 0 |
assertThat(coder, Matchers.equalTo(otherCoder));
AppliedPTransform.of(
transform, Collections.emptyList());
AppliedPTransform.of(
AppliedPTransform.of(
Collections.emptyList());
Collections.singletonList(childTransform));
AppliedPTransform.of(
AppliedPTransform.of(
AppliedPTransform.of(
AppliedPTransform.of(
transform, Collections.singletonList(childTransform)); | 0 |
}
@Override
public final void updateDatabaseSchemaVersion() { | 0 |
this.limitingCos = Math.cos( Math.toRadians( limitingConeAngle ) ); | 0 |
import org.apache.http.annotation.NotThreadSafe;
@NotThreadSafe | 0 |
package org.apache.felix.ipojo.test.scenarios.component;
import java.util.Properties;
import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.annotations.Provides;
import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
import org.apache.felix.ipojo.test.scenarios.annotations.service.CheckService;
import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
@Component
@Provides(specifications= {CheckService.class})
public class ProvidesTriple implements FooService, BarService, CheckService {
public boolean foo() {
return false;
}
public Properties fooProps() {
return null;
}
public boolean getBoolean() {
return false;
}
public double getDouble() {
return 0;
}
public int getInt() {
return 0;
}
public long getLong() {
return 0;
}
public Boolean getObject() {
return null;
}
public boolean bar() {
return false;
}
public Properties getProps() {
return null;
}
public boolean check() {
return false;
}
} | 0 |
log.debug("{} is a directory, ignoring.", fileStatus.getPath());
log.debug("{} does not have a valid extension, ignoring", fileStatus.getPath()); | 0 |
import org.apache.commons.jelly.expression.Expression;
// for example <manifest> inside a <jar> should be a nested object, where as
if ( ! ( parentObject instanceof Task ) &&
project.getTaskDefinitions().containsKey( tagName ) ) {
log.debug( "Creating an ant Task for name: " + tagName );
if ( log.isDebugEnabled() ) {
log.debug( "Creating a nested object name: " + tagName );
// lets treat this tag as static XML...
}
if ( value instanceof Expression )
{
super.setAttribute( name, ((Expression) value).evaluateAsValue(context) );
}
else
{
super.setAttribute( name, value.toString() );
}
| 0 |
/*
* Copyright 2006 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.deployer.monolithic;
public class NoRuleFoundException extends RuntimeException {
public NoRuleFoundException(String message) {
super(message);
}
} | 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.accumulo.core.iterators.system;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.Filter;
import org.apache.accumulo.core.iterators.IteratorEnvironment;
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.apache.accumulo.core.sample.RowSampler;
import org.apache.accumulo.core.sample.Sampler;
public class SampleIterator extends Filter {
private Sampler sampler = new RowSampler();
public SampleIterator(SortedKeyValueIterator<Key,Value> iter, Sampler sampler) {
setSource(iter);
this.sampler = sampler;
}
@Override
public boolean accept(Key k, Value v) {
return sampler.accept(k);
}
@Override
public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env) {
return new SampleIterator(getSource().deepCopy(env), sampler);
}
} | 1 |
/*
* $HeadURL$
* $Revision$
* $Date$
*
* ====================================================================
* 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.impl.client;
import java.net.URI;
import java.util.HashSet;
import java.util.Set;
public class RedirectLocations {
private final Set<URI> uris;
public RedirectLocations() {
super();
this.uris = new HashSet<URI>();
}
public boolean contains(final URI uri) {
return this.uris.contains(uri);
}
public void add(final URI uri) {
this.uris.add(uri);
}
public boolean remove(final URI uri) {
return this.uris.remove(uri);
}
} | 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 |
* 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 |
* Copyright 2003,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 $Id: NullOutputStream.java,v 1.4 2004/02/23 04:40:29 bayard Exp $ | 0 |
private final ServiceRegistry m_registry;
private ServiceRegistration<StartLevel> m_slReg;
m_registry = registry;
}
void start()
{
m_slReg = m_registry.registerService(m_felix._getBundleContext(),
new String[] { StartLevel.class.getName() },
new StartLevelImpl(m_felix),
null); | 0 |
prov.put("instance.name","FooProvider");
i1.put("instance.name","Simple");
i2.put("instance.name","Void");
i3.put("instance.name","Object");
i4.put("instance.name","Ref");
i5.put("instance.name","Both"); | 0 |
private Log log;
protected Log getLogger()
setupComponent(this.globalConfiguration);
vfsComponent.setLogger(getLogger());
setGlobalConfiguration(new GlobalConfiguration()); | 0 |
"gs://apache-beam-samples/wikipedia_edits/wiki_data-000000000000.json";
private static final String DEFAULT_OUTPUT_CHECKSUM = "13347784d49129bade295c371e30f9eb5325318a"; | 0 |
public class GraphBackedMetadataRepository implements MetadataRepository {
LoggerFactory.getLogger(GraphBackedMetadataRepository.class);
public static final String NAME = GraphBackedMetadataRepository.class.getSimpleName(); | 0 |
* @version CVS $Id: OutputStreamListener.java,v 1.8 2004/05/10 12:28:27 sylvain Exp $
// Flush the writer, but don't close the underlying stream.
writer.flush(); | 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.felix.framework.util.VersionRange;
String versionAttr = imported.getAttribute( Constants.VERSION_ATTRIBUTE );
if ( versionAttr == null )
{
// no specific version required, this export surely satisfies it
return true;
}
VersionRange required = VersionRange.parse( versionAttr );
return required.isInRange( exported.getVersion() ); | 0 |
import org.osgi.annotation.versioning.ConsumerType;
@ConsumerType | 0 |
toRet.initialize(context, initialize);
toRet.initialize(context, initialize);
zooCache = new ZooCache(context); | 0 |
flinkOptions.setRunner(TestFlinkPipelineRunner.class); | 0 |
* @version $Id$ | 0 |
* {@link FilterHandlerMapping} instances are immutable.
public final class FilterHandlerMapping
* Creates a new, empty, {@link FilterHandlerMapping} instance.
public FilterHandlerMapping()
* Creates a new {@link FilterHandlerMapping} instance for the given elements.
private FilterHandlerMapping(@Nonnull final Map<Pattern, Collection<FilterHandler>> mappings)
* Returns a new {@link FilterHandlerMapping} instance with a mapping for the
* @return a new {@link FilterHandlerMapping} instance with a mapping for the
public FilterHandlerMapping add(@Nonnull final FilterHandler handler)
FilterHandlerMapping add(@Nonnull final Map<Pattern, FilterHandler> mappings)
return new FilterHandlerMapping(newMappings);
* Returns a new {@link FilterHandlerMapping} instance without a mapping for the
* @return a new {@link FilterHandlerMapping} instance without a mapping for the
public FilterHandlerMapping remove(FilterHandler handler)
FilterHandlerMapping remove(Map<Pattern, FilterHandler> mappings)
return new FilterHandlerMapping(newMappings);
FilterHandlerMapping update(Map<Pattern, FilterHandler> add, Map<Pattern, FilterHandler> remove)
return new FilterHandlerMapping(newMappings); | 0 |
TcpipForwarder create(ConnectionService service); | 0 |
package org.apache.sshd.common.forward;
import org.apache.sshd.common.ForwardingAcceptorFactory;
import org.apache.sshd.common.Session;
public NioSocketAcceptor createNioSocketAcceptor(Session s) { | 0 |
* Authentication scheme registry that can be used to obtain the corresponding
* authentication scheme implementation for a given type of authorization challenge.
public final class AuthSchemeRegistry {
public final static AuthSchemeRegistry DEFAULT = new AuthSchemeRegistry(); | 0 |
import static org.easymock.EasyMock.createStrictMock;
import java.util.Set;
ConfigHelper configHelper = createStrictMock(ConfigHelper.class);
expect(injector.getInstance(ConfigHelper.class)).andReturn(configHelper).anyTimes();
configHelper.updateAgentConfigs(anyObject(Set.class));
expectLastCall();
replay(controller, clusters, cluster1, cluster2, configWithGroup, configWithoutGroup, newConfig, response, injector, kerberosHelperMock, configHelper);
verify(controller, clusters, cluster1, cluster2, configWithGroup, configWithoutGroup, newConfig, response, injector, upgradeCatalog270, configHelper); | 0 |
import org.apache.accumulo.core.file.blockfile.impl.CachableBlockFile;
import org.apache.accumulo.core.file.rfile.RFile;
import org.apache.accumulo.core.file.rfile.RFile.Reader;
import org.apache.accumulo.server.tabletserver.compaction.WriteParameters;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
public class ConfigurableMajorCompactionIT extends ConfigurableMacIT {
public static class TestCompactionStrategy extends CompactionStrategy {
if (request.getFiles().size() != 5)
return null;
plan.writeParameters = new WriteParameters();
plan.writeParameters.setBlockSize(1024 * 1024);
plan.writeParameters.setCompressType("none");
plan.writeParameters.setHdfsBlockSize(1024 * 1024);
plan.writeParameters.setIndexBlockSize(10);
plan.writeParameters.setReplication(7); | 0 |
import org.apache.hc.core5.http.ClassicHttpRequest;
final ClassicHttpRequest req1 = new BasicClassicHttpRequest("GET","/");
final ClassicHttpRequest req2 = new BasicClassicHttpRequest("GET","/");
execute(req1);
final HttpResponse result = execute(req2);
final ClassicHttpRequest req1 = new BasicClassicHttpRequest("GET","/");
final ClassicHttpRequest req2 = new BasicClassicHttpRequest("GET","/");
execute(req1);
final HttpResponse result = execute(req2); | 0 |
private final int connectTimeoutMillis;
final SftpFileSystemConfigBuilder builder = SftpFileSystemConfigBuilder.getInstance();
this.connectTimeoutMillis = builder.getConnectTimeoutMillis(fileSystemOptions);
channel.connect(connectTimeoutMillis);
channel.connect(connectTimeoutMillis); | 0 |
p.apply("ReadMyFile", TextIO.read().from("gs://bucket/object"))
.apply(TextIO.read().from(options.getInput()))
PCollection<String> unconsumed = p.apply(TextIO.read().from(options.getInput()));
p.apply("ReadMyNonGcsFile", TextIO.read().from(tmpFolder.newFile().getPath()));
p.apply("ReadMyGcsFile", TextIO.read().from("gs://bucket/object"))
p.apply("ReadInvalidGcsFile", TextIO.read().from("gs://bucket/tmp//file"));
PCollection<String> pc = p.apply("ReadMyGcsFile", TextIO.read().from("gs://bucket/object")); | 0 |
import com.google.cloud.dataflow.sdk.testing.PAssert;
PAssert.that(output)
PAssert.that(output).empty(); | 0 |
import org.springframework.stereotype.Service;
@Service | 0 |
import java.util.Optional; | 0 |
assertEquals(11, definitions.size());
assertEquals(2, hostAlertCount);
assertEquals(11, definitions.size());
assertEquals(10, definitions.size());
assertEquals(11, definitions.size());
assertEquals(10, definitions.size());
assertEquals(12, definitions.size()); | 0 |
public TransformResult<Object> finishBundle() throws Exception {
public TransformResult<Object> finishBundle() throws Exception { | 0 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ambari.view.hive20.actor.message.job;
public class ExecutionFailed extends Failure {
public ExecutionFailed(String message, Throwable error) {
super(message, error);
}
public ExecutionFailed(String message) {
super(message, new Exception(message));
}
} | 0 |
/** Subclass this class to have the whole suite operate on your executor of choice. */
BroadcastHashJoinTest.class,
CountByKeyTest.class,
DistinctTest.class,
FilterTest.class,
FlatMapTest.class,
JoinTest.class,
JoinWindowEnforcementTest.class,
MapElementsTest.class,
ReduceByKeyTest.class,
ReduceStateByKeyTest.class,
SumByKeyTest.class,
TopPerKeyTest.class,
UnionTest.class,
WindowingTest.class,
WatermarkTest.class,
public abstract class AllOperatorsSuite implements ExecutorProvider {} | 0 |
import java.io.StringWriter;
import org.apache.commons.jelly.XMLOutput;
import org.dom4j.io.HTMLWriter;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
import org.xml.sax.SAXException;
* @version $Revision: 1.3 $
assertEquals("target/testFileTag.tmp", "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\"></html>", data);
public void testDom4Xmlns() throws SAXException {
StringWriter writer = new StringWriter();
OutputFormat format = new OutputFormat();
final XMLWriter xmlWriter = new HTMLWriter(writer, format);
xmlWriter.setEscapeText(false);
XMLOutput output = new XMLOutput(xmlWriter, xmlWriter);
String golden = "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n";
golden += "<html>";
output.startDocument();
output.write(golden);
output.endDocument();
System.err.println("output was: '" + writer.toString() +"'");
System.err.println("golden is : '" + golden +"'");
assertEquals("output should contain the namespaces", golden, writer.toString());
}
| 0 |
import java.text.DateFormat;
import java.util.Date;
import org.apache.commons.vfs.FileContent;
import org.apache.commons.vfs.VFS;
* @version $Revision: 1.3 $ $Date: 2003/06/28 10:49:21 $
System.out.println( "ls [-R] [path] Lists contents of a file or folder." );
final FileObject file;
file = mgr.resolveFile( cwd, cmd[ pos ] );
file = cwd;
if ( file.getType() == FileType.FOLDER )
{
// List the contents
System.out.println( "Contents of " + file.getName() );
listChildren( file, recursive, "" );
}
else
{
// Stat the file
System.out.println( file.getName() );
final FileContent content = file.getContent();
System.out.println( "Size: " + content.getSize() + " bytes." );
final DateFormat dateFormat = DateFormat.getDateTimeInstance( DateFormat.MEDIUM, DateFormat.MEDIUM );
final String lastMod = dateFormat.format( new Date( content.getLastModifiedTime() ) );
System.out.println( "Last modified: " + lastMod );
} | 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 |
import org.apache.accumulo.start.classloader.vfs.MiniDFSUtil;
private MiniDFSCluster miniDFS = null;
private List<Process> cleanup = new ArrayList<Process>();
Process proc = exec(clazz, Collections.singletonList("-Xmx" + config.getDefaultMemory()), args);
cleanup.add(proc);
return proc;
File dfs = new File(config.getAccumuloDir(), "dfs");
dfs.mkdirs();
conf.set("dfs.datanode.synconclose", "true");
conf.set("dfs.datanode.data.dir.perm", MiniDFSUtil.computeDatanodeDirectoryPermission());
String oldTestBuildData = System.setProperty("test.build.data", dfs.getAbsolutePath());
if (oldTestBuildData == null)
System.clearProperty("test.build.data");
else
System.setProperty("test.build.data", oldTestBuildData);
writeConfig(coreFile, Collections.singletonMap("fs.default.name", uri).entrySet());
writeConfig(hdfsFile, conf);
writeConfig(siteFile, config.getSiteConfig().entrySet());
private void writeConfig(File file, Iterable<Map.Entry<String, String>> settings) throws IOException {
for (Entry<String,String> entry : settings) {
String value = entry.getValue().replace("&", "&").replace("<", "<").replace(">", ">");
fileWriter.append("<property><name>" + entry.getKey() + "</name><value>" + value + "</value></property>\n");
}
// sleep a little bit to let zookeeper come up before calling init, seems to work better
UtilWaitThread.sleep(250);
int ret = 0;
for (int i = 0; i < 5; i++) {
ret = exec(Main.class, SetGoalState.class.getName(), MasterGoalState.NORMAL.toString()).waitFor();
if (ret == 0)
break;
UtilWaitThread.sleep(1000);
}
for (Process p : cleanup)
p.destroy();
Runtime.getRuntime().exec("pkill -f " + config.getDir().getAbsolutePath()); | 0 |
package org.apache.felix.sigil.model; | 0 |
Map<String, Object> p = PropertyHelper.getProperties(resource);
for (String key : p.keySet()) {
if (!properties.contains(key)) {
System.out.printf(key);
}
}
| 0 |
Connector conn = master.getConnector();
Instance instance = master.getInstance();
return ("" + flushID + encodedIterators).getBytes();
return ("" + flushID + encodedIterators).getBytes(); | 1 |
log.debug("Replicating {} to {} using {}", filePath, target, replica.getClass().getName());
| 0 |
import java.util.Locale;
this.host = host.toLowerCase(Locale.ENGLISH); | 0 |
package org.apache.atlas.web.resources;
import org.apache.atlas.MetadataServiceClient;
import org.apache.atlas.ParamChecker;
import org.apache.atlas.discovery.DiscoveryException;
import org.apache.atlas.discovery.LineageService;
import org.apache.atlas.repository.EntityNotFoundException;
import org.apache.atlas.web.util.Servlets;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException; | 0 |
* limitations under the License. | 0 |
import org.apache.beam.model.pipeline.v1.Endpoints; | 0 |
public static final String ENCRYPTIONSPECIFICATION_URL =
/** The namespace of the
public static final String EncryptionSpecNS =
public static final String EncryptionSpec11NS =
public static final String TYPE_MEDIATYPE =
public static final String ALGO_ID_BLOCKCIPHER_TRIPLEDES =
public static final String ALGO_ID_BLOCKCIPHER_AES128 =
public static final String ALGO_ID_BLOCKCIPHER_AES256 =
public static final String ALGO_ID_BLOCKCIPHER_AES192 =
public static final String ALGO_ID_BLOCKCIPHER_AES128_GCM =
public static final String ALGO_ID_BLOCKCIPHER_AES192_GCM =
public static final String ALGO_ID_BLOCKCIPHER_AES256_GCM =
public static final String ALGO_ID_BLOCKCIPHER_SEED128 =
public static final String ALGO_ID_BLOCKCIPHER_CAMELLIA128 =
public static final String ALGO_ID_BLOCKCIPHER_CAMELLIA192 =
public static final String ALGO_ID_BLOCKCIPHER_CAMELLIA256 =
public static final String ALGO_ID_KEYTRANSPORT_RSA15 =
public static final String ALGO_ID_KEYTRANSPORT_RSAOAEP =
public static final String ALGO_ID_KEYTRANSPORT_RSAOAEP_11 =
public static final String ALGO_ID_KEYAGREEMENT_DH =
public static final String ALGO_ID_KEYWRAP_TRIPLEDES =
public static final String ALGO_ID_KEYWRAP_AES128 =
public static final String ALGO_ID_KEYWRAP_AES256 =
public static final String ALGO_ID_KEYWRAP_AES192 =
public static final String ALGO_ID_KEYWRAP_CAMELLIA128 =
public static final String ALGO_ID_KEYWRAP_CAMELLIA192 =
public static final String ALGO_ID_KEYWRAP_CAMELLIA256 =
public static final String ALGO_ID_KEYWRAP_SEED128 =
public static final String ALGO_ID_AUTHENTICATION_XMLSIGNATURE =
public static final String ALGO_ID_C14N_WITHCOMMENTS =
public static final String ALGO_ID_C14N_OMITCOMMENTS =
public static final String ALGO_ID_ENCODING_BASE64 =
| 1 |
@Override
public boolean isReversed() {
return false;
}
@Override
public void maybeReverse(boolean mirror) {
}
| 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.ipojo.runtime.core.test.annotations;
import org.apache.felix.ipojo.ComponentInstance;
import org.apache.felix.ipojo.architecture.Architecture;
import org.junit.Test;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;
/**
* Checks that a component setting a name and using the @Instantiate annotation creates the instance correctly.
* It reproduce {@link https://issues.apache.org/jira/browse/FELIX-4052}
*/
public class TestInstantiatedComponent extends Common {
@Test
public void testInstanceCreation() {
// This is the expected name.
Architecture architecture = osgiHelper.getServiceObject(Architecture.class,
"(architecture.instance=MyInstantiatedComponent-0)");
assertNotNull(architecture);
assertEquals(ComponentInstance.VALID, architecture.getInstanceDescription().getState());
}
} | 0 |
* @version $Revision$ | 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.dsls.sql.interpreter.operator.math;
import java.util.List;
import org.apache.beam.dsls.sql.interpreter.operator.BeamSqlExpression;
import org.apache.beam.dsls.sql.interpreter.operator.BeamSqlPrimitive;
import org.apache.calcite.runtime.SqlFunctions;
import org.apache.calcite.sql.type.SqlTypeName;
/**
* {@code BeamSqlMathUnaryExpression} for 'ASIN' function.
*/
public class BeamSqlAsinExpression extends BeamSqlMathUnaryExpression {
public BeamSqlAsinExpression(List<BeamSqlExpression> operands) {
super(operands);
}
@Override public BeamSqlPrimitive calculate(BeamSqlPrimitive op) {
return BeamSqlPrimitive
.of(SqlTypeName.DOUBLE, SqlFunctions.asin(SqlFunctions.toDouble(op.getValue())));
}
} | 0 |
case OpCode.createTTL:
case OpCode.createTTL:
case OpCode.createTTL:
return "createTtl"; | 0 |
* "License"); you may not use this file except in compliance
* distributed under the License is distributed on an "AS IS" BASIS, | 0 |
URL url = f.toURI().toURL(); | 0 |
return (TestReportProcessor)XMLReflect.buildObject(element);
new Object[] { element.getAttributeNS(null, XR_CLASS_ATTRIBUTE),
testSuite.addTest( XMLTestSuiteLoader.loadTestSuite(suiteHref) ); | 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.forms.transformation;
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.environment.SourceResolver;
import org.apache.cocoon.transformation.Transformer;
import org.apache.avalon.framework.parameters.Parameters;
import org.xml.sax.SAXException;
import java.io.IOException;
import java.util.Map;
/**
* See description of {@link EffectWidgetReplacingPipe}.
*
* @version $Id$
*/
public class FormsTemplateTransformer extends EffectWidgetReplacingPipe implements Transformer {
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters)
throws ProcessingException, SAXException, IOException {
FormsPipelineConfig pipeContext = FormsPipelineConfig.createConfig(objectModel, parameters);
super.init(null, pipeContext);
}
} | 0 |
// If COLORS is changed, please also make changes in
// release/src/main/groovy/MobileGamingCommands.COLORS | 0 |
public static <T extends Serializable> T clone(T value) {
@SuppressWarnings("unchecked")
T copy = (T) deserializeFromByteArray(serializeToByteArray(value),
value.toString());
return copy;
}
| 0 |
/**
* This is the name of the property that can point to other
* properties file for including other properties files.
* <p>
* If the file is absent, processing continues normally.
* </p>
*/
private static String includeOptional = "includeoptional";
* Gets the property value for including other properties files.
* By default it is "include".
* <p>
* If the file is absent, processing continues normally.
* </p>
*
* @return A String.
* @since 2.5
*/
public static String getIncludeOptional()
{
return PropertiesConfiguration.includeOptional;
}
/**
* Sets the property value for including other properties files.
* By default it is "include".
* <p>
* If the file is absent, processing continues normally.
* </p>
*
* @param inc A String.
* @since 2.5
*/
public static void setIncludeOptional(final String inc)
{
PropertiesConfiguration.includeOptional = inc;
}
/**
loadIncludeFile(interpolate(f), false);
}
}
result = false;
}
else if (StringUtils.isNotEmpty(getIncludeOptional())
&& key.equalsIgnoreCase(getIncludeOptional()))
{
if (isIncludesAllowed())
{
final Collection<String> files =
getListDelimiterHandler().split(value, true);
for (final String f : files)
{
loadIncludeFile(interpolate(f), true);
}
* @param optional whether or not the {@code fileName} is optional
private void loadIncludeFile(final String fileName, boolean optional) throws ConfigurationException
if (optional && url == null)
{
return;
}
| 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 java.util.HashMap;
import org.apache.beam.sdk.coders.Coder;
Map<TupleTag<?>, Coder<?>> outputCoders = new HashMap<>();
for (Map.Entry<TupleTag<?>, PValue> entry : outputs.entrySet()) {
TupleTag<?> tag = entry.getKey();
if (entry.getValue() instanceof PCollection) {
PCollection<?> pCollection = (PCollection<?>) entry.getValue();
outputCoders.put(tag, pCollection.getCoder());
}
outputCoders, | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.