Diff
stringlengths
5
2k
FaultInducingLabel
int64
0
1
LogEntry::new; Log.Position position = mutate( appendStats, logWriter -> logWriter.append(contents, writeTimeout, writeTimeUnit)); mutate(truncateStats, logWriter -> { logWriter.truncate(before, writeTimeout, writeTimeUnit); return null;
0
clipPathAttrBuf.append(clipDef.getAttributeNS(null, SVG_ID_ATTRIBUTE)); clipDef.setAttributeNS(null, SVG_ID_ATTRIBUTE,
1
* Tests whether multiple sources of a key can be retrieved. */ @Test public void testGetSourcesMultiSources() { setUpSourceTest(); final String key = "list.key"; config.getConfiguration(CHILD1).addProperty(key, "1,2,3"); config.getConfiguration(CHILD2).addProperty(key, "a,b,c"); Set<Configuration> sources = config.getSources(key); assertEquals("Wrong number of sources", 2, sources.size()); assertTrue("Source 1 not found", sources.contains(config.getConfiguration(CHILD1))); assertTrue("Source 2 not found", sources.contains(config.getConfiguration(CHILD2))); } /** * Tests getSources() for a non existing key. */ @Test public void testGetSourcesUnknownKey() { setUpSourceTest(); assertTrue("Got sources", config.getSources("non.existing,key") .isEmpty()); } /**
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/decorators/Attic/AbstractSortedBagDecorator.java,v 1.3 2003/11/16 00:39:37 scolebourne Exp $ * @version $Revision: 1.3 $ $Date: 2003/11/16 00:39:37 $ * @deprecated TO BE REMOVED BEFORE v3.0
0
m_handlerTasks.ungetEventHandler(handler, m_eventHandlerRef);
0
import org.apache.ambari.server.orm.dao.HostRoleCommandDAO; bind(HostRoleCommandDAO.class).toInstance(createNiceMock(HostRoleCommandDAO.class));
0
implements org.apache.batik.dom.dom3.ProcessingInstruction { * <b>DOM</b>: Implements {@link org.w3c.dom.Node#getTextContent()}. */ public String getTextContent() { return getNodeValue(); } /**
0
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ambari.server.controller.spi; /** * Factory for Schema instances. */ public interface SchemaFactory { /** * Obtain a schema instance for a given resource type. * * @param type resource type * @return schema instance for the specified type */ public Schema getSchema(Resource.Type type); }
0
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/bidimap/AbstractTestBidiMap.java,v 1.6 2003/12/03 12:59:36 scolebourne Exp $ * @version $Revision: 1.6 $ $Date: 2003/12/03 12:59:36 $ protected final Object[][] entries; if (isPutAddSupported() == false || isPutChangeSupported() == false) return; if (isRemoveSupported() == false) return; if (isRemoveSupported() == false) return; if (isRemoveSupported() == false) return; if (isRemoveSupported() == false) return; //----------------------------------------------------------------------- public Map makeFullMap() { return ((BidiMap) main.makeFullMap()).inverseBidiMap(); }
0
* @version $Revision$ $Date$
0
/** * Fill the buffer with random values * @param bytes The bytes to fill * @see #fill(byte[], int, int) */ void fill(byte[] bytes); // TODO in JDK-8 make this a default method
0
import static org.junit.Assert.assertTrue; public class C14nHelperTest {
0
ZooKeeperServer zkServer = new ZooKeeperServer( new FileTxnSnapLog(config.dataLogDir, config.dataDir), config.tickTime, config.minSessionTimeout, config.maxSessionTimeout, null);
0
private final Iterator<E> iterator;
0
SampleModel smRet = sm.createCompatibleSampleModel (rect.width, rect.height); // System.out.println("GD DB: " + wr.getDataBuffer().getSize());
0
* @author <a href="http://commons.apache.org/vfs/team-list.html">Commons VFS team</a>
0
this.keySet = (keySet == null) ? Collections.emptyList() : keySet;
0
mfw.append(rootDirKey, new Value("/root_tablet".getBytes())); mfw.append(tableDirKey, new Value(Constants.TABLE_TABLET_LOCATION.getBytes())); mfw.append(tableTimeKey, new Value((TabletTime.LOGICAL_TIME_ID + "0").getBytes())); mfw.append(defaultDirKey, new Value(Constants.DEFAULT_TABLET_LOCATION.getBytes())); mfw.append(defaultTimeKey, new Value((TabletTime.LOGICAL_TIME_ID + "0").getBytes())); zoo.putPersistentData(instanceNamePath, uuid.getBytes(), NodeExistsPolicy.FAIL); zoo.putPersistentData(zkInstanceRoot + Constants.ZMASTER_GOAL_STATE, MasterGoalState.NORMAL.toString().getBytes(), NodeExistsPolicy.FAIL); return cliPassword.getBytes(); return rootpass.getBytes();
0
import org.apache.accumulo.server.conf.ServerConfigurationFactory; conf = new ServerConfigurationFactory(HdfsZooInstance.getInstance()).getConfiguration();
1
CachingSourceValidityStrategy validityStrategy, super(factory, protocol, uri, sourceUri, (TraversableSource) source, expires, cacheName, async, validityStrategy, fail);
0
/** * Creates the object, a <code>FileConfiguration</code>. * * @param attributes the actual attributes * @return the file configuration * @throws Exception if the object could not be created */ /** * Creates a new instance of <code>PropertiesConfigurationFactory</code>. */ /** * Creates the new configuration object. Based on the file name * provided in the attributes either a <code>PropertiesConfiguration</code> * or a <code>XMLPropertiesConfiguration</code> object will be * returned. * * @param attributes the attributes * @return the new configuration object * @throws Exception if an error occurs */ /** * Creates a new instance of <code>PropertyListConfigurationFactory</code>. */ /** * Creates the new configuration object. Based on the file name * provided in the attributes either a <code>XMLPropertyListConfiguration</code> * or a <code>PropertyListConfiguration</code> object will be * returned. * * @param attributes the attributes * @return the new configuration object * @throws Exception if an error occurs */ /** * Creates a new instance of <code>JNDIConfigurationFactory</code>. */ /** * Creates a new instance of <code>SystemConfigurationFactory</code>. */
0
/** * A zero milliseconds {@link Timeout}. */
0
/** The port to use, defaults to -1 if not set. */
0
* * @version $Id: Form2Bean.java,v 1.5 2004/02/11 10:43:32 antonio Exp $
0
Object value = null; if(propType != null) { value = this.processColumn(rs, i, propType); if (value == null && propType.isPrimitive()) { value = primitiveDefaults.get(propType); }
0
SortedSet<Text> partitionKeys = new TreeSet<>();
0
final Option algorithm = new Option("a" , "algo", true, "the algorithm which it to perform executing"); final Option key = new Option("k" , "key", true, "the key the setted algorithm uses to process"); final String[] args = new String[] { "-a", "Caesar", "-k", "A" }; final CommandLine line = parser.parse( options, args); final String[] args = new String[] { "-k", "-a", "Caesar" }; } catch(final MissingArgumentException e) { final String[] args = new String[] { "-k", "-a", "Caesar" }; final CommandLine line = parser.parse( options, args);
0
public AuthenticationToken login(String principal, Properties properties) throws AccumuloSecurityException { throw new AccumuloSecurityException(principal, SecurityErrorCode.INSUFFICIENT_PROPERTIES);
0
AbstractUpgradeCatalog.class.getDeclaredMethod("updateKerberosDescriptorArtifacts");
0
import org.apache.accumulo.core.Constants; return Long.toString(v).getBytes(Constants.UTF8); return Long.parseLong(new String(b, Constants.UTF8));
0
@Override public Collection<Host> getHosts() { //todo: really, this class doesn't have a getName() method??? String clusterName = clusterEntity.getClusterName(); Map<String, Host> hosts; try { //todo: why the hell does this method throw AmbariException??? //todo: this is ridiculous that I need to get hosts for this cluster from Clusters!!! //todo: should I getHosts using the same logic as the other getHosts call? At least that doesn't throw AmbariException. hosts = clusters.getHostsForCluster(clusterName); } catch (AmbariException e) { //todo: in what conditions is AmbariException thrown? throw new RuntimeException("Unable to get hosts for cluster: " + clusterName, e); } return hosts == null ? Collections.<Host>emptyList() : hosts.values(); }
0
// TODO(wickman) Is an IllegalStateException the right thing to do here?
0
@FunctionalInterface Collection<Supplier<Iterable<KeyPair>>> suppliers = new ArrayList<>(providers.size());
0
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ambari.server.orm.entities; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.metamodel.SetAttribute; import javax.persistence.metamodel.SingularAttribute; import javax.persistence.metamodel.StaticMetamodel; /** * The {@link AlertTargetEntity_} is a strongly typed metamodel for creating * {@link CriteriaQuery} for {@link AlertTargetEntity}. */ @StaticMetamodel(AlertTargetEntity.class) public class AlertTargetEntity_ { public static volatile SingularAttribute<AlertTargetEntity, Long> targetId; public static volatile SingularAttribute<AlertTargetEntity, String> description; public static volatile SingularAttribute<AlertTargetEntity, String> notificationType; public static volatile SingularAttribute<AlertTargetEntity, String> properties; public static volatile SingularAttribute<AlertTargetEntity, String> targetName; public static volatile SetAttribute<AlertTargetEntity, AlertGroupEntity> alertGroups; }
0
import org.apache.accumulo.core.tabletserver.thrift.LogCopyInfo; public synchronized LogCopyInfo startCopy(String name, String fullyQualifiedFileName) throws ThriftSecurityException, TException {
0
import java.util.Properties; import org.apache.accumulo.core.conf.ClientProperty; Properties properties = options.getClientProperties(); if (ClientProperty.SASL_ENABLED.getBoolean(properties)) { logError(e.getMessage()); exitCode = 1; return false; try { setInstance(options); } catch (Exception e) { logError(e.getMessage()); exitCode = 1; return false; } DistributedTrace.enable(InetAddress.getLocalHost().getHostName(), "shell", properties); if (options.getZooKeeperInstance().size() > 0) { final Properties properties = options.getClientProperties(); instance = getZooInstance(instanceName, hosts, properties); * Get the ZooKeepers. Use the value passed in (if there was one), then fall back to value in accumulo-client.properties * @param properties * Client properties static String getZooKeepers(String keepers, Properties properties) { return properties.getProperty(ClientProperty.INSTANCE_ZOOKEEPERS.getKey()); /** * Determines Instance using command line options and properties * * @param instanceName Instance name set on CL * @param keepersOption ZooKeeper CL options * @param properties Config properties * @return Instance * @throws IllegalArgumentException if no instance name or zookeeper can be determined private static Instance getZooInstance(String instanceName, String keepersOption, Properties properties) { instanceName = properties.getProperty(ClientProperty.INSTANCE_NAME.getKey()); String keepers = getZooKeepers(keepersOption, properties); if (keepers == null) { throw new IllegalArgumentException("ZooKeepers must be set using -z or -zh on command line or in accumulo-client.properties"); if (instanceName == null) { throw new IllegalArgumentException("Instance name must be set using -z or -zi on command line or in accumulo-client.properties"); return new ZooKeeperInstance(instanceName, keepers);
0
* This filter follows the specification of the feSpecularLighting filter in Filter getSource(); void setSource(Filter src); Light getLight(); void setLight(Light light); double getSurfaceScale(); void setSurfaceScale(double surfaceScale); double getKs(); void setKs(double ks); double getSpecularExponent(); void setSpecularExponent(double specularExponent); Rectangle2D getLitRegion(); void setLitRegion(Rectangle2D litRegion); * Returns the min [dx,dy] distance in user space for evalutation of double [] getKernelUnitLength(); * Sets the min [dx,dy] distance in user space for evaluation of the void setKernelUnitLength(double [] kernelUnitLength);
0
MimeFileObject foParent = (MimeFileObject) FileObjectUtils.getAbstractFileObject(getParent()); part = foParent.findPart(getName().getBaseName()); return; private Part findPart(String partName) throws Exception { if (getType() == FileType.IMAGINARY) { // not existent return null; } if (part.getContentType() == null || !part.getContentType().startsWith("multipart/")) { // not a multipart return null; } Multipart multipart = (Multipart) part.getContent(); if (partName.startsWith(MimeFileSystem.NULL_BP_NAME)) { int partNumber = Integer.parseInt(partName.substring(MimeFileSystem.NULL_BP_NAME.length()), 10); if (partNumber < 0 || partNumber+1 > multipart.getCount()) { // non existent return null; } return multipart.getBodyPart(partNumber); } for (int i = 0; i<multipart.getCount(); i++) { Part childPart = multipart.getBodyPart(i); if (partName.equals(childPart.getFileName())) { return childPart; } } return null; } protected void doDetach() throws Exception List vfs = Collections.EMPTY_LIST; if (part.getContentType() != null && part.getContentType().startsWith("multipart/")) Object container = part.getContent(); if (container instanceof Multipart) Multipart multipart = (Multipart) container; vfs = new ArrayList(multipart.getCount()); for (int i = 0; i<multipart.getCount(); i++) Part part = multipart.getBodyPart(i); String filename = UriParser.encode(part.getFileName()); if (filename == null) { filename = MimeFileSystem.NULL_BP_NAME + i; } MimeFileObject fo = (MimeFileObject) FileObjectUtils.getAbstractFileObject(getFileSystem().resolveFile( getFileSystem().getFileSystemManager().resolveName( getName(), filename, NameScope.CHILD))); fo.setPart(part); vfs.add(fo); }
0
import org.slf4j.Logger; import org.slf4j.LoggerFactory; protected static final Logger LOG = LoggerFactory.getLogger(ZkDatabaseCorruptionTest.class); }
0
SplittableParDo.forJavaParDo(appliedTransform.getTransform()));
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 DownloadConfigZkCommand extends AbstractZookeeperRetryCommand<String> { public DownloadConfigZkCommand(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.downloadConfigDir(configSet, configDir); return configDir.toString(); } }
0
import java.nio.file.FileSystem; import java.nio.file.Paths; import org.apache.sshd.common.file.FileSystemFactory; import org.apache.sshd.common.session.Session; @Test // see extra fix for SSHD-538 public void testNavigateBeyondRootFolder() throws Exception { Path rootLocation = Paths.get(OsUtils.isUNIX() ? "/" : "C:\\"); final FileSystem fsRoot = rootLocation.getFileSystem(); sshd.setFileSystemFactory(new FileSystemFactory() { @Override public FileSystem createFileSystem(Session session) throws IOException { return fsRoot; } }); try (SshClient client = SshClient.setUpDefaultClient()) { client.start(); try (ClientSession session = client.connect(getCurrentTestName(), "localhost", port).verify(7L, TimeUnit.SECONDS).getSession()) { session.addPasswordIdentity(getCurrentTestName()); session.auth().verify(5L, TimeUnit.SECONDS); try (SftpClient sftp = session.createSftpClient()) { String rootDir = sftp.canonicalPath("/"); String upDir = sftp.canonicalPath(rootDir + "/.."); assertEquals("Mismatched root dir parent", rootDir, upDir); } } finally { client.stop(); } } }
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.swssf.xmlsec.ext.stax; import javax.xml.namespace.QName; import javax.xml.stream.events.XMLEvent; import java.util.List; /** * @author $Author$ * @version $Revision$ $Date$ */ public interface XMLSecEvent extends XMLEvent { void setParentXMLSecStartElement(XMLSecStartElement xmlSecStartElement); XMLSecStartElement getParentXMLSecStartElement(); int getDocumentLevel(); void getElementPath(List<QName> list); List<QName> getElementPath(); XMLSecStartElement getStartElementAtLevel(int level); @Override public XMLSecStartElement asStartElement(); @Override public XMLSecEndElement asEndElement(); @Override public XMLSecCharacters asCharacters(); }
0
import com.thinkaurelius.titan.core.TitanIndexQuery; import org.apache.commons.lang.StringUtils; import org.apache.hadoop.metadata.MetadataException; import org.codehaus.jettison.json.JSONArray; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject; import java.util.Arrays; //Refer http://s3.thinkaurelius.com/docs/titan/0.5.0/index-backends.html for indexed query //http://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query // .html#query-string-syntax for query syntax String graphQuery = String.format("v.%s:(%s)", Constants.ENTITY_TEXT_PROPERTY_KEY, query); LOG.debug("Full text query: {}", graphQuery); Iterator<TitanIndexQuery.Result<Vertex>> results = titanGraph.indexQuery(Constants.FULLTEXT_INDEX, graphQuery).vertices().iterator(); JSONArray response = new JSONArray(); while (results.hasNext()) { TitanIndexQuery.Result<Vertex> result = results.next(); Vertex vertex = result.getElement(); JSONObject row = new JSONObject(); String guid = vertex.getProperty(Constants.GUID_PROPERTY_KEY); if (guid != null) { //Filter non-class entities try { row.put("guid", guid); row.put("typeName", vertex.<String>getProperty(Constants.ENTITY_TYPE_PROPERTY_KEY)); row.put("score", result.getScore()); } catch (JSONException e) { LOG.error("Unable to create response", e); throw new DiscoveryException("Unable to create response"); } response.put(row); }
0
private final FileSystemProviderContext context; this.context = context; final FileObject entry = context.resolveFile( url.toExternalForm() ); catch ( FileSystemException fse ) FileObject old = context.resolveFile( u.toExternalForm() ); if ( start > 0 && spec.charAt( start - 1 ) == ':' ) newURL = context.resolveFile( old, spec ); catch ( FileSystemException fse )
0
@Override
0
public PreparedStatement getSequenceNoFromAmbariSequence(Connection connection,int id) throws SQLException { PreparedStatement prSt = connection.prepareStatement(getSqlSequenceNoFromAmbariSequence(id)); return prSt; } public PreparedStatement updateSequenceNoInAmbariSequence(Connection connection, int seqNo, int id) throws SQLException { PreparedStatement prSt = connection.prepareStatement(getSqlUpdateSequenceNo(id)); prSt.setInt(1, seqNo); return prSt; } public PreparedStatement insertToPigJob(String dirname, String maxcountforpigjob, long epochtime1, String title, Connection connection, int id, String status,String username) throws SQLException { prSt.setString(3, username); prSt.setString(4, pigScriptFile); prSt.setString(5, maxcountforpigjob); prSt.setString(6, status); prSt.setString(7, dirname); prSt.setString(8, title); return "INSERT INTO ds_pigjob_" + id + " values (?,?,0,'','f','','',?,0,?,'',?,'','',?,?,'',?);"; protected String getSqlSequenceNoFromAmbariSequence(int id) { return "select sequence_value from ambari_sequences where sequence_name ='ds_pigjob_"+id+"_id_seq';"; } protected String getSqlUpdateSequenceNo(int id) { return "update ambari_sequences set sequence_value=? where sequence_name='ds_pigjob_"+id+"_id_seq';"; }
0
import org.apache.aurora.scheduler.cron.CronJobManager; bindMock(CronJobManager.class);
0
package org.apache.beam.sdk.runners.inprocess; import org.apache.beam.sdk.runners.inprocess.InProcessPipelineRunner.CommittedBundle; import org.apache.beam.sdk.runners.inprocess.InProcessPipelineRunner.UncommittedBundle; import org.apache.beam.sdk.util.WindowedValue; import org.apache.beam.sdk.values.PCollection;
0
assertTrue("Should be a file.", file.isFile()); assertEquals("QUADTEST", file.getName()); assertEquals(5000000000L, file.getSize()); assertEquals("QUA1I1", file.getUser()); assertEquals("18128", file.getGroup());
0
/** * Returns the number of registered processes. * * @return the number of register process */ public int size() { return processes.size(); } /** Process process = (Process) e.nextElement(); try { process.destroy(); } catch(Throwable t) { System.err.println("Unable to terminate process during process shutdown"); } }
0
* <code>java.lang.System#getenv()</code> and ant is not required.
0
import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; @XmlEnum @XmlEnumValue("none") @XmlEnumValue("kerberos")
0
result = answer == key;
0
import java.util.List; import org.apache.hc.core5.http.Header; @Override public List<? extends Header> getTrailers() { return null; }
1
suite.addTest(DateTest.suite());
0
import org.apache.sshd.common.channel.ChannelListener; import org.apache.sshd.common.util.GenericUtils; ChannelListener listener = getChannelListenerProxy(); try { listener.channelOpenSuccess(this); f.setOpened(); } catch (RuntimeException t) { Throwable e = GenericUtils.peelException(t); try { listener.channelOpenFailure(this, e); } catch (Throwable ignored) { log.warn("doInit({}) failed ({}) to inform listener of open failure={}: {}", this, ignored.getClass().getSimpleName(), e.getClass().getSimpleName(), ignored.getMessage()); } f.setException(e); }
0
initPropMap.put("HBASE_MASTER-HTTPS", new String[]{"hbase.master.info.port"}); initPropMap.put("HBASE_REGIONSERVER-HTTPS", new String[]{"hbase.regionserver.info.port"}); initPropMap.put("HBASE_MASTER", new String[]{"hbase.http.policy"}); jmxDesiredProperties.put("HBASE_MASTER", initPropMap); initPropMap = new HashMap<String, String[]>(); initPropMap.put("HBASE_REGIONSERVER", new String[]{"hbase.http.policy"}); jmxDesiredProperties.put("HBASE_REGIONSERVER", initPropMap); initPropMap = new HashMap<String, String[]>(); if (componentName.equals("NAMENODE") || componentName.equals("DATANODE") || componentName.equals("RESOURCEMANAGER") || componentName.equals("NODEMANAGER") || componentName.equals("JOURNALNODE") || componentName.equals("HISTORYSERVER") || componentName.equals("HBASE_MASTER") || componentName.equals("HBASE_REGIONSERVER")) {
0
import org.apache.accumulo.core.client.AccumuloClient; AccumuloClient conn) throws TableNotFoundException { AccumuloClient conn, BatchWriter bw) throws TableNotFoundException, MutationsRejectedException { AccumuloClient conn, BatchWriter bw) throws TableNotFoundException, MutationsRejectedException { AccumuloClient conn = context.getConnector(); public static void removeBulkLoadEntries(AccumuloClient conn, Table.ID tableId, long tid) public static List<FileRef> getBulkFilesLoaded(ServerContext context, AccumuloClient conn,
0
private final WindowFn<T, W> windowFn; private MergingViaWindowFnRunner(WindowFn<T, W> windowFn) {
0
* Copyright 2016-2017 Seznam.cz, a.s.
0
private final LRUMap<ProblemReport,Long> problemReports = new LRUMap<>(1000);
0
/** * Checks whether a given string represents a valid IPv4 address. * * @param name the name to validate * @return true if the given name is a valid IPv4 address */ /** * Checks whether a given string represents a valid IPv6 address. * * @param inet6Address the name to validate * @return true if the given name is a valid IPv6 address */ /** * Checks whether a given string is a valid host name according to * RFC 3986 - not accepting IP addresses. * * @see "https://tools.ietf.org/html/rfc3986#section-3.2.2" * @param name the hostname to validate * @return true if the given name is a valid host name */
0
ROW(1), ROW_COLFAM(2), ROW_COLFAM_COLQUAL(3), ROW_COLFAM_COLQUAL_COLVIS(4), ROW_COLFAM_COLQUAL_COLVIS_TIME(5), //everything with delete flag ROW_COLFAM_COLQUAL_COLVIS_TIME_DEL(6)
1
import java.io.IOException; import java.math.BigInteger; import org.apache.beam.sdk.extensions.sql.impl.BeamRowCountStatistics; import org.apache.beam.sdk.io.gcp.bigquery.BigQueryHelpers; import org.apache.beam.sdk.io.gcp.bigquery.BigQueryOptions; import org.apache.beam.sdk.options.PipelineOptions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; private BeamRowCountStatistics rowCountStatistics = null; private static final Logger LOGGER = LoggerFactory.getLogger(BigQueryTable.class); public BeamRowCountStatistics getRowCount(PipelineOptions options) { if (rowCountStatistics == null) { rowCountStatistics = getRowCountFromBQ(options, bqLocation); } return rowCountStatistics; } @Override private static BeamRowCountStatistics getRowCountFromBQ(PipelineOptions o, String bqLocation) { try { BigInteger rowCount = BigQueryHelpers.getNumRows( o.as(BigQueryOptions.class), BigQueryHelpers.parseTableSpec(bqLocation)); if (rowCount == null) { return BeamRowCountStatistics.UNKNOWN; } return BeamRowCountStatistics.createBoundedTableStatistics(rowCount); } catch (IOException | InterruptedException e) { LOGGER.warn("Could not get the row count for the table " + bqLocation, e); } return BeamRowCountStatistics.UNKNOWN; }
0
import java.util.Collection; import java.util.Set; import org.apache.sshd.common.subsystem.sftp.extensions.Supported2Parser.Supported2; import org.apache.sshd.common.subsystem.sftp.extensions.SupportedParser.Supported; import org.apache.sshd.common.util.GenericUtils; SftpConstants.EXT_VENDORID, String extName = de.getKey(); Object extValue = de.getValue(); System.out.append('\t').append(extName).append(": ").println(extValue); if (SftpConstants.EXT_SUPPORTED.equalsIgnoreCase(extName)) { assertSupportedExtensions(extName, ((Supported) extValue).extensionNames); } else if (SftpConstants.EXT_SUPPORTED2.equalsIgnoreCase(extName)) { assertSupportedExtensions(extName, ((Supported2) extValue).extensionNames); } private static Set<String> EXPECTED_EXTENSIONS = Collections.unmodifiableSet( GenericUtils.asSortedSet(String.CASE_INSENSITIVE_ORDER, Arrays.asList( SftpConstants.EXT_VERSELECT, SftpConstants.EXT_COPYFILE ))); private static void assertSupportedExtensions(String extName, Collection<String> extensionNames) { assertEquals(extName + "[count]", EXPECTED_EXTENSIONS.size(), GenericUtils.size(extensionNames)); for (String name : EXPECTED_EXTENSIONS) { assertTrue(extName + " - missing " + name, extensionNames.contains(name)); } }
0
import org.apache.commons.configuration.io.FileHandler; FileHandler handler = new FileHandler(conf); handler.setFileName(testProperties); handler.load();
0
import java.util.Date; import com.twitter.common.quantity.Amount; import com.twitter.common.quantity.Time; Date now = new Date(); long elapsedMillis = now.getTime() - Iterables.getLast(task.getTaskEvents()).getTimestamp(); if (Amount.of(elapsedMillis, Time.MILLISECONDS).as(Time.HOURS) < 6) { job.recentlyFailedTaskCount++; } int recentlyFailedTaskCount = 0; public int getRecentlyFailedTaskCount() { return recentlyFailedTaskCount; }
0
public INIBuilderParametersImpl setSeparatorUsedInInput(final String separator) { public INIBuilderParametersImpl setCommentLeadingCharsUsedInInput(final String separator) {
0
final int port = host.getPort();
0
import org.apache.http.nio.pool.SocketAddressResolver; static class BasicAddressResolver implements SocketAddressResolver<HttpHost> { public SocketAddress resolveLocalAddress(final HttpHost host) { return null; } public SocketAddress resolveRemoteAddress(final HttpHost host) { return new InetSocketAddress(host.getHostName(), host.getPort()); } } super(ioreactor, connFactory, new BasicAddressResolver(), 2, 20); /** * @deprecated (4.3) use {@link SocketAddressResolver} */ @Deprecated /** * @deprecated (4.3) use {@link SocketAddressResolver} */ @Deprecated
0
import org.apache.beam.sdk.transforms.windowing.TimestampCombiner; * <p>This accepts the {@link TimestampCombiner} that dictates how watermark hold timestamps * added to the returned {@link WatermarkHoldState} are to be combined. <W extends BoundedWindow> WatermarkHoldState bindWatermark( StateTag<? super K, WatermarkHoldState> spec, TimestampCombiner timestampCombiner);
0
/** * Copyright 2016 Seznam a.s. * * 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
public synchronized HttpParams setParameter(final String name, final Object value) { return this; public HttpParams setLongParameter(final String name, long value) { return this; public HttpParams setIntParameter(final String name, int value) { return this; public HttpParams setDoubleParameter(final String name, double value) { return this; public HttpParams setBooleanParameter(final String name, boolean value) { return this;
0
protected Map<String, String> options; public Map<String, String> getOptions() { public void setOptions(Map<String, String> options) {
0
final MavenEntry maven;
0
package org.apache.hc.core5.http.nio; import org.apache.hc.core5.http.nio.reactor.AbstractIODispatch;
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 <K> * @param <V> */ protected abstract static class AbstractRecordReader<K,V> extends RecordReader<K,V> { protected abstract void setupIterators(TaskAttemptContext context, Scanner scanner, String tableName); * @param context public List<InputSplit> getSplits(JobContext context) throws IOException { log.setLevel(getLogLevel(context)); validateOptions(context); List<BatchScanConfig> tableConfigs = getBatchScanConfigs(context); binnedRanges = binOfflineTable(context, tableConfig.getTableName(), ranges); binnedRanges = binOfflineTable(context, tableConfig.getTableName(), ranges); Instance instance = getInstance(context); tl = getTabletLocator(context, tableConfig.getTableName()); Credentials creds = new Credentials(getPrincipal(context), getAuthenticationToken(context));
0
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.accumulo.core.client.admin; import java.util.List; import java.util.Map; import org.apache.accumulo.core.data.Range; import org.apache.accumulo.core.data.TabletId; /** * A snapshot of metadata information about where a specified set of ranges are located returned by {@link TableOperations#locate(String, java.util.Collection)} * * @since 1.8.0 */ public interface Locations { /** * For all of the ranges passed to {@link TableOperations#locate(String, java.util.Collection)}, return a map of the tablets each range overlaps. */ public Map<Range,List<TabletId>> groupByRange(); /** * For all of the ranges passed to {@link TableOperations#locate(String, java.util.Collection)}, return a map of the ranges each tablet overlaps. */ public Map<TabletId,List<Range>> groupByTablet(); /** * For any TabletId returned by {@link #getOverlappingTablets(Range)}, the method will return the tablet server location for that tablet. * * @return A tablet server location in the form of {@code <host>:<port>} */ public String getTabletLocation(TabletId tabletId); }
0
* @version $Revision$
0
import java.util.SortedMap; import java.util.SortedSet; import java.util.TreeMap; import java.util.TreeSet; ConfigurationRecommendationCommand command = new ConfigurationRecommendationCommand(StackAdvisorCommandType.RECOMMEND_CONFIGURATIONS, file, "1w", ServiceInfo.ServiceAdvisorType.PYTHON, 1, saRunner, metaInfo, null, null); SortedMap<String, SortedSet<String>> componentHostGroupMap = new TreeMap<>(); SortedSet<String> components1 = new TreeSet<>(); SortedSet<String> components2 = new TreeSet<>();
0
* <code>Object[]</code>. Defaults to a
0
Collection<Option> allOptions = new ArrayList<Option>(); Collection<Option> helpOptions = options.helpOptions();
0
import org.apache.felix.framework.capabilityset.SimpleFilter; m_filePattern = SimpleFilter.parseSubstring(filePattern); if (SimpleFilter.compareSubstring(m_filePattern, lastElement))
0
* @since 3.0
0
public static void updateHosts(AmbariManagementController controller, Set<HostRequest> requests) throws AmbariException { HostResourceProvider provider = getHostProvider(controller); provider.updateHosts(requests); }
0
Set<String> keys = new HashSet<>();
0
package org.apache.felix.serializer.impl.yaml; import org.osgi.service.serializer.Serializing; public class YamlEncodingImpl implements Serializing { public Serializing pretty() { public Serializing ignoreNull() {
0
import org.apache.beam.sdk.coders.KvCoder; import org.apache.beam.sdk.coders.StringUtf8Coder; import org.apache.beam.sdk.coders.VarIntCoder; return PCollection.createPrimitiveOutputInternal( input.getPipeline(), WindowingStrategy.globalDefault(), PCollection.IsBounded.UNBOUNDED, KvCoder.of(StringUtf8Coder.of(), VarIntCoder.of()));
0
Node copy = (Node) super.clone(); copy.children = null; return copy; Node copy = (Node) copyStack.pop(); result = copy;
0
import java.util.HashMap; import java.util.Map; * @version $Revision: 1.4 $ $Date: 2004/05/10 20:09:47 $ public void addMimeType(final String mimeType, final String scheme) mimeTypeMap.put(mimeType, scheme); public void addExtension(final String extension, final String scheme) extensionMap.put(extension, scheme); public String getScheme(final FileObject file) throws FileSystemException final String mimeType = (String) content.getAttribute("content-type"); if (mimeType != null) final String scheme = (String) mimeTypeMap.get(mimeType); if (scheme != null) return (String) extensionMap.get(extension);
0
* @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A>
0
ArrayList<ByteBuffer> result = new ArrayList<>(); ArrayList<byte[]> result = new ArrayList<>(bytesList.size());
0
import org.apache.atlas.RequestContext; RequestContext.clear();
1
* @version $Id: BasePropertiesConfiguration.java,v 1.18 2004/09/16 21:35:57 epugh Exp $ if (filename==null){ throw new ConfigurationException("File name was not provided."); }
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
* Gets the criteria builder used to construct the query and predicates. * * @return the builder (never {@code null}). */ public CriteriaBuilder getCriteriaBuilder() { return m_builder; } /**
0
return offer("slave-id", resources); } public static Protos.Offer offer(String agentId, Protos.Resource... resources) { .setAgentId(Protos.AgentID.newBuilder().setValue(agentId))
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