Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
import static org.testng.Assert.assertEquals; //API should accept single entity (or jsonarray of entities) public void testEntityDeduping() throws Exception { Referenceable db = new Referenceable(DATABASE_TYPE); String dbName = "db" + randomString(); db.set("name", dbName); db.set("description", randomString()); serviceClient.createEntity(db); JSONArray results = serviceClient.searchByDSL(String.format("%s where name='%s'", DATABASE_TYPE, dbName)); assertEquals(results.length(), 1); //create entity again shouldn't create another instance with same unique attribute value serviceClient.createEntity(db); results = serviceClient.searchByDSL(String.format("%s where name='%s'", DATABASE_TYPE, dbName)); assertEquals(results.length(), 1); //Test the same across references Referenceable table = new Referenceable(HIVE_TABLE_TYPE); final String tableName = randomString(); table.set("name", tableName); table.set("db", db); serviceClient.createEntity(table); results = serviceClient.searchByDSL(String.format("%s where name='%s'", DATABASE_TYPE, dbName)); assertEquals(results.length(), 1); } @Test
0
private List<String> hosts = new ArrayList<>();
0
import org.apache.atlas.model.impexp.AtlasExportRequest; import org.apache.atlas.model.typedef.AtlasClassificationDef; import org.apache.atlas.model.typedef.AtlasEntityDef; import org.apache.atlas.model.typedef.AtlasEnumDef; import org.apache.atlas.model.typedef.AtlasStructDef; import org.apache.atlas.utils.TestResourceFileUtils; import java.io.IOException; @Test public void deleteTypeByName() throws IOException { try { final String HIVEDB_v2_JSON = "hiveDBv2"; final String hiveDB2 = "hive_db_v2"; AtlasTypesDef typesDef = TestResourceFileUtils.readObjectFromJson(".", HIVEDB_v2_JSON, AtlasTypesDef.class); typeDefStore.createTypesDef(typesDef); typeDefStore.deleteTypeByName(hiveDB2); } catch (AtlasBaseException e) { fail("Deletion should've succeeded"); } }
0
* Check how short date is interpreted at a given time. * Check both with and without lenient future dates checkShortParse(msg, now, input, true); * Check only using specified lenient future dates setting parser.setLenientFutureDates(lenient); public void testParseJan01() throws Exception { GregorianCalendar now = new GregorianCalendar(2007, Calendar.JANUARY, 1, 12, 0); checkShortParse("2007-01-01",now,now); // should always work GregorianCalendar target = new GregorianCalendar(2006, Calendar.DECEMBER, 31, 12, 0); checkShortParse("2006-12-31",now,target, true); checkShortParse("2006-12-31",now,target, false); }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//io/src/test/org/apache/commons/io/FileUtilsTestCase.java,v 1.9 2003/12/30 07:00:03 bayard Exp $ * $Revision: 1.9 $ * $Date: 2003/12/30 07:00:03 $ * @version $Id: FileUtilsTestCase.java,v 1.9 2003/12/30 07:00:03 bayard Exp $ public class FileUtilsTestCase extends FileBasedTestCase { private static int TEST_DIRECTORY_SIZE = 0; private File testFile1; private File testFile2; public FileUtilsTestCase(String name) throws IOException { File[] files = new File[] { new File("file1"), new File("file2")}; URL[] urls = FileUtils.toURLs(files); File file = new File(getTestDirectory(), getName()); File objFile1 = File objFile2 = File file = new File(getTestDirectory(), getName()); String resourceName = "/java/lang/Object.class"; FileInputStream fis = new FileInputStream(file); File testFile = new File(getTestDirectory(), getName()); File file = new File(getTestDirectory(), getName()); private void log(Object obj) { File destination = new File(getTestDirectory(), "copy1.txt"); File destination = new File(getTestDirectory(), "copy2.txt"); File destination = new File(getTestDirectory(), "copy1.txt"); File destination = new File(getTestDirectory(), "copy2.txt"); File directory = new File(getTestDirectory(), "subdir"); File destination = new File(directory, testFile1.getName()); File directory = new File(getTestDirectory(), "subdir"); File destination = new File(directory, testFile1.getName()); String path = "/test.txt"; URL url = this.getClass().getResource(path); String filename2 = "test2.txt"; String file2contents = FileUtils.readFileToString(new File(filename2), "UTF-8"); String contents = FileUtils.readFileToString(new File(filename), "UTF-8");
0
import org.apache.hadoop.metrics2.MetricType; timelineMetricsCache.putTimelineMetric(metric, MetricType.COUNTER); timelineMetricsCache.putTimelineMetric(metric, MetricType.COUNTER); timelineMetricsCache.putTimelineMetric(metric, MetricType.COUNTER); timelineMetricsCache.putTimelineMetric(metric, MetricType.COUNTER);
0
if (propagateTags != null && propagateTags && classification.getEntityGuid() != null && !StringUtils.equals(classification.getEntityGuid(), guid)) { continue; } if (classification.getEntityGuid() == null) { classification.setEntityGuid(guid); } // ignore propagated classifications
0
import org.apache.beam.vendor.guava.v20_0.com.google.common.io.BaseEncoding;
0
Map<Resource.Type,String> mapIds = new HashMap<>();
1
public Iterator getKeys(String prefix) return new PrefixedKeysIterator(getKeys(), prefix);
0
* @version $Revision$
0
@Override
0
PropertyMetaData[] metadata() default {};
0
private static final String SERVICE_COMPONENT = "Service-Component"; private String serviceComponent; if ( getServiceComponent() != null ) { entries.put( SERVICE_COMPONENT, getServiceComponent() ); } public String getServiceComponent() { return serviceComponent; } public void setServiceComponent( String serviceComponent ) { this.serviceComponent = serviceComponent; }
0
* <p> * Unit tests that exercise the new (in 1.8) methods for passing in <code>URL</code> arguments instead of strings. * </p> public class URLTestCase { public void setUp() { public void tearDown() { * <p> * Public identifier of the Digester Rules DTD. * </p> private static final String DIGESTER_RULES_PUBLIC_ID = "-//Jakarta Apache //DTD digester-rules XML V1.0//EN"; * <p> * System identifier of the Digester Rules DTD. * </p> private static final String DIGESTER_RULES_SYSTEM_ID = "/org/apache/commons/digester3/xmlrules/digester-rules.dtd"; * <p> * System identifier for the Digester Rules file that we will parse. * </p> "/org/apache/commons/digester3/xmlrules/test-call-param-rules.xml"; * <p> * The <code>Digester</code> instance under test. * </p> public void testPristine() { assertNotNull( digester ); public void testResource() throws Exception { URL dtd = URLTestCase.class.getResource( DIGESTER_RULES_SYSTEM_ID ); assertNotNull( dtd ); digester.register( DIGESTER_RULES_PUBLIC_ID, dtd ); URL xml = URLTestCase.class.getResource( TEST_INPUT_SYSTEM_ID ); assertNotNull( xml ); digester.parse( xml ); digester.parse( xml );
1
* @revision $Revision: 1.2 $ $Date: 2001/09/05 03:33:26 $ * @param identifier Used to tell which TestRule is which /** * Constructor sets namespace URI. * * @param digester The digester with which this rule is associated * @param identifier Used to tell which TestRule is which * @param namespaceURI Set rule namespace */ public TestRule(Digester digester, String identifier, String namespaceURI) { super(digester); this.identifier = identifier; setNamespaceURI(namespaceURI); }
0
* <li>{@code resourceId.resolve("*", StandardResolveOptions.RESOLVE_FILE)} returns a {@code * ResourceId} which matches all files in this {@code ResourceId}. * <li>{@code resourceId.resolve("*", StandardResolveOptions.RESOLVE_DIRECTORY)} returns a * {@code ResourceId} which matches all directories in this {@code ResourceId}.
0
Map<String,Set<Text>> groups = new TreeMap<>(); Map<String,Set<Text>> groups = new TreeMap<>(); Set<Text> cols = new HashSet<>();
1
import org.apache.atlas.model.TypeCategory; private final TypeCategory category; protected AtlasBaseTypeDef(TypeCategory category, String name, String description, String typeVersion) { this.category = category; protected AtlasBaseTypeDef(AtlasBaseTypeDef other) { this.category = other.category; this.category = TypeCategory.PRIMITIVE; public TypeCategory getCategory() { return category; } sb.append("category='").append(category).append('\''); sb.append(", guid='").append(guid).append('\''); if (category != null ? !category.equals(that.category) : that.category != null) { return false; } int result = category != null ? category.hashCode() : 0; result = 31 * result + (guid != null ? guid.hashCode() : 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
0
@Deprecated
0
.setIsService(true) .setIsService(true)
0
import org.apache.commons.lang.NumberUtils; return NumberUtils.createNumber(str);
0
import org.apache.accumulo.core.security.Credentials; public MultiTableBatchWriterImpl(Instance instance, Credentials credentials, BatchWriterConfig config) { @Override @Override
0
.withName( element.getName() );
0
/* $Id$
0
import org.apache.avalon.framework.container.ContainerUtil; protected LibraryManager libraryManager; this.libraryManager = new LibraryManagerImpl(); /** * @see org.apache.avalon.framework.logger.AbstractLogEnabled#enableLogging(org.apache.avalon.framework.logger.Logger) */ ContainerUtil.enableLogging(this.libraryManager, getLogger().getChildLogger("library")); /** * @see org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context) */ ContainerUtil.contextualize(this.libraryManager, avalonContext); /** * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager) */ ContainerUtil.service(this.libraryManager, new FormServiceManager()); /** * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) */ ContainerUtil.configure(this.libraryManager, configuration.getChild("libraries")); /** * @see org.apache.avalon.framework.activity.Disposable#dispose() */ if (this.libraryManager != null) { ContainerUtil.dispose(this.libraryManager);
0
public ByteSequence getTerm(byte[] expression) {
0
public enum ClusterStateFSM {
0
final String fileString = file.toString(); Assert.assertEquals(fileString, TEST_DATA.length(), ra.length()); Assert.assertEquals(fileString, 1, ra.length()); Assert.assertEquals(fileString, ra.readByte(), TEST_DATA.charAt(0)); Assert.assertEquals(fileString, 2, ra.length());
0
import org.apache.cocoon.core.container.spring.avalon.ComponentInfo; import org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo; * @see org.apache.cocoon.CocoonTestCase#addComponents(org.apache.cocoon.core.container.spring.avalon.ConfigurationInfo)
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
package org.apache.felix.karaf.features; import java.util.EventObject; public class FeatureEvent extends EventObject { public static enum EventType { FeatureInstalled, FeatureUninstalled } private final EventType type; private final Feature feature; private final boolean replay; public FeatureEvent(Feature feature, EventType type, boolean replay) { super(feature); this.type = type; this.feature = feature; this.replay = replay; } public EventType getType() { return type; } public Feature getFeature() { return feature; } public boolean isReplay() { return replay; }
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.visitor.generic; import org.apache.felix.ipojo.manipulator.metadata.annotation.ComponentWorkbench; import org.apache.felix.ipojo.metadata.Attribute; import org.apache.felix.ipojo.metadata.Element; import org.objectweb.asm.tree.FieldNode; import java.lang.annotation.ElementType; /** * @author <a href="mailto:[email protected]">Felix Project Team</a> */ public class FieldGenericVisitor extends RootGenericVisitor { public FieldGenericVisitor(ComponentWorkbench workbench, Element element, FieldNode node) { super(workbench, element, ElementType.FIELD); element.addAttribute(new Attribute("field", node.name)); } }
0
import org.apache.batik.dom.anim.AnimatableElement;
0
File repository = new File(System.getProperty("java.io.tmpdir"), "file"); File repository = new File(System.getProperty("java.io.tmpdir"), "\0");
0
app.setTypeId(value.toUpperCase() + "-" + app.getAppVersion()); app.setTypeId(app.getType() + "-" + value); app.setTypeId(appType.getId()); appType.setId(application.getName() + "-" + application.getVersion()); final String appTypeId = json.get("typeName").getAsString(); SliderAppType sliderAppType = getSliderAppType(appTypeId, null); saveAppConfigs(configs, componentsArray, appName, sliderAppType.getTypeName(), securityEnabled, appConfigJsonFile); installArgs.name = sliderAppType.getTypeName(); for (String keytab : getUserToRunAsKeytabs(sliderAppType.getTypeName())) {
0
// work from sufficiently privilages code. // search through all methods
0
package org.apache.felix.inventory.impl.webconsole;
0
import static org.junit.Assert.fail; }
0
String message = "sideOutput is an unsupported operation for doFunctions, use a " + "MultiDoFunction instead."; "sideOutputWithTimestamp is an unsupported operation for doFunctions, use a " + "MultiDoFunction instead.";
0
* a different <code>ServiceManager</code>.
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.
0
* @since 1.8.0 * @since 1.8.0 * @since 1.8.0 * @since 1.8.0
0
boolean isZKServerRunning() { return zkServer == null || !zkServer.isRunning(); }
1
import org.apache.hc.core5.http.ssl.TLS; import org.apache.hc.core5.http.ssl.TlsCiphers; sslParameters.setProtocols(TLS.excludeWeak(sslParameters.getProtocols())); sslParameters.setCipherSuites(TlsCiphers.excludeH2Blacklisted(sslParameters.getCipherSuites()));
0
public interface FieldValueSetterFactory extends Factory<List<FieldValueSetter>> { @Override List<FieldValueSetter> create(Class<?> targetClass, Schema schema);
0
/* * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cocoon.servlet.multipart; /** * Exception thrown when on a parse error such as * a malformed stream. * * @version $Id$ */ public class MultipartException extends Exception { /** * Constructor MultipartException */ public MultipartException() { super(); } /** * Constructor MultipartException * * @param text */ public MultipartException(String text) { super(text); } }
0
try (BatchWriter bw = c.createBatchWriter(tableName)) { bw.addMutation(m); }
0
content = new DefaultFileContent(this, getFileContentInfoFactory()); protected FileContentInfoFactory getFileContentInfoFactory() return getFileSystem().getFileSystemManager().getFileContentInfoFactory();
0
* $Revision: 1.11 $ * $Date: 2003/10/09 21:04:44 $ * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * permission of the Apache Software Foundation. * @version $Id: PoolingDataSource.java,v 1.11 2003/10/09 21:04:44 rdonkin Exp $
0
final boolean removed = Runtime.getRuntime().removeShutdownHook( } catch (final InterruptedException ie) { final boolean processRemoved = processes.removeElement(process); final Enumeration e = processes.elements(); final Process process = (Process) e.nextElement(); catch (final Throwable t) {
0
private Comparators(){ // constructor hiden from potential users }
0
private JobConfiguration fetchJob(String managerId, String jobKey) {
0
import static org.apache.beam.vendor.guava.v20_0.com.google.common.base.Preconditions.checkArgument; import org.apache.beam.vendor.guava.v20_0.com.google.common.base.Joiner;
0
import org.apache.beam.sdk.annotations.Experimental; import org.apache.beam.sdk.transforms.SerializableFunction; import org.apache.beam.sdk.values.Row; @Experimental /** * Given atype, return a function that converts that type to a {@link Row} object. */ public abstract <T> SerializableFunction<T, Row> toRowFunction(TypeDescriptor<T> typeDescriptor); /** * Given a type, returns a function that converts from a {@link Row} object to that type. */ public abstract <T> SerializableFunction<Row, T> fromRowFunction( TypeDescriptor<T> typeDescriptor);
0
/* * $Header: /cvshome/build/ee.foundation/src/java/io/BufferedReader.java,v 1.6 2006/03/14 01:20:23 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.io; public class BufferedReader extends java.io.Reader { public BufferedReader(java.io.Reader var0) { } public BufferedReader(java.io.Reader var0, int var1) { } public void close() throws java.io.IOException { } public void mark(int var0) throws java.io.IOException { } public boolean markSupported() { return false; } public int read() throws java.io.IOException { return 0; } public int read(char[] var0, int var1, int var2) throws java.io.IOException { return 0; } public java.lang.String readLine() throws java.io.IOException { return null; } public boolean ready() throws java.io.IOException { return false; } public void reset() throws java.io.IOException { } public long skip(long var0) throws java.io.IOException { return 0l; } }
0
* * <pre>{@code * PCollection<MyRecord> records = * foo.apply(...).setCoder(WritableCoder.of(MyRecord.class)); * }</pre> * throw new NonDeterministicException(this, "Hadoop Writable may be non-deterministic."); * Returns a {@link CoderProvider} which uses the {@link WritableCoder} for Hadoop {@link Writable * writable types}. /** A {@link CoderProvider} for Hadoop {@link Writable writable types}. */ public <T> Coder<T> coderFor( TypeDescriptor<T> typeDescriptor, List<? extends Coder<?>> componentCoders) throws CannotProvideCoderException { WritableCoder.class.getSimpleName(), typeDescriptor, Writable.class.getName()));
1
import org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO;
0
import org.apache.cocoon.portal.services.PortalManager;
0
/** the maximum number of entries allowed for this pool */ protected final int maxEntries; * @param route the route for which to pool * @param maxEntries the maximum number of entries allowed for this pool public RouteSpecificPool(HttpRoute route, int maxEntries) { this.maxEntries = maxEntries; /** * Obtains the maximum number of entries allowed for this pool. * * @return the max entry number */ public final int getMaxEntries() { return maxEntries; } public BasicPoolEntry allocEntry(final Object state) {
0
v.visitConstantMethodType(this);
0
// input.setCanonicalizerURI(Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS);
0
@Nullable return getTable( new TableReference().setProjectId(projectId).setDatasetId(datasetId).setTableId(tableId), Sleeper.DEFAULT); } @VisibleForTesting @Nullable Table getTable(TableReference ref, BackOff backoff, Sleeper sleeper) throws IOException, InterruptedException { try { return executeWithRetries( client.tables().get(ref.getProjectId(), ref.getDatasetId(), ref.getTableId()), String.format( "Unable to get table: %s, aborting after %d retries.", ref.getTableId(), MAX_RPC_RETRIES), sleeper, backoff, DONT_RETRY_NOT_FOUND); } catch (IOException e) { if (errorExtractor.itemNotFound(e)) { return null; } throw e; }
0
* Evaluates the given key and finds the corresponding child node of the * root node of the specified tree data object. This is a convenience method * that works like the method with the same name, but obtains the root node * from the given data object. * * @param td the {@code TreeData} instance * @param key the key to the desired node * @return the found target node * @throws NoSuchElementException if the desired node cannot be found */ public static ImmutableNode nodeForKey(TreeData td, String key) { return nodeForKey(td.getRoot(), key); } /**
0
public StringMap getIdentifiers() {
0
import org.junit.After; import org.junit.Before; @Before public void setUpTest() throws Exception { TestByteBufAllocatorTestHelper.setTestAllocator(TestByteBufAllocator.getInstance()); } @After public void tearDownTest() throws Exception { TestByteBufAllocatorTestHelper.clearTestAllocator(); TestByteBufAllocator.checkForLeaks(); }
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.configurator.impl.model; /** * The state of a configuration. * * The state represents the configurator's view. It might not * reflect the current state of the system. For example if a * configuration is installed through the configurator, it gets * the state "INSTALLED". However if an administrator now deletes * the configuration through any other way like e.g. the web console, * the configuration still has the state "INSTALLED". * */ public enum ConfigState { INSTALL, // the configuration should be installed UNINSTALL, // the configuration should be uninstalled INSTALLED, // the configuration is installed UNINSTALLED, // the configuration is uninstalled IGNORED // the configuration is ignored }
0
/* * $Header: /cvshome/build/ee.foundation/src/java/io/UTFDataFormatException.java,v 1.6 2006/03/14 01:20:23 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.io; public class UTFDataFormatException extends java.io.IOException { public UTFDataFormatException() { } public UTFDataFormatException(java.lang.String var0) { } }
0
import com.google.common.base.Supplier; import java.io.OutputStream; private static class FixedOutputStreamFactory implements Supplier<OutputStream> { private OutputStream[] streams; private int next = 0; public FixedOutputStreamFactory(OutputStream... streams) { this.streams = streams; } @Override public OutputStream get() { return streams[next++]; } } FixedOutputStreamFactory factory = new FixedOutputStreamFactory(output); DataflowWorkerLoggingHandler handler = new DataflowWorkerLoggingHandler(factory, 0); public void testOutputStreamRollover() throws IOException { ByteArrayOutputStream first = new ByteArrayOutputStream(); ByteArrayOutputStream second = new ByteArrayOutputStream(); LogRecord record = createLogRecord("test.message", null); String expected = "{\"timestamp\":{\"seconds\":0,\"nanos\":1000000},\"severity\":\"INFO\"," + "\"message\":\"test.message\",\"thread\":\"2\",\"logger\":\"LoggerName\"}" + System.lineSeparator(); FixedOutputStreamFactory factory = new FixedOutputStreamFactory(first, second); DataflowWorkerLoggingHandler handler = new DataflowWorkerLoggingHandler(factory, expected.length() + 1 /* sizelimit */); // Using |expected|+1 for size limit means that we will rollover after writing 2 log messages. // We thus expect to see 2 messsages written to 'first' and 1 message to 'second', handler.publish(record); handler.publish(record); handler.publish(record); assertEquals(expected + expected, new String(first.toByteArray(), StandardCharsets.UTF_8)); assertEquals(expected, new String(second.toByteArray(), StandardCharsets.UTF_8)); } @Test
0
import javax.annotation.Nullable; @Nullable private Coder<K> keyCoder; this(pipeline, new ArrayList<TaggedKeyedPCollection<K, ?>>(), TupleTagList.empty(), null); @Nullable Coder<K> keyCoder) {
0
this((HierarchicalConfiguration<ImmutableNode>) null); this(createNodeModel(c)); } /** * Creates a new instance of {@code BaseHierarchicalConfiguration} and * initializes it with the given {@code NodeModel}. * * @param model the {@code NodeModel} */ protected BaseHierarchicalConfiguration(NodeModel<ImmutableNode> model) { super(model); //TODO implementation return null; //new SubnodeConfiguration(this, node, subnodeKey); // Set<SubnodeConfiguration> subs = // new HashSet<SubnodeConfiguration>(subConfigs.keySet()); // for (SubnodeConfiguration sub : subs) // { // if (sub != event.getSource()) // { // sub.validateRootNode(); // } // }
0
* Copyright 1999-2009 The Apache Software Foundation.
0
package org.apache.beam.runners.direct;
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
import java.io.FileOutputStream; import java.nio.channels.FileChannel; switch (attribute) { case Size: { long newSize = (Long) value; FileChannel outChan = new FileOutputStream(file, true).getChannel(); outChan.truncate(newSize); outChan.close(); continue; } case Permissions: name = "unix:permissions"; value = toPerms((EnumSet<Permission>) value); break;
0
* @version $Id$
0
import com.google.common.collect.Lists; static final List<GameActionInfo> GAME_ACTION_INFO_LIST = Lists.newArrayList( new GameActionInfo("user0_MagentaKangaroo", "MagentaKangaroo", 3, 1447955630000L), new GameActionInfo("user13_ApricotQuokka", "ApricotQuokka", 15, 1447955630000L), new GameActionInfo("user6_AmberNumbat", "AmberNumbat", 11, 1447955630000L), new GameActionInfo("user7_AlmondWallaby", "AlmondWallaby", 15, 1447955630000L), new GameActionInfo( "user7_AndroidGreenKookaburra", "AndroidGreenKookaburra", 12, 1447955630000L), new GameActionInfo( "user7_AndroidGreenKookaburra", "AndroidGreenKookaburra", 11, 1447955630000L), new GameActionInfo("user19_BisqueBilby", "BisqueBilby", 6, 1447955630000L), new GameActionInfo("user19_BisqueBilby", "BisqueBilby", 8, 1447955630000L)); PCollection<String> input = p.apply(Create.of(GAME_EVENTS)); PCollection<GameActionInfo> output = input.apply(ParDo.of(new ParseEventFn())); PAssert.that(output).containsInAnyOrder(GAME_ACTION_INFO_LIST); p.run().waitUntilFinish(); PCollection<String> input = p.apply(Create.of(GAME_EVENTS)); PCollection<String> input = p.apply(Create.of(GAME_EVENTS));
0
final X509HostnameVerifier DEFAULT = new BrowserCompatHostnameVerifier(); final X509HostnameVerifier STRICT = new StrictHostnameVerifier(); final X509HostnameVerifier ALLOW_ALL = new AllowAllHostnameVerifier(); final CertificateFactory cf = CertificateFactory.getInstance("X.509"); final CertificateFactory cf = CertificateFactory.getInstance("X.509"); final InputStream in = new ByteArrayInputStream(CertificatesToPlayWith.X509_MULTIPLE_SUBJECT_ALT); final X509Certificate x509 = (X509Certificate) cf.generateCertificate(in); final X509HostnameVerifier verifier = SSLSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER; } catch (final SSLException ex) { } catch (final SSLException ex) { catch(final SSLException e) { catch(final SSLException e) { final X509HostnameVerifier bhv = new BrowserCompatHostnameVerifier(); final X509HostnameVerifier shv = new StrictHostnameVerifier(); final String alt[] = {}; final X509HostnameVerifier bhv = new BrowserCompatHostnameVerifier(); final X509HostnameVerifier shv = new StrictHostnameVerifier(); final X509HostnameVerifier bhv = new BrowserCompatHostnameVerifier(); final X509HostnameVerifier shv = new StrictHostnameVerifier(); final String cns[] = new String []{"m*.a.b.c.com"}; // component part final String alt[] = {}; final Principal principal = Mockito.mock(Principal.class); final X509Certificate cert = Mockito.mock(X509Certificate.class);
0
* </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
* http://www.apache.org/licenses/LICENSE-2.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. */ package org.apache.ambari.server.utils; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = {}) public class JaxbMapKeyVal { @XmlElement public String key; @XmlElement public String value; private JaxbMapKeyVal() {} public JaxbMapKeyVal(String key, String value) { this.key = key; this.value = value; } }
1
* Copyright (c) 2002 The Apache Software Foundation. All rights
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
protected Iterator<String> getKeysInternal() @Override protected Iterator<String> getKeysInternal()
0
static void deleteAllEntities(V1TestOptions options, String project, String ancestor) throws Exception { Datastore datastore = getDatastore(options, project); static long countEntities(V1TestOptions options, String project, String ancestor) throws Exception { Datastore datastore = V1TestUtil.getDatastore(options, project);
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.master.replication; import static org.junit.Assert.*; import org.junit.Test; /** * */ public class FinishedWorkUpdaterTest { @Test public void recordsWithProgressUpdateBothTables() { fail("Not yet implemented"); } }
0
* @throws IOReactorException - not thrown currently * @throws IOReactorException - not thrown currently
0
import java.util.stream.Collectors; import java.util.stream.StreamSupport; StreamSupport.stream( elements .stream() .filter( Predicates.compose(new StartsWith("a"), new ExtractWriteDestination()) ::apply) .collect(Collectors.toList()) .spliterator(), false) .map(Functions.toStringFunction()::apply) .collect(Collectors.toList()), StreamSupport.stream( elements .stream() .filter( Predicates.compose(new StartsWith("b"), new ExtractWriteDestination()) ::apply) .collect(Collectors.toList()) .spliterator(), false) .map(Functions.toStringFunction()::apply) .collect(Collectors.toList()), StreamSupport.stream( elements .stream() .filter( Predicates.compose(new StartsWith("c"), new ExtractWriteDestination()) ::apply) .collect(Collectors.toList()) .spliterator(), false) .map(Functions.toStringFunction()::apply) .collect(Collectors.toList()), assertTrue(actual.stream().allMatch(haveProperHeaderAndFooter(header, footer)::apply));
0
String name = names.get(0); name = names.get(1);
0
import org.apache.beam.runners.core.StateTag.StateBinder;
0
protected ContentEncoder createContentEncoder( final long len, return super.createContentEncoder(len, channel, buffer, metrics);
0
"The first component of the Kerberos principal, the 'primary', " + "that Accumulo servers use to login"); log.warn("Client configuration constructed with a Configuration that did not have " + "list delimiter disabled or overridden, multi-valued config " + "properties may be unavailable");
0
implements Blocks, Configurable, blockManager.setBlocks(this);
0
resolver = new MasterHostResolver(configHelper, cluster, version);
0
public class JavascriptLanguage extends AbstractProgrammingLanguage {
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.state.svccomphost; import org.apache.ambari.server.state.ServiceComponentHostEvent; import org.apache.ambari.server.state.ServiceComponentHostEventType; public class ServiceComponentHostStoppedEvent extends ServiceComponentHostEvent { public ServiceComponentHostStoppedEvent(String serviceComponentName, String hostName, long opTimestamp) { super(ServiceComponentHostEventType.HOST_SVCCOMP_STOPPED, serviceComponentName, hostName, opTimestamp); // TODO Auto-generated constructor stub } }
0
package org.w3c.dom.svg; public interface SVGAnimateMotionElement extends SVGAnimationElement { }
1
import org.apache.commons.codec.Charsets;
0