Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import org.apache.accumulo.core.client.sample.SamplerConfiguration;
0
import java.util.concurrent.ScheduledExecutorService; import org.apache.sshd.common.PropertyResolverUtils; import org.apache.sshd.common.session.Session; ChannelSession channel = ChannelSession.this; long timeout = PropertyResolverUtils.getLongProperty( channel, ServerFactoryManager.COMMAND_EXIT_TIMEOUT, ServerFactoryManager.DEFAULT_COMMAND_EXIT_TIMEOUT); log.debug("Wait {} ms for shell to exit cleanly on {}", Long.valueOf(timeout), channel); Session s = channel.getSession(); FactoryManager manager = ValidateUtils.checkNotNull(s.getFactoryManager(), "No factory manager"); ScheduledExecutorService scheduler = ValidateUtils.checkNotNull(manager.getScheduledExecutorService(), "No scheduling service"); scheduler.schedule(task, timeout, TimeUnit.MILLISECONDS); Session session = getSession(); ((SessionAware) command).setSession((ServerSession) session); ServerFactoryManager manager = ((ServerSession) session).getFactoryManager(); PipeDataReceiver recv = new PipeDataReceiver(this, localWindow); Session session = getSession(); Session session = getSession();
0
@Test public void testNullCacheConfig() throws Exception { CachingHttpClientBuilder.create().setCacheConfig(null).build(); }
0
DoFnSignature signature = DoFnSignatures.getSignature(fn.getClass());
0
@Override @Override @Override
0
return isSet(CommandSession.OPTION_NO_GLOB, false) ? null : session().currentDir(); } protected boolean isSet(String name, boolean def) { Object v = session.get(name); if (v instanceof Boolean) { return (Boolean) v; } else if (v != null) { String s = v.toString(); return s.isEmpty() || s.equalsIgnoreCase("on") || s.equalsIgnoreCase("1") || s.equalsIgnoreCase("true"); } return def;
0
import org.apache.ambari.server.state.MaintenanceState; public void testHostMaintenance() throws Exception { Assert.assertNull(stateEntity.getMaintenanceState()); Assert.assertEquals(MaintenanceState.OFF, host.getMaintenanceState(c1.getClusterId())); host.setMaintenanceState(c1.getClusterId(), MaintenanceState.ON); Assert.assertNotNull(stateEntity.getMaintenanceState()); Assert.assertEquals(MaintenanceState.ON, host.getMaintenanceState(c1.getClusterId()));
0
resultList.get(i).apply(BigQueryIO.write().to(tableRef).withSchema(getSchema()));
0
public class FELIX2344_ExtraDependencyWithCallbackTest extends Base {
0
@Override @Override @Override @Override @Override @Override
0
import org.apache.sshd.common.config.keys.KeyUtils;
0
import org.apache.log4j.Level; return (audit.isInfoEnabled() || audit.isEnabledFor(Level.WARN)) && !tableId.equals(MetadataTable.ID) && shouldAudit(credentials);
0
import org.apache.xml.security.utils.Constants; import org.apache.xml.security.utils.SignatureElementProxy; import org.w3c.dom.Document; import org.w3c.dom.Element;
0
import org.apache.ambari.spi.ClusterInformation; import org.apache.ambari.spi.RepositoryType; import org.apache.ambari.spi.RepositoryVersion; import org.apache.ambari.spi.upgrade.UpgradeCheckRequest; import org.apache.ambari.spi.upgrade.UpgradeCheckResult; import org.apache.ambari.spi.upgrade.UpgradeCheckStatus; import org.apache.ambari.spi.upgrade.UpgradeType; private UpgradeCheckRequest request; private StackId sourceStackId = new StackId(STACK_NAME, "1.0"); expect(cluster.getCurrentStackVersion()).andReturn(sourceStackId).anyTimes(); ClusterInformation clusterInformation = new ClusterInformation("cluster", false, null, null); request = new UpgradeCheckRequest(clusterInformation, UpgradeType.ROLLING, repoVersion(), null); UpgradeCheckResult result = check.perform(request); assertEquals(UpgradeCheckStatus.PASS, result.getStatus()); UpgradeCheckResult result = check.perform(request); assertEquals(UpgradeCheckStatus.FAIL, result.getStatus()); UpgradeCheckResult result = check.perform(request); assertEquals(UpgradeCheckStatus.WARNING, result.getStatus()); private RepositoryVersion repoVersion() { RepositoryVersion repositoryVersion = new RepositoryVersion(1, new StackId(STACK_NAME, STACK_VERSION).getStackId(), STACK_VERSION, RepositoryType.STANDARD); sourceStackId, new StackId(request.getTargetRepositoryVersion().getStackId()),
0
import static org.apache.aurora.scheduler.state.StateChangeResult.ILLEGAL; import static org.apache.aurora.scheduler.state.StateChangeResult.ILLEGAL_WITH_SIDE_EFFECTS; import static org.apache.aurora.scheduler.state.StateChangeResult.NOOP; import static org.apache.aurora.scheduler.state.StateChangeResult.SUCCESS; return new TransitionResult(NOOP, ImmutableSet.<SideEffect>of()); if (success) { return new TransitionResult(SUCCESS, transitionEffects); } return new TransitionResult( transitionEffects.isEmpty() ? ILLEGAL : ILLEGAL_WITH_SIDE_EFFECTS, transitionEffects);
0
* * * * * * * * * * * * * * * * *
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
0
import org.apache.ambari.server.controller.internal.PropertyIdImpl; import org.apache.ambari.server.controller.internal.ResourceImpl;
1
import org.apache.ambari.server.controller.internal.ClusterControllerImpl; import org.mortbay.log.Log; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Map that associates categories with temporal data. */ private final static Logger LOG = LoggerFactory.getLogger(QueryImpl.class); //todo: provide a more meaningful node name LOG.info("Resource object resource " + resource); for (Map.Entry<String, ResourceDefinition> entry : m_mapSubResources.entrySet()) { r.setParentId(m_resourceDefinition.getType(), (String) (resource.getPropertyValue( getKeyPropertyId(m_resourceDefinition.getType())).toString())); LOG.info("Setting various values for resource " + r.getId()); if (r.getResourceIds() != null) { for (Map.Entry<Resource.Type, String> tentry: r.getResourceIds().entrySet()) { LOG.info("Resource Id's " + tentry.getKey() + " value " + tentry.getValue()); } } return new ResultImpl(true);
1
public String createConfig(ConfigurationInfo info)
0
/* * Copyright 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.portal.deployment; import org.apache.cocoon.portal.event.Event; import org.apache.cocoon.portal.event.Receiver; /** * A deployment event is fired when a new artifact is found for deployment. * A {@link Receiver} for this event should first check the status before performing * an action. If the receiver could deploy the artifact, it should set the status * accordingly. If the receiver is not responsible for deploying this type of artifact * or if the artifact has already been deployed, the receiver should just ignore the * event. If an error occurs during deployment the status should be updated by the * receiver as well. * * @version $Id$ */ public interface DeploymentEvent extends DeploymentStatus, Event { /** * Get the corresponding deployment object. */ DeploymentObject getDeploymentObject(); /** * Sets the status of this event. @see getEvent() */ void setStatus(int status); }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/NonSerializableListDoubleList.java,v 1.3 2003/11/07 20:07:51 rwaldhoff Exp $ * * @deprecated This code has been moved to Jakarta Commons Primitives (http://jakarta.apache.org/commons/primitives/) * @version $Revision: 1.3 $ $Date: 2003/11/07 20:07:51 $
0
// It's expected that the user is already logged in via UserGroupInformation or external to this program (kinit). // ACCUMULO-3701 We need to ensure we're logged in before parseArgs returns as the MapReduce Job is going to make a copy of the current user (UGI) // when it is instantiated. if (null != keytabPath) { File keytab = new File(keytabPath); if (!keytab.exists() || !keytab.isFile()) { throw new IllegalArgumentException("Keytab isn't a normal file: " + keytabPath); } if (null == principal) { throw new IllegalArgumentException("Principal must be provided if logging in via Keytab"); } try { UserGroupInformation.loginUserFromKeytab(principal, keytab.getAbsolutePath()); } catch (IOException e) { throw new RuntimeException("Failed to log in with keytab", e); } }
0
try (BatchWriter bw = accumuloClient.createBatchWriter(tableName)) { // populate for (int i = 0; i < NUM_ROWS; i++) { Mutation m = new Mutation(new Text(String.format("%05d", i))); m.put(new Text("col" + ((i % 3) + 1)), new Text("qual"), new Value("junk".getBytes(UTF_8))); bw.addMutation(m); }
0
suite.addTest(org.apache.xml.security.test.c14n.helper.AttrCompareTest.suite()); suite.addTest(org.apache.xml.security.test.c14n.implementations.ExclusiveC14NInterop.suite()); suite.addTest(org.apache.xml.security.test.c14n.implementations.Bug45961Test.suite()); suite.addTest(org.apache.xml.security.test.transforms.RegisterTest.suite()); suite.addTest(org.apache.xml.security.test.keys.content.x509.XMLX509SKITest.suite()); suite.addTest(org.apache.xml.security.test.keys.content.x509.XMLX509IssuerSerialTest.suite()); suite.addTest(org.apache.xml.security.test.keys.content.x509.XMLX509CertificateTest.suite());
0
// DEPRECATED METHODS - for API compatibility only - DO NOT USE /** * @deprecated, use {@link #getSystemType()} instead */ @Deprecated public String getSystemName() throws IOException { if (__systemName == null && FTPReply.isPositiveCompletion(syst())) __systemName = _replyLines.get(_replyLines.size() - 1).substring(4); return __systemName; }
0
import net.jcip.annotations.NotThreadSafe; @NotThreadSafe // Entity is @NotThreadSafe
0
/* * Copyright (c) OSGi Alliance (2009). All Rights Reserved. * * 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.osgi.framework; /** * A reference to a Bundle. * * @since 1.5 * @ThreadSafe * @version $Revision: 6860 $ */ public interface BundleReference { /** * Returns the <code>Bundle</code> object associated with this * <code>BundleReference</code>. * * @return The <code>Bundle</code> object associated with this * <code>BundleReference</code>. */ public Bundle getBundle(); }
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. */ package org.apache.aurora.scheduler.storage.db.views; import java.util.Set; import org.apache.aurora.gen.InstanceTaskConfig; import org.apache.aurora.gen.Range; public final class DbInstanceTaskConfig { private DbTaskConfig task; private Set<Range> instances; private DbInstanceTaskConfig() { } InstanceTaskConfig toThrift() { return new InstanceTaskConfig() .setTask(task.toThrift()) .setInstances(instances); } }
0
import org.apache.batik.ext.awt.image.renderable.Filter; import org.apache.batik.ext.awt.image.renderable.FilterChainRable; import org.apache.batik.ext.awt.image.renderable.FilterChainRable8Bit; // Build a FilterChainRable8Bit = new FilterChainRable8Bit(sourceGraphic, filterRegion);
0
import org.apache.commons.vfs.impl.test.VfsClassLoaderTests; * @version $Revision: 1.3 $ $Date: 2002/11/23 00:32:12 $ private final String prefix; public ProviderTestSuite( final ProviderTestConfig providerConfig ) throws Exception this( providerConfig, "", false ); } private ProviderTestSuite( final ProviderTestConfig providerConfig, final String prefix, final boolean nested ) throws Exception { this.providerConfig = providerConfig; this.prefix = prefix; addBaseTests(); if ( !nested ) // Add nested tests // TODO - enable this again //addTest( new ProviderTestSuite( new JunctionProviderConfig( providerConfig ), "junction.", true )); * Adds base tests - excludes the nested test cases. */ private void addBaseTests() throws Exception { addTestClass( ProviderReadTests.class ); addTestClass( ProviderWriteTests.class ); addTestClass( UrlTests.class ); addTestClass( VfsClassLoaderTests.class ); } /** || Modifier.isStatic( method.getModifiers() ) || method.getReturnType() != Void.TYPE || method.getParameterTypes().length != 0 ) testCase.setConfig( method, providerConfig ); testCase.setName( prefix + method.getName() );
0
import org.apache.hc.core5.http.protocol.HttpContext; import org.apache.hc.core5.http.protocol.HttpCoreContext; final HttpContext context, final Command executionCommand = new ExecutionCommand<>( requestProducer, responseConsumer, context != null ? context : HttpCoreContext.create(), new FutureCallback<T>() { public <T> Future<T> execute( final AsyncRequestProducer requestProducer, final AsyncResponseConsumer<T> responseConsumer, final FutureCallback<T> callback) { return execute(requestProducer, responseConsumer, HttpCoreContext.create(), callback); }
0
super(s, initCause);
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.batik.dom.util; import org.xml.sax.SAXException; import java.io.IOException; /** * Wrapper for SAX Exceptions which would make it possible to * include line and column information with SAX parse errors. * * @author <a href="mailto:[email protected]>deweese</a> * @version $Id: skel.el,v 1.1 2003/05/13 21:04:46 deweese Exp $ */ public class SAXIOException extends IOException { protected SAXException saxe; public SAXIOException( SAXException saxe) { super(saxe.getMessage()); this.saxe = saxe; } public SAXException getSAXException() { return saxe; } public Throwable getCause() { return saxe; } };
0
/** * Returns the kerning value of this character pair. */ public float getKerning(String unicode1, String unicode2);
0
protected static void configureForEnvironment(MiniAccumuloConfigImpl cfg, Class<?> testClass) { configureForSsl(cfg); protected static void configureForSsl(MiniAccumuloConfigImpl cfg) { File sslDir = new File(cfg.getDir(), "ssl");
0
import org.apache.sshd.client.session.ClientSession; import org.apache.sshd.common.session.SessionHolder; public interface ScpClient extends SessionHolder<ClientSession>, ClientSessionHolder {
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
0
import java.util.ArrayList; import java.util.List; import org.apache.xml.security.exceptions.XMLSecurityException; import org.apache.xml.security.stax.ext.DocumentContext; import org.apache.xml.security.stax.ext.OutboundSecurityContext; import org.apache.xml.security.stax.ext.OutputProcessor; import org.apache.xml.security.stax.ext.OutputProcessorChain; import org.apache.xml.security.stax.ext.XMLSecurityConstants; import org.apache.xml.security.stax.ext.stax.XMLSecEvent; import org.apache.xml.security.stax.ext.stax.XMLSecStartElement; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
final ByteArrayOutputStream expected = new ByteArrayOutputStream(); expected.write(i); assertByteArrayEquals("TeeOutputStream.write(int)", expected.toByteArray(), baos1.toByteArray()); assertByteArrayEquals("TeeOutputStream.write(int)", expected.toByteArray(), baos2.toByteArray()); expected.write(array); assertByteArrayEquals("TeeOutputStream.write(byte[])", expected.toByteArray(), baos1.toByteArray()); assertByteArrayEquals("TeeOutputStream.write(byte[])", expected.toByteArray(), baos2.toByteArray()); expected.write(array, 5, 5); assertByteArrayEquals("TeeOutputStream.write(byte[], int, int)", expected.toByteArray(), baos1.toByteArray()); assertByteArrayEquals("TeeOutputStream.write(byte[], int, int)", expected.toByteArray(), baos2.toByteArray()); expected.flush(); expected.close();
0
import org.apache.accumulo.core.client.impl.ClientContext; ClientContext context = new ClientContext(instance, new Credentials(principal, token), ClientConfiguration.loadDefault()); scanner = new ScannerImpl(context, split.getTableId(), authorizations); ClientContext context = new ClientContext(getInstance(job), new Credentials(getPrincipal(job), getAuthenticationToken(job)), ClientConfiguration.loadDefault()); while (!tl.binRanges(context, ranges, binnedRanges).isEmpty()) {
1
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
package org.apache.accumulo.server.mini;
0
KERBEROS("Kerberos");
0
Assert.assertNotNull( dag.getOperatorMeta("ParDo(EmbeddedCollector)/ParMultiDo(EmbeddedCollector)"));
0
long sum = 0l; public Value aggregate() { try { return new Value(NumSummation.longToBytes(sum)); } catch (IOException e) { throw new RuntimeException(e); } public void collect(Value value) { long l; try { l = NumSummation.bytesToLong(value.get()); } catch (IOException e) { throw new RuntimeException(e); sum = NumSummation.safeAdd(sum, l); } public static byte[] longToBytes(long l) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(baos); WritableUtils.writeVLong(dos, l); return baos.toByteArray(); } public static long bytesToLong(byte[] b) throws IOException { DataInputStream dis = new DataInputStream(new ByteArrayInputStream(b)); return WritableUtils.readVLong(dis); } public static long safeAdd(long a, long b) { long aSign = Long.signum(a); long bSign = Long.signum(b); if ((aSign != 0) && (bSign != 0) && (aSign == bSign)) { if (aSign > 0) { if (Long.MAX_VALUE - a < b) return Long.MAX_VALUE; } else { if (Long.MIN_VALUE - a > b) return Long.MIN_VALUE; } return a + b; } public void reset() { sum = 0l; }
1
import com.google.common.net.HostAndPort; protected HostAndPort httpServer; httpServer = injector.getInstance(HttpService.class).getAddress(); return String.format("http://%s:%s%s", httpServer.getHostText(), httpServer.getPort(), path);
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.cocoon.forms.datatype.convertor; public interface DateConvertorBuilder extends ConvertorBuilder { }
0
public interface Transactioned extends Mutable, Transactional { }
0
if (count != 0) throw new Exception("count == " + count); if (count != 0) throw new Exception("count == " + count);
1
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0
0
+ "Set this to an unprivileged user if the mesos master was started with " + "\"--no-root_submissions\". If set to anything other than \"root\", the executor " + "will ignore the \"role\" setting for jobs since it can't use setuid() anymore. " + "This means that all your jobs will run under the specified user and the user has " + "to exist on the mesos slaves.")
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/adapters/Attic/TestIntCollectionCollection.java,v 1.5 2003/10/02 22:14:31 scolebourne Exp $ import org.apache.commons.collections.AbstractTestObject; * @version $Revision: 1.5 $ $Date: 2003/10/02 22:14:31 $ public class TestIntCollectionCollection extends AbstractTestObject {
0
public class SearchTab { searchCriteriaSelections.add( Arrays.asList( Boolean.TRUE, Boolean.FALSE, Boolean.FALSE ) ); searchCriteriaSelections.add( Arrays.asList( Boolean.FALSE, Boolean.TRUE, Boolean.TRUE ) ); public List<List<Boolean>> getSearchCriteriaSelections() { public void setSearchCriteriaSelections( List<List<Boolean>> selections ) { searchCriteria.add( new SearchCriteria( "Crittery critters" ) ); searchCriteria.add( new SearchCriteria( "Woodland creatures" ) ); public List<SearchCriteria> getSearchCriteria() { public void setSearchCriteria( List<SearchCriteria> searchCriteria ) { public List<List<String>> getSearchCriteriaOptions() { public void setSearchCriteriaOptions( List<List<String>> searchCriteriaOptions ) {
0
package org.apache.accumulo.shell.commands; import org.apache.accumulo.shell.Shell; import org.apache.accumulo.shell.Token; import org.apache.accumulo.shell.Shell.Command;
0
/** * Creates an instance of the content. * This method needs to be called once only for singleton provided service. * This methods call the {@link InstanceManager#createObject()} method, and adds * the created object to the {@link InstanceManager#m_pojoObjects} list. Then, * it calls the {@link PrimitiveHandler#onCreation(Object)} methods on attached * handlers. * @return a new instance or <code>null</code> if an error occurs during the * creation. */ public Object createPojoObject() { Object instance = createObject(); // Add the new instance in the instance list. synchronized (this) { if (m_pojoObjects == null) { m_pojoObjects = new ArrayList(1); } m_pojoObjects.add(instance); } //Do not call onCreation, this will be done in the start method. return instance; } // Start attached handler. // Call the onCreation method. for (int i = 0; i < m_handlers.length; i++) { ((PrimitiveHandler) m_handlers[i].getHandler()).onCreation(m_handler); } m_handler.start(); // Call the handler start method, the instance might be invalid.
0
* @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
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
* files, which are encoded in Intel format (i&#x2e;e&#x2e; little indian).
1
* @param useHex if <code>true</code> then use Base32 Hex alphabet * @param useHex if <code>true</code> then use Base32 Hex alphabet * if <code>true</code>, then use Base32 Hex alphabet, otherwise use Base32 alphabet * if <code>true</code>, then use Base32 Hex alphabet, otherwise use Base32 alphabet * @return <code>true</code> if the value is defined in the the Base32 alphabet <code>false</code> otherwise.
1
import com.google.common.base.Optional; void changedState(String taskId, ScheduleStatus status, Optional<String> message); public void changedState(String taskId, ScheduleStatus status, Optional<String> message) {
0
* $Date$
0
* <p> * </p>
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
* @param logFile the file to read.
0
/* * $Header: /cvshome/build/ee.foundation/src/java/text/Format.java,v 1.6 2006/03/14 01:20:30 hargrave Exp $ * * (C) Copyright 2001 Sun Microsystems, Inc. * Copyright (c) OSGi Alliance (2001, 2005). All Rights Reserved. * * 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 java.text; public abstract class Format implements java.io.Serializable, java.lang.Cloneable { public Format() { } public java.lang.Object clone() { return null; } public final java.lang.String format(java.lang.Object var0) { return null; } public abstract java.lang.StringBuffer format(java.lang.Object var0, java.lang.StringBuffer var1, java.text.FieldPosition var2); public java.lang.Object parseObject(java.lang.String var0) throws java.text.ParseException { return null; } public abstract java.lang.Object parseObject(java.lang.String var0, java.text.ParsePosition var1); }
0
* Tests adding nodes from another configuration. */ public void testAddNodesCopy() throws ConfigurationException { XMLConfiguration c2 = new XMLConfiguration(testProperties2); conf.addNodes("copiedProperties", c2.getRootNode().getChildren()); conf.save(testSaveConf); XMLConfiguration checkConf = new XMLConfiguration(); checkConf.setFile(testSaveConf); checkSavedConfig(checkConf); } /**
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.fn.harness.fn; import java.util.function.Consumer; /** * A {@link Consumer} which can throw {@link Exception}s. * * <p>Used to expand the allowed set of method references to be used by Java 8 * functional interfaces. */ @FunctionalInterface public interface ThrowingConsumer<T> { void accept(T t) throws Exception; }
0
import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.Serializable; /** * Broadcast helper. */
0
* to provide their own display data.
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.controller; import org.apache.ambari.common.rest.entities.ClusterDefinition; import org.apache.ambari.common.rest.entities.ClusterState; public interface ClusterFactory { public Cluster create(String name); public Cluster create(ClusterDefinition definition, ClusterState state); }
0
if (!topology.getBlueprint().getComponents(HIVE_SERVICE).contains(MYSQL_SERVER_COMPONENT)) {
0
private static final FrameworkInfo BASE_INFO = FrameworkInfo.newBuilder() .build(); private static final DriverSettings SETTINGS = new DriverSettings( "fakemaster", Optional.absent()); private FrameworkInfoFactory infoFactory; infoFactory = createMock(FrameworkInfoFactory.class); driverService = new SchedulerDriverService( scheduler, storage.storage, SETTINGS, driverFactory, infoFactory); expect(infoFactory.getFrameworkInfo()).andReturn(BASE_INFO); FrameworkInfo.Builder builder = BASE_INFO.toBuilder();
0
super.next(); if (super.hasTop()) super.next();
0
public TemporaryFolder folder = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));
0
reduceFnRunner.processElements(element.elementsIterable());
0
import org.apache.ambari.server.configuration.AmbariServerConfigurationCategory; super(configurationMap); @Override protected AmbariServerConfigurationCategory getCategory() { return AmbariServerConfigurationCategory.TPROXY_CONFIGURATION; * Determines of trusted proxy support is enabled based on the configuration data. * @return <code>true</code> if trusted proxy support is enabled; <code>false</code> otherwise
0
Object newV = (newValue) ? Boolean.TRUE : Boolean.FALSE;
0
* Tests whether a clear() operation clears the footer comment. */ @Test public void testClearFooterComment() { conf.clear(); assertNull("Still got a footer comment", conf.getFooter()); assertNull("Still got a header comment", conf.getHeader()); } /**
0
import java.io.OutputStream; * @version CVS $Id: HttpEnvironment.java,v 1.7 2003/05/07 20:35:43 cziegeler Exp $ /** * Get the output stream where to write the generated resource. * The returned stream is buffered by the environment. If the * buffer size is -1 then the complete output is buffered. * If the buffer size is 0, no buffering takes place. * This method replaces {@link #getOutputStream()}. */ public OutputStream getOutputStream(final int bufferSize) throws IOException { if ( this.outputStream == null) { this.outputStream = this.response.getOutputStream(); } return super.getOutputStream( bufferSize ); }
0
when(mockTrigger1.onElement(Mockito.<Trigger<IntervalWindow>.OnElementContext>any())) .thenReturn(TriggerResult.CONTINUE); when(mockTrigger2.onElement(Mockito.<Trigger<IntervalWindow>.OnElementContext>any())) .thenReturn(TriggerResult.CONTINUE); tester.injectElements( TimestampedValue.of(1, new Instant(1)), TimestampedValue.of(5, new Instant(12))); when(mockTrigger1.onMerge(Mockito.<Trigger<IntervalWindow>.OnMergeContext>any())) when(mockTrigger2.onMerge(Mockito.<Trigger<IntervalWindow>.OnMergeContext>any())) tester.injectElements( TimestampedValue.of(12, new Instant(5)));
0
// nothing to override
0
List<PermissionEntity> permissionEntities = new LinkedList<>(); List<PermissionEntity> permissionEntities = new LinkedList<>();
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
this.queue.remove(t);
0
* DoFunctions ignore outputs that are not the main output. MultiDoFunctions deal with additional * outputs by enriching the underlying data with multiple TupleTags.
0
import org.apache.http.client.utils.DateUtils;
0
private static final Veto ALMOST = Veto.insufficientResources("Almost", 1); private static final Veto NOPE = Veto.insufficientResources("Nope", 5); private static final Veto NO_CHANCE = Veto.insufficientResources("No chance", 1000);
0
return -1; return -1; return null; return null;
0
getConnector().securityOperations().grantTablePermission(getAdminPrincipal(), MetadataTable.NAME, TablePermission.WRITE); ClientContext context = new ClientContext(getConnector().getInstance(), credentials, cluster.getClientConfig());
0
package org.apache.beam.sdk.extensions.euphoria.operator.test; import org.apache.beam.sdk.extensions.euphoria.core.client.dataset.Dataset; import org.apache.beam.sdk.extensions.euphoria.core.client.operator.Filter; import org.apache.beam.sdk.extensions.euphoria.operator.test.junit.AbstractOperatorTest; import org.apache.beam.sdk.extensions.euphoria.operator.test.junit.Processing; import org.junit.Test;
0
import org.apache.http.protocol.HttpCoreContext; context.setAttribute(HttpCoreContext.HTTP_REQUEST, request); context.setAttribute(HttpCoreContext.HTTP_CONNECTION, conn); context.setAttribute(HttpCoreContext.HTTP_RESPONSE, response);
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
package org.apache.beam.examples.complete; import org.apache.beam.examples.common.DataflowExampleOptions; import org.apache.beam.examples.common.DataflowExampleUtils; import org.apache.beam.examples.common.ExampleBigQueryTableOptions; import org.apache.beam.examples.common.ExamplePubsubTopicAndSubscriptionOptions; import org.apache.beam.sdk.Pipeline; import org.apache.beam.sdk.PipelineResult; import org.apache.beam.sdk.coders.AvroCoder; import org.apache.beam.sdk.coders.DefaultCoder; import org.apache.beam.sdk.io.BigQueryIO; import org.apache.beam.sdk.io.PubsubIO; import org.apache.beam.sdk.io.TextIO; import org.apache.beam.sdk.options.Default; import org.apache.beam.sdk.options.Description; import org.apache.beam.sdk.options.PipelineOptionsFactory; import org.apache.beam.sdk.transforms.Combine; import org.apache.beam.sdk.transforms.DoFn; import org.apache.beam.sdk.transforms.PTransform; import org.apache.beam.sdk.transforms.ParDo; import org.apache.beam.sdk.transforms.SerializableFunction; import org.apache.beam.sdk.transforms.windowing.SlidingWindows; import org.apache.beam.sdk.transforms.windowing.Window; import org.apache.beam.sdk.values.KV; import org.apache.beam.sdk.values.PBegin; import org.apache.beam.sdk.values.PCollection;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/FloatArrayList.java,v 1.10 2003/08/31 17:21:14 scolebourne Exp $ * any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * @version $Revision: 1.10 $ $Date: 2003/08/31 17:21:14 $
0
@SuppressWarnings("resource") // BasicHttpClientConnectionManager
0
import java.util.Arrays; import java.util.Collection; import java.util.Collections;
0
/* $Id: FinderFromDfltMethod.java,v 1.5 2004/05/10 06:34:01 skitching Exp $ * Copyright 2004 The Apache Software Foundation.
0
final TupleTag<Integer> additionalOutputTag = new TupleTag<Integer>("extra") {}; c.output(additionalOutputTag, c.element()); .withOutputTags(emptyOutputTag, TupleTagList.of(additionalOutputTag))); PAssert.that(outputs.get(additionalOutputTag)).containsInAnyOrder(inputs);
0