name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hadoop_OBSCommonUtils_objectRepresentsDirectory_rdh
/** * Predicate: does the object represent a directory?. * * @param name * object name * @param size * object size * @return true if it meets the criteria for being an object */ public static boolean objectRepresentsDirectory(final String name, final long size) { return ((!name.isEmpty()) && (name.cha...
3.26
hadoop_OBSCommonUtils_closeAll_rdh
/** * Close the Closeable objects and <b>ignore</b> any Exception or null * pointers. (This is the SLF4J equivalent of that in {@code IOUtils}). * * @param closeables * the objects to close */ static void closeAll(final Closeable... closeables) { for (Closeable c : closeables) { if (c != null) { ...
3.26
hadoop_OBSCommonUtils_innerMkdirs_rdh
/** * Make the given path and all non-existent parents into directories. * * @param owner * the owner OBSFileSystem instance * @param path * path to create * @return true if a directory was created * @throws FileAlreadyExistsException * there is a file at the path specified * @throws IOException * ot...
3.26
hadoop_OBSCommonUtils_maybeDeleteBeginningSlash_rdh
/** * Delete obs key started '/'. * * @param key * object key * @return new key */ static String maybeDeleteBeginningSlash(final String key) { return (!StringUtils.isEmpty(key)) && key.startsWith("/") ? key.substring(1) : key; }
3.26
hadoop_OBSCommonUtils_appendFile_rdh
/** * Append File. * * @param owner * the owner OBSFileSystem instance * @param appendFileRequest * append object request * @throws IOException * on any failure to append file */ static void appendFile(final OBSFileSystem owner, final WriteFileRequest appendFileRequest) throws IOException { long len...
3.26
hadoop_OBSCommonUtils_m1_rdh
// Used to check if a folder is empty or not. static boolean m1(final OBSFileSystem owner, final String key) throws FileNotFoundException, ObsException { for (int retryTime = 1; retryTime < MAX_RETRY_TIME; retryTime++) { try { return innerIsFolderEmpty(owner, key); } cat...
3.26
hadoop_OBSCommonUtils_dateToLong_rdh
/** * Date to long conversion. Handles null Dates that can be returned by OBS by * returning 0 * * @param date * date from OBS query * @return timestamp of the object */ public static long dateToLong(final Date date) { if (date == null) { return 0L; } return (date.getTime() / OBSConstants...
3.26
hadoop_OBSCommonUtils_deleteObject_rdh
/** * Delete an object. Increments the {@code OBJECT_DELETE_REQUESTS} and write * operation statistics. * * @param owner * the owner OBSFileSystem instance * @param key * key to blob to delete. * @throws IOException * on any failure to delete object */ static void deleteObject(final OBSFileSystem owner,...
3.26
hadoop_OBSCommonUtils_continueListObjects_rdh
/** * List the next set of objects. * * @param owner * the owner OBSFileSystem instance * @param objects * paged result * @return the next result object * @throws IOException * on any failure to list the next set of objects */ static ObjectListing continueListObjects(final OBSFileSystem owner, final Obj...
3.26
hadoop_OBSCommonUtils_keyToQualifiedPath_rdh
/** * Convert a key to a fully qualified path. * * @param owner * the owner OBSFileSystem instance * @param key * input key * @return the fully qualified path including URI scheme and bucket name. */ static Path keyToQualifiedPath(final OBSFileSystem owner, final String key) { return qualify(owner, keyT...
3.26
hadoop_OBSCommonUtils_createListObjectsRequest_rdh
/** * Create a {@code ListObjectsRequest} request against this bucket. * * @param owner * the owner OBSFileSystem instance * @param key * key for request * @param delimiter * any delimiter * @return the request */ static ListObjectsRequest createListObjectsRequest(final OBSFileSystem owner, final String...
3.26
hadoop_OBSCommonUtils_rejectRootDirectoryDelete_rdh
/** * Implements the specific logic to reject root directory deletion. The caller * must return the result of this call, rather than attempt to continue with * the delete operation: deleting root directories is never allowed. This * method simply implements the policy of when to return an exit c...
3.26
hadoop_OBSCommonUtils_stringify_rdh
/** * String information about a summary entry for debug messages. * * @param summary * summary object * @return string value */ static String stringify(final ObsObject summary) { return (summary.getObjectKey() + " size=") + summary.getMetadata().getContentLength(); }
3.26
hadoop_OBSCommonUtils_longBytesOption_rdh
/** * Get a long option not smaller than the minimum allowed value, supporting * memory prefixes K,M,G,T,P. * * @param conf * configuration * @param key * key to look up * @param defVal * default value * @param min * minimum value * @return the value * @throws IllegalArgumentException * if the v...
3.26
hadoop_OBSCommonUtils_keyToPath_rdh
/** * Convert a path back to a key. * * @param key * input key * @return the path from this key */ static Path keyToPath(final String key) { return new Path("/" + key); }
3.26
hadoop_OBSCommonUtils_pathToKey_rdh
/** * Turns a path (relative or otherwise) into an OBS key. * * @param owner * the owner OBSFileSystem instance * @param path * input path, may be relative to the working dir * @return a key excluding the leading "/", or, if it is the root path, "" */ static String pathToKey(final OBSFileSystem owner, final...
3.26
hadoop_OBSCommonUtils_uploadPart_rdh
/** * Upload part of a multi-partition file. Increments the write and put * counters. <i>Important: this call does not close any input stream in the * request.</i> * * @param owner * the owner OBSFileSystem instance * @param request * request * @return the result of the operation. * @throws ObsException ...
3.26
hadoop_OBSCommonUtils_createFileStatus_rdh
/** * Create a files status instance from a listing. * * @param keyPath * path to entry * @param summary * summary from OBS * @param blockSize * block size to declare. * @param owner * owner of the file * @return a status entry */ static OBSFileStatus createFileStatus(final Path keyPath, final ObsOb...
3.26
hadoop_OBSCommonUtils_initMultipartUploads_rdh
/** * initialize multi-part upload, purge larger than the value of * PURGE_EXISTING_MULTIPART_AGE. * * @param owner * the owner OBSFileSystem instance * @param conf * the configuration to use for the FS * @throws IOException * on any failure to initialize multipart upload */ static void initMultipartUpl...
3.26
hadoop_OBSCommonUtils_m0_rdh
/** * Initiate a {@code listObjects} operation, incrementing metrics in the * process. * * @param owner * the owner OBSFileSystem instance * @param request * request to initiate * @return the results * @throws IOException * on any failure to list objects */ static ObjectListing m0(final OBSFileSystem o...
3.26
hadoop_OBSCommonUtils_intOption_rdh
/** * Get a integer option not smaller than the minimum allowed value. * * @param conf * configuration * @param key * key to look up * @param defVal * default value * @param min * minimum value * @return the value * @throws IllegalArgumentException * if the value is below the minimum */ static i...
3.26
hadoop_OBSCommonUtils_getPassword_rdh
/** * Get a password from a configuration, or, if a value is passed in, pick that * up instead. * * @param conf * configuration * @param key * key to look up * @param val * current valu...
3.26
hadoop_OBSCommonUtils_newPutObjectRequest_rdh
/** * Create a {@link PutObjectRequest} request. The metadata is assumed to have * been configured with the size of the operation. * * @param owner * the owner OBSFileSystem instance * @param key * key of object * @param metadata * metadata header * @param inputStream * source data. * @return the re...
3.26
hadoop_ContainerReInitEvent_getResourceSet_rdh
/** * Get the ResourceSet. * * @return ResourceSet. */ public ResourceSet getResourceSet() { return resourceSet; }
3.26
hadoop_ContainerReInitEvent_getReInitLaunchContext_rdh
/** * Get the Launch Context to be used for upgrade. * * @return ContainerLaunchContext */ public ContainerLaunchContext getReInitLaunchContext() { return reInitLaunchContext; }
3.26
hadoop_MutableCSConfigurationProvider_getInitSchedulerConfig_rdh
// Unit test can overwrite this method protected Configuration getInitSchedulerConfig() { Configuration initialSchedConf = new Configuration(false); initialSchedConf.addResource(YarnConfiguration.CS_CONFIGURATION_FILE); return initialSchedConf; }
3.26
hadoop_EmptyIOStatisticsStore_getInstance_rdh
/** * Get the single instance of this class. * * @return a shared, empty instance. */ static IOStatisticsStore getInstance() { return INSTANCE; }
3.26
hadoop_ManifestSuccessData_toJson_rdh
/** * To JSON. * * @return json string value. * @throws IOException * failure */ public String toJson() throws IOException { return serializer().toJson(this); }
3.26
hadoop_ManifestSuccessData_dumpDiagnostics_rdh
/** * Dump the diagnostics (if any) to a string. * * @param prefix * prefix before every entry * @param middle * string between key and value * @param suffix * suffix to each entry * @return the dumped string */ public String dumpDiagnostics(String prefix, String middle, String suffix) { return joi...
3.26
hadoop_ManifestSuccessData_getFilenames_rdh
/** * * @return a list of filenames in the commit. */ public List<String> getFilenames() { return filenames; }
3.26
hadoop_ManifestSuccessData_serializer_rdh
/** * Get a JSON serializer for this class. * * @return a serializer. */ public static JsonSerialization<ManifestSuccessData> serializer() { return new JsonSerialization<>(ManifestSuccessData.class, false, true); }
3.26
hadoop_ManifestSuccessData_getCommitter_rdh
/** * * @return committer name. */ public String getCommitter() { return committer; }
3.26
hadoop_ManifestSuccessData_recordJobFailure_rdh
/** * Note a failure by setting success flag to false, * then add the exception to the diagnostics. * * @param thrown * throwable */ public void recordJobFailure(Throwable thrown) { setSuccess(false); String stacktrace = ExceptionUtils.getStackTrace(thrown); diagnostics.put(DiagnosticKeys.EXCEPTION,...
3.26
hadoop_ManifestSuccessData_getDate_rdh
/** * * @return timestamp as date; no expectation of parseability. */ public String getDate() { return date;}
3.26
hadoop_ManifestSuccessData_getMetrics_rdh
/** * * @return any metrics. */ public Map<String, Long> getMetrics() { return metrics; }
3.26
hadoop_ManifestSuccessData_getDescription_rdh
/** * * @return any description text. */ public String getDescription() { return description; }
3.26
hadoop_ManifestSuccessData_dumpMetrics_rdh
/** * Dump the metrics (if any) to a string. * The metrics are sorted for ease of viewing. * * @param prefix * prefix before every entry * @param middle * string between key and value * @param suffix * suffix to each entry * @return the dumped string */ public String dumpMetrics(String prefix, String...
3.26
hadoop_ManifestSuccessData_setFilenamePaths_rdh
/** * Set the list of filename paths. */ @JsonIgnore public void setFilenamePaths(List<Path> paths) { setFilenames(new ArrayList<>(paths.stream().map(AbstractManifestData::marshallPath).collect(Collectors.toList())));}
3.26
hadoop_ManifestSuccessData_getHostname_rdh
/** * * @return host which created the file (implicitly: committed the work). */ public String getHostname() { return hostname; }
3.26
hadoop_ManifestSuccessData_setSuccess_rdh
/** * Set the success flag. * * @param success * did the job succeed? */ public void setSuccess(boolean success) { this.success = success; }
3.26
hadoop_ManifestSuccessData_getJobId_rdh
/** * * @return Job ID, if known. */ public String getJobId() { return jobId; }
3.26
hadoop_ManifestSuccessData_load_rdh
/** * Load an instance from a file, then validate it. * * @param fs * filesystem * @param path * path * @return the loaded instance * @throws IOException * IO failure */ public static ManifestSuccessData load(FileSystem fs, Path path) throws IOException { LOG.debug("Reading success data from {}", ...
3.26
hadoop_QueryResult_getRecords_rdh
/** * Get the result of the query. * * @return List of records. */ public List<T> getRecords() { return this.records; }
3.26
hadoop_QueryResult_getTimestamp_rdh
/** * The timetamp in driver time of this query. * * @return Timestamp in driver time. */ public long getTimestamp() { return this.timestamp; }
3.26
hadoop_ReadStatistics_getTotalZeroCopyBytesRead_rdh
/** * * @return The total number of zero-copy bytes read. */ public synchronized long getTotalZeroCopyBytesRead() {return f0; }
3.26
hadoop_ReadStatistics_getRemoteBytesRead_rdh
/** * * @return The total number of bytes read which were not local. */ public synchronized long getRemoteBytesRead() { return totalBytesRead - totalLocalBytesRead; }
3.26
hadoop_ReadStatistics_getTotalEcDecodingTimeMillis_rdh
/** * Return the total time in milliseconds used for erasure coding decoding. */ public synchronized long getTotalEcDecodingTimeMillis() { return totalEcDecodingTimeMillis; }
3.26
hadoop_ReadStatistics_getTotalShortCircuitBytesRead_rdh
/** * * @return The total short-circuit local bytes read. */ public synchronized long getTotalShortCircuitBytesRead() { return totalShortCircuitBytesRead; }
3.26
hadoop_AbstractSchedulerPlanFollower_m0_rdh
/** * Resizes reservations based on currently available resources. */ private Resource m0(ResourceCalculator rescCalculator, Resource availablePlanResources, Resource totalReservationResources, Resource reservationResources) { return Resources.multiply(availablePlanResources, Resources.ratio(rescCalculator, reser...
3.26
hadoop_AbstractSchedulerPlanFollower_arePlanResourcesLessThanReservations_rdh
/** * Check if plan resources are less than expected reservation resources. */ private boolean arePlanResourcesLessThanReservations(ResourceCalculator rescCalculator, Resource clusterResources, Resource planResources, Resource reservedResources) { return Resources.greaterThan(rescCalculator, clusterResources, res...
3.26
hadoop_AbstractSchedulerPlanFollower_getReservationQueueName_rdh
// Schedulers have different ways of naming queues. See YARN-2773 protected String getReservationQueueName(String planQueueName, String reservationId) { return reservationId; }
3.26
hadoop_AbstractSchedulerPlanFollower_calculateReservationToPlanRatio_rdh
/** * Calculates ratio of reservationResources to planResources. */ private float calculateReservationToPlanRatio(ResourceCalculator rescCalculator, Resource clusterResources, Resource planResources, Resource reservationResources) { return Resources.divide(rescCalculator, clusterResources, reservationResources, ...
3.26
hadoop_AbstractSchedulerPlanFollower_sortByDelta_rdh
/** * Sort in the order from the least new amount of resources asked (likely * negative) to the highest. This prevents "order-of-operation" errors related * to exceeding 100% capacity temporarily. * * @param currentRese...
3.26
hadoop_AbstractSchedulerPlanFollower_cleanupExpiredQueues_rdh
/** * First sets entitlement of queues to zero to prevent new app submission. * Then move all apps in the set of queues to the parent plan queue's default * reservation queue if move is enabled. Finally cleanups the queue by killing * any apps (if move is disabled or move failed) and removing the queue * * @param...
3.26
hadoop_ValueAggregatorBaseDescriptor_configure_rdh
/** * get the input file name. * * @param job * a job configuration object */public void configure(JobConf job) { super.configure(job); maxNumItems = job.getLong("aggregate.max.num.unique.values", Long.MAX_VALUE); }
3.26
hadoop_ValueAggregatorBaseDescriptor_generateValueAggregator_rdh
/** * * @param type * the aggregation type * @return a value aggregator of the given type. */ public static ValueAggregator generateValueAggregator(String type) {ValueAggregator retv = null;if (type.compareToIgnoreCase(LONG_VALUE_SUM) == 0) { retv = new LongValueSum(); } if (type.compareT...
3.26
hadoop_FilePosition_absolute_rdh
/** * Gets the current absolute position within this file. * * @return the current absolute position within this file. */ public long absolute() { throwIfInvalidBuffer(); return bufferStartOffset + relative(); }
3.26
hadoop_FilePosition_isValid_rdh
/** * Determines if the current position is valid. * * @return true if the current position is valid, false otherwise. */ public boolean isValid() { return buffer != null; }
3.26
hadoop_FilePosition_blockNumber_rdh
/** * Gets the id of the current block. * * @return the id of the current block. */ public int blockNumber() { throwIfInvalidBuffer(); return blockData.getBlockNumber(bufferStartOffset); }
3.26
hadoop_FilePosition_setData_rdh
/** * Associates a buffer with this file. * * @param bufferData * the buffer associated with this file. * @param startOffset * Start offset of the buffer relative to the start of a file. * @param readOffset * Offset where reading starts relative to the start of a file. * @throws IllegalArgumentException ...
3.26
hadoop_FilePosition_m0_rdh
/** * Determines whether the given absolute position lies within the current buffer. * * @param pos * the position to check. * @return true if the given absolute position lies within the current buffer, false otherwise. */public boolean m0(long pos) { throwIfInvalidBuffer(); long bufferEndOffset = bufferStartOf...
3.26
hadoop_FilePosition_setAbsolute_rdh
/** * If the given {@code pos} lies within the current buffer, updates the current position to * the specified value and returns true; otherwise returns false without changing the position. * * @param pos * the absolute position to change the current position to if possible. * @return true if the given current ...
3.26
hadoop_FilePosition_invalidate_rdh
/** * Marks the current position as invalid. */ public void invalidate() { buffer = null; bufferStartOffset = -1; data = null; }
3.26
hadoop_FilePosition_relative_rdh
/** * Gets the current position within this file relative to the start of the associated buffer. * * @return the current position within this file relative to the start of the associated buffer. */ public int relative() { throwIfInvalidBuffer(); return buffer.position(); }
3.26
hadoop_FilePosition_bufferStartOffset_rdh
/** * Gets the start of the current block's absolute offset. * * @return the start of the current block's absolute offset. */public long bufferStartOffset() { throwIfInvalidBuffer(); return bufferStartOffset; }
3.26
hadoop_FilePosition_isLastBlock_rdh
/** * Determines whether the current block is the last block in this file. * * @return true if the current block is the last block in this file, false otherwise. */ public boolean isLastBlock() { return blockData.isLastBlock(blockNumber()); }
3.26
hadoop_FilePosition_bufferFullyRead_rdh
/** * Determines whether the current buffer has been fully read. * * @return true if the current buffer has been fully read, false otherwise. */ public boolean bufferFullyRead() { throwIfInvalidBuffer(); return ((bufferStartOffset == readStartOffset) && (relative() == buffer.limit())) && (f0 == buffer.limit()); }
3.26
hadoop_AbstractManifestData_validateCollectionClass_rdh
/** * Verify that all instances in a collection are of the given class. * * @param it * iterator * @param classname * classname to require * @throws IOException * on a failure */ void validateCollectionClass(Iterable it, Class classname) throws IOException { for (Object o : it) { verify(o.ge...
3.26
hadoop_AbstractManifestData_unmarshallPath_rdh
/** * Convert a string path to Path type, by way of a URI. * * @param path * path as a string * @return path value * @throws RuntimeException * marshalling failure. */ public static Path unmarshallPath(String path) { try { return new Path(new URI(requireNonNull(path, "No path"))); } catch...
3.26
hadoop_AbstractManifestData_marshallPath_rdh
/** * Convert a path to a string which can be included in the JSON. * * @param path * path * @return a string value, or, if path==null, null. */ public static String marshallPath(@Nullable Path path) { return path != null ? path.toUri().toString() : null; }
3.26
hadoop_ApplicationEntity_getApplicationEvent_rdh
/** * * @param te * TimelineEntity object. * @param eventId * event with this id needs to be fetched * @return TimelineEvent if TimelineEntity contains the desired event. */ public static TimelineEvent getApplicationEvent(TimelineEntity te, String eventId) { if (m0(te)) { for (TimelineEvent ev...
3.26
hadoop_ApplicationEntity_m0_rdh
/** * Checks if the input TimelineEntity object is an ApplicationEntity. * * @param te * TimelineEntity object. * @return true if input is an ApplicationEntity, false otherwise */ public static boolean m0(TimelineEntity te) { return te == null ? false : te.getType().equals(TimelineEntityType.YARN_APPLICATIO...
3.26
hadoop_BigDecimalSplitter_tryDivide_rdh
/** * Divide numerator by denominator. If impossible in exact mode, use rounding. */ protected BigDecimal tryDivide(BigDecimal numerator, BigDecimal denominator) { try { return numerator.divide(denominator); } catch (ArithmeticException ae) { return numerator.divide(denominator, BigDecimal.ROU...
3.26
hadoop_BigDecimalSplitter_split_rdh
/** * Returns a list of BigDecimals one element longer than the list of input splits. * This represents the boundaries between input splits. * All splits are open on the top end, except the last one. * * So the list [0, 5, 8, 12, 18] would represent splits capturing the intervals: * * [0, 5) * [5, 8) * [8, 12)...
3.26
hadoop_Abfs_finalize_rdh
/** * Close the file system; the FileContext API doesn't have an explicit close. */ @Override protected void finalize() throws Throwable { fsImpl.close(); super.finalize(); }
3.26
hadoop_FieldSelectionMapper_m0_rdh
/** * The identify function. Input key/value pair is written directly to output. */ public void m0(K key, V val, Context context) throws IOException, InterruptedException { FieldSelectionHelper helper = new FieldSelectionHelper(FieldSelectionHelper.emptyText, FieldSelectionHelper.emptyText); helper.extractOut...
3.26
hadoop_FileBasedCopyListing_getBytesToCopy_rdh
/** * {@inheritDoc } */ @Override protected long getBytesToCopy() { return globbedListing.getBytesToCopy(); } /** * {@inheritDoc }
3.26
hadoop_FileBasedCopyListing_validatePaths_rdh
/** * {@inheritDoc } */ @Override protected void validatePaths(DistCpContext context) throws IOException, InvalidInputException { }
3.26
hadoop_FileBasedCopyListing_doBuildListing_rdh
/** * Implementation of CopyListing::buildListing(). * Iterates over all source paths mentioned in the input-file. * * @param pathToListFile * Path on HDFS where the listing file is written. * @param context * Distcp context with associated input options. * @throws IOException */ @Overridepublic void doB...
3.26
hadoop_SendRequestIntercept_bind_rdh
/** * Binds a new lister to the operation context so the WASB file system can * appropriately intercept sends and allow concurrent OOB I/Os. This * by-passes the blob immutability check when reading streams. * * @param opContext * the operation context assocated with this request. */ public static void bind(O...
3.26
hadoop_SendRequestIntercept_eventOccurred_rdh
/** * Handler which processes the sending request event from Azure SDK. The * handler simply sets reset the conditional header to make all read requests * unconditional if reads with concurrent OOB writes are allowed. * * @param sendEvent * - send event context from Windows Azure SDK. */ @Override public void ...
3.26
hadoop_AbfsCountersImpl_getRegistry_rdh
/** * Getter for MetricRegistry. * * @return MetricRegistry or null. */ private MetricsRegistry getRegistry() { return registry; }
3.26
hadoop_AbfsCountersImpl_formString_rdh
/** * {@inheritDoc } * * Method to aggregate all the counters in the MetricRegistry and form a * string with prefix, separator and suffix. * * @param prefix * string that would be before metric. * @param separator * string that would be between metric name and value. * @param suffix * string that would...
3.26
hadoop_AbfsCountersImpl_trackDuration_rdh
/** * Tracks the duration of a statistic. * * @param key * name of the statistic. * @return DurationTracker for that statistic. */ @Override public DurationTracker trackDuration(String key) { return ioStatisticsStore.trackDuration(key); }
3.26
hadoop_AbfsCountersImpl_lookupCounter_rdh
/** * Look up counter by name. * * @param name * name of counter. * @return counter if found, else null. */ private MutableCounterLong lookupCounter(String name) { MutableMetric metric = lookupMetric(name); if (metric == null) { return null; } if (!(metric instanceof MutableCounterLong))...
3.26
hadoop_AbfsCountersImpl_incrementCounter_rdh
/** * {@inheritDoc } * * Increment a statistic with some value. * * @param statistic * AbfsStatistic need to be incremented. * @param value * long value to be incremented by. */ @Override public void incrementCounter(AbfsStatistic statistic, long value) { ioStatisticsStore.incrementCounter(statistic.ge...
3.26
hadoop_AbfsCountersImpl_lookupMetric_rdh
/** * Look up a Metric from registered set. * * @param name * name of metric. * @return the metric or null. */private MutableMetric lookupMetric(String name) { return getRegistry().get(name); }
3.26
hadoop_AbfsCountersImpl_toMap_rdh
/** * {@inheritDoc } * * Map of all the counters for testing. * * @return a map of the IOStatistics counters. */ @VisibleForTesting @Override public Map<String, Long> toMap() { return ioStatisticsStore.counters(); }
3.26
hadoop_AbfsCountersImpl_createCounter_rdh
/** * Create a counter in the registry. * * @param stats * AbfsStatistic whose counter needs to be made. * @return counter or null. */ private MutableCounterLong createCounter(AbfsStatistic stats) { return registry.newCounter(stats.getStatName(), stats.getStatDescription(), 0L); }
3.26
hadoop_AbfsCountersImpl_getIOStatistics_rdh
/** * Returning the instance of IOStatisticsStore used to collect the metrics * in AbfsCounters. * * @return instance of IOStatistics. */@Override public IOStatistics getIOStatistics() { return ioStatisticsStore; }
3.26
hadoop_LocalResolver_getNamenodesSubcluster_rdh
/** * Get the Namenode mapping from the subclusters from the Membership store. As * the Routers are usually co-located with Namenodes, we also check for the * local address for this Router here. * * @return NN IP -> Subcluster. */ private Map<String, String> getNamenodesSubcluster(MembershipStore membershipStor...
3.26
hadoop_LocalResolver_chooseFirstNamespace_rdh
/** * Get the local name space. This relies on the RPC Server to get the address * from the client. * * TODO we only support DN and NN locations, we need to add others like * Resource Managers. * * @param path * Path ignored by this policy. * @param loc * Federa...
3.26
hadoop_LocalResolver_getSubclusterInfo_rdh
/** * Get the mapping from nodes to subcluster. It gets this mapping from the * subclusters through expensive calls (e.g., RPC) and uses caching to avoid * too many calls. The cache might be updated asynchronously to reduce * latency. * * @return Node IP to Subcluster. */ @Override protected Map<String, String> ...
3.26
hadoop_LocalResolver_getDatanodesSubcluster_rdh
/** * Get the Datanode mapping from the subclusters from the Namenodes. This * needs to be done as a privileged action to use the user for the Router and * not the one from the client in the RPC call. * * @return DN IP -> Subcluster. */ private Map<String, String> getDatanodesSubcluster() { final RouterRpcSer...
3.26
hadoop_CachingGetSpaceUsed_incDfsUsed_rdh
/** * Increment the cached value of used space. * * @param value * dfs used value. */ public void incDfsUsed(long value) { used.addAndGet(value); }
3.26
hadoop_CachingGetSpaceUsed_initRefreshThread_rdh
/** * RunImmediately should set true, if we skip the first refresh. * * @param runImmediately * The param default should be false. */ private void initRefreshThread(boolean runImmediately) { if (refreshInterval > 0) { refreshUsed = new Thread(new RefreshThread(this, runImmediately), "refreshUsed-" ...
3.26
hadoop_CachingGetSpaceUsed_setShouldFirstRefresh_rdh
/** * Reset that if we need to do the first refresh. * * @param shouldFirstRefresh * The flag value to set. */ protected void setShouldFirstRefresh(boolean shouldFirstRefresh) { this.shouldFirstRefresh = shouldFirstRefresh; }
3.26
hadoop_CachingGetSpaceUsed_getRefreshInterval_rdh
/** * How long in between runs of the background refresh. * * @return refresh interval. */ @VisibleForTesting public long getRefreshInterval() { return refreshInterval; }
3.26
hadoop_CachingGetSpaceUsed_setUsed_rdh
/** * Reset the current used data amount. This should be called * when the cached value is re-computed. * * @param usedValue * new value that should be the disk usage. */ protected void setUsed(long usedValue) { this.used.set(usedValue); }
3.26
hadoop_CachingGetSpaceUsed_getDirPath_rdh
/** * * @return The directory path being monitored. */ public String getDirPath() { return dirPath; }
3.26