Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
public class LicenseManager implements ILicenseManager { private HashMap<String, Pattern> licenses = new HashMap<String, Pattern>(); private HashMap<String, LicensePolicy> policies = new HashMap<String, LicensePolicy>(); private LicensePolicy defaultPolicy = new LicensePolicy( this ); public void addLicense( String name, Pattern pattern ) { licenses.put( name, pattern ); } public void removeLicense( String name ) { licenses.remove( name ); } public Set<String> getLicenseNames() { return Collections.unmodifiableSet( licenses.keySet() ); } public Pattern getLicensePattern( String name ) { return licenses.get( name ); } public ILicensePolicy getDefaultPolicy() { return defaultPolicy; } //public ILicensePolicy getPolicy(ISigilProjectModel project) { // synchronized( policies ) { // LicensePolicy p = policies.get(project.getName()); // // if ( p == null ) { // p = new LicensePolicy(this, project); // policies.put( project.getName(), p ); // } // // return p; // } //}
0
import org.apache.beam.sdk.PipelineRunner;
0
* NameFileComparator.NAME_COMPARATOR.sort(list); * NameFileComparator.NAME_INSENSITIVE_REVERSE.sort(array); public class NameFileComparator extends AbstractFileComparator implements Serializable {
0
ModificationHandler { * The default value producer. */ protected DefaultAttributeValueProducer defaultValueProducer; /** * @param def The default value producer. public SVGOMAnimatedLength(SVGOMElement elt, String nsURI, String attr, DefaultAttributeValueProducer def) { defaultValueProducer = def; baseVal.setModificationHandler(this); } else { baseVal.parseLength(defaultValueProducer.getDefaultAttributeValue()); } * Returns the associated element. */ public SVGElement getSVGElement() { return element; } /** * Implements {@link ModificationHandler#valueChanged(String)}. public void valueChanged(String value) {
0
@XmlElement(name="supportDeleteViaUI") private Boolean supportDeleteViaUIField; private boolean supportDeleteViaUIInternal = true; public Boolean getSupportDeleteViaUIField(){ return supportDeleteViaUIField; } public void setSupportDeleteViaUIField(Boolean supportDeleteViaUIField) { this.supportDeleteViaUIField = supportDeleteViaUIField; } public boolean isSupportDeleteViaUI() { if (null != supportDeleteViaUIField) { return supportDeleteViaUIField.booleanValue(); } // If set to null and has a parent, then the value would have already been resolved and set. // Otherwise, return the default value (true). return this.supportDeleteViaUIInternal; } public void setSupportDeleteViaUI(boolean supportDeleteViaUI){ this.supportDeleteViaUIInternal = supportDeleteViaUI; }
0
* ConditionalWriter provides the ability to do efficient, atomic read-modify-write operations on * rows. These operations are performed on the tablet server while a row lock is held. * If this method throws an exception, then its possible the mutation is still being actively * processed. Therefore if code chooses to continue after seeing an exception it should take * this into consideration. throw new AccumuloSecurityException(ase.getUser(), SecurityErrorCode.valueOf(ase.getSecurityErrorCode().name()), ase.getTableInfo(), ase); * @return A copy of the mutation previously submitted by a user. The mutation will reference * the same data, but the object may be different. * error occurred after mutation was sent to server, its unknown if the mutation was written. * Although the status of the mutation is unknown, Accumulo guarantees the mutation will not be * written at a later point in time. * This method returns one result for each mutation passed to it. This method is thread safe. * Multiple threads can safely use a single conditional writer. Sharing a conditional writer * between multiple threads may result in batching of request to tablet servers. * @return Result for each mutation submitted. The mutations may still be processing in the * background when this method returns, if so the iterator will block.
0
* Copyright (c) 1999 The Apache Software Foundation. All rights * notice, this list of conditions and the following disclaimer. * if any, must include the following acknowledgment: * software without prior written permission. For written * The development of this software was partly funded by the European * Commission in the <WebSig> project in the ISIS Programme. import org.apache.xml.security.utils.XMLUtils; + XMLUtils.getXalanVersion();
0
import static java.util.Objects.requireNonNull; requireNonNull(className); requireNonNull(opts);
0
@Override protected int defaultTimeoutSeconds() { return 60; } @Test
0
* If it is not yet {@link #open open} but {@link #announce announced},
0
/* * Copyright (c) OSGi Alliance (2016). All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.osgi.util.converter; public interface ConvertingTypeSettings { Converting as(Class<?> type); // change to Type? Converting asJavaBean(); }
0
List<String> messages = new ArrayList<>();
0
* @version $Id: BooleanType.java,v 1.3 2004/02/11 09:53:44 antonio Exp $
0
public class PlainSocketFactory extends AbstractConnectionSocketFactory {
0
package org.apache.aurora.scheduler.storage.backup; import org.apache.aurora.codec.ThriftBinaryCodec; import org.apache.aurora.codec.ThriftBinaryCodec.CodingException; import org.apache.aurora.gen.storage.Snapshot; import org.apache.aurora.scheduler.storage.SnapshotStore;
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
* e.g. x = { a$args }; x 1 2 =&gt; a1 2 and not a[1, 2]
0
import static org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList;
0
return NullableCoder.of(inputTVCoder.getValueCoder());
0
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap;
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.runtime.core.services; /** * Simple users. */ public interface User { public String getName(); public int getType(); }
0
* <p> * </p> * * <p> * </p> * <p> * </p> * * <p> * </p> * * <p> * </p> * * <p> * </p> * * <p> * </p> * * <p> * </p> * * <p> * </p> * * <p> * </p> * @throws IOException if failed to consume the data * Called to indicate EOF. The client will no longer send us any more data. * * @throws IOException if failed
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/decorators/Attic/TestTransformedList.java,v 1.3 2003/10/02 22:14:34 scolebourne Exp $ import org.apache.commons.collections.AbstractTestList; * @version $Revision: 1.3 $ $Date: 2003/10/02 22:14:34 $ public class TestTransformedList extends AbstractTestList {
0
* @version $Revision$
0
import org.osgi.util.converter.Functioning; @Override public Functioning function() { return new FunctioningImpl(this); }
0
.setConnectionTimeout(33, TimeUnit.MILLISECONDS)
0
public <OutputT extends POutput, InputT extends PInput> OutputT apply( PTransform<InputT, OutputT> transform, InputT input) {
0
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @SuppressFBWarnings(value = "PATH_TRAVERSAL_IN", justification = "paths not set by user input")
0
* Annotates an Adapater service component. Adapters, like {@link AspectService}, are used to "extend" * The AdapterService will also have the following service property: p1=v1, p2=v2 : * interface AdapteeService { * void method1(); * void method2(); * } * * &#64;Component * &#64;Property(name="p1", value="v1") * class Adaptee implements AdapteeService { * ... * } * * interface AdapterService { * void doWork(); * } * * &#64;Property(name="p2", value="v2") * volatile AdapteeService adaptee; * adaptee.method1(); * @deprecated you can apply {@link Property} annotation directly on the component class. * in any attributes of the adapter implementation that are of the same type as the adaptee interface. /** * The service scope for the service of this Component. * * <p> * If not specified, the {@link ServiceScope#SINGLETON singleton} service * scope is used. */ ServiceScope scope() default ServiceScope.SINGLETON;
0
this.connpool = new BasicNIOConnPool(this.ioReactor, new BasicNIOConnFactory(connFactory), 0);
0
import java.net.ServerSocket; import org.junit.Ignore; private int port; @Ignore("AES192CBC is not always available by default") @Ignore("AES192CBC is not always available by default") ServerSocket s = new ServerSocket(0); port = s.getLocalPort(); s.close(); sshd.setPort(port); com.jcraft.jsch.Session s = sch.getSession("smx", "localhost", port);
0
/** Properties needed when using Bigtable with the Beam SDK. */
1
Table hiveTable = setupTable(hiveClient, TEST_DB_NAME, TEST_TABLE_NAME); String processQualifiedName = HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, hiveTable); when(atlasClient.searchByDSL(HiveMetaStoreBridge.getProcessDSLQuery(HiveDataTypes.HIVE_PROCESS.getName(), processQualifiedName))).thenReturn(getEntityReference("82e06b34-9151-4023-aa9d-b82103a50e77")); String processQualifiedName = HiveMetaStoreBridge.getTableQualifiedName(CLUSTER_NAME, hiveTable); when(atlasClient.searchByDSL(HiveMetaStoreBridge.getProcessDSLQuery(HiveDataTypes.HIVE_PROCESS.getName(), processQualifiedName))).thenReturn(getEntityReference("82e06b34-9151-4023-aa9d-b82103a50e77"));
0
import java.io.IOException; import java.util.HashMap; import java.util.Map; return new AppConfigurationEntry[]{ AppConfigurationEntry.LoginModuleControlFlag.REQUIRED, new HashMap<String, Object>())
1
* * @version $Id: FieldDefinition.java,v 1.3 2004/02/11 10:43:30 antonio Exp $
0
public Builder setExpectContinueEnabled(final boolean expectContinueEnabled) { public Builder setStaleConnectionCheckEnabled(final boolean staleConnectionCheckEnabled) { public Builder setRedirectsEnabled(final boolean redirectsEnabled) { public Builder setRelativeRedirectsAllowed(final boolean relativeRedirectsAllowed) { public Builder setCircularRedirectsAllowed(final boolean circularRedirectsAllowed) { public Builder setAuthenticationEnabled(final boolean authenticationEnabled) { public Builder setConnectTimeout(final int connectTimeout) {
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.commons.bcel6.generic; /** * IXOR - Bitwise XOR int * <PRE>Stack: ..., value1, value2 -&gt; ..., result</PRE> * * @version $Id$ * @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A> */ public class IXOR extends ArithmeticInstruction { private static final long serialVersionUID = -6524415552072672532L; public IXOR() { super(org.apache.commons.bcel6.Constants.IXOR); } /** * Call corresponding visitor method(s). The order is: * Call visitor methods of implemented interfaces first, then * call methods according to the class hierarchy in descending order, * i.e., the most specific visitXXX() call comes last. * * @param v Visitor object */ @Override public void accept( Visitor v ) { v.visitTypedInstruction(this); v.visitStackProducer(this); v.visitStackConsumer(this); v.visitArithmeticInstruction(this); v.visitIXOR(this); } }
1
import javax.annotation.Nullable; private @Nullable T nextElement;
0
public <R, P> R accept( NodeVisitor<? extends R, ? super P> visitor, P data ) throws OgnlException
0
if (chopped) { if (state.equals(TabletState.HOSTED)) { this.chopped++; } else if (!hasWALs) { this.chopped++; } } log.info("Computing next merge state for " + info.getRange() + " which is presently " + state + " isDelete : " + info.isDelete()); log.info("failed to see any tablets for this range, ignoring " + info.getRange()); log.info("Merge range is already contained in a single tablet " + info.getRange()); log.info("Waiting for " + info + " lower split to occur " + info.getRange()); log.info("Waiting for " + info + " upper split to occur " + info.getRange()); log.info("Waiting for " + hosted + " hosted tablets to be " + total + " " + info.getRange()); log.info(chopped + " tablets are chopped " + info.getRange()); log.info("Waiting for " + chopped + " chopped tablets to be " + needsToBeChopped + " " + info.getRange()); log.info(chopped + " tablets are chopped, " + unassigned + " are offline " + info.getRange()); log.info("Waiting for " + unassigned + " unassigned tablets to be " + total + " " + info.getRange()); log.info(unassigned + " tablets are unassigned " + info.getRange()); if (!tls.walogs.isEmpty() && verify.getMergeInfo().overlaps(tls.extent)) {
0
HashSet<String> expectedServices = new HashSet<>(); Map<String, ServiceInfo> serviceMap = new HashMap<>(); HashSet<String> expectedServices = new HashSet<>(); assertEquals(new HashSet<>(stormServiceComponents), new HashSet<>(baseStormServiceComponents)); HashSet<String> expectedServices = new HashSet<>();
1
extends DoFnOperator<KeyedWorkItem<K, InputT>, KV<K, OutputT>> {
0
import com.google.inject.Inject; import com.google.inject.Singleton; import org.apache.ambari.view.tez.exceptions.TezWebAppException; import org.slf4j.LoggerFactory; import java.util.HashMap; import java.util.Map; private static final Logger LOG = LoggerFactory.getLogger(ViewControllerImpl.class); String message = "Failed to find YARN Timeline Server location!"; LOG.error(message, ex); throw new TezWebAppException(message, ex); String message = "Failed to find Active ResourceManager location!"; LOG.error(message, ex); throw new TezWebAppException(message, ex); try { return ambariApi.getServices().getYARNProtocol(); } catch (AmbariApiException ex) { String message = "Failed to find YARN http/https protocol configuration value!"; LOG.error(message, ex); throw new TezWebAppException(message, ex); }
0
private static final Pattern SINGLE_QUOTED_IDENTIFIER = Pattern.compile("'(\\w[\\w\\d\\.\\s]*)'"); private static final Pattern DOUBLE_QUOTED_IDENTIFIER = Pattern.compile("\"(\\w[\\w\\d\\.\\s]*)\""); private static final Pattern BACKTICK_QUOTED_IDENTIFIER = Pattern.compile("`(\\w[\\w\\d\\.\\s]*)`"); public static String get(String quotedIdentifier) { String ret; if (quotedIdentifier.charAt(0) == '`') { ret = extract(BACKTICK_QUOTED_IDENTIFIER, quotedIdentifier); } else if (quotedIdentifier.charAt(0) == '\'') { ret = extract(SINGLE_QUOTED_IDENTIFIER, quotedIdentifier); } else if (quotedIdentifier.charAt(0) == '"') { ret = extract(DOUBLE_QUOTED_IDENTIFIER, quotedIdentifier); } else { ret = quotedIdentifier; public static Advice create(GremlinQueryComposer.Context context, GremlinQueryComposer.Context context, return rhs.replace("\"", "") .replace("'", "") .replace("`", ""); this.actual = IdentifierHelper.get(raw); private void update(org.apache.atlas.query.Lookup lookup, GremlinQueryComposer.Context context) { private void updateSubTypes(org.apache.atlas.query.Lookup lookup, GremlinQueryComposer.Context context) { private void updateEdgeInfo(org.apache.atlas.query.Lookup lookup, GremlinQueryComposer.Context context) { private void updateTypeInfo(org.apache.atlas.query.Lookup lookup, GremlinQueryComposer.Context context) { private void setIsDate(Lookup lookup, GremlinQueryComposer.Context context) {
0
import org.apache.felix.ipojo.composite.service.importer.ImportExportHandler; import org.apache.felix.ipojo.composite.service.instantiator.ServiceInstantiatorHandler; /** * Available composite handlers in the iPOJO bundle. */ public static final Class[] INTERNAL_COMPOSITE_HANDLERS = new Class[] { ServiceInstantiatorHandler.class, ImportExportHandler.class, org.apache.felix.ipojo.composite.architecture.ArchitectureHandler.class };
0
* Sets the topKey and topValue based on the top key of the source. If the column of the source top key is in the set of combiners, topKey will be the top key * of the source and topValue will be the result of the reduce method. Otherwise, topKey and topValue will be unchanged. (They are always set to null before * this method is called.) if (combiners.contains(workKey)) {
0
public class LogicalTimeIT extends SimpleMacIT {
0
String testDataPath = System.getProperty("test.data.dir", "src/test/resources/data");
0
* @param object object to test * @param toType target class * @return boolean * @param object object to convert * @param toType target class * @return resulting Object
0
* Copyright 1999-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 CVS $Id: OdmgImplementationImpl.java,v 1.3 2004/03/05 13:02:02 bdelacretaz Exp $
1
* @version CVS $Id: Environment.java,v 1.3 2003/05/04 19:03:01 stephan Exp $ String getRootContext(); String getContext(); /** * Set the context. This is similar to changeContext() * except that it is absolute. */ void setContext(String prefix, String uri, String context);
0
return String.format("<a href='/trace/listType?type=%s&minutes=%d'>%s</a>", encodedType, minutes, type); public void pageBody(HttpServletRequest req, HttpServletResponse resp, StringBuilder sb) throws Exception { trace.addSortableColumn("Histogram", new HistogramType(), "Counts of spans of different duration. Columns start at milliseconds, and each column is ten times longer: tens of milliseconds, seconds, tens of seconds, etc.");
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
/** * Generated serial version ID. */ private static final long serialVersionUID = 4354731610923110264L;
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//jxpath/src/test/org/apache/commons/jxpath/ri/compiler/CoreFunctionTest.java,v 1.8 2004/01/19 20:44:52 dmitri Exp $ * $Revision: 1.8 $ * $Date: 2004/01/19 20:44:52 $ * @version $Revision: 1.8 $ $Date: 2004/01/19 20:44:52 $ return NodePointer.newNodePointer(null, "42", null);
0
package org.apache.accumulo.shell.commands; import org.apache.accumulo.shell.Shell; import org.apache.accumulo.shell.ShellExtension; import org.apache.accumulo.shell.Shell.Command;
0
public <C> int getMatchingChildrenCount(ImmutableNode node, NodeMatcher<C> matcher, C criterion) { return getMatchingChildren(node, matcher, criterion).size(); /** * {@inheritDoc} This implementation returns an immutable list with all * child nodes accepted by the specified matcher. */ public <C> List<ImmutableNode> getMatchingChildren(ImmutableNode node, NodeMatcher<C> matcher, C criterion) { List<ImmutableNode> result = new ArrayList<ImmutableNode>(node.getChildren().size()); for (ImmutableNode c : node.getChildren()) { if (matcher.matches(c, this, criterion)) { result.add(c); } } return Collections.unmodifiableList(result);
0
ValueProvider<String> nvp = NestedValueProvider.of(svp, from -> from + "bar"); ValueProvider<String> nvp = NestedValueProvider.of(rvp, from -> from + "bar"); ValueProvider<String> doubleNvp = NestedValueProvider.of(nvp, from -> from);
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/share/org/apache/commons/validator/Validator.java,v 1.30 2003/08/26 16:11:48 rleland Exp $ * $Revision: 1.30 $ * $Date: 2003/08/26 16:11:48 $ * @version $Revision: 1.30 $ $Date: 2003/08/26 16:11:48 $
0
extends CloseableUtils.AbstractInnerCloseable implements Channel, ExecutorServiceConfigurer { protected ExecutorService executor; protected boolean shutdownExecutor; protected final AtomicBoolean eof = new AtomicBoolean(false); : SshConstants.SSH_MSG_CHANNEL_FAILURE; Collection<?> running = service.shutdownNow();
1
package org.apache.commons.ognl.internal; import org.apache.commons.ognl.internal.entry.MethodAccessCacheEntryFactory; import org.apache.commons.ognl.internal.entry.MethodAccessEntryValue; import org.apache.commons.ognl.test.objects.Root; import org.junit.Assert; import org.junit.Test; import java.lang.reflect.Method; /** * User: Maurizio Cucchiara * Date: 10/17/11 * Time: 12:59 AM */ public class MethodAccessCacheTest { private Cache<Method, MethodAccessEntryValue> cache = new ConcurrentHashMapCache<Method, MethodAccessEntryValue>( new MethodAccessCacheEntryFactory( ) ); @Test public void testGetAccessibleNonPublicMethod( ) throws Exception { Method method = Root.class.getDeclaredMethod( "getPrivateAccessorIntValue3" ); MethodAccessEntryValue methodAccessValue = cache.get( method ); Assert.assertTrue( methodAccessValue.isNotPublic( ) ); Assert.assertFalse( methodAccessValue.isAccessible()); } @Test public void testGetNotAccessibleNonPublicMethod( ) throws Exception { Method method = Root.class.getDeclaredMethod( "getPrivateAccessorIntValue3" ); method.setAccessible( true ); MethodAccessEntryValue methodAccessValue = cache.get( method ); Assert.assertTrue( methodAccessValue.isNotPublic( ) ); Assert.assertTrue( methodAccessValue.isAccessible()); } @Test public void testGetPublicMethod( ) throws NoSuchMethodException, CacheException { Method method = Root.class.getDeclaredMethod( "getArray" ); MethodAccessEntryValue methodAccessValue = cache.get( method ); Assert.assertFalse( methodAccessValue.isNotPublic( ) ); Assert.assertTrue( methodAccessValue.isAccessible()); } }
0
if (super.validateOptions(options) == false) return false; try { setEncoder(options); } catch (Exception e) { throw new IllegalArgumentException("bad encoder option", e); }
1
public ABlockWriter prepareMetaBlock(String name, String compressionName) throws IOException; public ABlockWriter prepareMetaBlock(String name) throws IOException; public ABlockWriter prepareDataBlock() throws IOException; public void close() throws IOException;
1
* any, must include the following acknowledgement: * Alternately, this acknowledgement may appear in the software itself, * if and wherever such third-party acknowledgements normally appear. * permission of the Apache Software Foundation.
0
public DefaultClientIdentitiesWatcher( boolean supportedOnly, ClientIdentityLoader loader, FilePasswordProvider provider, boolean strict) {
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.hive2; import org.apache.ambari.view.ViewContext; import org.apache.ambari.view.hive2.utils.SharedObjectsFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.inject.Inject; /** * Parent service */ public class BaseService { @Inject protected ViewContext context; protected final static Logger LOG = LoggerFactory.getLogger(BaseService.class); private SharedObjectsFactory sharedObjectsFactory; public SharedObjectsFactory getSharedObjectsFactory() { if (sharedObjectsFactory == null) { sharedObjectsFactory = new SharedObjectsFactory(context); } return sharedObjectsFactory; } public void setSharedObjectsFactory(SharedObjectsFactory sharedObjectsFactory) { this.sharedObjectsFactory = sharedObjectsFactory; } public BaseService() { // Thread.currentThread().setContextClassLoader(null); } }
0
* @deprecated use {@link FTPCmd} instead @Deprecated
0
package cz.seznam.euphoria.operator.test.ng.junit; import cz.seznam.euphoria.core.executor.Executor; public interface ExecutorEnvironment { Executor getExecutor(); void shutdown() throws Exception; }
0
final Map<TupleTag<?>, Object> sideInputCache; this.sideInputCache = new HashMap<>(); if (!sideInputCache.containsKey(tag)) { if (!sideInputs.has(tag)) { throw new IllegalArgumentException( "calling sideInput() with unknown view; " + "did you forget to pass the view in " + "ParDo.withSideInputs()?"); } sideInputCache.put( tag, view.fromIterableInternal((Iterable<WindowedValue<?>>) sideInputs.get(tag))); return (T) sideInputCache.get(tag);
0
import org.apache.commons.jelly.parser.XMLParser; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; * @version $Revision: 1.14 $ /** The Log to which logging calls will be made. */ private static final Log log = LogFactory.getLog(XMLOutput.class); if (log.isDebugEnabled()) log.debug("error setting lexical handler properties", e);
0
* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at
0
package com.twitter.aurora.scheduler.periodic; import com.twitter.aurora.Protobufs; import com.twitter.aurora.codec.ThriftBinaryCodec; import com.twitter.aurora.codec.ThriftBinaryCodec.CodingException; import com.twitter.aurora.gen.ScheduledTask; import com.twitter.aurora.gen.comm.AdjustRetainedTasks; import com.twitter.aurora.scheduler.PulseMonitor; import com.twitter.aurora.scheduler.TaskLauncher; import com.twitter.aurora.scheduler.base.CommandUtil; import com.twitter.aurora.scheduler.base.Query; import com.twitter.aurora.scheduler.base.Tasks; import com.twitter.aurora.scheduler.configuration.Resources; import com.twitter.aurora.scheduler.storage.Storage;
1
import org.apache.beam.sdk.transforms.windowing.BoundedWindow; @Override public BeamSqlPrimitive<? extends Number> evaluate(BeamRecord inputRow, BoundedWindow window) { return calculate(operand.evaluate(inputRow, window));
0
package org.apache.beam.examples.complete.game; import org.apache.beam.examples.complete.game.UserScore.GameActionInfo; import org.apache.beam.examples.complete.game.UserScore.ParseEventFn; import org.apache.beam.sdk.Pipeline; import org.apache.beam.sdk.coders.StringUtf8Coder; import org.apache.beam.sdk.testing.PAssert; import org.apache.beam.sdk.testing.RunnableOnService; import org.apache.beam.sdk.testing.TestPipeline; import org.apache.beam.sdk.transforms.Create; import org.apache.beam.sdk.transforms.Filter; import org.apache.beam.sdk.transforms.MapElements; import org.apache.beam.sdk.transforms.ParDo; import org.apache.beam.sdk.values.KV; import org.apache.beam.sdk.values.PCollection; import org.apache.beam.sdk.values.TypeDescriptor;
0
public Object clone() { DefaultHttpParams clone = new DefaultHttpParams(this.defaults);
0
* limitations under the License.
0
import static com.google.common.base.Charsets.UTF_8; OutputStreamWriter osw = new OutputStreamWriter(dataOut, UTF_8); BufferedWriter distcpOut = new BufferedWriter(new OutputStreamWriter(fs.create(new Path(exportDir, "distcp.txt"), false), UTF_8)); OutputStreamWriter osw = new OutputStreamWriter(dataOut, UTF_8);
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: FOPSerializer.java,v 1.10 2004/03/05 13:01:56 bdelacretaz Exp $
1
* Gets the query string. * Gets the path and query string e.g. /path/servlet?param1=true. * Gets the path encoded suitable for url like filesystem e.g. (http, webdav). * Creates a FileName. * Appends query string to the uri. * Encodes a URI.
0
* }</pre> * <p>It is up to the user to ensure that two {@code TupleTag}s with the same id actually mean the * same tag and carry the same generic type parameter. Violating this invariant can lead to * hard-to-diagnose runtime type errors. Consequently, this operation should be used very * sparingly, such as when the producer and consumer of {@code TupleTag}s are written in separate * modules and can only coordinate via ids rather than shared {@code TupleTag} instances. Most of * the time, {@link #TupleTag()} should be preferred. * <p>{@code TupleTag}s are not ordered, i.e., the class does not implement Comparable interface. * TupleTags implement equals and hashCode, making them suitable for use as keys in HashMap and * HashSet. * If this {@code TupleTag} is tagging output {@code outputIndex} of a {@code PTransform}, returns * the name that should be used by default for the output. * Returns a {@code TypeDescriptor} capturing what is known statically about the type of this * {@code TupleTag} instance's most-derived class. * <p>This is useful for a {@code TupleTag} constructed as an instance of an anonymous subclass * with a trailing {@code {}}, e.g., {@code new TupleTag<SomeType>(){}}. String caller = stackTrace.length >= 4 ? stackTrace[3].getClassName() + "." + stackTrace[3].getMethodName() + ":" + stackTrace[3].getLineNumber() : "unknown";
1
import org.apache.felix.sigil.common.osgi.VersionRange;
0
throw new BridgeException(ctx, filteredElement, throw new BridgeException(ctx, clippedElement, throw new BridgeException(ctx, maskedElement,
1
import org.junit.Test; import static org.junit.Assert.*; @Test @Test
0
private int pmg_class_index, pmg_index; * @param pmg_class_index */ public final void setPMGClassIndex( int pmg_class_index ) { this.pmg_class_index = pmg_class_index; } /** * @param pmg_index */ public final void setPMGIndex( int pmg_index ) { this.pmg_index = pmg_index; } /**
0
import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import com.google.common.collect.Maps; import com.google.inject.Inject; import com.google.inject.Singleton; import com.google.inject.persist.Transactional; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.TreeMap; import java.util.concurrent.TimeUnit; StackInfo stack = ambariMetaInfo.getStack(stackId.getStackName(), stackId.getStackVersion()); Map<String, DesiredConfig> desiredConfigs = cluster.getDesiredConfigs(); Map<String, Config> actualConfigs = new HashMap<>(); for (Map.Entry<String, DesiredConfig> desiredConfigEntry : desiredConfigs.entrySet()) { String configType = desiredConfigEntry.getKey(); DesiredConfig desiredConfig = desiredConfigEntry.getValue(); actualConfigs.put(configType, cluster.getConfig(configType, desiredConfig.getTag())); } result.add(actualConfigs.get(stackPropertyConfigType).getProperties().get(serviceProperty.getName())); result.add(actualConfigs.get(stackPropertyConfigType).getProperties().get(stackProperty.getName()));
0
* Returns <code>true</code> if VFS treats the user directory as the root directory. Defaults to <code>true</code>. * * @param opts * The FileSystemOptions. * @return <code>true</code> if VFS treats the user directory as the root directory. Defaults to <code>true</code>. return getBoolean(opts, USER_DIR_IS_ROOT, Boolean.TRUE);
0
import cz.seznam.euphoria.core.client.dataset.windowing.MergingWindowing; import cz.seznam.euphoria.guava.shaded.com.google.common.collect.Iterables; import java.util.Random; private boolean allowWindowBasedShuffling = false; public InMemExecutor setReduceStateByKeyMaxKeysPerWindow(int maxKeyPerWindow) { return this; public InMemExecutor setWatermarkEmitStrategySupplier( return this; public InMemExecutor allowWindowBasedShuffling() { this.allowWindowBasedShuffling = true; return this; } windowing == null ? Optional.empty() : Optional.of(windowing)); final Optional<Windowing> windowing) { final Optional<UnaryFunction<Object, Long>> timestampAssigner = windowing.isPresent() ? windowing.get().getTimestampAssigner() : Optional.empty(); final boolean isMergingWindowing = windowing.isPresent() && windowing.get() instanceof MergingWindowing; final Set<WindowID> targetWindows; int windowShift = 0; if (allowWindowBasedShuffling) { if (windowing.isPresent()) { targetWindows = windowing.get().assignWindowsToElement(datum); } else { targetWindows = Collections.singleton(datum.getWindowID()); } if (!isMergingWindowing && targetWindows.size() == 1) { windowShift = new Random( Iterables.getOnlyElement(targetWindows).hashCode()).nextInt(); } } = ((partitioning.getPartitioner().getPartition(key) + windowShift) & Integer.MAX_VALUE) % outputPartitions; // do not hadle elements
0
* @version $Revision$ $Date$
0
import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService; Factory fact = Utils.getFactoryByName(context, "CONFIG-FieldConfigurableCheckService");
0
suite.addTest(TestBaseIOReactorSSL.suite()); suite.addTest(TestDefaultIOReactorsSSL.suite());
0
* Tests {@link org.apache.commons.ognl.ASTMethod}.
0
* <p> * <b>Note:</b> {@link org.apache.cocoon.selection.ResourceExistsSelector} * should be preferred to this component, as the semantics of a Selector better * match the supplied functionality. * @version CVS $Id: ResourceExistsAction.java,v 1.2 2003/03/19 06:19:38 jefft Exp $
0
.apply(View.asIterable());
0
import com.google.inject.Inject; import com.google.inject.Provider; import org.apache.ambari.server.state.stack.PrereqCheckType; }
0
import org.apache.accumulo.core.cli.BatchWriterOpts; import org.apache.accumulo.core.cli.ClientOnRequiredTable; import com.beust.jcommander.Parameter; static class Opts extends ClientOnRequiredTable { @Parameter(names="--start") long start = 0; @Parameter(names="--num", required=true) long num = 0; @Parameter(names="--size", required=true, description="size of the value to write") int valueSize = 0; @Parameter(names="--vis", converter=VisibilityConverter.class) ColumnVisibility vis = new ColumnVisibility(); } Opts opts = new Opts(); BatchWriterOpts bwOpts = new BatchWriterOpts(); opts.parseArgs(SequentialBatchWriter.class.getName(), args, bwOpts); Connector connector = opts.getConnector(); BatchWriter bw = connector.createBatchWriter(opts.tableName, bwOpts.getBatchWriterConfig()); long end = opts.start + opts.num; for (long i = opts.start; i < end; i++) { Mutation m = RandomBatchWriter.createMutation(i, opts.valueSize, opts.vis);
1
class CBZip2InputStream CBZip2InputStream( final InputStream input )
0
import org.junit.Before; @Before public void init(){ DummyMetricsSink.clear(); }
0
repoFile = new RepositoryXml(); repoFile.setValid(false); repoFile.setErrors("Unable to parse repo file at location: " + repositoryFile.getAbsolutePath()); if (repoFile == null || !repoFile.isValid()) { metaInfoXml = new StackMetainfoXml(); metaInfoXml.setValid(false); metaInfoXml.setErrors("Unable to parse stack metainfo.xml file at location: " + stackMetaInfoFile.getAbsolutePath());
0
package org.apache.felix.ipojo.test.scenarios.component; import org.apache.felix.ipojo.annotations.Component; import org.apache.felix.ipojo.annotations.Controller; import org.apache.felix.ipojo.annotations.Invalidate; import org.apache.felix.ipojo.annotations.Validate; @Component public class Lifecycle { @Controller boolean lfc; @Validate public void start() { } @Invalidate public void stop() { } }
0
public void addWorkRecord(Text file, Value v, Map<String,String> targets, String sourceTableId) { conn.securityOperations().grantTablePermission(conn.whoami(), ReplicationTable.NAME, TablePermission.WRITE); conn.securityOperations().grantTablePermission(conn.whoami(), ReplicationTable.NAME, TablePermission.READ); workMaker.addWorkRecord(new Text(file), StatusUtil.fileCreatedValue(timeCreated), ImmutableMap.of("remote_cluster_1", "4"), tableId); m.put(StatusSection.NAME, new Text(tableId), StatusUtil.fileCreatedValue(System.currentTimeMillis())); Map<String,String> targetClusters = ImmutableMap.of("remote_cluster_1", "4", "remote_cluster_2", "6", "remote_cluster_3", "8"); workMaker.addWorkRecord(new Text(file), StatusUtil.fileCreatedValue(System.currentTimeMillis()), targetClusters, tableId); Assert.assertTrue("Did not find expected target: " + expected, actualTargets.contains(expected)); Assert.assertTrue("Found extra replication work entries: " + actualTargets, actualTargets.isEmpty()); m.put(StatusSection.NAME, new Text(tableId), StatusUtil.fileCreatedValue(System.currentTimeMillis())); conn.tableOperations().setProperty(ReplicationTable.NAME, Property.TABLE_REPLICATION_TARGET.getKey() + "remote_cluster_1", "4"); // If we don't shortcircuit out, we should get an exception because // ServerConfiguration.getTableConfiguration
0