Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
int bands = dstOut.getNumBands(); int y, i, b, val, max; for (y = y0; y<y1; y++) { for (i=0; i<srcPix.length; i++) { max=0; for (b=1; b<bands; b++, i++) { val =(int)((kk1*srcPix[i]*dstPix[i]) + k2*srcPix[i] + k3*dstPix[i] + kk4); if ((val & 0xFFFFFF00) != 0) if ((val & 0x80000000) != 0) val = 0; else val = 255; if (val > max) max=val; dstPix[i] = val; } if (val > max) dstPix[i] = val; else dstPix[i] = max; if (a < r) a = r; if (a < g) a = g; if (a < b) a = b; int a, r, g, b; srcP = srcPixels [srcSp++]; dstP = dstInPixels[dstInSp++]; a = lut[(((srcP>> 16)&0xFF00)|((dstP>>>24) ))]; a &= 0xFF; r = lut[(((srcP>> 8)&0xFF00)|((dstP>> 16)&0x00FF))]; r &= 0xFF; g = lut[(((srcP )&0xFF00)|((dstP>> 8)&0x00FF))]; g &= 0xFF; b = lut[(((srcP<< 8)&0xFF00)|((dstP )&0x00FF))]; b &= 0xFF; if (r>a) a = r; if (g>a) a = g; if (b>a) a = b; dstOutPixels[dstOutSp++] = (a<<24)|(r<<16)|(g<<8)|(b);
0
import static org.junit.Assert.assertEquals; import org.junit.Test; @Test @Test
1
.withFinalDelay(Duration.ofSeconds(2));
0
import org.apache.sshd.common.session.SessionContext; protected KeyPair reloadClientIdentity(SessionContext session, Path path) throws IOException, GeneralSecurityException { return super.reloadClientIdentity(session, path); KeyPair actualIdentity = provider.getClientIdentity(null);
0
* Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ * @version $Id: BooleanFieldDefinition.java,v 1.4 2004/03/05 13:02:31 bdelacretaz Exp $
1
public static final String VIEWINSTANCE_TABLE = "viewinstance"; public static final String SHORT_URL_COLUMN = "short_url"; updateViewInstanceEntityTable(); } private void updateViewInstanceEntityTable() throws SQLException { dbAccessor.addColumn(VIEWINSTANCE_TABLE, new DBColumnInfo(SHORT_URL_COLUMN, String.class, 255, null, true));
0
import java.util.Locale; paramName = paramName.toLowerCase(Locale.ENGLISH);
0
* @version $Revision: 1.18 $ if (opt.hasArg())
0
import java.io.DataInput; * Initialize instance from input data. * @param input input stream ConstantMethodref(DataInput input) throws IOException { super(Constants.CONSTANT_Methodref, input);
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.annotations.VisibleForTesting;
0
import org.testng.annotations.AfterTest; import static org.apache.atlas.repository.impexp.ZipFileResourceTestUtils.getDefaultImportRequest; import static org.apache.atlas.repository.impexp.ZipFileResourceTestUtils.getZipSource; import static org.apache.atlas.repository.impexp.ZipFileResourceTestUtils.loadModelFromJson; import static org.apache.atlas.repository.impexp.ZipFileResourceTestUtils.loadModelFromResourcesJson; import static org.apache.atlas.repository.impexp.ZipFileResourceTestUtils.runAndVerifyQuickStart_v1_Import; import static org.apache.atlas.repository.impexp.ZipFileResourceTestUtils.runImportWithNoParameters; import static org.apache.atlas.repository.impexp.ZipFileResourceTestUtils.runImportWithParameters; import static org.testng.Assert.assertFalse; public class ImportServiceTest extends ExportImportTestBase { private ExportImportAuditService auditService; @Inject @AfterTest public void postTest() { assertAuditEntry(auditService); } ImportService importService = new ImportService(typeDefStore, typeRegistry, null, null);
0
import org.apache.avalon.excalibur.i18n.ResourceManager; import org.apache.avalon.excalibur.i18n.Resources; private static final Resources REZ = ResourceManager.getPackageResources( AbstractFileSystem.class ); private FileObject parentLayer; final FileName rootName, final FileObject parentLayer ) this.parentLayer = parentLayer; /** * Retrives the attribute with the specified name. The default * implementation simply throws an exception. */ public Object getAttribute( String attrName ) throws FileSystemException { final String message = REZ.getString( "get-attribute-not-supported.error" ); throw new FileSystemException( message ); } /** * Sets the attribute with the specified name. The default * implementation simply throws an exception. */ public void setAttribute( String attrName, Object value ) throws FileSystemException { final String message = REZ.getString( "set-attribute-not-supported.error" ); throw new FileSystemException( message ); } /** * Returns the parent layer if this is a layered file system. */ public FileObject getParentLayer() throws FileSystemException { return parentLayer; }
0
FileSKVWriter writer = FileOperations.getInstance().openWriter(tempFile.toString(), fs, defaultConf, null, AccumuloConfiguration.getDefaultConfiguration());
1
buffer = session.createBuffer(SshConstants.SSH_MSG_USERAUTH_BANNER); buffer = session.createBuffer(SshConstants.SSH_MSG_USERAUTH_SUCCESS); buffer = session.createBuffer(SshConstants.SSH_MSG_USERAUTH_FAILURE); buffer = session.createBuffer(SshConstants.SSH_MSG_USERAUTH_FAILURE);
0
return "Metadata Tablets";
0
public synchronized boolean isParameterSetLocally(final String name) { public synchronized void clear() {
0
import org.apache.accumulo.fate.zookeeper.ZooCache;
0
package org.apache.felix.sigil.common.junit.server.impl; import org.apache.felix.sigil.common.junit.server.JUnitService;
0
return RowHelper.ShortCoder.of(); return RowHelper.FloatCoder.of(); return RowHelper.DoubleCoder.of(); return RowHelper.BooleanCoder.of(); return RowHelper.TimeCoder.of(); return RowHelper.DateCoder.of(); return RowHelper.DateCoder.of();
0
if (isKnopflerfish()) {
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
+ " [-w password] [-c cipherlist] [-m maclist] hostname/user@host");
0
import org.apache.accumulo.fate.zookeeper.ZooLock; import org.apache.accumulo.fate.zookeeper.ZooUtil;
0
import org.apache.http.impl.io.HttpTransportMetricsImpl; final HttpTransportMetricsImpl metrics, super(channel, buffer, metrics); if (bytesRead > 0) { this.metrics.incrementBytesTransferred(bytesRead); } if (bytesRead > 0) { this.metrics.incrementBytesTransferred(bytesRead); }
0
import org.apache.hc.core5.http.HeaderElements; import org.apache.hc.core5.util.Args; expectContinue = expect != null && HeaderElements.CONTINUE.equalsIgnoreCase(expect.getValue());
0
import org.apache.commons.jexl3.JexlException; public Object invoke(Object o, Object... args) throws IllegalAccessException, InvocationTargetException { } catch (InvocationTargetException xinvoke) { throw JexlException.tryFailed(xinvoke); // throw
0
import org.apache.log4j.Logger; private static final Logger LOG = Logger.getLogger(QuorumTest.class); LOG.warn("Setup finished"); LOG.warn("creating QuorumPeer 1"); LOG.warn("creating QuorumPeer 2"); LOG.warn("creating QuorumPeer 3"); LOG.warn("creating QuorumPeer 4"); LOG.warn("creating QuorumPeer 5"); LOG.warn("start QuorumPeer 1"); LOG.warn("start QuorumPeer 2"); LOG.warn("start QuorumPeer 3"); LOG.warn("start QuorumPeer 4"); LOG.warn("start QuorumPeer 5"); LOG.warn("started QuorumPeer 5"); LOG.warn("TearDown started");
0
public void testOnlySensitivePropertiesExtractedFromCredentialProvider() throws SecurityException, NoSuchMethodException { SiteConfiguration siteCfg = EasyMock.createMockBuilder(SiteConfiguration.class) .addMockedMethod("getHadoopConfiguration").createMock(); // site-cfg.jceks={'ignored.property'=>'ignored', 'instance.secret'=>'mysecret', // 'general.rpc.timeout'=>'timeout'} hadoopConf.set(CredentialProviderFactoryShim.CREDENTIAL_PROVIDER_PATH, "jceks://file" + keystorePath); Assert.assertEquals(Property.GENERAL_RPC_TIMEOUT.getDefaultValue(), props.get(Property.GENERAL_RPC_TIMEOUT.getKey()));
0
case KILLING:
0
* or more contributor license agreements. See the NOTICE file * regarding copyright ownership. The ASF licenses this file * with the License. You may obtain a copy of the License at * KIND, either express or implied. See the License for the
0
import org.apache.sshd.util.EchoShell; sshd = Utils.setupTestServer(); client = Utils.setupTestClient(); TestEchoShell.latch = new CountDownLatch(1); assertTrue("Session latch not signalled in time", latch.await(1L, TimeUnit.SECONDS)); assertTrue("Shell latch not signalled in time", TestEchoShell.latch.await(1L, TimeUnit.SECONDS)); } public static class TestEchoShell extends EchoShell { public static CountDownLatch latch; public TestEchoShell() { super(); } @Override public void destroy() { if (latch != null) { latch.countDown(); super.destroy(); Thread.sleep(TimeUnit.SECONDS.toMillis(5L)); byte[] data = "0123456789\n".getBytes(StandardCharsets.UTF_8); out.write(data); SshServer sshd = Utils.setupTestServer();
0
package org.apache.hc.core5.concurrent;
1
* @version $Revision$ $Date$
0
public final void addProperty(String key, Object value) addPropertyInternal(key, value); * Actually adds a property to this configuration. This method is called by * {@code addProperty()}. It performs list splitting if necessary and * delegates to {@link #addPropertyDirect(String, Object)} for every single * property value. * * @param key the key of the property to be added * @param value the new property value * @since 2.0 */ protected void addPropertyInternal(String key, Object value) { addPropertyValues(key, value, isDelimiterParsingDisabled() ? DISABLED_DELIMITER : getListDelimiter()); } /**
0
Utils.unreserveTable(cloneInfo.srcTableId, tid, false); Utils.unreserveTable(cloneInfo.tableId, tid, true); Utils.unreserveTable(cloneInfo.tableId, tid, true); public CloneTable(String user, String srcTableId, String tableName, Map<String,String> propertiesToSet, Set<String> propertiesToExclude) { Instance inst = HdfsZooInstance.getInstance(); Utils.unreserveTable(cloneInfo.srcTableId, tid, false);
0
* * * * @version $Revision: 1.4 $
1
public void clear() { this.properties.clear(); }
0
* @author Gary D. Gregory * @version $Id: Shell.java,v 1.5 2003/11/28 17:27:16 ggregory Exp $ /** * Does a 'cd' command. * If the taget directory does not exist, a message is printed to <code>System.err</code>. */ private void cd(final String[] cmd) throws Exception { if (cmd.length > 1) { path = cmd[1]; } else { path = System.getProperty("user.home"); FileObject tmp = mgr.resolveFile(cwd, path); if (tmp.exists()) { cwd = tmp; } else { System.out.println("Folder does not exist: " + tmp.getName()); } System.out.println("Current folder is " + cwd.getName());
0
* @version $Id$
0
* @version CVS $Id: ParserTransformerTestCase.java,v 1.3 2003/04/17 07:36:25 stephan Exp $ /*public void testParserTransformer3() { }*/
0
Vector<URL> results = new Vector<>();
0
public class TestProtocolRequirements extends AbstractProtocolTest {
0
@SuppressWarnings("OctalInteger")
0
if (null == method) { c = sb.charAt(2); if (Character.isLowerCase(c)) { sb.setCharAt(2, Character.toUpperCase(c)); } else { sb.setCharAt(2, Character.toLowerCase(c)); } methodUsed = sb.toString(); method = introspector.getMethod(clazz, methodUsed, params); } /** * pass through application level runtime exceptions */ } catch( RuntimeException e ) { throw e; rlog.error("PROGRAMMER ERROR : BooleanPropertyExector() : " + e, e);
0
import org.apache.accumulo.core.iterators.user.RegExFilter; IteratorSetting more = new IteratorSetting(20 + i, "ii" + i, RegExFilter.class); RegExFilter.setRegexs(more, null, null, null, "(^|(.*\\s))" + words[i] + "($|(\\s.*))", false);
0
import org.apache.accumulo.core.client.Accumulo; try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) { try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) {
0
if (!sourceIter.hasTop())
0
import org.apache.sshd.common.channel.ChannelHolder; public interface SubsystemClient extends SessionHolder<ClientSession>, ClientSessionHolder, NamedResource, ChannelHolder, Channel {
0
* @version $Id: SoundexTest.java,v 1.20 2004/10/08 22:56:22 ggregory Exp $ return new TestSuite(SoundexTest.class);
0
import org.apache.commons.net.io.CopyStreamEvent; Util.copyStream(local, output, Util.DEFAULT_COPY_BUFFER_SIZE, CopyStreamEvent.UNKNOWN_STREAM_SIZE, null, false); Util.copyStream(input, local, Util.DEFAULT_COPY_BUFFER_SIZE, CopyStreamEvent.UNKNOWN_STREAM_SIZE, null, false);
0
public boolean isValid(final int timeoutSeconds) throws SQLException { return connection.isValid(timeoutSeconds);
0
import org.apache.sshd.common.NamedResource; SessionContext session, NamedResource resourceKey, SessionContext session, NamedResource resourceKey, public List<KeyPair> extractKeyPairs(NamedResource resourceKey, Collection<? extends Subkey> subKeys) public PublicKey extractPublicKey(NamedResource resourceKey, Subkey sk) throws IOException, GeneralSecurityException { public RSAPublicKey extractRSAPublicKey(NamedResource resourceKey, RSAPublicBCPGKey bcKey) throws GeneralSecurityException { public PublicKey extractECPublicKey(NamedResource resourceKey, ECPublicBCPGKey bcKey) throws GeneralSecurityException { public ECPublicKey extractECDSAPublicKey(NamedResource resourceKey, ECDSAPublicBCPGKey bcKey) throws GeneralSecurityException { public PublicKey extractEdDSAPublicKey(NamedResource resourceKey, EdDSAPublicBCPGKey bcKey) throws GeneralSecurityException { public DSAPublicKey extractDSSPublicKey(NamedResource resourceKey, DSAPublicBCPGKey bcKey) throws GeneralSecurityException { public PrivateKey extractPrivateKey(NamedResource resourceKey, Subkey sk, PublicKey pubKey) public ECPrivateKey extractECDSAPrivateKey(NamedResource resourceKey, ECPublicKey pubKey, ECSecretBCPGKey bcKey) public PrivateKey extractEdDSAPrivateKey(NamedResource resourceKey, PublicKey pubKey, EdSecretBCPGKey bcKey) public RSAPrivateKey extractRSAPrivateKey(NamedResource resourceKey, RSAPublicKey pubKey, RSASecretBCPGKey bcKey) public DSAPrivateKey extractDSSPrivateKey(NamedResource resourceKey, DSAPublicKey pubKey, DSASecretBCPGKey bcKey)
0
import org.apache.hc.core5.http.HttpResponse; import org.apache.hc.core5.http.HttpStatus; import org.apache.hc.core5.http.HttpVersion; import org.apache.hc.core5.http.message.BasicHttpResponse;
0
package org.apache.ambari.server.audit.request.eventcreator;
1
* @author <a href="mailto:[email protected]">Felix Project Team</a>
0
AtlasSearchResult searchResult = atlasClientV2.dslSearch(dslQuery); AtlasSearchResult searchResult = atlasClientV2.dslSearch(dslQuery); searchResult = atlasClientV2.dslSearchWithParams(dslQuery, 10, 0); searchResult = atlasClientV2.dslSearchWithParams(dslQuery, -1, -1); searchResult = atlasClientV2.dslSearchWithParams(dslQuery, 1, 0); searchResult = atlasClientV2.dslSearchWithParams(dslQuery, 10, 1); searchResult = atlasClientV2.dslSearchWithParams(dslQuery, 0, 10); searchResult = atlasClientV2.dslSearchWithParams(dslQuery, Integer.MAX_VALUE, 10); searchResult = atlasClientV2.dslSearchWithParams(dslQuery, 10, -2); atlasClientV2.dslSearch(dslQuery); AtlasSearchResult searchResult = atlasClientV2.dslSearch(query); AtlasSearchResult searchResult = atlasClientV2.fullTextSearch(query); AtlasSearchResult searchResult = atlasClientV2.fullTextSearchWithParams(dbName, 10, 0); searchResult = atlasClientV2.fullTextSearch(query); searchResult = atlasClientV2.fullTextSearchWithParams(query, 10, 0); searchResult = atlasClientV2.fullTextSearchWithParams(query, 10, 1); searchResult = atlasClientV2.fullTextSearchWithParams(query, 1, 0); searchResult = atlasClientV2.fullTextSearchWithParams(query, 1, 2);
0
public class HostTest { registerHost(host, true); } private void registerHost(Host host, boolean firstReg) throws Exception { if (!firstReg) { Assert.assertTrue(host.isPersisted()); } Host host = clusters.getHost("foo"); host.setIPv4("ipv4"); host.setIPv6("ipv6"); registerHost(host, false); registerHost(host, false); registerHost(host, false); registerHost(host, false); registerHost(host, false);
0
Mockito.any(String.class)))
0
String propsPath = getPropertiesPath(); siteConfig = (propsPath == null ? SiteConfiguration.fromEnv() : SiteConfiguration.fromFile(new File(propsPath))).withOverrides(getOverrides()).build();
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.txt file. */ package org.apache.commons.vfs; /** * A {@link FileSelector} that selects files of a particular type. * * @author <a href="mailto:[email protected]">Adam Murdoch</a> * @version $Revision: 1.1 $ $Date: 2002/10/23 10:56:32 $ */ public class FileTypeSelector implements FileSelector { private final FileType type; public FileTypeSelector( final FileType type ) { this.type = type; } /** * Determines if a file or folder should be selected. */ public boolean includeFile( final FileSelectInfo fileInfo ) throws FileSystemException { return ( fileInfo.getFile().getType() == type ); } /** * Determines whether a folder should be traversed. */ public boolean traverseDescendents( final FileSelectInfo fileInfo ) { return true; } }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/tags/core/ExprTag.java,v 1.9 2002/06/11 21:41:11 jstrachan Exp $ * $Revision: 1.9 $ * $Date: 2002/06/11 21:41:11 $ * $Id: ExprTag.java,v 1.9 2002/06/11 21:41:11 jstrachan Exp $ * @tag out * @version $Revision: 1.9 $ /** * Sets the Jexl expression to evaluate. * * @required true */
0
protected final Logger log = Logger.getLogger(this.getClass()); public abstract void setUp(State state) throws Exception; public abstract void tearDown(State state) throws Exception;
1
* A {@link StreamObserver} which uses synchronization on the underlying {@link CallStreamObserver} * to provide thread safety. * which waits for advancement of the phase if the {@link CallStreamObserver} is not ready. Creator * is expected to advance the {@link Phaser} whenever the underlying {@link CallStreamObserver} * becomes ready. public DirectStreamObserver(Phaser phaser, CallStreamObserver<T> outboundObserver) { Phaser phaser, CallStreamObserver<T> outboundObserver, int maxMessagesBeforeCheck) { + "https://issues.apache.org/jira/browse/BEAM-4280 for the history for " + "this issue.",
1
import org.apache.avalon.framework.service.ServiceException; import org.apache.avalon.framework.service.ServiceManager; * @version $Id: GenericProxyGenerator.java,v 1.2 2003/09/04 09:38:37 cziegeler Exp $ public class GenericProxyGenerator extends ServiceableGenerator { public void service(ServiceManager manager) throws ServiceException { super.service(manager); this.parser = (SAXParser)manager.lookup(SAXParser.ROLE); * Dispose */ public void dispose() { if ( this.manager != null ) { this.manager.release( this.parser ); this.parser = null; } super.dispose(); } /**
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
StringBuilder buffer = new StringBuilder();
0
* Empty constructor needed for Instruction.readInstruction. * Not to be used otherwise.
0
import org.slf4j.Logger; import org.slf4j.LoggerFactory; private static final Logger log = LoggerFactory.getLogger(BloomFilter.class);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/jelly-tags/jms/src/java/org/apache/commons/jelly/tags/jms/ConnectionTag.java,v 1.2 2003/01/26 06:24:47 morgand Exp $ * $Revision: 1.2 $ * $Date: 2003/01/26 06:24:47 $ * $Id: ConnectionTag.java,v 1.2 2003/01/26 06:24:47 morgand Exp $ import javax.jms.JMSException; import org.apache.commons.jelly.JellyTagException; * @version $Revision: 1.2 $ public void doTag(XMLOutput output) throws JellyTagException { try { connection = MessengerManager.get( name ); } catch (JMSException e) { throw new JellyTagException(e); } throw new JellyTagException( "Could not find a JMS connection called: " + name );
0
/* * public static HandlerFactory[] getHandlerFactories(BundleContext bc) { ServiceReference[] refs; try { refs = bc.getServiceReferences(HandlerFactory.class.getName(), null); if (refs == null) { System.err.println("Cannot get the handler factories"); return null; } HandlerFactory[] factories = new HandlerFactory[refs.length]; for (int i = 0; i < factories.length; i++) { factories[i] = (HandlerFactory) bc.getService(refs[i]); } return factories; } catch (InvalidSyntaxException e) { return null; } }
0
import org.apache.beam.sdk.loadtests.metrics.ByteMonitor; pipeline.apply("Read input", SyntheticBoundedIO.readFrom(sourceOptions)); input = input.apply("Collect start time metrics (input)", ParDo.of(runtimeMonitor)); applyStepIfPresent(input, "Synthetic step for input", syntheticStep); pipeline.apply("Read co-input", SyntheticBoundedIO.readFrom(coSourceOptions)); coInput = coInput.apply("Collect start time metrics (co-input)", ParDo.of(runtimeMonitor)); applyStepIfPresent(coInput, "Synthetic step for co-input", syntheticStep); .apply( "Collect total bytes", ParDo.of(new ByteMonitor(METRICS_NAMESPACE, "totalBytes.count"))) .apply("Collect end time metrics", ParDo.of(runtimeMonitor));
0
* Copyright 2000-2009 The Apache Software Foundation
0
protected void setParameters(HttpUrlMethod method) { ((UrlPostMethod) method).addParameter(parameter);
0
@org.apache.felix.ipojo.handlers.event.Publisher(name="p2", synchronous=false, topics="foo,bar", dataKey="data") @Subscriber(name="s1", dataKey="data") @Subscriber(name="s3", topics="foo", dataKey="data", dataType="java.lang.String")
0
// Ignore trailing whitespace. for (int ch = lexer.get(); ch != EOF; ch = lexer.get()) if (!Character.isWhitespace(ch)) { throw new ParseException( "expected <EOF>; found '" + ((char) ch) + "'"); }
0
input -> { Iterator<KV<String, Long>> inputIterator = input.iterator(); // first element long count0 = inputIterator.next().getValue(); // window duration is 6 and batch size is 5, so there should be 2 elements in the // window (flush because batchSize reached and for end of window reached) assertEquals("Wrong number of elements in first window", 2, count0); // second element long count1 = inputIterator.next().getValue(); // collection is 10 elements, there is only 4 elements left, so there should be only // one element in the window (flush because end of window/collection reached) assertEquals("Wrong number of elements in second window", 1, count1); // third element return null; input -> { Iterator<KV<String, Iterable<String>>> inputIterator = input.iterator(); // first element int size0 = Iterables.size(inputIterator.next().getValue()); // window duration is 6 and batch size is 5, so output batch size should de 5 // (flush because of batchSize reached) assertEquals("Wrong first element batch Size", 5, size0); // second element int size1 = Iterables.size(inputIterator.next().getValue()); // there is only one element left in the window so batch size should be 1 // (flush because of end of window reached) assertEquals("Wrong second element batch Size", 1, size1); // third element int size2 = Iterables.size(inputIterator.next().getValue()); // collection is 10 elements, there is only 4 left, so batch size should be 4 // (flush because end of collection reached) assertEquals("Wrong third element batch Size", 4, size2); return null;
0
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ @SuppressWarnings("all") public class Range implements org.apache.thrift.TBase<Range, Range._Fields>, java.io.Serializable, Cloneable { @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0
@Category({ValidatesRunner.class}) @Category({ValidatesRunner.class}) @Category({ValidatesRunner.class, UsesFailureMessage.class}) @Category({ValidatesRunner.class, UsesFailureMessage.class})
0
TraceWrap.service(new MasterReplicationCoordinator(this)));
0
* Standard and common HTTP cookie management policies.
0
public Class<?>[] getExceptions() { Class<?>[] cs = new Class[1 + ExceptionConstants.EXCS_CLASS_AND_INTERFACE_RESOLUTION.length];
0
ErrorContainer<T> errorContainer, boolean skipInvalidRows, boolean ignoreUnknownValues)
0
* Copyright 2003-2005 The Apache Software Foundation
0
import java.util.Set;
0
import org.apache.accumulo.core.client.sample.RowSampler; import org.apache.accumulo.core.client.sample.Sampler;
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.manipulator.metadata.annotation.model.literal.types; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * User: guillaume * Date: 09/07/13 * Time: 10:15 */ @Retention(RetentionPolicy.RUNTIME) public @interface InnerAnnotation { String aString() default "42"; Class[] arrayOfClass() default {}; Mode modeEnum() default Mode.IN; }
0
import org.apache.atlas.model.legacy.EntityResult; import org.apache.atlas.typesystem.types.*; import org.springframework.stereotype.Component; import java.util.Set; @Component final Set<TypesChangeListener> typesChangeListeners, final Set<EntityChangeListener> entityChangeListeners, final TypeSystem typeSystem, final Configuration configuration, TypeCache typeCache, EntityAuditRepository auditRepository) throws AtlasException { this.typeChangeListeners.addAll(typesChangeListeners); this.entityChangeListeners.addAll(entityChangeListeners); this.auditRepository = auditRepository; @Override private void onEntitiesAddedUpdated(EntityResult entityResult) throws AtlasException { .checkArgument(!getTraitNames(guid).contains(traitName), "trait=%s is already defined for entity=%s", traitName, guid); throws AtlasException { public EntityResult deleteEntities(List<String> deleteCandidateGuids) throws AtlasException { public EntityResult deleteEntityByUniqueAttribute(String typeName, String uniqueAttributeName, String attrValue) throws AtlasException { private EntityResult deleteGuids(List<String> deleteCandidateGuids) throws AtlasException { EntityResult entityResult = repository.deleteEntities(deleteCandidateGuids);
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
void setParams(HttpParams params);
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.hive.persistence.utils; public interface PersonalResource extends Indexed, Owned { }
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 * * 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.server.api.predicate.expressions; import org.apache.ambari.server.api.predicate.operators.RelationalOperator; import org.apache.ambari.server.controller.spi.Predicate; /** * Relational Expression. * Consists of a property name for the left operand, a relational operator * and a value as the right operand. */ public class RelationalExpression extends AbstractExpression<String> { /** * Constructor. * * @param op relational operator */ public RelationalExpression(RelationalOperator op) { super(op); } @Override public Predicate toPredicate() { return ((RelationalOperator) getOperator()). toPredicate(getLeftOperand(), getRightOperand()); } @Override public String toString() { return "RelationalExpression{ property='" + getLeftOperand() + "\', value='" + getRightOperand() + "\', op=" + getOperator() + " }"; } }
0
serviceRequests.add(new ServiceRequest(clusterName, service, stackId.getStackId(), repositoryVersion, null, credentialStoreEnabled));
0
if (!StatusUtil.isSafeForRemoval(pendingReplica.getValue())) {
0
* any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * permission of the Apache Software Foundation.
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/adapters/Attic/AbstractListIntList.java,v 1.2 2003/08/31 17:21:17 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.2 $ $Date: 2003/08/31 17:21:17 $
0
* Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ * @version CVS $Id: DatabaseReader.java,v 1.5 2004/03/05 13:01:55 bdelacretaz Exp $
1
entity.setSource("{\"type\" : \"METRIC\"}");
0
int DEFAULT_BACKLOG = 0;
1
import org.apache.zookeeper.metrics.Counter; public class SimpleCounter extends Metric implements Counter { public long get() { m.put(name, this.get());
0