Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
@Override @Override @Override @Override @Override @Override
0
import org.hamcrest.CoreMatchers; * JIRA: DBCP-482 * Verify warning not logged if JMX MBean unregistered before close() called. */ @Test public void testInstanceNotFoundExceptionLogSuppressed() throws Exception { final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); try (Connection c = ds.getConnection()) {} mbs.unregisterMBean(new ObjectName(ds.getJmxName())); StackMessageLog.clear(); ds.close(); assertThat(StackMessageLog.popMessage(), CoreMatchers.not(CoreMatchers.containsString("InstanceNotFoundException"))); assertNull(ds.getRegisteredJmxName()); } /**
0
import org.apache.batik.anim.values.AnimatableBooleanValue; import org.apache.batik.anim.values.AnimatableValue; import org.apache.batik.dom.anim.AnimationTarget; * Updates the animated value with the gien {@link AnimatableValue}. */ protected void updateAnimatedValue(AnimatableValue val) { if (val == null) { hasAnimVal = false; } else { hasAnimVal = true; this.animVal = ((AnimatableBooleanValue) val).getValue(); } * Returns the base value of the attribute as an {@link AnimatableValue}. */ public AnimatableValue getUnderlyingValue(AnimationTarget target) { return new AnimatableBooleanValue(target, getBaseVal()); } /**
0
log.error("Could not add table '" + table + "'", e);
0
// add comma delimited lists with escaped delimiters conf.addProperty("split.list5", "a\\,b\\,c"); conf.setProperty("element3", "value\\,value1\\,value2"); conf.setProperty("element3[@name]", "foo\\,bar"); /** * Tests the subset() method. There was a bug that calling subset() had * undesired side effects. */ /** * Tests string properties with list delimiters and escaped delimiters. */ public void testSplitLists() { assertEquals("a", conf.getString("split.list3[@values]")); assertEquals(2, conf.getMaxIndex("split.list3[@values]")); assertEquals("a,b,c", conf.getString("split.list4[@values]")); assertEquals("a", conf.getString("split.list1")); assertEquals(2, conf.getMaxIndex("split.list1")); assertEquals("a,b,c", conf.getString("split.list2")); }
0
public final class UnmodifiableMap<K, V> extends AbstractMapDecorator<K, V> implements IterableMap<K, V>, Unmodifiable, Serializable { public static <K, V> Map<K, V> decorate(Map<K, V> map) { return new UnmodifiableMap<K, V>(map); private UnmodifiableMap(Map<K, V> map) { @SuppressWarnings("unchecked") map = (Map<K, V>) in.readObject(); public V put(K key, V value) { public void putAll(Map<? extends K, ? extends V> mapToCopy) { public V remove(Object key) { public MapIterator<K, V> mapIterator() { MapIterator<K, V> it = ((IterableMap<K, V>) map).mapIterator(); MapIterator<K, V> it = new EntrySetMapIterator<K, V>(map); return UnmodifiableMapIterator.decorate(it); public Set<Map.Entry<K, V>> entrySet() { Set<Map.Entry<K, V>> set = super.entrySet(); public Set<K> keySet() { Set<K> set = super.keySet(); public Collection<V> values() { Collection<V> coll = super.values();
0
* <p>To execute this pipeline in streaming mode, specify: * --streaming * <p>To change the runner, specify: * --runner=YOUR_SELECTED_RUNNER * } * </pre> * See examples/java/README.md for instructions about how to configure different runners. * <p>Inherits standard Beam example configuration options. // ExampleUtils will try to cancel the pipeline and the injector before the program exists.
0
import com.google.common.collect.HashMultiset; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Multiset;
0
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.collect.ImmutableList;
0
import org.apache.ambari.logsearch.web.filters.LogsearchTrustedProxyFilter; .addFilterBefore(logsearchTrustedProxyFilter(), BasicAuthenticationFilter.class) .addFilterAfter(logsearchKRBAuthenticationFilter(), LogsearchTrustedProxyFilter.class) public LogsearchTrustedProxyFilter logsearchTrustedProxyFilter() throws Exception { LogsearchTrustedProxyFilter filter = new LogsearchTrustedProxyFilter(requestMatcher(), authPropsConfig); filter.setAuthenticationManager(authenticationManagerBean()); return filter; } @Bean
0
import static com.google.common.base.Charsets.UTF_8;
0
* @version CVS $Id: HttpEnvironment.java,v 1.16 2004/05/25 07:28:25 cziegeler Exp $ public class HttpEnvironment extends AbstractEnvironment { private HttpRequest request; private HttpResponse response; private HttpContext webcontext; private String contentType; super(uri, null, null); /** * Redirect the client to new URL */ public void redirect(String newURL, boolean global, boolean permanent) throws IOException {
0
import java.nio.charset.StandardCharsets; final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII)); final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII)); final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII)); final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII)); final ByteArrayInputStream instream = new ByteArrayInputStream(s.getBytes(StandardCharsets.US_ASCII));
0
import org.apache.hc.core5.http.ClassicHttpResponse; public class DefaultHttpResponseParserFactory implements HttpMessageParserFactory<ClassicHttpResponse> { public HttpMessageParser<ClassicHttpResponse> create(final MessageConstraints constraints) {
0
import com.google.common.base.Supplier; import com.twitter.common.stats.StatsProvider; @VisibleForTesting enum State { ShutdownRegistry shutdownRegistry, StatsProvider statsProvider) { shutdownRegistry, statsProvider); static final String REGISTERED_GAUGE = "framework_registered"; @VisibleForTesting static String stateGaugeName(State state) { return "scheduler_lifecycle_" + state; } @VisibleForTesting final ShutdownRegistry shutdownRegistry, StatsProvider statsProvider) { statsProvider.makeGauge( REGISTERED_GAUGE, new Supplier<Integer>() { @Override public Integer get() { return registrationAcked.get() ? 1 : 0; } }); statsProvider.makeGauge( stateGaugeName(state), new Supplier<Integer>() { @Override public Integer get() { return (state == stateMachine.getState()) ? 1 : 0; } });
0
public InvokeContext(InvokeContext context, ServiceManager manager) throws ServiceException { service(manager); inform(context.processingPipelineName, context.processingPipelineParameters, context.processingPipelineObjectModel);
0
import com.google.cloud.dataflow.sdk.coders.VoidCoder; import org.apache.flink.api.java.typeutils.runtime.ValueSerializer; @Override public boolean equals(Object obj) { if (obj instanceof VoidCoderTypeSerializer) { VoidCoderTypeSerializer other = (VoidCoderTypeSerializer) obj; return other.canEqual(this); } else { return false; } } @Override public boolean canEqual(Object obj) { return obj instanceof VoidCoderTypeSerializer; } @Override public int hashCode() { return 0; }
0
import java.util.Map; public void flexApp(String appId, Map<String, Integer> componentsMap) throws YarnException, IOException, InterruptedException;
0
public class TestHttpClientNio { public TestHttpClientNio(final HttpParams params) throws IOException {
0
for (IOFileFilter filter1 : filters) { filter.addFileFilter(filter1);
1
Assert.assertEquals(ResourceType.AMBARI.name(), resource.getPropertyValue(UserPrivilegeResourceProvider.TYPE)); Assert.assertEquals("TestCluster", resource.getPropertyValue(ClusterPrivilegeResourceProvider.CLUSTER_NAME)); Assert.assertEquals(ResourceType.CLUSTER.name(), resource.getPropertyValue(UserPrivilegeResourceProvider.TYPE)); Assert.assertEquals("Test View", resource.getPropertyValue(ViewPrivilegeResourceProvider.INSTANCE_NAME)); Assert.assertEquals("TestView", resource.getPropertyValue(ViewPrivilegeResourceProvider.VIEW_NAME)); Assert.assertEquals("1.2.3.4", resource.getPropertyValue(ViewPrivilegeResourceProvider.VERSION)); Assert.assertEquals(ResourceType.VIEW.name(), resource.getPropertyValue(UserPrivilegeResourceProvider.TYPE)); Assert.assertEquals("Test View", resource.getPropertyValue(ViewPrivilegeResourceProvider.INSTANCE_NAME)); Assert.assertEquals("TestView", resource.getPropertyValue(ViewPrivilegeResourceProvider.VIEW_NAME)); Assert.assertEquals("1.2.3.4", resource.getPropertyValue(ViewPrivilegeResourceProvider.VERSION)); Assert.assertEquals(ResourceType.VIEW.name(), resource.getPropertyValue(UserPrivilegeResourceProvider.TYPE)); propertyIds.add(UserPrivilegeResourceProvider.USER_NAME); .property(UserPrivilegeResourceProvider.USER_NAME) String userName = (String) resource.getPropertyValue(UserPrivilegeResourceProvider.USER_NAME); propertyIds.add(UserPrivilegeResourceProvider.USER_NAME); .property(UserPrivilegeResourceProvider.USER_NAME) String userName = (String) resource.getPropertyValue(UserPrivilegeResourceProvider.USER_NAME);
0
import org.apache.hc.core5.http.HttpResponse; import org.apache.hc.core5.http.protocol.HttpContext;
0
package org.apache.xml.security.stax.impl.processor.input; import org.apache.xml.security.stax.ext.*; import org.apache.xml.security.stax.ext.stax.XMLSecEvent; import org.apache.xml.security.stax.ext.stax.XMLSecEventFactory; import org.apache.xml.security.stax.ext.stax.XMLSecStartElement;
0
public void start(int options) throws BundleException { throw new UnsupportedOperationException("This feature has not yet been implemented."); } public void stop(int options) throws BundleException { throw new UnsupportedOperationException("This feature has not yet been implemented."); }
1
Future<Integer> ret = svc.submit(() -> { try { return control.exec(TestIngest.class, args); } catch (IOException e) { log.error("Error running TestIngest", e); return -1; Future<Integer> ret = svc.submit(() -> { try { return control.exec(TestIngest.class, args); } catch (Exception e) { log.error("Error running TestIngest", e); return -1;
0
URL newurl = ((BundleWiringImpl) m_targetRevision.getWiring()).getResourceByDelegation(url.getPath());
0
import javax.annotation.Nullable; @Option(name = "zk_endpoints", usage = "Endpoint specification for the ZooKeeper servers.") @Nullable if (endpointStatus != null) { try { endpointStatus.update(Status.ALIVE); } catch (ServerSet.UpdateException e) { LOG.log(Level.SEVERE, "Failed to update server status in ZooKeeper.", e); } catch (InterruptedException e) { LOG.log(Level.SEVERE, "Interrupted while updating server status in ZooKeeper.", e); } if (nexusSchedulerServerSet == null ) { LOG.warning("Not registering server with ZooKeeper."); return null; } else { LOG.info("Registering host in server set " + getOptions().nexusSchedulerNameSpec + " as listening on port " + schedulerThriftInterface.getListeningPort()); return joinServerSet(nexusSchedulerServerSet, schedulerThriftInterface.getListeningPort(), Status.STARTING); }
0
* Data describing the gauge. This should retain enough detail that it can be combined with other * {@link GaugeData}. /** Empty {@link GaugeData}, representing no values reported. */ private EmptyGaugeData() {}
1
componentDesiredStateEntity.setHostComponentDesiredStateEntities(new ArrayList<HostComponentDesiredStateEntity>()); componentDesiredStateEntity.getHostComponentDesiredStateEntities().add(hostComponentDesiredStateEntity);
0
modes.put(mode, v); modes.put(mode, v); if (val.contains("undef")) {
0
import java.util.stream.Stream; Map<String,Reference> references = new TreeMap<>(); public Stream<Reference> getReferences() { return references.values().stream(); public void addFileReference(String tableId, String endRow, String file) { references.put(tableId + ":" + endRow + ":" + file, new Reference(Table.ID.of(tableId), file, false)); public void removeFileReference(String tableId, String endRow, String file) { references.remove(tableId + ":" + endRow + ":" + file); public void addDirReference(String tableId, String endRow, String dir) { references.put(tableId + ":" + endRow, new Reference(Table.ID.of(tableId), dir, true)); public void removeDirReference(String tableId, String endRow) { references.remove(tableId + ":" + endRow);
0
import org.apache.cocoon.configuration.Settings;
0
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.BeanNameAware; * This is a base class that can be used for own {@link SecurityHandler}s. */ implements SecurityHandler, BeanNameAware { /** The id for the security handler. */ protected String id = String.valueOf(this.hashCode()); /** By default we use the logger for this class. */ private Log logger = LogFactory.getLog(getClass()); public Log getLogger() { return this.logger; } public void setLogger(Log l) { this.logger = l; } public void setAnonymousName(String anonName) { this.anonName = anonName; } public void setAnonymousPassword(String anonPass) { this.anonPass = anonPass; } public void setSupportAnonymousUser(boolean supportAnonUser) { this.supportAnonUser = supportAnonUser; * @see org.springframework.beans.factory.BeanNameAware#setBeanName(java.lang.String) public void setBeanName(String name) { this.id = name;
0
Copyright 2000-2002 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
import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Lists; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.Sets;
0
import org.osgi.util.converter.TypeRule; rule(new TypeRule<Foo, String>(Foo.class, String.class, Foo::tsFun)). rule(new TypeRule<String, Foo>(String.class, Foo.class, v -> Foo.fsFun(v))).build();
0
CryptoModuleParameters params = new CryptoModuleParameters(); return fillParamsObjectFromConfiguration(params, conf); } public static CryptoModuleParameters fillParamsObjectFromConfiguration(CryptoModuleParameters params, AccumuloConfiguration conf) { cryptoOpts.put(Property.CRYPTO_BLOCK_STREAM_SIZE.getKey(), Integer.toString((int) conf.getMemoryInBytes(Property.CRYPTO_BLOCK_STREAM_SIZE))); params.setBlockStreamSize(Integer.parseInt(cryptoOpts.get(Property.CRYPTO_BLOCK_STREAM_SIZE.getKey())));
0
import org.apache.ambari.logsearch.model.request.impl.query.AuditBarGraphQueryRequest; AuditBarGraphRequest request = new AuditBarGraphQueryRequest(); AuditBarGraphRequest request = new AuditBarGraphQueryRequest();
0
@Deprecated
0
final LineParser parser) throws HttpException, IOException { return parseHeaders(inbuffer, maxHeaderCount, maxLineLen, parser != null ? parser : BasicLineParser.INSTANCE, headerLines);
0
package org.apache.atlas; import org.apache.atlas.security.SecurityProperties; import org.apache.atlas.util.CredentialProviderUtility; import java.util.ArrayList; import java.util.List; import java.util.Random; provider.getCredentialEntry(SecurityProperties.KEYSTORE_PASSWORD_KEY); entry = provider.getCredentialEntry(SecurityProperties.TRUSTSTORE_PASSWORD_KEY); entry = provider.getCredentialEntry(SecurityProperties.SERVER_CERT_PASSWORD_KEY); provider.getCredentialEntry(SecurityProperties.KEYSTORE_PASSWORD_KEY); entry = provider.getCredentialEntry(SecurityProperties.TRUSTSTORE_PASSWORD_KEY); entry = provider.getCredentialEntry(SecurityProperties.SERVER_CERT_PASSWORD_KEY); provider.getCredentialEntry(SecurityProperties.KEYSTORE_PASSWORD_KEY); entry = provider.getCredentialEntry(SecurityProperties.TRUSTSTORE_PASSWORD_KEY); entry = provider.getCredentialEntry(SecurityProperties.SERVER_CERT_PASSWORD_KEY); provider.getCredentialEntry(SecurityProperties.KEYSTORE_PASSWORD_KEY); entry = provider.getCredentialEntry(SecurityProperties.TRUSTSTORE_PASSWORD_KEY); entry = provider.getCredentialEntry(SecurityProperties.SERVER_CERT_PASSWORD_KEY);
1
fs.mkdirs(new Path(ServerConstants.getDataVersionLocation(), "" + ServerConstants.DATA_VERSION)); String initRootTabFile = ServerConstants.getRootTabletDir() + "/00000_00000."
0
import org.apache.beam.model.pipeline.v1.RunnerApi;
0
Map<String, KeyPair> pairsMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
0
// add an instance of the auto-activator it for processing // auto-install and auto-start properties. // Create a case-insensitive property map. // Create an instance of the framework.
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.event; import org.w3c.css.sac.SelectorList; /** * This class represents the events which get fired whenever a * selector list is changed. * * @author <a href="mailto:[email protected]">Stephane Hillion</a> * @version $Id$ */ public class SelectorListChangeEvent { /** * The source of this event. */ protected Object source; /** * The selector list old value. */ protected SelectorList oldValue; /** * The selector list new value. */ protected SelectorList newValue; /** * Creates a new SelectorListChangeEvent object. * @param source The source of this event. * @param property The property name. * @param before The selector list value before the change. * @param after The selector value after the change. */ public SelectorListChangeEvent(Object source, SelectorList before, SelectorList after) { this.source = source; oldValue = before; newValue = after; } /** * Returns the event source. */ public Object getSource() { return source; } /** * Returns the value of the property before the change. */ public SelectorList getOldValue() { return oldValue; } /** * Returns the value of the property after the change. */ public SelectorList getNewValue() { return newValue; } }
1
import com.google.cloud.dataflow.sdk.options.DirectPipelineOptions; import com.google.cloud.dataflow.sdk.options.PipelineOptions; import com.google.cloud.dataflow.sdk.options.PipelineOptionsValidator; /** * Constructs a SparkPipelineRunner from the given options. */ public static SparkPipelineRunner fromOptions(PipelineOptions options) { SparkPipelineOptions sparkOptions = PipelineOptionsValidator.validate(SparkPipelineOptions.class, options); return new SparkPipelineRunner(sparkOptions); }
0
m_felix.removeBundleListener(m_bundle, l); m_felix.removeServiceListener(m_bundle, l); m_felix.removeFrameworkListener(m_bundle, l);
0
import org.apache.batik.bridge.svg12.SVG12ScriptingEnvironment; import org.apache.batik.dom.svg.SVGOMDocument; SVGOMDocument d = (SVGOMDocument) doc; if (d.isSVG12()) { scriptingEnvironment = new SVG12ScriptingEnvironment(ctx); } else { scriptingEnvironment = new ScriptingEnvironment(ctx); }
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
return this.count.incrementAndGet() % 4 != 0; return false;
0
public CombinedBeanDeclaration(final BeanDeclaration... decl) for (final BeanDeclaration d : childDeclarations) final String factoryName = d.getBeanFactoryName(); for (final BeanDeclaration d : childDeclarations) final Object factoryParam = d.getBeanFactoryParameter(); for (final BeanDeclaration d : childDeclarations) final String beanClassName = d.getBeanClassName(); final Map<String, Object> result = new HashMap<>(); final Map<String, Object> props = final Map<String, Object> result = new HashMap<>(); final Map<String, Object> decls = for (final BeanDeclaration d : childDeclarations) final Collection<ConstructorArg> args = d.getConstructorArgs();
0
import org.apache.accumulo.core.clientImpl.Table;
0
* Each property has the syntax <code>key &lt;separator&gt; value</code>. The * <p>Here is an example of a valid extended properties file:</p> * <pre> * Controls whether additional files can be loaded by the {@code include = <xxx>}
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.sshd.common.io.IoHandlerFactory; private final IoHandlerFactory socksProxyIoHandlerFactory = new IoHandlerFactory() { private final IoHandlerFactory staticIoHandlerFactory = new IoHandlerFactory() {
0
// and that arg is not the sole argument and not an array of the expected type, Class<?> aclazz = actual[index].getClass(); if (!aclazz.isArray() || !aclazz.getComponentType().equals(type)) { // create a 1-length array to hold and replace the last argument Object lastActual = Array.newInstance(type, 1); Array.set(lastActual, 0, actual[index]); actual[index] = lastActual; }
0
//TODO - fix this //final String message = REZ.getString( "delete-temp.warn", file.getName() ); getLogger().warn( "vfs.impl/delete-temp.warn", e );
0
import org.apache.ambari.server.controller.internal.RepositoryVersionResourceProvider; .implement(ResourceProvider.class, Names.named("repositoryVersion"), RepositoryVersionResourceProvider.class) }
0
final String taskId = change.getTaskId(); final ScheduleStatus newState = change.getNewState(); executor.schedule( new Runnable() { @Override public void run() { // This query acts as a CAS by including the state that we expect the task to be in if // the timeout is still valid. Ideally, the future would have already been canceled, // but in the event of a state transition race, including transientState prevents an // unintended task timeout. // Note: This requires LOST transitions trigger Driver.killTask. if (stateManager.changeState( taskId, Optional.of(newState), ScheduleStatus.LOST, TIMEOUT_MESSAGE)) { LOG.info("Timeout reached for task " + taskId + ":" + taskId); timedOutTasks.incrementAndGet(); } } }, timeoutMillis, TimeUnit.MILLISECONDS);
0
import org.apache.accumulo.core.sample.impl.SamplerConfigurationImpl; @Override public FileSKVIterator getSample(SamplerConfigurationImpl sampleConfig) { throw new UnsupportedOperationException(); }
1
* * * * The name of the requested charset; may be a canonical name, an alias, or null.
0
RepositoryInfo repositoryInfo = ambariMetaInfo.getRepository(rr.getStackName(), rr.getStackVersion(), rr.getOsType(), rr.getRepoId()); String repoName = repositoryInfo.getRepoName(); String suffix = String.format(suffixes[i], repoName);
0
* Retrieve all of the cluster versions for the given cluster name. * * @param clusterName Cluster name * @return Return all of the host versions that match the criteria. */ @RequiresSession public List<HostVersionEntity> findByCluster(String clusterName) { final TypedQuery<HostVersionEntity> query = entityManagerProvider.get() .createNamedQuery("findByCluster", HostVersionEntity.class); query.setParameter("clusterName", clusterName); return daoUtils.selectList(query); } /**
0
int[] positions = byte_positions; if (ih == null) {
0
import org.apache.batik.util.Platform; if (Platform.isOSX)
0
JexlContext jc = JexlHelper.createContext(); assertExpression(jc, "myvar == 'Użytkownik'", Boolean.FALSE); assertExpression(jc, "'c:\\some\\windows\\path'", "c:\\some\\windows\\path"); assertExpression(jc, "'foo\\u0020bar'", "foo\u0020bar"); assertExpression(jc, "'foo\\u0020\\u0020bar'", "foo\u0020\u0020bar"); assertExpression(jc, "'\\u0020foobar\\u0020'", "\u0020foobar\u0020");
0
import org.apache.accumulo.core.clientImpl.AuthenticationTokenIdentifier; import org.apache.accumulo.core.clientImpl.ClientContext; import org.apache.accumulo.core.clientImpl.DelegationTokenImpl; import org.apache.accumulo.core.clientImpl.OfflineScanner; import org.apache.accumulo.core.clientImpl.ScannerImpl; import org.apache.accumulo.core.clientImpl.Table; import org.apache.accumulo.core.clientImpl.Tables; import org.apache.accumulo.core.clientImpl.TabletLocator; import org.apache.accumulo.core.clientImpl.mapred.BatchInputSplit; import org.apache.accumulo.core.clientImpl.mapreduce.SplitUtils; import org.apache.accumulo.core.clientImpl.mapreduce.lib.ConfiguratorBase; import org.apache.accumulo.core.clientImpl.mapreduce.lib.InputConfigurator; import org.apache.accumulo.core.dataImpl.KeyExtent;
0
import org.apache.ambari.server.api.services.AmbariMetaInfo; import org.apache.ambari.server.orm.dao.StackDAO; import org.apache.ambari.server.orm.entities.StackEntity; @Inject private StackDAO stackDAO; StackEntity stackEntity = stackDAO.find("HDP", "2.2.0"); clusterEntity.setDesiredStack(stackEntity); // required to populate the database with stacks injector.getInstance(AmbariMetaInfo.class); StackDAO stackDAO = injector.getInstance(StackDAO.class); StackEntity stackEntity = stackDAO.find("HDP", "2.0.6"); assertNotNull(stackEntity); clusterEntity.setDesiredStack(stackEntity); StackId stackId = new StackId("HDP", "2.0.6"); clusters.addCluster(clusterName, stackId); getOrCreateRepositoryVersion(stackId, stackId.getStackVersion()); cluster.createClusterVersion(stackId, public RepositoryVersionEntity getOrCreateRepositoryVersion(StackId stackId, String version) { StackDAO stackDAO = injector.getInstance(StackDAO.class); StackEntity stackEntity = stackDAO.find(stackId.getStackName(), stackId.getStackVersion()); assertNotNull(stackEntity); RepositoryVersionEntity repositoryVersion = repositoryVersionDAO.findByStackAndVersion( stackId, version); repositoryVersion = repositoryVersionDAO.create(stackEntity, version, String.valueOf(System.currentTimeMillis()), "pack", "");
0
import org.apache.beam.runners.direct.TestStreamEvaluatorFactory.DirectTestStreamFactory; import org.apache.beam.sdk.testing.TestStream; import com.google.common.base.Supplier; import java.util.concurrent.Executors; .put(GroupByKey.class, new DirectGroupByKeyOverrideFactory()) .put(TestStream.class, new DirectTestStreamFactory()) private Supplier<ExecutorService> executorServiceSupplier = new FixedThreadPoolSupplier(); private Supplier<Clock> clockSupplier = new NanosOffsetClockSupplier(); Supplier<Clock> getClockSupplier() { return clockSupplier; } void setClockSupplier(Supplier<Clock> supplier) { this.clockSupplier = supplier; } clockSupplier.get(), ExecutorService executorService = executorServiceSupplier.get(); TransformEvaluatorRegistry registry = TransformEvaluatorRegistry.defaultRegistry(); registry, /** * A {@link Supplier} that creates a {@link ExecutorService} based on * {@link Executors#newFixedThreadPool(int)}. */ private static class FixedThreadPoolSupplier implements Supplier<ExecutorService> { @Override public ExecutorService get() { return Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); } } /** * A {@link Supplier} that creates a {@link NanosOffsetClock}. */ private static class NanosOffsetClockSupplier implements Supplier<Clock> { @Override public Clock get() { return NanosOffsetClock.create(); } }
0
VoidCoder.of());
0
Copyright 2002 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
// a 4xx is only registered as failure DTO if overlayed by a 4xx! // -> no failure in this case assertEquals(0, holder.failedErrorPageDTOs.size());
0
final ClientContext context = getClientContext(); final ClientContext context = getClientContext();
0
/* * Copyright 2013 Twitter, Inc. * * 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
import java.io.Serializable; private static class BundleByElementTimestampComparator extends Ordering<CommittedBundle<?>> implements Serializable {
0
osType, repoId, AmbariMetaInfo.REPOSITORY_XML_PROPERTY_BASEURL); MetainfoEntity entity = metaInfoDAO.findByKey(key); return entity != null ? entity.getMetainfoValue() : null; } public String getUpdatedMirrorsList(String stackName, String stackVersion, String osType, String repoId) { String key = AmbariMetaInfo.generateRepoMetaKey(stackName, stackVersion, osType, repoId, AmbariMetaInfo.REPOSITORY_XML_PROPERTY_MIRRORSLIST);
0
description = "The name of the mapping element should be map_field_value. The value json element should contain the following parameter:" return "map_field_value"; path = "/filter/[]/post_map_values/{field_name}/[]/map_field_value/pre_value", path = "/filter/[]/post_map_values/{field_name}/[]/map_field_value/post_value",
0
AttributedCharacterIterator.Attribute TEXT_COMPOUND_DELIMITER = GVTAttributedCharacterIterator.TextAttribute.TEXT_COMPOUND_DELIMITER; public static final AttributedCharacterIterator.Attribute PAINT_INFO = GVTAttributedCharacterIterator.TextAttribute.PAINT_INFO; public static final AttributedCharacterIterator.Attribute ALT_GLYPH_HANDLER = GVTAttributedCharacterIterator.TextAttribute.ALT_GLYPH_HANDLER; if (SVG_NAMESPACE_URI.equals(element.getNamespaceURI()) && element.getLocalName().equals(SVG_ALT_GLYPH_TAG)) { result.put(ALT_GLYPH_HANDLER, new SVGAltGlyphHandler(ctx, element)); if (aci.getAttribute(ALT_GLYPH_HANDLER) != null){
0
at = HdfsZooInstance.getInstance().getAuthenticator().login(principal, props);
0
qb.setUp();
0
package org.apache.http.mockup;
0
timeout.recordStateChange(TaskStateChange.transition(task, from)); clock.setNowMillis(TIMEOUT_MS * 2); for (IScheduledTask task : ImmutableList.of( makeTask("a", ASSIGNED, 0), makeTask("b", KILLING, TIMEOUT_MS), makeTask("c", PREEMPTING, clock.nowMillis() + TIMEOUT_MS))) { timeout.recordStateChange(TaskStateChange.initialized(task)); } changeState("b", KILLING, KILLED); changeState("c", PREEMPTING, FINISHED);
0
/** Test for dependency resolution for pipeline execution on YARN. */ private static class MockApexYarnLauncherParams extends ApexYarnLauncher.LaunchParams { public MockApexYarnLauncherParams( DAG dag, AttributeMap launchAttributes, Properties properties) { public AppHandle launchApp( StreamingApplication application, Configuration configuration, AttributeMap launchParameters) public void shutdown(Launcher.ShutdownMode arg0) {}
1
import org.apache.ambari.server.stack.upgrade.RepositoryVersionHelper; import org.apache.ambari.server.stack.upgrade.UpgradePack; import org.apache.ambari.server.stack.upgrade.UpgradeType;
0
String viewBox = root.getAttributeNS (null, SVGConstants.SVG_VIEW_BOX_ATTRIBUTE); if ((ref != null) && (ref.length() != 0)) { Px = ViewBox.getViewTransform(ref, root, width, height); } else if ((viewBox != null) && (viewBox.length() != 0)) { String aspectRatio = root.getAttributeNS (null, SVGConstants.SVG_PRESERVE_ASPECT_RATIO_ATTRIBUTE); Px = ViewBox.getPreserveAspectRatioTransform (root, viewBox, aspectRatio, width, height); } else { // no viewBox has been specified, create a scale transform
1
import java.util.HashMap; import java.util.Map; private static Map<String, String> defaultNamespacePrefixes = new HashMap<String, String>(); static { defaultNamespacePrefixes.put("http://www.w3.org/2000/09/xmldsig#", "ds"); defaultNamespacePrefixes.put("http://www.w3.org/2001/04/xmlenc#", "xenc"); defaultNamespacePrefixes.put("http://www.xmlsecurity.org/experimental#", "experimental"); defaultNamespacePrefixes.put("http://www.w3.org/2002/04/xmldsig-filter2", "dsig-xpath-old"); defaultNamespacePrefixes.put("http://www.w3.org/2002/06/xmldsig-filter2", "dsig-xpath"); defaultNamespacePrefixes.put("http://www.w3.org/2001/10/xml-exc-c14n#", "ec"); defaultNamespacePrefixes.put( "http://www.nue.et-inf.uni-siegen.de/~geuer-pollmann/#xpathFilter", "xx" ); } /** * TODO */ public synchronized static void dynamicInit() { if (alreadyInitialized) { return; } // // Load the Resource Bundle - the default is the English resource bundle. // To load another resource bundle, call I18n.init(...) before calling this // method. // I18n.init("en", "US"); // // Bind the default prefixes // TODO possibly move the default Map into ElementProxy? // try { for (String key : defaultNamespacePrefixes.keySet()) { ElementProxy.setDefaultPrefix(key, defaultNamespacePrefixes.get(key)); } } catch (Exception ex) { log.error(ex); ex.printStackTrace(); } }
0
Configuration conf = new Configuration();
0
package org.apache.beam.sdk.io.gcp.bigquery; /** * Created by relax on 3/28/17. */ public class TableDestination { }
0
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.slf4j.Logger; import org.slf4j.LoggerFactory; private static final Logger log = LoggerFactory.getLogger(DeadServerList.class); log.error(ex.getMessage(), ex); log.error("delete failed with exception", ex); log.error("post failed with exception", ex);
0
package org.apache.accumulo.test.randomwalk.bulk; import org.apache.accumulo.test.randomwalk.State; import org.apache.accumulo.test.randomwalk.Test;
0
// Trace.enter(this, "seekTo", new Object[] { new Float(time) } ); try { // } finally { Trace.exit(); }
0
protected final long startOffset; protected DecompressingStreamFactory compressionStreamFactory; DecompressingStreamFactory compressionStreamFactory) throws IOException { // Currently we assume that only a offset position and fraction are reported as // other metrics, e.g. report a different completion percentage or remaining time. // If endOffset is null, we don't know the fraction consumed. if (endOffset != null) { // offset, in principle, can go beyond endOffset, e.g.: // - We just read the last record and offset points to its end, which is after endOffset // - This is some block-based file format where not every record is a "split point" and some // records can *start* after endOffset (though the first record of the next shard would // start still later). progress.setPercentComplete( Math.min(1.0f, 1.0f * (offset - startOffset) / (endOffset - startOffset))); } implements DecompressingStreamFactory {
0
package org.apache.accumulo.core.client.mapreduce.lib.util;
0
import static org.apache.commons.collections4.functors.NullPredicate.*; import static org.apache.commons.collections4.functors.TruePredicate.*; import static org.junit.Assert.*; @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class) } catch (final NullPointerException ex) {}
0
import static org.apache.hadoop.metrics2.sink.timeline.TimelineMetricUtils.getJavaMetricPatterns; private List<String> skipInterpolationMetricPatterns = new ArrayList<>(); LOG.info("Skipping Interpolation for patterns : " + skipInterpolationMetricPatternStrings); skipInterpolationMetricPatterns.addAll(getJavaMetricPatterns(skipInterpolationMetricPatternStrings)); boolean skipInterpolationForMetric = shouldInterpolationBeSkipped(metric.getMetricName()); metadataManagerInstance.getUuid(timelineClusterMetric, true); } private boolean shouldInterpolationBeSkipped(String metricName) { for (String pattern : skipInterpolationMetricPatterns) { if (metricName.matches(pattern)) { return true; } } return false;
0
protected StateNamespace windowNamespace; this.windowNamespace = namespaceFor(window); return windowNamespace; return stateInternals.state(windowNamespace, address); List<StateNamespace> readNamespaces = new ArrayList<>(); for (W readWindow : activeWindows.readStateAddresses(window)) { readNamespaces.add(namespaceFor(readWindow)); StateNamespace writeNamespace = namespaceFor(activeWindows.writeStateAddress(window)); return stateInternals.mergedState(readNamespaces, writeNamespace, address, window); public <StateT extends MergeableState<?, ?>> StateT mergingAccess(StateTag<StateT> address) { List<StateNamespace> readNamespaces = new ArrayList<>(); readNamespaces.add(delegate.namespaceFor(mergingWindow)); readNamespaces, delegate.windowNamespace, address, delegate.window); public <StateT extends State> Map<BoundedWindow, StateT> mergingAccessInEachMergingWindow( this.timers = new TimersImpl(state.namespace()); this.timers = new TimersImpl(state.namespace()); this.timers = new TimersImpl(state.namespace()); this.timers = new TimersImpl(state.delegate.namespace());
0
package com.twitter.aurora.scheduler.thrift.auth; import com.twitter.aurora.scheduler.thrift.auth.CapabilityValidator.Capability;
0
import org.apache.sshd.common.session.SessionContext; * @param session The {@link SessionContext} for invoking this load command - may * be {@code null} if not invoked within a session context (e.g., offline tool or session unknown). public PublicKey resolvePublicKey(SessionContext session, PublicKeyEntryResolver fallbackResolver) return decoder.resolve(session, kt, getKeyData()); * @param session The {@link SessionContext} for invoking this command - may * be {@code null} if not invoked within a session context (e.g., offline tool or session unknown). public PublicKey appendPublicKey( SessionContext session, Appendable sb, PublicKeyEntryResolver fallbackResolver) throws IOException, GeneralSecurityException { PublicKey key = resolvePublicKey(session, fallbackResolver); * @param session The {@link SessionContext} for invoking this command - may * be {@code null} if not invoked within a session context (e.g., offline tool or session unknown). SessionContext session, Collection<? extends PublicKeyEntry> entries, PublicKeyEntryResolver fallbackResolver) PublicKey k = e.resolvePublicKey(session, fallbackResolver);
0