Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
package org.apache.commons.digester3; import org.apache.commons.digester3.Digester; "/org/apache/commons/digester3/xmlrules/digester-rules.dtd"; "/org/apache/commons/digester3/xmlrules/test-call-param-rules.xml";
1
import org.apache.ambari.server.security.authorization.UserType; public UserEntity findUserByNameAndType(String userName, UserType userType) { TypedQuery<UserEntity> query = entityManagerProvider.get().createQuery("SELECT user FROM UserEntity user WHERE " + "user.userType=:type AND user.userName=:name", UserEntity.class); query.setParameter("type", userType); query.setParameter("name", userName); try { return query.getSingleResult(); } catch (NoResultException e) { return null; } } @RequiresSession
0
import org.apache.cocoon.acting.ConfigurableServiceableAction; * @version CVS $Id: AbstractMethodAction.java,v 1.3 2003/10/15 20:47:15 cziegeler Exp $ public abstract class AbstractMethodAction extends ConfigurableServiceableAction {
0
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
0
import javax.persistence.UniqueConstraint; initialValue = 0, uniqueConstraints=@UniqueConstraint(columnNames={"layout_name", "cluster_id"}) @Column(name = "layout_name", nullable = false, length = 255)
0
public class DefaultFileMonitorTests extends AbstractVfsTestCase { public void setUp() throws Exception { if (testFile.exists()) { public void tearDown() throws Exception { if (testFile != null && testFile.exists()) { public void testFileCreated() throws Exception { try { public void testFileDeleted() throws Exception { try { public void testFileModified() throws Exception { try { assertTrue("setLastModified succeeded", rc); public void testFileRecreated() throws Exception { try { public void testChildFileRecreated() throws Exception { try { private void writeToFile(final File file) throws Exception { public class TestFileListener implements FileListener { public void fileChanged(final FileChangeEvent event) throws Exception { public void fileDeleted(final FileChangeEvent event) throws Exception { public void fileCreated(final FileChangeEvent event) throws Exception {
1
if (properties == null) return; if (!this.properties.containsKey(scope)) this.properties.put(scope, new HashMap<String,String>());
1
endTimes[i].deinitialize();
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/java/org/apache/commons/jxpath/ri/axes/DescendantContext.java,v 1.5 2002/04/21 21:52:32 dmitri Exp $ * $Revision: 1.5 $ * $Date: 2002/04/21 21:52:32 $ import org.apache.commons.jxpath.ri.model.*; * @version $Revision: 1.5 $ $Date: 2002/04/21 21:52:32 $ stack.push(currentNodePointer.childIterator(null, false, null)); stack.push(currentNodePointer.childIterator(null, false, null));
0
Element context = doc.createElement("nscontext"); context.setAttribute( "xmlns:x", "http://www.xmlsecurity.org/NS/#configuration"); Element cipherAlgos = (Element) XPathAPI.selectSingleNode(doc, "/x:Configuration/x:EncryptionMethods", context);
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.events; import java.util.TreeMap; import org.apache.ambari.server.agent.stomp.dto.TopologyCluster; import com.fasterxml.jackson.annotation.JsonInclude; /** * Contains info about clusters topology update. This update will be sent to all subscribed recipients. * Is used to messaging to agents. */ @JsonInclude(JsonInclude.Include.NON_EMPTY) public class TopologyAgentUpdateEvent extends TopologyUpdateEvent { public TopologyAgentUpdateEvent(TreeMap<String, TopologyCluster> clusters, String hash, EventType eventType) { super(Type.AGENT_TOPOLOGY, clusters, hash, eventType); } }
1
package org.apache.aurora.scheduler.http; import org.antlr.stringtemplate.StringTemplate; import org.apache.aurora.gen.CronCollisionPolicy; import org.apache.aurora.gen.ScheduleStatus; import org.apache.aurora.gen.apiConstants; import org.apache.aurora.scheduler.base.JobKeys; import org.apache.aurora.scheduler.base.Query; import org.apache.aurora.scheduler.base.Tasks; import org.apache.aurora.scheduler.cron.CronPredictor; import org.apache.aurora.scheduler.quota.QuotaManager; import org.apache.aurora.scheduler.quota.Quotas; import org.apache.aurora.scheduler.state.CronJobManager; import org.apache.aurora.scheduler.storage.Storage; import org.apache.aurora.scheduler.storage.entities.IJobConfiguration; import org.apache.aurora.scheduler.storage.entities.IJobKey; import org.apache.aurora.scheduler.storage.entities.IQuota; import org.apache.aurora.scheduler.storage.entities.IScheduledTask; import org.apache.aurora.scheduler.storage.entities.ITaskConfig; import static org.apache.aurora.scheduler.base.Tasks.GET_STATUS; import static org.apache.aurora.scheduler.base.Tasks.LATEST_ACTIVITY;
0
* A {@link PCollectionView PCollectionView<T>} is an immutable view of a {@link PCollection} as a * value of type {@code T} that can be accessed e.g. as a side input to a * {@link com.google.cloud.dataflow.sdk.transforms.DoFn}. * <p>A {@code PCollectionView} should always be the output of a * {@link com.google.cloud.dataflow.sdk.transforms.PTransform}. It is the joint responsibility of * this transform and each {@link com.google.cloud.dataflow.sdk.runners.PipelineRunner} to implement * the view in a runner-specific manner. * * <p>The most common case is using the {@link com.google.cloud.dataflow.sdk.transforms.View} * transforms to prepare a {@link PCollection} for use as a side input to * {@link com.google.cloud.dataflow.sdk.transforms.ParDo}. See * {@link com.google.cloud.dataflow.sdk.transforms.View#asSingleton()}, * {@link com.google.cloud.dataflow.sdk.transforms.View#asIterable()}, and * {@link com.google.cloud.dataflow.sdk.transforms.View#asMap()} for more detail on specific views * available in the SDK.
0
import java.util.TreeMap; * <li>format: html|json|jsonp|txt|verbose.txt private static final String CORS_ORIGIN_HEADER_NAME = "Access-Control-Allow-Origin"; private Map<Result.Status, Integer> defaultStatusMapping; this.defaultStatusMapping = getStatusMapping(configuration.httpStatusMapping()); LOG.info("defaultStatusMapping={}", defaultStatusMapping); if (disabled) { LOG.info("Health Check Servlet is disabled by configuration"); return; } String httpStatusMappingParameterVal = request.getParameter(PARAM_HTTP_STATUS.name); final Map<Result.Status, Integer> statusMapping = httpStatusMappingParameterVal!=null ? getStatusMapping(httpStatusMappingParameterVal) : defaultStatusMapping; Integer httpStatus = statusMapping.get(overallResult.getStatus()); response.setStatus(httpStatus); Map<Result.Status, Integer> getStatusMapping(String mappingStr) { Map<Result.Status, Integer> statusMapping = new TreeMap<Result.Status, Integer>(); throw new IllegalArgumentException("Invalid parameter httpStatus=" + mappingStr + " " + e, e); if (!statusMapping.containsKey(Result.Status.TEMPORARILY_UNAVAILABLE)) { statusMapping.put(Result.Status.TEMPORARILY_UNAVAILABLE, 503); } statusMapping.put(Result.Status.CRITICAL, 503); statusMapping.put(Result.Status.HEALTH_CHECK_ERROR, 500); private static final long serialVersionUID = 1L;
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.provider.url; import org.apache.commons.vfs.provider.FileSystem; import org.apache.commons.vfs.provider.AbstractFileSystem; import org.apache.commons.vfs.provider.FileSystemProviderContext; import org.apache.commons.vfs.FileName; import org.apache.commons.vfs.FileObject; import org.apache.commons.vfs.FileSystemException; import java.net.URL; import java.net.MalformedURLException; /** * A File system backed by Java's URL API. * * @author <a href="mailto:[email protected]">Adam Murdoch</a> * @version $Revision: 1.1 $ $Date: 2002/08/21 01:39:47 $ */ public class UrlFileSystem extends AbstractFileSystem implements FileSystem { public UrlFileSystem( final FileSystemProviderContext context, final FileName rootName ) { super( context, rootName ); } /** * Creates a file object. */ protected FileObject createFile( final FileName name ) throws FileSystemException { try { final URL url = new URL( name.getURI() ); return new UrlFileObject( this, name, url ); } catch ( MalformedURLException e ) { throw new FileSystemException( e ); } } }
0
return (byte[]) bytes.clone();
0
stats = client.getMasterStats(Tracer.traceInfo(), creds.toThrift(c.instanceOperations().getInstanceID()));
0
import org.apache.commons.vfs2.FileObject;
0
import org.apache.ambari.logfeeder.util.LogFeederPropertiesUtil; String logFeederConfigFilesProperty = LogFeederPropertiesUtil.getConfigFiles(); int simulatedInputNumber = LogFeederPropertiesUtil.getSimulateInputNumber();
0
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ambari.view.hive20.resources.jobs.atsJobs; import org.json.simple.JSONObject; import java.util.List; public class HiveQueryId { public static long ATS_15_RESPONSE_VERSION = 2; // version returned from ATS 1.5 release public String url; public String entity; public String query; public List<String> dagNames; public List<JSONObject> stages; public long starttime; public long duration; public String operationId; public String user; public long version; }
0
Buffer buffer = getCommandBuffer(Integer.BYTES + NumberUtils.length(srcId) + Integer.BYTES + NumberUtils.length(dstId) + (3 * (Long.SIZE + Integer.BYTES)));
0
/** * Constructs a {@link PriorityQueue} of multiple SortedKeyValueIterators. Provides a simple way to interact with multiple SortedKeyValueIterators in sorted * order. */
0
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.fail; assertEquals("r1", entry.getKey().getRow().toString()); assertEquals("cf1", entry.getKey().getColumnFamily().toString()); assertEquals("cq1", entry.getKey().getColumnQualifier().toString()); assertEquals("v1", entry.getValue().toString()); assertFalse(iter.hasNext()); assertTrue("Found unexpected data in zookeeper for GC location: " + gcLoc, assertNotEquals("Could not find split point of GC location for: " + gcLoc, -1, loc); assertNotEquals("Could not find split of GC host:port for: " + addr, -1, addrSplit); assertNotEquals("0.0.0.0", host); assertNotEquals(0, Integer.parseInt(port)); fail("Could not find advertised GC address");
0
if(StringUtils.isNumeric(stringValue)) { long value = Long.valueOf(stringValue).longValue(); matches = value == Long.valueOf(parts[1]).longValue(); } else { matches = stringValue.equals(parts[1]); }
0
import java.io.*; import java.util.Map; @Test public void testRevokeExistingAgentCert() throws Exception { Map<String,String> config = certMan.configs.getConfigsMap(); config.put(Configuration.PASSPHRASE_KEY,"passphrase"); String agentHostname = "agent_hostname1"; SignCertResponse scr = certMan.signAgentCrt(agentHostname, "incorrect_agentCrtReqContent", "passphrase"); //Revoke command wasn't executed assertFalse(scr.getMessage().contains("-revoke")); //Emulate existing agent certificate File fakeAgentCertFile = new File(temp.getRoot().getAbsoluteFile() + File.separator + agentHostname + ".crt"); assertFalse(fakeAgentCertFile.exists()); fakeAgentCertFile.createNewFile(); assertTrue(fakeAgentCertFile.exists()); //Revoke command was executed scr = certMan.signAgentCrt(agentHostname, "incorrect_agentCrtReqContent", "passphrase"); assertTrue(scr.getMessage().contains("-revoke")); }
0
.apply(Latest.globally()); .apply(Latest.globally()); PCollection<Long> output = emptyInput.apply(Latest.globally()); .apply(Latest.perKey()); .apply(Latest.perKey()); .apply(Latest.perKey());
0
* Constructes an GVTFontFace with the specfied font-face attributes.
0
/* * $Id$ * 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
* 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.felix.dm.test.bundle.annotation.simple; import org.apache.felix.dm.annotation.api.Service; import org.apache.felix.dm.annotation.api.ServiceDependency; import org.apache.felix.dm.annotation.api.Start; import org.apache.felix.dm.annotation.api.Stop; import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer; /** * Consumes a service which is provided by the {@link Producer} class. */ @Service public class Consumer { @ServiceDependency Runnable m_runnable; @ServiceDependency Sequencer m_sequencer; @Start protected void start() { m_sequencer.step(2); m_runnable.run(); } @Stop protected void stop() { m_sequencer.step(4); } }
0
package org.apache.beam.sdk.util.common;
0
private static final int COLLECTOR_DEFAULT_PORT = 6188; collectorPort != null ? Integer.parseInt(collectorPort) : COLLECTOR_DEFAULT_PORT));
0
import java.awt.Rectangle; import java.awt.image.BufferedImageOp; import java.awt.image.ConvolveOp; import java.awt.image.Kernel;
0
private final boolean hasLegacyAttributeEnd; AtlasRelationshipEndDef end1Def = relationshipDef != null ? relationshipDef.getEndDef1() : null; AtlasRelationshipEndDef end2Def = relationshipDef != null ? relationshipDef.getEndDef2() : null; this.relationshipDef = relationshipDef; this.hasLegacyAttributeEnd = (end1Def != null && end1Def.getIsLegacyAttribute()) || (end2Def != null && end2Def.getIsLegacyAttribute()); this(relationshipDef); public boolean hasLegacyAttributeEnd() { return this.hasLegacyAttributeEnd; }
0
Copyright 2003 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */
0
Invoker.executeNode(consumer, val);
0
package org.apache.sshd.common.session;
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 org.apache.sshd.util.test.JUnitTestSupport; public class IoUtilsTest extends JUnitTestSupport {
0
Provider provider = (Provider)cons.newInstance();
0
byte[] row = {1}; byte[] colFamily = {0, 1}; byte[] colQualifier = {0, 0, 1}; byte[] colVisibility = {0, 0, 0, 1};
0
* <p>Anything stored within the in-memory buffer from offset {@link #size()} is considered * temporary unused storage. * <p>This coder does not support encoding positive infinity. * <p>The {@link UnsignedLexicographicalComparator} supports comparing {@link RandomAccessData}
0
final ClassWriter writer = new ClassWriter(0); mv.visitFieldInsn(Opcodes.PUTFIELD, this.getName().replace('.', '/'), propertyName, type.toString()); mv.visitMaxs(2, 2);
0
Connector conn = state.getInstance().getConnector(source);
0
* @param obj the object to compare with return // Do the cheapest tests first LangUtils.equals(this.targetHost, that.targetHost) && LangUtils.equals(this.localAddress, that.localAddress) &&
0
import java.util.ArrayList; import java.util.Collections; import java.util.Dictionary; import java.util.Enumeration; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; final Dictionary<String, Object> properties = new OrderedDictionary();
0
/* * Copyright 2016-2018 Seznam.cz, a.s.
0
* {@link SourceValidity#VALID}, as (in theory) Cocoon always accesses us return SourceValidity.VALID; * <p>This method will return {@link SourceValidity#VALID} if and only if * {@link SourceValidity#INVALID} in all other cases.</p> return (this.equals(validity)? VALID: INVALID);
0
import org.apache.accumulo.fate.zookeeper.ZooUtil; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @SuppressFBWarnings(value = {"PATH_TRAVERSAL_IN", "URLCONNECTION_SSRF_FD"}, justification = "path provided by test; url provided by test") SSLContext ctx = SSLContext.getInstance("TLSv1.2"); @SuppressFBWarnings(value = "WEAK_TRUST_MANAGER", justification = "trust manager is okay for testing") @SuppressFBWarnings(value = "WEAK_HOSTNAME_VERIFIER", justification = "okay for test")
0
/* * Copyright 2000-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.bcel.generic;
0
* @version $Id$
0
ClassLoader cl = extractor.extractViewArchive(viewDefinition, archiveFile, extractedArchiveDirFile); } viewDefinition.setConfiguration(viewConfig); for (InstanceConfig instanceConfig : viewConfig.getInstances()) { ViewInstanceEntity instanceEntity = createViewInstanceDefinition(viewConfig, viewDefinition, instanceConfig); instanceEntity.setXmlDriven(true); instanceDefinitions.add(instanceEntity);
0
import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.Random;
0
import org.apache.ambari.server.state.State; private boolean validateScanResults(Map<ServiceComponentHost, Boolean> scanResuls) { int startedComponents = 0; activeMasters += (entry.getValue() && entry.getKey().getState() == State.STARTED) ? 1 : 0; startedComponents += (entry.getKey().getState() == State.STARTED) ? 1 : 0; if (startedComponents > 0) { if (activeMasters == 0 || activeMasters > 1) { res = false; } else { res = true; } } else { if (activeMasters > 0) { res = false; } else { res = true; } LOG.info("Results of HBASE_MASTER scan are " + ((res) ? "valid" : "invalid")); return res;
0
import java.util.Collections; import java.util.List; List<Range> ranges = Collections.singletonList(new Range(new Key("a"), new Key("b"))); BatchInputSplit split = new BatchInputSplit("table", Table.ID.of("1"), ranges, List<Range> ranges = Collections.singletonList(new Range(new Key("a"), new Key("b"))); BatchInputSplit split = new BatchInputSplit("table", Table.ID.of("1"), ranges,
0
package org.apache.commons.vfs2.util; import org.apache.commons.vfs2.FileSystemConfigBuilder; import org.apache.commons.vfs2.FileSystemException; import org.apache.commons.vfs2.FileSystemManager; import org.apache.commons.vfs2.FileSystemOptions;
1
* The connection must already be open or tunnelled * to the host and port, but the scheme of the target
0
public void testCommandLineParsingWithExpansion3() {
0
final List<OperatingSystemEntity> operatingSystems = new ArrayList<>();
0
import java.util.Map; Map<Long,QuorumServer> peers;
0
return requestPoolEntry(route, state).getPoolEntry(timeout, tunit); public abstract PoolEntryRequest requestPoolEntry(HttpRoute route, Object state);
0
import java.util.Collection;
0
package org.apache.beam.sdk.util.state;
0
* The name/key the set of validation rules is stored under. * @deprecated Subclasses should use getFieldMap() instead. public void setExtends(String inherit) { this.inherit = inherit; /** * Returns a Map of String field keys to Field objects. * @since Validator 1.2.0 */ protected Map getFieldMap() { return hFields; }
1
import org.apache.commons.jxpath.JXPathTypeConversionException; String string = value == null ? "null" : value.getClass().getName(); throw new JXPathTypeConversionException( "Cannot convert value of class " + string + " to type " + type, ex);
0
600_000, "e2add2f680de9024e9bc46cd3912545e",
0
Collection<PublicKey> keys = tracker.loadMatchingAuthorizedEntries(session, Collections.singletonList(pke)); PublicKey expected = pke.resolvePublicKey(session, Collections.emptyMap(), tracker);
0
import org.apache.accumulo.trace.instrument.Span; import org.apache.accumulo.trace.instrument.Trace; import org.apache.accumulo.trace.instrument.Tracer; import org.apache.accumulo.trace.thrift.TInfo;
0
@Override
0
import java.util.Collection; assertEquals("Number of configurations", 2, cc.getNumberOfConfigurations()); assertEquals("Number of configurations", 2, cc.getNumberOfConfigurations()); assertEquals("Number of configurations", 3, cc.getNumberOfConfigurations()); assertEquals("Number of configurations", 2, cc.getNumberOfConfigurations()); assertEquals("Number of configurations", 1, cc.getNumberOfConfigurations()); Configuration subset = cc.subset("test"); public void testInstanciateWithCollectiono() { Collection configs = new ArrayList(); configs.add(xmlConf); configs.add(conf1); configs.add(conf2); CompositeConfiguration config = new CompositeConfiguration(configs); assertEquals("Number of configurations", 4, config.getNumberOfConfigurations()); assertTrue("The in memory configuration is not empty", config.getInMemoryConfiguration().isEmpty()); }
0
URL getURL() throws FileSystemException;
0
Copyright 2001 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
* Copyright 2002-2005 The Apache Software Foundation.
0
import org.apache.ambari.server.orm.dao.ResourceTypeDAO; import org.apache.ambari.server.orm.entities.ResourceEntity; import org.apache.ambari.server.orm.entities.ResourceTypeEntity; import javax.persistence.EntityManager; ResourceTypeDAO resourceTypeDAO = injector.getInstance(ResourceTypeDAO.class); // create an admin resource to represent this cluster ResourceTypeEntity resourceTypeEntity = resourceTypeDAO.findById(ResourceTypeEntity.CLUSTER_RESOURCE_TYPE); if (resourceTypeEntity == null) { resourceTypeEntity = new ResourceTypeEntity(); resourceTypeEntity.setId(ResourceTypeEntity.CLUSTER_RESOURCE_TYPE); resourceTypeEntity.setName(ResourceTypeEntity.CLUSTER_RESOURCE_TYPE_NAME); resourceTypeEntity = resourceTypeDAO.merge(resourceTypeEntity); } ResourceEntity resourceEntity = new ResourceEntity(); resourceEntity.setResourceType(resourceTypeEntity); clusterEntity.setResource(resourceEntity);
0
import java.util.SortedMap;
0
public static <E> Set<E> decorateTransform(Set<E> set, Transformer<? super E, ? extends E> transformer) { TransformedSet<E> decorated = new TransformedSet<E>(set, transformer); @SuppressWarnings("unchecked") // set is type E E[] values = (E[]) set.toArray();
0
package org.apache.felix.dm.test.components;
0
LOG.debug("Extracting {}", entryPath); LOG.debug("Making directory {}", entryPath); LOG.debug("Begin copying from {} to {}", jarEntry.getName(), entryPath); LOG.debug("Finish copying from {} to {}", jarEntry.getName(), entryPath);
1
import org.apache.felix.service.command.Descriptor; @ServiceProperty(name = "osgi.command.scope", value = "ipojo") String m_scope; @ServiceProperty(name = "osgi.command.function", value = "{}") @Descriptor("Display iPOJO instances") @Descriptor("Display the architecture of a specific instance") public void instance(@Descriptor("target instance name") String instance) { @Descriptor("Display the information about a specific factory") public void factory(@Descriptor("target factory") String factory) { @Descriptor("Display iPOJO factories") @Descriptor("Display iPOJO handlers")
0
* Most users should use {@link GenerateSequence} instead. * * <p>A source that produces longs. When used as a {@link BoundedSource}, {@link CountingSource} * starts at {@code 0} and counts up to a specified maximum. When used as an {@link * UnboundedSource}, it counts up to {@link Long#MAX_VALUE} and then never produces more output. (In * practice, this limit should never be reached.) * <p>To produce a bounded source, use {@link #createSourceForSubrange(long, long)}. To produce an * unbounded source, use {@link #createUnboundedFrom(long)}. * @deprecated use {@link GenerateSequence} instead * @deprecated use {@link GenerateSequence} instead * @deprecated use {@link GenerateSequence} and call * {@link GenerateSequence#withTimestampFn(SerializableFunction)} instead
0
import org.apache.commons.vfs.Capability; protected void addCapabilities(Collection<Capability> caps)
0
// for each text run, see if it contains the current char. int idx = layout.getGlyphIndex(charIndex);
0
* * import java.util.EventListener; import org.osgi.framework.Bundle; import org.osgi.framework.Filter; public class ListenerInfo implements ListenerHook.ListenerInfo private final Bundle m_bundle; private final Class m_listenerClass; private final EventListener m_listener; private final Filter m_filter; private final Object m_acc; private final boolean m_removed; public ListenerInfo( Bundle bundle, Class listenerClass, EventListener listener, Filter filter, Object acc, boolean removed) m_bundle = bundle; m_listenerClass = listenerClass; m_acc = acc; public ListenerInfo(ListenerInfo info, boolean removed) { m_bundle = info.m_bundle; m_listenerClass = info.m_listenerClass; m_listener = info.m_listener; m_filter = info.m_filter; m_acc = info.m_acc; m_removed = removed; } public Bundle getBundle() { return m_bundle; } return m_bundle.getBundleContext(); public Class getListenerClass() { return m_listenerClass; } public EventListener getListener() { return m_listener; } public Filter getParsedFilter() public String getFilter() { if (m_filter != null) { return m_filter.toString(); } return null; } public Object getSecurityContext() { return m_acc; } @Override public boolean equals(Object obj) if (obj == this) if (!(obj instanceof ListenerInfo)) ListenerInfo other = (ListenerInfo) obj; @Override public int hashCode()
0
String tempLocation = bqOptions.getTempLocation(); checkArgument( !Strings.isNullOrEmpty(tempLocation), "BigQueryIO.Read needs a GCS temp location to store temp files."); if (bigQueryServices == null) { try { GcsPath.fromUri(tempLocation); } catch (IllegalArgumentException e) { throw new IllegalArgumentException( String.format( "BigQuery temp location expected a valid 'gs://' path, but was given '%s'", tempLocation), e); } }
0
private static final Set<String> RESERVED_KEYS = new HashSet<String>(11);
0
import org.apache.beam.runners.core.construction.ReplacementOutputs; import org.apache.beam.sdk.io.WriteFilesResult; class WriteWithShardingFactory<InputT, DestinationT> PCollection<InputT>, WriteFilesResult<DestinationT>, PTransform<PCollection<InputT>, WriteFilesResult<DestinationT>>> { public PTransformReplacement<PCollection<InputT>, WriteFilesResult<DestinationT>> getReplacementTransform( AppliedPTransform< PCollection<InputT>, WriteFilesResult<DestinationT>, PTransform<PCollection<InputT>, WriteFilesResult<DestinationT>>> transform) { WriteFiles<InputT, DestinationT, ?> replacement = Map<TupleTag<?>, PValue> outputs, WriteFilesResult<DestinationT> newOutput) { // We must connect the new output from WriteFilesResult to the outputs provided by the original // transform. return ReplacementOutputs.tagged(outputs, newOutput);
0
import com.google.common.base.Preconditions;
0
static final int DATASTORE_BATCH_UPDATE_BYTES_LIMIT = 9_000_000;
0
/* * $Header: /cvshome/build/ee.foundation/src/java/util/ListIterator.java,v 1.6 2006/03/14 01:20:25 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.util; public abstract interface ListIterator extends java.util.Iterator { public abstract void add(java.lang.Object var0); public abstract boolean hasNext(); public abstract boolean hasPrevious(); public abstract java.lang.Object next(); public abstract int nextIndex(); public abstract java.lang.Object previous(); public abstract int previousIndex(); public abstract void remove(); public abstract void set(java.lang.Object var0); }
0
File[] files = f.listFiles(pathname -> pathname.getName().endsWith("site.xml"));
0
Map<String, Set<String>> componentHostGroupMap = new HashMap<>(); Set<String> components1 = new HashSet<>(); Set<String> components2 = new HashSet<>(); new HashMap<>(); Set<String> componentNames1 = new HashSet<>(); Set<String> componentNames2 = new HashSet<>();
0
* * @author Scott Sanders - Added ASL, removed external dependencies public class ObjectTestImpl { private Long longValue = new Long( -1L ); public ObjectTestImpl() { public String toString() { for ( Object o : children ) { public void add( Object o ) { children.add( o ); public void setValue( String val ) { public void setLongValue( Long val ) { public Long getLongValue() { public void setStringValue( String val ) { public boolean isPushed() { public void push() { public void setMapValue( String name, String value ) { public String getMapValue( String name ) { public String getProperty() { public void setProperty( String pProperty ) {
1
import org.apache.atlas.web.integration.BaseResourceIT;
0
public void setUp() throws Exception { initServer(); public void tearDown() throws Exception { shutDownServer();
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
return getManifest( project, new LinkedHashMap(), new Properties(), classpath ); boolean hasErrors = reportErrors( "Manifest " + project.getArtifact(), analyzer ); if ( hasErrors ) Builder analyzer = getOSGiBuilder( project, instructions, properties, classpath ); addMavenInstructions( project, analyzer ); mergeMavenManifest( project, analyzer );
0
package org.apache.accumulo.test.randomwalk.security; import org.apache.accumulo.test.randomwalk.State; import org.apache.accumulo.test.randomwalk.Test;
0
import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.repository.store.bootstrap.AtlasTypeDefStoreInitializer; import org.apache.atlas.type.AtlasTypeRegistry; import org.apache.commons.io.FileUtils; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileNotFoundException; private final AtlasTypeRegistry typeRegistry; public ImportService(final AtlasTypeDefStore typeDefStore, final AtlasEntityStore entityStore, AtlasTypeRegistry typeRegistry) { this.typeRegistry = typeRegistry; setGuidToEmpty(typeDefinitionMap); AtlasTypesDef typesToCreate = AtlasTypeDefStoreInitializer.getTypesToCreate(typeDefinitionMap, this.typeRegistry); if (!typesToCreate.isEmpty()) { typeDefStore.createTypesDef(typesToCreate); } typeDefStore.updateTypesDef(typeDefinitionMap); private void setGuidToEmpty(AtlasTypesDef typesDef) { for (AtlasEntityDef def: typesDef.getEntityDefs()) { def.setGuid(null); } for (AtlasClassificationDef def: typesDef.getClassificationDefs()) { def.setGuid(null); } for (AtlasEnumDef def: typesDef.getEnumDefs()) { def.setGuid(null); } for (AtlasStructDef def: typesDef.getStructDefs()) { def.setGuid(null);
0
import org.apache.beam.vendor.grpc.v1p21p0.io.grpc.ClientInterceptor; import org.apache.beam.vendor.grpc.v1p21p0.io.grpc.ManagedChannel; import org.apache.beam.vendor.grpc.v1p21p0.io.grpc.ManagedChannelBuilder; import org.apache.beam.vendor.grpc.v1p21p0.io.grpc.netty.NettyChannelBuilder; import org.apache.beam.vendor.grpc.v1p21p0.io.netty.channel.epoll.EpollDomainSocketChannel; import org.apache.beam.vendor.grpc.v1p21p0.io.netty.channel.epoll.EpollEventLoopGroup; import org.apache.beam.vendor.grpc.v1p21p0.io.netty.channel.epoll.EpollSocketChannel; import org.apache.beam.vendor.grpc.v1p21p0.io.netty.channel.unix.DomainSocketAddress; org.apache.beam.vendor.grpc.v1p21p0.io.netty.channel.epoll.Epoll.ensureAvailability();
0
import org.apache.atlas.repository.store.graph.v1.AtlasEntityStream; import java.util.Map; EntityGraphDiscoveryContext discoverEntities() throws AtlasBaseException;
1