Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
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
public void start(BundleContext bc) { Hashtable<String, Object> props = new Hashtable<>(); public void stop(BundleContext bc) {
0
import com.twitter.aurora.gen.Lock; import com.twitter.aurora.gen.LockKey; import com.twitter.aurora.gen.storage.RemoveLock; import com.twitter.aurora.gen.storage.SaveLock; public void testSaveLock() throws Exception { final Lock lock = new Lock( LockKey.job(JobKeys.from("testRole", "testEnv", "testJob")), "testLockId", "testUser", 12345L); new MutationFixture() { @Override protected void setupExpectations() throws Exception { storageUtil.expectOperations(); storageUtil.updateStore.saveLock(lock); streamMatcher.expectTransaction(Op.saveLock(new SaveLock(lock))) .andReturn(position); } @Override protected void performMutations() { logStorage.saveLock(lock); } }.run(); } @Test public void testRemoveLock() throws Exception { final LockKey lockKey = LockKey.job(JobKeys.from("testRole", "testEnv", "testJob")); new MutationFixture() { @Override protected void setupExpectations() throws Exception { storageUtil.expectOperations(); storageUtil.updateStore.removeLock(lockKey); streamMatcher.expectTransaction(Op.removeLock(new RemoveLock(lockKey))) .andReturn(position); } @Override protected void performMutations() { logStorage.removeLock(lockKey); } }.run(); } @Test
0
return true;
0
return new ZipFileSystem( name, file );
0
import org.apache.felix.http.base.internal.runtime.ServletRequestAttributeListenerInfo; import org.apache.felix.http.base.internal.runtime.ServletRequestListenerInfo; else if ( info instanceof ServletRequestListenerInfo ) { handler.addListener((ServletRequestListenerInfo)info ); } else if ( info instanceof ServletRequestAttributeListenerInfo ) { handler.addListener((ServletRequestAttributeListenerInfo)info ); } else if ( info instanceof ServletRequestListenerInfo ) { handler.removeListener((ServletRequestListenerInfo)info ); } else if ( info instanceof ServletRequestAttributeListenerInfo ) { handler.removeListener((ServletRequestAttributeListenerInfo)info ); }
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.controller.spi; import java.util.Set; /** * Resource query response. Used for resource queries * that may include the paging and/or sorting of the * returned resources. */ public interface QueryResponse { /** * Get the set of resources returned in the response. * * @return the set of resources */ public Set<Resource> getResources(); /** * Determine whether or not the response is sorted. * * @return {@code true} if the response is sorted */ public boolean isSortedResponse(); /** * Determine whether or not the response is paginated. * * @return {@code true} if the response is paginated */ public boolean isPagedResponse(); /** * Get the the total number of resources for the query result. * May be different than the size of the resource set for a * paged response. * * @return total the total number of resources in the query result */ public int getTotalResourceCount(); }
0
@Column(name = "target_id", nullable = false, updatable = false) @Column(length = 32672) if (this == object) { } if (object == null || getClass() != object.getClass()) { } : that.targetId != 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. */
0
new TraitInformation(true, SVGTypes.TYPE_RECT)); * The 'viewBox' attribute value. */ protected SVGOMAnimatedRect viewBox; /** viewBox = createLiveAnimatedRect(null, SVG_VIEW_BOX_ATTRIBUTE, null); return viewBox;
0
import java.util.Collection; /** the recognised options */ /** the processed options */ private Option[] optionsArray; /** * <p>Returns an array of the processed {@link Option}s.</p> * * @return an array of the processed {@link Option}s. */ public Option[] getOptions( ) { Collection processed = options.values(); // reinitialise array optionsArray = new Option[ processed.size() ]; // return the array return (Option[]) processed.toArray( optionsArray ); }
0
import org.apache.hc.core5.annotation.Contract; import org.apache.hc.core5.annotation.ThreadingBehavior; @Contract(threading = ThreadingBehavior.IMMUTABLE)
0
* Parameter names for HTTP client connections.
0
import com.google.common.collect.Lists; import java.util.Arrays; import java.util.Objects; @Override public boolean equals(Object o) { if (!(o instanceof Schema)) { return false; } Schema other = (Schema) o; return Objects.equals(fieldIndices, other.fieldIndices) && Objects.equals(getFields(), other.getFields()); } @Override public int hashCode() { return Objects.hash(fieldIndices, getFields()); } @Override public boolean equals(Object o) { if (!(o instanceof FieldTypeDescriptor)) { return false; } FieldTypeDescriptor other = (FieldTypeDescriptor) o; return Objects.equals(getType(), other.getType()) && Objects.equals(getComponentType(), other.getComponentType()) && Objects.equals(getRowSchema(), other.getRowSchema()) && Arrays.equals(getMetadata(), other.getMetadata()); } @Override public int hashCode() { return Arrays.deepHashCode( new Object[] {getType(), getComponentType(), getRowSchema(), getMetadata()}); } @Override public boolean equals(Object o) { if (!(o instanceof Field)) { return false; } Field other = (Field) o; return Objects.equals(getName(), other.getName()) && Objects.equals(getDescription(), other.getDescription()) && Objects.equals(getTypeDescriptor(), other.getTypeDescriptor()) && Objects.equals(getNullable(), other.getNullable()); } @Override public int hashCode() { return Objects.hash(getName(), getDescription(), getTypeDescriptor(), getNullable()); }
0
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument; import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkNotNull; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Iterables;
0
import org.apache.accumulo.server.replication.StatusUtil; import org.apache.accumulo.server.replication.proto.Replication.Status;
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.http.whiteboard.internal.tracker; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; import org.osgi.service.http.HttpContext; import org.apache.felix.http.whiteboard.internal.manager.ExtenderManager; public final class HttpContextTracker extends AbstractTracker<HttpContext> { private final ExtenderManager manager; public HttpContextTracker(BundleContext context, ExtenderManager manager) { super(context, HttpContext.class); this.manager = manager; } protected void added(HttpContext service, ServiceReference ref) { this.manager.add(service, ref); } protected void modified(HttpContext service, ServiceReference ref) { removed(service); added(service, ref); } protected void removed(HttpContext service) { this.manager.remove(service); } }
0
* Copyright (c) OSGi Alliance (2004, 2008). All Rights Reserved. import java.util.ArrayList; import java.util.Collections; import java.util.Enumeration; import java.util.Iterator; * * @version $Revision: 5673 $
0
import static com.google.cloud.dataflow.sdk.runners.worker.SourceTranslationUtils.cloudPositionToReaderPosition; import static com.google.cloud.dataflow.sdk.runners.worker.SourceTranslationUtils.cloudProgressToReaderProgress; import com.google.cloud.dataflow.sdk.util.common.worker.Reader; public class InMemoryReader<T> extends Reader<T> { private static final Logger LOG = LoggerFactory.getLogger(InMemoryReader.class); public InMemoryReader(List<String> encodedElements, @Nullable Long startIndex, @Nullable Long endIndex, Coder<T> coder) { throw new IllegalArgumentException("end index should be >= start index"); public ReaderIterator<T> iterator() throws IOException { return new InMemoryReaderIterator(); * A ReaderIterator that yields an in-memory list of elements. class InMemoryReaderIterator extends AbstractReaderIterator<T> { public InMemoryReaderIterator() { byte[] encodedElement = StringUtils.jsonStringToByteArray(encodedElementString); // current progress. An implementer can override this method to update return cloudProgressToReaderProgress(progress); // an API Position in InMemoryReader. If stop position in other types is LOG.warn("A stop position other than a Dataflow API Position is not currently supported."); LOG.warn("A stop position other than record index is not supported in InMemoryReader."); return cloudPositionToReaderPosition(stopPosition);
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
/** * Create the node given an id. * * @param id node id. */ /** * Create a node with the given parser and id. * * @param p a parser. * @param id node id. */
0
StringBuilder buffer = new StringBuilder("UpgradeGroupHolder{"); buffer.append("name=").append(name);
0
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkState; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.annotations.VisibleForTesting; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Predicates; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Maps;
0
import cz.seznam.euphoria.core.client.dataset.windowing.WindowedElement; import cz.seznam.euphoria.core.client.dataset.windowing.Windowing;
0
final String mode = (this.settings != null ? this.settings.getRunningMode() : SettingsDefaults.DEFAULT_RUNNING_MODE);
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: CocoonCrawling.java,v 1.2 2004/03/05 10:07:25 bdelacretaz Exp $
0
protected long getMinCIdleThreshold(KeyExtent extent) { final long now = currentTimeMillis(); protected long currentTimeMillis() { return System.currentTimeMillis(); }
0
this(tabletServer, new Text(info.dir), extent, trm, CachedConfiguration.getInstance(), info.datafiles, info.time, info.initFlushID, info.initCompactID, info.lastLocation); this(tabletServer, location, extent, trm, conf, VolumeManagerImpl.get(), EMPTY, datafiles, time, lastLocation, new HashSet<FileRef>(), initFlushID, initCompactID); private static final long serialVersionUID = 1L;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jelly/src/java/org/apache/commons/jelly/tags/define/Attic/InvokeBodyTag.java,v 1.5 2002/05/15 06:25:48 jstrachan Exp $ * $Revision: 1.5 $ * $Date: 2002/05/15 06:25:48 $ * $Id: InvokeBodyTag.java,v 1.5 2002/05/15 06:25:48 jstrachan Exp $ import org.apache.commons.jelly.JellyContext; * @version $Revision: 1.5 $ private static final Log log = LogFactory.getLog( JellyContext.class ); public void run(JellyContext context, XMLOutput output) throws Exception {
0
// Real bug - https://issues.apache.org/jira/browse/BEAM-6559 @SuppressFBWarnings("NP_NULL_ON_SOME_PATH")
0
* @return {@code true} if this file is writeable, {@code false} if not.
0
import java.io.InputStream; import org.junit.Assert; Assert.assertNotNull(ClassPath.SYSTEM_CLASS_PATH.getClassFile("java.lang.String")); } public void testGetResource() throws IOException { Assert.assertNotNull(ClassPath.SYSTEM_CLASS_PATH.getResource("java/lang/String.class")); } public void testGetResourceAsStream() throws IOException { try (final InputStream inputStream = ClassPath.SYSTEM_CLASS_PATH .getResourceAsStream("java/lang/String.class")) { Assert.assertNotNull(inputStream); }
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.beam.sdk.schemas; import org.apache.avro.specific.SpecificRecord; import org.apache.beam.sdk.schemas.utils.AvroSpecificRecordTypeInformationFactory; import org.apache.beam.sdk.schemas.utils.AvroUtils; import org.apache.beam.sdk.values.TypeDescriptor; /** * A {@link SchemaProvider} for AVRO generated SpecificRecords. * * <p>This provider infers a schema from generates SpecificRecord objects, and creates schemas and * rows that bind to the appropriate fields. */ public class AvroSpecificRecordSchema extends GetterBasedSchemaProvider { @Override public <T> Schema schemaFor(TypeDescriptor<T> typeDescriptor) { return AvroUtils.getSchema((Class<? extends SpecificRecord>) typeDescriptor.getRawType()); } @Override public FieldValueGetterFactory fieldValueGetterFactory() { return new AvroSpecificRecordGetterFactory(); } @Override public UserTypeCreatorFactory schemaTypeCreatorFactory() { return new AvroSpecificRecordUserTypeCreatorFactory(); } @Override public FieldValueTypeInformationFactory fieldValueTypeInformationFactory() { return new AvroSpecificRecordTypeInformationFactory(); } }
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. * @version $Revision: 1.10 $ $Date: 2003/10/13 08:44:26 $
0
private static final String TIMER_STATE_ID = "timer"; TimerRegistry<KeyedTimerData<K>> timerRegistry, final SamzaStoreStateInternals.Factory<?> nonKeyedStateInternalsFactory = SamzaStoreStateInternals.createStateInternalFactory( null, context, pipelineOptions, null, mainOutputTag); Collections.singletonMap( SamzaStoreStateInternals.BEAM_STORE, SamzaStoreStateInternals.getBeamStore(context)), SamzaTimerInternalsFactory.createTimerInternalFactory( keyCoder, timerRegistry, TIMER_STATE_ID, nonKeyedStateInternalsFactory, windowingStrategy, pipelineOptions); timerInternalsFactory.removeProcessingTimer(keyedTimerData);
0
import org.apache.beam.model.fnexecution.v1.BeamFnApi; import org.apache.beam.model.fnexecution.v1.BeamFnApi.ProcessBundleRequest; import org.apache.beam.model.fnexecution.v1.BeamFnApi.StateRequest; import org.apache.beam.model.fnexecution.v1.BeamFnApi.StateRequest.Builder; import org.apache.beam.model.fnexecution.v1.BeamFnApi.StateResponse; * Processes {@link BeamFnApi.ProcessBundleRequest}s by materializing
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
suite.addTest(TestEnglishReasonPhraseCatalog.suite());
0
@NamedQuery(name = "AlertDefinitionEntity.findByServiceMaster", query = "SELECT ad FROM AlertDefinitionEntity ad WHERE ad.serviceName IN :services AND ad.scope = :scope AND ad.clusterId = :clusterId AND ad.componentName IS NULL" + " AND ad.sourceType <> org.apache.ambari.server.state.alert.SourceType.AGGREGATE"),
0
import javax.xml.bind.JAXBContext; import javax.xml.bind.Marshaller; OptionBuilder.isRequired(); public void printClusterDefinition(ClusterDefinition def) throws Exception { JAXBContext jc = JAXBContext.newInstance(org.apache.ambari.common.rest.entities.ClusterDefinition.class); Marshaller m = jc.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); m.marshal(def, System.out); } /* * If dry_run print the clsuter defn and return */ if (line.hasOption("dry_run")) { System.out.println("Cluster: ["+def.getName()+"] created. Mode: dry_run.\n"); printClusterDefinition(def); return; } /* * If no wait, then print the cluster definition and return */ System.out.println("Cluster: ["+def.getName()+"] created.\n"); printClusterDefinition(def); System.out.println("Waiting for cluster ["+def.getName()+"] to get to desired goalstate of ["+def.getGoalState()+"]"); System.out.println("Cluster: ["+def.getName()+"] created. Cluster state: ["+clusterState.getState()+"]\n"); printClusterDefinition(def);
0
// Ignore.
0
// FELIX-4491: only resources that need to be processed should be handled... if (!resourceInfo.isProcessedResource()) { session.getLog().log(LogService.LOG_INFO, "Ignoring non-processed resource: " + resourceInfo.getPath()); continue; } // Keep track of which resource processors we've seen already... if (!resourceProcessors.add(rpName)) {
0
import org.apache.sshd.util.test.JUnit4ClassRunnerWithParametersFactory; import org.junit.runners.Parameterized.UseParametersRunnerFactory; @UseParametersRunnerFactory(JUnit4ClassRunnerWithParametersFactory.class)
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
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/EvalContext.java,v 1.23 2003/03/11 00:59:18 dmitri Exp $ * $Revision: 1.23 $ * $Date: 2003/03/11 00:59:18 $ * Copyright (c) 1999-2003 The Apache Software Foundation. All rights * @version $Revision: 1.23 $ $Date: 2003/03/11 00:59:18 $
0
public Object expr(CharSequence expr) { return processor.expr(this, expr); }
0
Optional<InetSocketAddress> httpSocket = Optional.fromNullable(serviceRegistry.getAuxiliarySockets().get("http")); if (!httpSocket.isPresent()) { throw new IllegalStateException("No HTTP service registered with LocalServiceRegistry."); httpSocket.get(),
0
/* * Copyright 2004-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.pluto; import org.apache.pluto.services.PortletContainerEnvironment; /** * This interface marks a factory/service as a component that nees * access to the portlet container environment. * This method is invoke in the component initialization phase just * before the initialize method. * * @version $Id$ */ public interface PortletContainerEnabled { void setPortletContainerEnvironment(PortletContainerEnvironment env); }
0
String nameSpace = assertNameSpaceIsRegistered(ns.getName()); AtlasClientV2 atlasClient = getAtlasClient(); if (atlasClient != null) { AtlasEntityWithExtInfo nameSpaceRef = atlasClient.getEntityByGuid(nameSpace); String nameSpaceQualifiedName = HBaseAtlasHook.getNameSpaceQualifiedName(CLUSTER_NAME, ns.getName()); Assert.assertEquals(nameSpaceRef.getEntity().getAttribute(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME), nameSpaceQualifiedName); } else { Assert.fail("Unable to create AtlasClient for Testing"); } String table = assertTableIsRegistered(namespace, tablename); AtlasClientV2 atlasClient = getAtlasClient(); if (atlasClient != null) { AtlasEntityWithExtInfo tableRef = atlasClient.getEntityByGuid(table); String entityName = HBaseAtlasHook.getTableQualifiedName(CLUSTER_NAME, namespace, tablename); Assert.assertEquals(tableRef.getEntity().getAttribute(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME), entityName); } else { Assert.fail("Unable to create AtlasClient for Testing"); }
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.scr.integration.components.felix3680_2; public class F { }
0
void visit(int level, RemoteSpan parent, RemoteSpan node, Collection<RemoteSpan> children);
1
import javax.swing.tree.TreePath;
0
import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; ObjectNode response = atlasClientV1.callAPIWithBody(AtlasClient.API_V1.CREATE_TYPE, typesAsJSON); ArrayNode typesAdded = (ArrayNode) response.get(AtlasClient.TYPES); assertEquals(typesAdded.size(), 1); assertEquals(typesAdded.get(0).get(NAME).asText(), typeDefinition.getTypeName()); ObjectNode response = atlasClientV1.callAPIWithBodyAndParams(AtlasClient.API_V1.LIST_TYPES, null, typeDefinition.getTypeName()); TypesDef typesDef = AtlasType.fromV1Json(response.get(AtlasClient.DEFINITION).asText(), TypesDef.class); ObjectNode response = atlasClientV1.callAPIWithBodyAndParams(AtlasClient.API_V1.LIST_TYPES, null, "blah"); ObjectNode response = atlasClientV1.callAPIWithBodyAndParams(AtlasClient.API_V1.LIST_TYPES, null, (String[]) null); final ArrayNode list = (ArrayNode) response.get(AtlasClient.RESULTS); String typesString = list.toString(); ObjectNode response = atlasClientV1.callAPIWithQueryParams(AtlasClient.API_V1.LIST_TYPES, queryParams); final ArrayNode list = (ArrayNode) response.get(AtlasClient.RESULTS); Assert.assertTrue(list.size() >= traitsAdded.length);
0
import org.apache.accumulo.core.clientImpl.Table; import org.apache.accumulo.core.dataImpl.KeyExtent;
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
assertEquals("Unexpected testfile.txt while processing ", e.getMessage());
0
ReduceByKey<IN, IN, Byte, VALUE, Void, OUT, WLABEL, W> reduceByKey;
0
status.getHost(), executorBuild, localBuild));
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.forms.event; import org.w3c.dom.Element; /** * A component that build widget event listeners. * * @version $Id$ */ public interface WidgetListenerBuilder { public static final String ROLE = WidgetListenerBuilder.class.getName(); public WidgetListener buildListener(Element element, Class listenerClass) throws Exception; }
0
public static final String LOGSEARCH_PROPERTIES_FILE = "logsearch.properties";
0
initialValue = 0
0
import org.apache.hc.core5.reactor.TlsCapableIOSession; public ClientHttpProtocolNegotiator createHandler(final TlsCapableIOSession ioSession, final Object attachment) {
0
List<String> userRoles = roles.get(user); if (userRoles.contains("admin")) { final PrivilegeEntity privilege = new PrivilegeEntity(); privilege.setPermission(adminPermission); privilege.setPrincipal(user.getPrincipal()); privilege.setResource(ambariResource); user.getPrincipal().getPrivileges().add(privilege); privilegeDAO.create(privilege); for (ClusterEntity cluster: clusterDAO.findAll()) { final PrivilegeEntity clusterPrivilege = new PrivilegeEntity(); clusterPrivilege.setPermission(clusterOperatePermission); clusterPrivilege.setPrincipal(user.getPrincipal()); clusterPrivilege.setResource(cluster.getResource()); privilegeDAO.create(clusterPrivilege); user.getPrincipal().getPrivileges().add(clusterPrivilege); } userDAO.merge(user); } else if (userRoles.contains("user")) { for (ClusterEntity cluster: clusterDAO.findAll()) { privilege.setPermission(clusterReadPermission); privilege.setResource(cluster.getResource()); user.getPrincipal().getPrivileges().add(privilege); userDAO.merge(user);
0
package org.apache.commons.codec2.net; import org.apache.commons.codec2.CharEncoding; import org.apache.commons.codec2.DecoderException; import org.apache.commons.codec2.EncoderException; import org.apache.commons.codec2.StringDecoder; import org.apache.commons.codec2.StringEncoder;
0
/***************************************************************************** * Copyright (C) The Apache Software Foundation. All rights reserved. * * ------------------------------------------------------------------------- * * This software is published under the terms of the Apache Software License * * version 1.1, a copy of which has been included with this distribution in * * the LICENSE file. * *****************************************************************************/ package org.apache.batik.css.engine; import org.apache.batik.css.engine.value.Value; import org.w3c.dom.Element; /** * This interface allows the user of a CSSEngine to provide contextual * informations. * * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a> * @version $Id$ */ public interface CSSContext { /** * Returns the Value corresponding to the given system color. */ Value getSystemColor(String ident); /** * Returns a lighter font-weight. */ float getLighterFontWeight(float f); /** * Returns a bolder font-weight. */ float getBolderFontWeight(float f); /** * Returns the pixel to millimeters conversion factor. */ float getPixelToMillimeters(); /** * Returns the medium font size. */ float getMediumFontSize(); /** * Returns the width of the block which directly contains the * given element. */ float getBlockWidth(Element elt); /** * Returns the height of the block which directly contains the * given element. */ float getBlockHeight(Element elt); }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/share/org/apache/commons/validator/Validator.java,v 1.34 2004/02/21 17:10:29 rleland Exp $ * $Revision: 1.34 $ * $Date: 2004/02/21 17:10:29 $ * Copyright 2001-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
* Creates a new <code>StyleReference</code>.
0
Combiner.setColumns(is, Collections.singletonList(new IteratorSetting.Column("acf")));
0
return IResource.newBuilder( type.getValue(), type.getAuroraResourceConverter().parseFrom(value));
0
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSeeAlso; import org.apache.atlas.model.PList; import org.apache.atlas.model.SearchFilter.SortType; @XmlRootElement /** * REST serialization friendly list. */ @JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONLY, fieldVisibility=NONE) @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown=true) @XmlRootElement @XmlSeeAlso(AtlasEntityDef.class) public static class AtlasEntityDefs extends PList<AtlasEntityDef> { private static final long serialVersionUID = 1L; public AtlasEntityDefs() { super(); } public AtlasEntityDefs(List<AtlasEntityDef> list) { super(list); } public AtlasEntityDefs(List list, long startIndex, int pageSize, long totalCount, SortType sortType, String sortBy) { super(list, startIndex, pageSize, totalCount, sortType, sortBy); } }
0
DoFn<TimerOrElement<KV<K, VI>>, KV<K, VO>>.ProcessContext context, DoFn<TimerOrElement<KV<K, VI>>, KV<K, Iterable<VI>>>.ProcessContext context, DoFn<TimerOrElement<KV<K, VI>>, KV<K, VO>>.ProcessContext context, key, context, new StreamingActiveWindowManager<>(windowFn, context)); for (BoundedWindow window : context.windowingInternals().windows()) { context, new StreamingActiveWindowManager<>(windowFn, context)); DoFn<?, ?>.ProcessContext context; DoFn<?, ?>.ProcessContext context) { context.windowingInternals().setTimer( context.windowingInternals().deleteTimer(
0
* @see #getKeys() * Get the list of the keys contained in the configuration. The returned * iterator can be used to obtain all defined keys. Note that the exact * behavior of the iterator's <code>remove()</code> method is specific to * a concrete implementation. It <em>may</em> remove the corresponding * property from the configuration, but this is not guaranteed. In any case * it is no replacement for calling * <code>{@link #clearProperty(String)}</code> for this property. So it is * highly recommended to avoid using the iterator's <code>remove()</code> * method. *
0
CountSum value) { CountSum value, ElementByteSizeObserver observer) LONG_CODER.registerByteSizeObserver(value.count, observer); DOUBLE_CODER.registerByteSizeObserver(value.sum, observer);
0
updateHosts(path, zoo.getChildren(path, this)); }
0
package org.apache.aurora.scheduler.config.validators; import com.beust.jcommander.IValueValidator; import com.beust.jcommander.ParameterException; import org.apache.aurora.common.quantity.Amount; public class PositiveAmount implements IValueValidator<Amount<? extends Number, ?>> { public void validate(String name, Amount<? extends Number, ?> value) throws ParameterException { if (value.getValue().longValue() <= 0) { throw new ParameterException(String.format("%s must be positive", name));
0
import org.apache.commons.configuration.interpol.ConfigurationInterpolator; @Override public ConfigurationInterpolator getInterpolator() { return parent.getInterpolator(); }
0
import org.apache.http.FormattedHeader; import org.apache.http.Header; import org.apache.http.TrailerSupplier; import org.apache.http.message.BasicLineFormatter; private final TrailerSupplier trailers; * * @since 5.0 public ChunkedOutputStream(final int bufferSize, final SessionOutputBuffer out, final TrailerSupplier trailers) { this.trailers = trailers; } /** * Wraps a session output buffer and chunk-encodes the output. * * @param bufferSize The minimum chunk size (excluding last chunk) * @param out The session output buffer */ public ChunkedOutputStream(final int bufferSize, final SessionOutputBuffer out) { this(bufferSize, out, null); writeTrailers(); private void writeTrailers() throws IOException { final Header[] headers = this.trailers != null ? this.trailers.get() : null; if (headers != null) { for (Header header: headers) { if (header instanceof FormattedHeader) { final CharArrayBuffer chbuffer = ((FormattedHeader) header).getBuffer(); this.out.writeLine(chbuffer); } else { this.linebuffer.clear(); BasicLineFormatter.INSTANCE.formatHeader(this.linebuffer, header); this.out.writeLine(this.linebuffer); } } } }
0
* Copyright 2002,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * @version $Revision: 1.4 $
0
* by its unique article identifier (including the enclosing &lt; and &gt;). * @throws IOException if an error occurs * @return the reader * @throws IOException if an error occurs /** * Same as <code> retrieveArticleHeader(articleNumber, null) </code> * * @param articleNumber the article number * @return the reader * @throws IOException if an error occurs */ * @param articleId the article id * @return the reader * @throws IOException if an error occurs * @return the reader * @throws IOException if an error occurs /** * Same as <code> retrieveArticleBody(articleNumber, null) </code> * @param articleNumber the article number * @return the reader * @throws IOException if an error occurs */ /** * Same as <code> selectNewsgroup(newsgroup, null) </code> * @param newsgroup the newsgroup name * @return true if newsgroup exist and was selected * @throws IOException if an error occurs */
0
final String testData = "ABCD";
0
public abstract class AbstractTestNullComparator extends AbstractTestComparator<Integer> { public AbstractTestNullComparator(String testName) { TestSuite suite = new TestSuite(AbstractTestNullComparator.class.getName()); public static class TestNullComparator1 extends AbstractTestNullComparator { public static class TestNullComparator2 extends AbstractTestNullComparator {
0
* Converts an array of bytes into a String representing the hexadecimal values of each byte in order. The returned * String will be double the length of the passed array, as it takes two characters to represent any given byte. * * @param data * a byte[] to convert to Hex characters * @param toLowerCase * <code>true</code> converts to lowercase, <code>false</code> to uppercase * @return A String containing lower-case hexadecimal characters * @since 1.11 */ public static String encodeHexString(final byte[] data, boolean toLowerCase) { return new String(encodeHex(data, toLowerCase)); } /** * Converts a byte buffer into a String representing the hexadecimal values of each byte in order. The returned * String will be double the length of the passed array, as it takes two characters to represent any given byte. * * @param data * a byte buffer to convert to Hex characters * @param toLowerCase * <code>true</code> converts to lowercase, <code>false</code> to uppercase * @return A String containing lower-case hexadecimal characters * @since 1.11 */ public static String encodeHexString(final ByteBuffer data, boolean toLowerCase) { return new String(encodeHex(data, toLowerCase)); } /**
0
RELATIONSHIP_ALREADY_DELETED(404, "ATLAS-404-00-00F", "Attempting to delete a relationship which is already deleted : {0}"),
1
filter = new CompositeRable8Bit(srcs, rule, true);
0
* @version $Id: HttpFilesCacheTestCase.java 1808381 2017-09-14 19:26:39Z * ggregory $ try (final FileObject noQueryFile = fileSystemManager.resolveFile(noQueryStringUrl)) { Assert.assertEquals(noQueryStringUrl, noQueryFile.getURL().toExternalForm()); } try (final FileObject queryFile = fileSystemManager.resolveFile(queryStringUrl)) { Assert.assertEquals(queryStringUrl, queryFile.getURL().toExternalForm()); // failed for VFS-426 } try (final FileObject queryFile2 = fileSystemManager.resolveFile(queryStringUrl2)) { Assert.assertEquals(queryStringUrl2, queryFile2.getURL().toExternalForm()); // failed for VFS-426 }
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 * 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 com.google.common.annotations.VisibleForTesting; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
0
WindowingUtils.checkGroupByKeyApplicable(operator, leftKvInput, rightKvInput);
0
if (pk instanceof java.security.interfaces.DSAPublicKey) { } else if (pk instanceof java.security.interfaces.RSAPublicKey) { * @return the public key
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.cocoon.core.container.spring.ResourceUtils; Arrays.sort(resources, ResourceUtils.getResourceComparator());
0
package org.apache.felix.persister.test.objects; import org.apache.felix.persister.test.objects.Bottom.BottomDTO; public interface SimpleMiddle extends Middle { Bottom embeddedValue(); public static class SimpleMiddleDTO extends DTO { public String id; public String value; public BottomDTO embedded;
0
* Autogenerated by Thrift Compiler (0.12.0) @javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") public @org.apache.thrift.annotation.Nullable org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent; // required @org.apache.thrift.annotation.Nullable @org.apache.thrift.annotation.Nullable @org.apache.thrift.annotation.Nullable public NotServingTabletException setExtent(@org.apache.thrift.annotation.Nullable org.apache.accumulo.core.dataImpl.thrift.TKeyExtent extent) { public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { @org.apache.thrift.annotation.Nullable @org.apache.thrift.annotation.Nullable
0
private synchronized ExecutionCommandWrapper addGenericExecutionCommand(String clusterName, String hostName, Role role, RoleCommand command, ServiceComponentHostEvent event){ HostRoleCommand hrc = new HostRoleCommand(hostName, role, event, command); public synchronized void addHostRoleExecutionCommand(String host, Role role, RoleCommand command, ServiceComponentHostEvent event, String clusterName, String serviceName) { ExecutionCommandWrapper commandWrapper = addGenericExecutionCommand(clusterName, host, role, command, event); @Nullable Integer timeout) { clusterName, StageUtils.getHostName(), event, commandParams, commandDetail, timeout); @Nullable Integer timeout) { ExecutionCommandWrapper commandWrapper = addGenericExecutionCommand(clusterName, hostName, role, command, event); * Adds cancel command to stage for given cancelTargets collection of task id's that has to be canceled in Agent layer. ExecutionCommandWrapper commandWrapper = addGenericExecutionCommand(clusterName, hostName, Role.AMBARI_SERVER_ACTION, RoleCommand.ABORT, null); * {@link #addHostRoleExecutionCommand(String, Role, RoleCommand, * ServiceComponentHostEvent, String, String)}
0
boolean isHostStateUnknown = false; } else if (timeOutActionNeeded(status, s, hostObj, roleStr, now, commandTimeout) || (isHostStateUnknown = isHostStateUnknown(s, hostObj, roleStr))) { if (s.getAttemptCount(host, roleStr) >= maxAttempts || isHostStateUnknown) { db.timeoutHostRole(host, s.getRequestId(), s.getStageId(), c.getRole(), isSkipSupported, isHostStateUnknown);
1
byte newbuf[] = new byte[this.buf.length << 1]; int newcount = this.bufCount + len;
0
package org.apache.beam.runners.core; import org.apache.beam.sdk.util.WindowedValue; import org.apache.beam.sdk.util.WindowingStrategy;
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
* @version CVS $Id: EP_Grid.java,v 1.3 2003/09/05 07:31:40 cziegeler Exp $
0
import org.codehaus.jackson.map.DeserializationConfig; import org.codehaus.jackson.map.ObjectReader; import java.io.InputStream; private final static ObjectReader objectReader; ObjectMapper objectMapper = new ObjectMapper(); objectMapper.configure(DeserializationConfig.Feature.USE_ANNOTATIONS, false); objectReader = objectMapper.reader(JMXMetricHolder.class); InputStream in = null; in = streamProvider.readFrom(spec); JMXMetricHolder metricHolder = objectReader.readValue(in); } finally { if (in != null) { try { in.close(); } catch (IOException e) { if (LOG.isWarnEnabled()) { LOG.warn("Unable to close http input steam : spec=" + spec, e); } } }
0