Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
ManualTask task = new ManualTask(); task.message = batch.message; StageWrapper wrapper = new StageWrapper( StageWrapper.Type.MANUAL, "Validate partial upgrade", new TaskWrapper(null, null, Collections.<String>emptySet(), task)); results.add(wrapper);
1
import org.apache.cocoon.portal.LayoutException; protected abstract void publish(PortalService service, Layout layout, String[] values) throws LayoutException; final Layout layout = service.getProfileManager().getLayout(values[0] ); try { this.publish( service, layout, values); } catch (Exception e) { this.getLogger().warn("Unable to publish event. Ignoring exception.", e); }
0
import org.apache.ambari.server.topology.SecurityConfiguration; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; * security configuration */ protected SecurityConfiguration securityConfiguration; /** public SecurityConfiguration getSecurityConfiguration() { return securityConfiguration; }
0
@Mojo( name = "manifest", requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true, defaultPhase = LifecyclePhase.PROCESS_CLASSES)
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//validator/src/test/org/apache/commons/validator/CreditCardValidatorTest.java,v 1.4 2004/01/11 23:30:21 dgraham Exp $ * $Revision: 1.4 $ * $Date: 2004/01/11 23:30:21 $ * Copyright (c) 2001-2004 The Apache Software Foundation. All rights
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/Attic/SoftRefHashMap.java,v 1.6 2002/10/12 22:15:18 scolebourne Exp $ * $Revision: 1.6 $ * $Date: 2002/10/12 22:15:18 $ import java.lang.ref.Reference; import java.lang.ref.SoftReference; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; import java.util.TreeSet;
0
package org.apache.beam.harness.channel; ManagedChannel channel = ManagedChannelFactory.createDefault().forDescriptor(apiServiceDescriptor); ManagedChannel channel = ManagedChannelFactory.createEpoll().forDescriptor(apiServiceDescriptor); ManagedChannel channel = ManagedChannelFactory.createEpoll().forDescriptor(apiServiceDescriptor);
0
assertEquals( new String(output, "UTF-8"), expectedResult);
0
StageBundleFactory bf1 = bundleFactory.forStage(getExecutableStage(environment)); StageBundleFactory bf2 = bundleFactory.forStage(getExecutableStage(environment));
0
*/ public POP2() { super(org.apache.bcel.Constants.POP2); } /** * 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 */ public void accept( Visitor v ) { v.visitStackConsumer(this); v.visitPopInstruction(this); v.visitStackInstruction(this); v.visitPOP2(this); }
0
import org.apache.sshd.common.util.ThreadUtils; this.executor = ThreadUtils.newCachedThreadPool(manager.toString() + "-mina");
0
* Copyright 2016 Seznam.cz, a.s.
0
expect(attributeStore.getHostAttributes("a")).andReturn(Optional.absent()); Suppliers.ofInstance(ImmutableSet.copyOf(activeTasks)), .setAttributes(ImmutableSet.copyOf(attributes))))); .setValues(ImmutableSet.copyOf(values));
0
// Alerts notifications properties public static final String AMBARI_DISPLAY_URL = "ambari.display.url"; * Get the ambari display URL * @return */ public String getAmbariDisplayUrl() { return properties.getProperty(AMBARI_DISPLAY_URL, null); } /**
0
if (monitor.isCanceled()) { return Status.CANCEL_STATUS; }
0
import org.apache.http.HttpCoreNIOTestBase; import org.apache.http.impl.nio.SSLNHttpClientConnectionFactory; import org.apache.http.impl.nio.SSLNHttpServerConnectionFactory; import org.apache.http.nio.NHttpClientIOTarget; import org.apache.http.nio.NHttpConnectionFactory; import org.apache.http.nio.NHttpServerIOTarget; import org.apache.http.params.HttpParams; import org.apache.http.testserver.SSLTestContexts; import org.junit.After; import org.junit.Before; public class TestDefaultIOReactorsSSL extends HttpCoreNIOTestBase { @Before @Override public void initServer() throws Exception { super.initServer(); } @Before @Override public void initClient() throws Exception { super.initClient(); } @After @Override public void shutDownClient() throws Exception { super.shutDownClient(); } @After @Override public void shutDownServer() throws Exception { super.shutDownServer(); } @Override protected NHttpConnectionFactory<NHttpServerIOTarget> createServerConnectionFactory( HttpParams params) throws Exception { return new SSLNHttpServerConnectionFactory(SSLTestContexts.createServerSSLContext(), null, params); } @Override protected NHttpConnectionFactory<NHttpClientIOTarget> createClientConnectionFactory( HttpParams params) throws Exception { return new SSLNHttpClientConnectionFactory(SSLTestContexts.createClientSSLContext(), null, params); }
0
import org.apache.commons.dbutils.handlers.KeyedHandlerTest; suite.addTestSuite(KeyedHandlerTest.class);
0
package org.apache.felix.karaf.shell.admin;
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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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.utils; import akka.actor.ActorRef; import com.google.common.base.Optional; import org.apache.ambari.view.hive20.ConnectionSystem; import org.apache.ambari.view.hive20.actor.message.Ping; /** * Static class to submit event to the MetaData Manager. */ public final class MetaDataManagerEventSubmitter { /** * Send a ping message to the MetaDataManager Actor for that instance * @param username Logged-in username * @param instanceName current instance name */ public static void sendDBRefresh(String username, String instanceName) { Optional<ActorRef> metaDataManagerOptional = ConnectionSystem.getInstance().getMetaDataManagerIfPresent(instanceName); if(metaDataManagerOptional.isPresent()) { ActorRef metaDataManager = metaDataManagerOptional.get(); metaDataManager.tell(new Ping(username, instanceName, true), ActorRef.noSender()); } } }
0
if ( hasDelegate ) { hasDefaultConstructor = getAccessibleConstructor( clazz, new Class[0] ) != null; if ( argTypes[i].equals( boolean.class ) ) templateConstructorArguments[i] = convert( "0", argTypes[i] ); DeferredConstructionCallback callback = new DeferredConstructionCallback( constructor, constructorArguments ); enhancer.setInterceptDuringConstruction( false ); void finalize( Object proxy ) throws Exception ( (DeferredConstructionCallback) ( (Factory) proxy ).getCallback( 0 ) ).establishDelegate(); proxyManager = new ProxyManager( clazz, constructor, defaultConstructorArguments, getDigester() ); proxyManager.finalize( top );
0
GANGLIA_CLUSTER_NAME_MAP.put("DATANODE", Arrays.asList("HDPDataNode", "HostMetrics")); GANGLIA_CLUSTER_NAME_MAP.put("TASKTRACKER", Arrays.asList("HDPTaskTracker", "HostMetrics")); GANGLIA_CLUSTER_NAME_MAP.put("NODEMANAGER", Arrays.asList("HDPNodeManager", "HostMetrics")); GANGLIA_CLUSTER_NAME_MAP.put("HBASE_REGIONSERVER", Arrays.asList("HDPHBaseRegionServer", "HostMetrics")); GANGLIA_CLUSTER_NAME_MAP.put("FLUME_SERVER", Arrays.asList("HDPFlumeServer", "HostMetrics")); GANGLIA_CLUSTER_NAME_MAP.put("JOURNALNODE", Arrays.asList("HDPJournalNode", "HostMetrics"));
0
public void testParseSuccess() throws Exception { public void testParseFailure() throws Exception { public void testParseInvalidInput() throws Exception { public void testFormatting() throws Exception { RequestLine requestline = new RequestLine("GET", "/stuff", HttpVersion.HTTP_1_1); String s = RequestLine.format(requestline); assertEquals("GET /stuff HTTP/1.1", s); } public void testFormattingInvalidInput() throws Exception { try { RequestLine.format(null, new RequestLine("GET", "/stuff", HttpVersion.HTTP_1_1)); fail("IllegalArgumentException should habe been thrown"); } catch (IllegalArgumentException ex) { // expected } try { RequestLine.format(new CharArrayBuffer(10), (RequestLine) null); fail("IllegalArgumentException should habe been thrown"); } catch (IllegalArgumentException ex) { // expected } }
0
import org.apache.hc.core5.http.io.entity.AbstractImmutableHttpEntity;
1
return BlockingBuffer.blockingBuffer(new MyBuffer<E>()); Buffer<E> blockingBuffer = BlockingBuffer.blockingBuffer(new MyBuffer<E>(), 500); Buffer<E> blockingBuffer = BlockingBuffer.blockingBuffer(new MyBuffer<E>(), 500); Buffer<E> blockingBuffer = BlockingBuffer.blockingBuffer(new MyBuffer<E>(), 100); Buffer<E> blockingBuffer = BlockingBuffer.blockingBuffer(new MyBuffer<E>(), 100);
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
/** * 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.zookeeper.graph.filterops; import org.apache.zookeeper.graph.LogEntry; import org.apache.zookeeper.graph.FilterOp; import org.apache.zookeeper.graph.FilterException; public class EqualsOp extends FilterOp { public boolean matches(LogEntry entry) throws FilterException { Object last = null; for (Arg a : args) { Object v = a.getValue(); if (a.getType() == FilterOp.ArgType.SYMBOL) { String key = (String)a.getValue(); v = entry.getAttribute(key); } if (last != null && !last.equals(v)) { return false; } last = v; } return true; } }
0
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken; import org.apache.accumulo.core.security.CredentialHelper; String principal; AuthenticationToken token; principal = SecurityConstants.getSystemPrincipal(); token = SecurityConstants.getSystemToken(); principal = opts.principal; token = opts.getToken(); stopTabletServer(instance, CredentialHelper.create(principal, token, instance.getInstanceID()), stopOpts.args, opts.force); stopServer(instance, CredentialHelper.create(principal, token, instance.getInstanceID()), everything);
0
* <!> FIX ME: add a scale factor to account for ObjectBoundingBox *
0
import org.apache.batik.util.ParsedURL; ParsedURL uri, ParsedURL uri, ParsedURL uri,
0
public Connector getConnector() {
0
import org.apache.commons.collections.functors.TruePredicate; public class TestPredicatedBag<T> extends AbstractTestBag<T> { protected Predicate<T> stringPredicate() { return new Predicate<T>() { public boolean evaluate(T o) { } protected Predicate<T> truePredicate = TruePredicate.<T>truePredicate(); protected Bag<T> decorateBag(HashBag<T> bag, Predicate<T> predicate) { public Bag<T> makeObject() { return decorateBag(new HashBag<T>(), truePredicate); protected Bag<T> makeTestBag() { return decorateBag(new HashBag<T>(), stringPredicate()); @SuppressWarnings("unchecked") Bag<T> bag = makeTestBag(); T[] els = (T[]) new Object[] { "1", "3", "5", "7", "2", "4", "1" }; Set<T> set = ((PredicatedBag<T>) bag).uniqueSet(); assertEquals(true, bag.remove(els[0])); set = ((PredicatedBag<T>) bag).uniqueSet(); !set.contains(els[0])); @SuppressWarnings("unchecked") Bag<T> bag = makeTestBag(); bag.add((T) i); assertTrue("Collection shouldn't contain illegal element", !bag.contains(i)); @SuppressWarnings("unchecked") HashBag<Object> elements = new HashBag<Object>(); decorateBag((HashBag<T>) elements, stringPredicate()); decorateBag(new HashBag<T>(), null); }
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.ambari.logsearch.solr.commands; import org.apache.ambari.logsearch.solr.AmbariSolrCloudClient; import org.apache.solr.common.cloud.ZkConfigManager; import java.nio.file.Path; import java.nio.file.Paths; public class UploadConfigZkCommand extends AbstractZookeeperRetryCommand<String> { public UploadConfigZkCommand(int maxRetries, int interval) { super(maxRetries, interval); } @Override protected String executeZkCommand(ZkConfigManager zkConfigManager, AmbariSolrCloudClient client) throws Exception { Path configDir = Paths.get(client.getConfigDir()); String configSet = client.getConfigSet(); zkConfigManager.uploadConfigDir(configDir, configSet); return configSet; } }
0
/* * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cocoon.forms.datatype.convertor; import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; import java.util.Locale; import java.util.Date; /** * A Convertor for Date objects which uses the number of milliseconds since * January 1, 1970, 00:00:00 GMT as string representation. * * @version $Id$ */ public class MillisDateConvertor implements Convertor { public ConversionResult convertFromString(String value, Locale locale, Convertor.FormatCache formatCache) { try { long date = Long.parseLong(value); return new ConversionResult(new Date(date)); } catch (NumberFormatException e) { return ConversionResult.create("date"); } } public String convertToString(Object value, Locale locale, Convertor.FormatCache formatCache) { Date date = (Date)value; return String.valueOf(date.getTime()); } public Class getTypeClass() { return Date.class; } public void generateSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException { // intentionally empty } }
0
package org.apache.hadoop.metadata.types; import org.apache.hadoop.metadata.MetadataException; import org.apache.hadoop.metadata.MetadataException; import org.apache.hadoop.metadata.storage.DownCastStructInstance; import org.apache.hadoop.metadata.storage.StructInstance;
0
import org.apache.accumulo.server.conf.ServerConfigurationFactory; ServerConfigurationFactory conf = new ServerConfigurationFactory(opts.getInstance());
1
public void write(final int b) throws IOException { public void write(final byte[] b) throws IOException { public void write(final byte[] b, final int off, final int len) throws IOException {
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
* @param lineParser the line parser. * {@link AbstractMessageParser#AbstractMessageParser(SessionInputBuffer, LineParser, * MessageConstraints)} public AbstractMessageParser( final SessionInputBuffer buffer, final LineParser lineParser, this.lineParser = (lineParser != null) ? lineParser : BasicLineParser.INSTANCE; * @param lineParser the line parser. If <code>null</code> {@link BasicLineParser#INSTANCE} * will be used. final LineParser lineParser, this.lineParser = lineParser != null ? lineParser : BasicLineParser.INSTANCE;
0
package org.apache.commons.digester3.rule;
0
import org.apache.beam.sdk.extensions.sql.impl.utils.CalciteUtils; import org.apache.calcite.sql.type.SqlTypeName; .typeDescriptor(FieldTypeDescriptor.of(FieldType.STRING) .withMetadata(CalciteUtils.typeToMetadata(SqlTypeName.VARCHAR)))
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
public final void add( String pattern, Rule rule )
0
final ExecChain.Scope scope = new ExecChain.Scope("test", route, request, mock(ExecRuntime.class), context);
0
import org.apache.ambari.server.ldap.domain.AmbariLdapConfiguration; private static final String AMBARI_ADMIN_LDAP_ATTRIBUTE_KEY = "ambari_admin"; private final AmbariLdapConfiguration ldapConfiguration; public AmbariLdapBindAuthenticator(BaseLdapPathContextSource contextSource, AmbariLdapConfiguration ldapConfiguration) { this.ldapConfiguration = ldapConfiguration;; LdapServerProperties ldapServerProperties = ldapConfiguration.getLdapServerProperties();
0
Copyright 2000-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
UpgradeEntity lastUpgradeItemForCluster = s_upgradeDAO.findLastUpgradeForCluster( cluster.getClusterId(), Direction.UPGRADE);
0
* @version CVS $Id: EPFont.java,v 1.3 2003/09/05 07:31:40 cziegeler Exp $
0
requestParameters, requestProperties.get(REQUEST_CONTEXT_PROPERTY), false); Map<String, String> requestParameters, String requestContext, boolean runSmokeTest) if (runSmokeTest && (State.INSTALLED == s.getDesiredState())) { if (runSmokeTest && (entry.getValue().size() > 1)) { if (runSmokeTest && compInfo.isMaster()) { Set<ServiceRequest> requests, Map<String, String> requestProperties, boolean runSmokeTest) throws AmbariException { List<Stage> stages = doStageCreation(cluster, changedServices, changedComps, changedScHosts, null, requestProperties.get(REQUEST_CONTEXT_PROPERTY), runSmokeTest); Map<String, String> requestProperties, boolean runSmokeTest) changedComps, changedScHosts, null, requestProperties.get(REQUEST_CONTEXT_PROPERTY), runSmokeTest); Map<String, String> requestProperties, boolean runSmokeTest) requestProperties.get(REQUEST_CONTEXT_PROPERTY), runSmokeTest);
0
/** * {@link OutputStream} adaptor for {@link ContentOutputBuffer}. */
0
import cz.seznam.euphoria.core.annotation.audience.Audience; @Audience(Audience.Type.CLIENT)
0
assertThat(value, equalTo(pcsByTag.get(tag)));
0
* result of the test in the DOM using the following namespace: <br> * xmlns:test="http://xml.apache.org/batik/test" <br> * test file. <br> * Sample input SVG file:<br><code>
0
public class GarbageCollectorIT extends ConfigurableMacIT {
0
if (name == null) { return commands.keySet(); }
0
@Override
1
import org.apache.ambari.server.controller.internal.UnitUpdater.PropertyValue;
0
import org.apache.http.HttpHost; import org.apache.http.client.HttpClient; import org.apache.http.client.RoutedRequest; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.conn.HttpRoute; import org.apache.http.conn.PlainSocketFactory; import org.apache.http.conn.Scheme; import org.apache.http.conn.SchemeRegistry; import org.apache.http.conn.SocketFactory; import org.apache.http.conn.ssl.SSLSocketFactory; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.impl.conn.ThreadSafeClientConnManager; import org.apache.http.params.BasicHttpParams;
0
import java.awt.print.PrinterException; import javax.swing.JOptionPane; import org.apache.batik.transcoder.TranscoderInput; new Thread() { public void run(){ // // Build a PrintTranscoder to handle printing // of the svgDocument object // PrintTranscoder printTranscoder = new PrintTranscoder(); // // Set transcoding hints // printTranscoder.addTranscodingHint(PrintTranscoder.KEY_XML_PARSER_CLASSNAME, application.getXMLParserClassName()); printTranscoder.addTranscodingHint(PrintTranscoder.KEY_SHOW_PAGE_DIALOG, new Boolean(true)); printTranscoder.addTranscodingHint(PrintTranscoder.KEY_SHOW_PRINTER_DIALOG, new Boolean(true)); // // Do transcoding now // printTranscoder.transcode(new TranscoderInput(svgDocument), null); // // Print // try{ printTranscoder.print(); }catch(PrinterException ex){ // <!> TEMPORARY: NEED BETTER ERROR HANDLING STRATEGY JOptionPane.showMessageDialog(JSVGViewerFrame.this, ex); } } }.start();
0
@SuppressWarnings({"unchecked", "serial", "rawtypes", "unused"}) public class NotServingTabletException extends TException implements org.apache.thrift.TBase<NotServingTabletException, NotServingTabletException._Fields>, java.io.Serializable, Cloneable, Comparable<NotServingTabletException> { public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0
import java.util.Arrays; @Override putEvents(Arrays.asList(events)); } @Override /** * Add events to the event repository * @param events events to be added * @throws AtlasException */ public void putEvents(List<EntityAuditEvent> events) throws AtlasException { LOG.info("Putting {} events", events.size()); List<Put> puts = new ArrayList<>(events.size()); if (event.action != null) { put.addColumn(COLUMN_FAMILY, COLUMN_ACTION, Bytes.toBytes((short)event.action.ordinal())); } event.action = EntityAuditAction.values()[(Bytes.toShort(result.getValue(COLUMN_FAMILY, COLUMN_ACTION)))]; public static org.apache.hadoop.conf.Configuration getHBaseConfiguration(Configuration atlasConf) throws AtlasException {
0
* @version $Revision$
0
* Copyright (c) 2002 The Apache Software Foundation. All rights
0
import static org.apache.ambari.metrics.core.timeline.PhoenixHBaseAccessor.DATE_TIERED_COMPACTION_POLICY; import static org.apache.ambari.metrics.core.timeline.PhoenixHBaseAccessor.FIFO_COMPACTION_POLICY_CLASS; import static org.apache.ambari.metrics.core.timeline.PhoenixHBaseAccessor.HSTORE_COMPACTION_CLASS_KEY; import static org.apache.ambari.metrics.core.timeline.PhoenixHBaseAccessor.HSTORE_ENGINE_CLASS; Field f2 = PhoenixHBaseAccessor.class.getDeclaredField("timelineMetricsTablesDurability"); f2.setAccessible(true); f2.set(hdb, "ASYNC_WAL"); boolean tableDurabilitySet = false; for (int i = 0; i < 10; i++) { tableDurabilitySet = (Durability.ASYNC_WAL.equals(tableDescriptor.getDurability())); Assert.assertTrue("Durability Set.", tableDurabilitySet); PreparedStatement stmt = conn.prepareStatement("SELECT * FROM CONTAINER_METRICS_UUID");
0
if (repoInfo.isEmpty()){ LOG.error(String.format("Repository list is empty. Ambari may not be managing the repositories for %s", osFamily)); }
0
public void testCannotEscapeUserAbsoluteRoot() throws Exception { testCannotEscapeRoot(true); } @Test // see SSHD-605 public void testCannotEscapeUserRelativeRoot() throws Exception { testCannotEscapeRoot(false); } private void testCannotEscapeRoot(boolean useAbsolutePath) throws Exception { String escapePath; if (useAbsolutePath) { escapePath = targetPath.toString(); if (OsUtils.isWin32()) { escapePath = "/" + escapePath.replace(File.separatorChar, '/'); } } else { Path parent = lclSftp.getParent(); Path forbidden = Files.createDirectories(parent.resolve("forbidden")); escapePath = "../" + forbidden.getFileName(); int expected = OsUtils.isWin32() || (!useAbsolutePath) ? SftpConstants.SSH_FX_INVALID_FILENAME : SftpConstants.SSH_FX_NO_SUCH_FILE; assertEquals("Mismatched status for " + escapePath, SftpConstants.getStatusName(expected), SftpConstants.getStatusName(e.getStatus()));
0
.combineBy(Sums.ofLongs(), TypeDescriptors.longs())
0
@SuppressWarnings("EmptyMethod") public static void checkJarHell() {
0
import javax.persistence.NamedQueries; @NamedQueries({ @NamedQuery(name = "AlertNoticeEntity.findAll", query = "SELECT notice FROM AlertNoticeEntity notice"), @NamedQuery(name = "AlertNoticeEntity.removeByDefinitionId", query = "DELETE FROM AlertNoticeEntity notice WHERE notice.alertHistory.alertDefinition.definitionId = :definitionId") })
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
= "dataflow.gcr.io/v1beta3/beam-java-batch:beam-master-20160427"; = "dataflow.gcr.io/v1beta3/beam-java-streaming:beam-master-20160427";
0
* http://www.apache.org/licenses/LICENSE-2.0
0
import org.slf4j.Logger; import org.slf4j.LoggerFactory; private static final Logger LOG = LoggerFactory.getLogger(AbortHandler.class); LOG.info("Received abort HTTP signal from {} ({})", req.getRemoteAddr(), req.getRemoteHost());
0
import org.apache.beam.runners.core.metrics.MetricUpdates;
0
private byte[] buffer; private int len; public byte[] buffer() { return this.buffer; }
0
final int EXPECTED_TOTAL_COUNT = 92;
0
* This is a Java Bean class that can be used to wrap an instance of * {@link HttpParams} and manipulate HTTP authentication parameters * using Java Beans conventions.
0
MapFile.Writer output = new MapFile.Writer(ns.getConf(), ns.makeQualified(path), MapFile.Writer.keyClass(LogFileKey.class), MapFile.Writer.valueClass(LogFileValue.class));
0
serviceContexts.put( implementationObject, serviceContext ); serviceContexts.remove( implementationObject ); <T> void invokeBindMethod( DependencyManager<S, T> dependencyManager, RefPair<T> refPair, int trackingCount ) dependencyManager.invokeBindMethod( implementationObject, refPair, trackingCount ); <T> void invokeUpdatedMethod( DependencyManager<S, T> dependencyManager, RefPair<T> refPair, int trackingCount ) dependencyManager.invokeUpdatedMethod( implementationObject, refPair, trackingCount );
0
import static org.junit.Assert.assertNotNull; import java.util.Collections; import org.apache.commons.configuration.interpol.DefaultLookups; * Tests whether a {@code ConfigurationInterpolator} is created from * properties defined in the parameters object if necessary. */ @Test public void testInterpolatorFromParameters() throws ConfigurationException { BasicBuilderParameters params = new MultiFileBuilderParametersImpl().setFilePattern(PATTERN) .setPrefixLookups( Collections.singletonMap( DefaultLookups.SYSTEM_PROPERTIES .getPrefix(), DefaultLookups.SYSTEM_PROPERTIES .getLookup())); MultiFileConfigurationBuilder<XMLConfiguration> builder = new MultiFileConfigurationBuilder<XMLConfiguration>( XMLConfiguration.class); builder.configure(params); switchToConfig(1); assertEquals("Wrong property", 15, builder.getConfiguration().getInt("rowsPerPage")); } /** * Tests whether the ConfigurationInterpolator is reset, too. */ @Test public void testInterpolatorReset() { BasicBuilderParameters params = new MultiFileBuilderParametersImpl().setFilePattern(PATTERN); MultiFileConfigurationBuilder<XMLConfiguration> builder = new MultiFileConfigurationBuilder<XMLConfiguration>( XMLConfiguration.class); builder.configure(params); ConfigurationInterpolator interpolator = builder.getInterpolator(); assertNotNull("No interpolator", interpolator); builder.resetParameters(); assertNotSame("No new interpolator", interpolator, builder.getInterpolator()); } /**
0
* The 'type' attribute values. */ protected final static String[] TYPE_VALUES = { "", SVG_IDENTITY_VALUE, SVG_TABLE_VALUE, SVG_DISCRETE_VALUE, SVG_LINEAR_VALUE, SVG_GAMMA_VALUE }; /** return getAnimatedEnumerationAttribute (null, SVG_TYPE_ATTRIBUTE, TYPE_VALUES, (short)1); return getAnimatedNumberAttribute(null, SVG_SLOPE_ATTRIBUTE, 1f); return getAnimatedNumberAttribute(null, SVG_INTERCEPT_ATTRIBUTE, 0f); return getAnimatedNumberAttribute(null, SVG_AMPLITUDE_ATTRIBUTE, 1f); return getAnimatedNumberAttribute(null, SVG_EXPONENT_ATTRIBUTE, 1f); return getAnimatedNumberAttribute(null, SVG_OFFSET_ATTRIBUTE, 0f);
0
// add service check actions from the target stack for(ServiceInfo serviceInfo : stackInfo.getServices()) { if(serviceInfo.getCommandScript() != null) { actionMetadata.addServiceCheckAction(serviceInfo.getName()); } }
0
/** A test that verifies that metrics push system works in spark runner. */ @Rule public final transient ReuseSparkContextRule noContextResue = ReuseSparkContextRule.no(); @Rule public final TestPipeline pipeline = TestPipeline.create(); public void init() { private static class CountingDoFn extends DoFn<Integer, Integer> { private final Counter counter = Metrics.counter(SparkMetricsPusherTest.class, "counter"); pipeline.apply(Create.of(1, 2, 3, 4, 5, 6)).apply(ParDo.of(new CountingDoFn()));
1
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.felix.ipojo.manipulator.store.mapper; import org.apache.felix.ipojo.manipulator.store.ResourceMapper; /** * A {@code WABResourceMapper} knows how to map resource names for a Web Application Bundle (WAB). * * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a> * * TODO It is not actually used by default, that will probably lead to some Exception */ public class WABResourceMapper implements ResourceMapper { public static final String WEB_INF_CLASSES = "WEB-INF/classes/"; public String internalize(String name) { return WEB_INF_CLASSES + name; } public String externalize(String name) { if (name.startsWith(WEB_INF_CLASSES)) { return name.substring(WEB_INF_CLASSES.length()); } else { throw new IllegalArgumentException("Path '" + name + "' do not start with '" + WEB_INF_CLASSES + "'"); } } }
0
* Sets FTPS mode, either "implicit" or "explicit". * Returns the FTPS mode. Defaults to "explicit" if not defined. * Sets FTPS type, either "implicit" or "explicit". * Returns the FTPS type. Defaults to "explicit" if not defined.
0
/** * Constructor CertificateElement * * @param element * @param BaseURI * @throws XMLSecurityException */ public CertificateElement(Element element, String BaseURI) throws XMLSecurityException { /** * Method setJCAType * * @param cert */ this._constructionElement .setAttribute(ApacheKeyStoreConstants._ATT_JCATYPE, cert.getType()); /** * Method getJCAType * * @return */ return this._constructionElement .getAttribute(ApacheKeyStoreConstants._ATT_JCATYPE); /** * Method getCertificate * * @return * @throws CertificateException * @throws XMLSecurityException */ public Certificate getCertificate() throws XMLSecurityException, CertificateException { Element certElem = this.getChildElementLocalName(0, Constants.SignatureSpecNS, Constants._TAG_X509CERTIFICATE); XMLX509Certificate xCert = new XMLX509Certificate(certElem, this._baseURI); Certificate cert = cf.generateCertificate(new ByteArrayInputStream(xCert .getCertificateBytes())); return ApacheKeyStoreConstants._TAG_CERTIFICATE;
0
upstream = upstream.apply(stageName + "_assignEventTimestamp", WithTimestamps PCollection<BeamSqlRow> windowStream = upstream.apply(stageName + "_window", PCollection<KV<BeamSqlRow, BeamSqlRow>> exGroupByStream = windowStream.apply( stageName + "_exGroupBy", .apply(stageName + "_groupBy", GroupByKey.<BeamSqlRow, BeamSqlRow>create()) PCollection<KV<BeamSqlRow, BeamSqlRow>> aggregatedStream = groupedStream.apply( stageName + "_aggregation", PCollection<BeamSqlRow> mergedStream = aggregatedStream.apply(stageName + "_mergeRecord",
0
return clusters.getHostsForCluster(clusterName).values();
0
* @version $Revision: 1.3 $ $Date: 2004/05/22 20:33:05 $ HeaderElement[] element;
0
import java.util.Collection; import java.util.Map; import org.apache.felix.utils.json.JSONParser; import org.apache.felix.utils.json.JSONWriter; @Override @Override @Override { JSONParser parser = new JSONParser(dataRaw); final Map<String, Object> data = parser.getParsed(); Role xrole = userAdmin.getRole((String)data.get("name")); //$NON-NLS-1$ (String)data.get("name"), //$NON-NLS-1$ (int)(long)(Long)data.get("type")); //$NON-NLS-1$ jw.flush(); @SuppressWarnings("unchecked") private static final void doSetData(Role role, Map<String, Object> data) throws IOException putProps(role.getProperties(), (Map<String, Object>)data.get("properties")); //$NON-NLS-1$ putProps(((User) role).getCredentials(), (Map<String, Object>)data.get("credentials")); //$NON-NLS-1$ private static final void putProps(Dictionary dest, Map<String, Object> props) throws IOException if (props == null || props.size() == 0) for (Iterator i = props.keySet().iterator(); i.hasNext();) Object val = props.get(key); if (val instanceof Collection) val = toArray((Collection) val); private static final byte[] toArray(Collection array) throws IOException final byte[] ret = new byte[array.size()]; Iterator iter = array.iterator(); ret[i] = (byte) ((Long)iter.next() & 0xff); throws IOException throws IOException throws IOException throws IOException
0
import org.apache.xml.security.transforms.Transforms; import org.w3c.dom.Document; import org.w3c.dom.Node;
0
import org.apache.http.impl.nio.DefaultClientIODispatch; final IOEventDispatch ioEventDispatch = new DefaultClientIODispatch(handler, params);
0
REPO, PROJECT, EXTERNAL, LIBRARY, ERROR
0
// FIXME this.cocoon = (Cocoon)this.coreUtil.createProcessor(); // FIXME this.cocoon = (Cocoon)this.coreUtil.getProcessor(request.getParameter(Constants.RELOAD_PARAM) != null); // FIXME this.cocoon = (Cocoon)this.coreUtil.getProcessor(request.getParameter(Constants.RELOAD_PARAM) != null);
0
final int port;
0
* Included starting in Oracle Java 9 GA. * Included starting in Oracle Java 9 GA. * Included starting in Oracle Java 9 GA. * Included starting in Oracle Java 9 GA.
0
import java.io.EOFException; import java.io.WriteAbortedException; public IoWriteFuture writePacket(Buffer buffer) throws IOException { throw new EOFException("Not open"); throw new WriteAbortedException("Failed to offer outgoing buffer", new IllegalStateException("Offer failure"));
0
/* * Copyright 1999-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.cocoon.caching.impl; import java.io.Serializable; import org.apache.commons.collections.MultiHashMap; /** * A light object for persisting the state of an EventRegistry implementation * based on two MultiHashMaps. * * @author <a href="mailto:ghoward@apache.org">Geoff Howard</a> * @version $Id$ */ public class EventRegistryDataWrapper implements Serializable { private MultiHashMap m_keyMMap; private MultiHashMap m_eventMMap; public EventRegistryDataWrapper() { this.m_keyMMap = null; this.m_eventMMap = null; } public void setupMaps(MultiHashMap keyMap, MultiHashMap eventMap) { this.m_keyMMap = keyMap; this.m_eventMMap = eventMap; } public MultiHashMap get_eventMap() { return m_eventMMap; } public MultiHashMap get_keyMap() { return m_keyMMap; } }
0
userEntity.setUserName(UserName.fromString(userName)); userEntity.setUserName(UserName.fromString(userName));
0
Coder<?> valueCoder = ((WindowedValueCoder<?>) coder).getValueCoder(); try { super.close(); } finally { outputChannel.close(); } try { super.close(); } finally { outputChannel.close(); }
0
document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); document = XMLUtils.parse(is, false); XMLUtils.parse(new ByteArrayInputStream(baos.toByteArray()), false); XMLUtils.parse(new ByteArrayInputStream(baos.toByteArray()), false);
0