name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hadoop_CachingGetSpaceUsed_getJitter_rdh | /**
* Randomize the refresh interval timing by this amount, the actual interval will be chosen
* uniformly between {@code interval-jitter} and {@code interval+jitter}.
*
* @return between interval-jitter and interval+jitter.
*/
@VisibleForTesting
public long getJitter() {
return jitter;
} | 3.26 |
hadoop_CachingGetSpaceUsed_getUsed_rdh | /**
*
* @return an estimate of space used in the directory path.
*/
@Override
public long getUsed() throws IOException {
return Math.max(used.get(), 0);
} | 3.26 |
hadoop_CachingGetSpaceUsed_running_rdh | /**
* Is the background thread running.
*/
boolean running() {
return running.get();} | 3.26 |
hadoop_BoundedAppender_append_rdh | /**
* Append a {@link CharSequence} considering {@link #limit}, truncating
* from the head of {@code csq} or {@link #messages} when necessary.
*
* @param csq
* the {@link CharSequence} to append
* @return this
*/
public BoundedAppender append(final CharSequence csq) {
appendAndCount(csq);
checkAndCut()... | 3.26 |
hadoop_BoundedAppender_length_rdh | /**
* Get current length of messages considering truncates
* without header and ellipses.
*
* @return current length
*/
public int length() {return f0.length();
} | 3.26 |
hadoop_BoundedAppender_toString_rdh | /**
* Get a string representation of the actual contents, displaying also a
* header and ellipses when there was a truncate.
*
* @return String representation of the {@link #messages}
*/
@Override
public String toString() {
if (f0.length()
< totalCharacterCount) {
return String.format(TRUNCATED_ME... | 3.26 |
hadoop_LoggingStateChangeListener_stateChanged_rdh | /**
* Callback for a state change event: log it
*
* @param service
* the service that has changed.
*/
@Override
public void stateChanged(Service service) {
log.info((("Entry to state " + service.getServiceState()) + " for ")
+ service.getName());
} | 3.26 |
hadoop_MetricsAnnotations_makeSource_rdh | /**
* Make an metrics source from an annotated object.
*
* @param source
* the annotated object.
* @return a metrics source
*/
public static MetricsSource makeSource(Object source) {
return new MetricsSourceBuilder(source, DefaultMetricsFactory.getAnnotatedMetricsFactory()).build();
} | 3.26 |
hadoop_Preconditions_checkState_rdh | /**
* Preconditions that the expression involving one or more parameters to the calling method.
*
* <p>The message of the exception is {@code msgSupplier.get()}.</p>
*
* @param expression
* a boolean expression
* @param msgSupplier
* the {@link Supplier#get()} set the
* exception message if valid. Otherw... | 3.26 |
hadoop_Preconditions_getDefaultNullMSG_rdh | /* @VisibleForTesting */
static String getDefaultNullMSG() {
return f0;} | 3.26 |
hadoop_Preconditions_getDefaultCheckArgumentMSG_rdh | /* @VisibleForTesting */
static String getDefaultCheckArgumentMSG() {
return CHECK_ARGUMENT_EX_MESSAGE;
} | 3.26 |
hadoop_Preconditions_checkArgument_rdh | /**
* Preconditions that the expression involving one or more parameters to the calling method.
*
* <p>The message of the exception is {@code msgSupplier.get()}.</p>
*
* @param expression
* a boolean expression
* @param msgSupplier
* the {@link Supplier#get()} set the
* exception message if valid. Otherw... | 3.26 |
hadoop_Preconditions_getDefaultCheckStateMSG_rdh | /* @VisibleForTesting */
static String getDefaultCheckStateMSG() {
return CHECK_STATE_EX_MESSAGE;
} | 3.26 |
hadoop_Preconditions_checkNotNull_rdh | /**
* Preconditions that the specified argument is not {@code null},
* throwing a NPE exception otherwise.
*
* <p>The message of the exception is {@code msgSupplier.get()}.</p>
*
* @param <T>
* the object type
* @param obj
* the object to check
* @param msgSupplier
* the {@link Supplier#get()} set the
... | 3.26 |
hadoop_AuxServiceRecord_launchTime_rdh | /**
* The time when the service was created, e.g. 2016-03-16T01:01:49.000Z.
*/public AuxServiceRecord launchTime(Date time) {
this.launchTime = (time == null) ? null : ((Date)
(time.clone()));
return this;
} | 3.26 |
hadoop_AuxServiceRecord_name_rdh | /**
* A unique service name.
*/
public AuxServiceRecord name(String n)
{this.name = n;
return this;
} | 3.26 |
hadoop_AuxServiceRecord_version_rdh | /**
* Version of the service.
*/
public AuxServiceRecord version(String v) {
this.version = v;
return this;
} | 3.26 |
hadoop_AuxServiceRecord_configuration_rdh | /**
* Config properties of an service. Configurations provided at the
* service/global level are available to all the components. Specific
* properties can be overridden at the component level.
*/
public AuxServiceRecord configuration(AuxServiceConfiguration conf) {
this.configuration = conf;
return this;
} | 3.26 |
hadoop_AuxServiceRecord_toIndentedString_rdh | /**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null)
{
return "null";
}
return o.toString().replace("\n", "\n ");
} | 3.26 |
hadoop_AuxServiceRecord_description_rdh | /**
* Description of the service.
*/
public AuxServiceRecord description(String d) {
this.description = d;
return this;
} | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_getSubClusterForUnResolvedRequest_rdh | /**
* For requests whose location cannot be resolved, choose an active and
* enabled sub-cluster to forward this requestId to.
*/
private SubClusterId getSubClusterForUnResolvedRequest(long allocationId) {
if (unResolvedRequestLocation.containsKey(allocationId)) {
return unResolvedRequestLocation.get(a... | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_addLocalizedNodeRR_rdh | /**
* Add to the answer a localized node request, and keeps track of statistics
* on a per-allocation-id and per-subcluster bases.
*/
private void addLocalizedNodeRR(SubClusterId targetId, ResourceRequest rr) {
Preconditions.checkArgument(!ResourceRequest.isAnyLocation(rr.getResourceName()));
if (rr.getNumCo... | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_prettyPrintRequests_rdh | /**
* Print a list of Resource Requests into a one line string.
*
* @param response
* list of ResourceRequest
* @param max
* number of ResourceRequest to print
* @return the printed one line string
*/public static String prettyPrintRequests(List<ResourceRequest> response, int max) {
StringBuilder builde... | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_computeIntegerAssignment_rdh | /**
* Split the integer into bins according to the weights.
*
* @param totalNum
* total number of containers to split
* @param weightsList
* the weights for each subcluster
* @return the container allocation after split
* @throws YarnException
* if fails
*/
@VisibleForTesting
protected ArrayList<Integer... | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_m1_rdh | /**
* Return the set of sub-clusters that are both active and allowed by our
* policy (weight > 0).
*
* @return a set of active and enabled {@link SubClusterId}s
*/
private Set<SubClusterId> m1() {
return activeAndEnabledSC;
} | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_getNumLocalizedContainers_rdh | /**
* Returns the number of containers matching an allocation Id that are
* localized in the targetId subcluster.
*/
private long getNumLocalizedContainers(long allocationId, SubClusterId targetId) {
AtomicLong c = countContainersPerRM.get(allocationId).get(targetId);
return c == null ? 0 : c.get();
} | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_getAnswer_rdh | /**
* Return the answer accumulated so far.
*
* @return the answer
*/
private Map<SubClusterId, List<ResourceRequest>> getAnswer() {
Iterator<Entry<SubClusterId, List<ResourceRequest>>> answerIter = answer.entrySet().iterator();
// Remove redundant rack RR before returning the answer
while (answerIter.h... | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_chooseSubClusterIdForMaxLoadSC_rdh | /**
* Check if the current target subcluster is over max load, and if it is
* reroute it.
*
* @param targetId
* the original target subcluster id
* @param maxThreshold
* the max loa... | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_getHeadroomWeighting_rdh | /**
* Compute the weighting based on available headroom. This is proportional to
* the available headroom memory announced by RM, or to 1/N for RMs we have
* not seen yet. If all RMs report zero headroom, we fallback to 1/N again.
*/
private float getHeadroomWeighting(SubClusterId targetId, AllocationBookkeeper all... | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_m0_rdh | /**
* get the Load data of the subCluster.
*
* @param subClusterId
* subClusterId.
* @return The number of pending containers for the subCluster.
*/
private int m0(SubClusterId
subClusterId) {
EnhancedHeadroom headroomData = this.enhancedHeadroom.get(subClusterId);
if (headroomData == null) {
re... | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_getLocalityBasedWeighting_rdh | /**
* Compute the weight to assign to a subcluster based on how many local
* requests a subcluster is target of.
*/private float getLocalityBasedWeighting(long reqId, SubClusterId targetId, AllocationBookkeeper allocationBookkeeper) {
float totWeight = allocationBookkeeper.getTotNumLocalizedContainers(reqId);
... | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_getTotNumLocalizedContainers_rdh | /**
* Return the total number of container coming from localized requests
* matching an allocation Id.
*/
private long getTotNumLocalizedContainers(long allocationId) {
AtomicLong c = totNumLocalizedContainers.get(allocationId);
return c == null ? 0 : c.get();
} | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_addAnyRR_rdh | /**
* Add an ANY request to the final answer.
*/
private void addAnyRR(SubClusterId targetId, ResourceRequest rr) {Preconditions.checkArgument(ResourceRequest.isAnyLocation(rr.getResourceName()));
internalAddToAnswer(targetId, rr, false);
} | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_getPolicyConfigWeighting_rdh | /**
* Compute the "weighting" to give to a sublcuster based on the configured
* policy weights (for the active subclusters).
*/
private float getPolicyConfigWeighting(SubClusterId targetId, AllocationBookkeeper allocationBookkeeper) {
float totWeight = allocationBookkeeper.totPolicyWeight;
Float v45 = alloc... | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_routeNodeRequestIfNeeded_rdh | /**
* When certain subcluster is too loaded, reroute Node requests going there.
*
* @param targetId
* current subClusterId where request is sent
* @param maxThreshold
* threshold for Pending count
* @param activeAndEnabledSCs
* list of active sc
* @return subClusterId target sc id
*/
protected SubCluste... | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_splitAnyRequests_rdh | /**
* It splits a list of non-localized resource requests among sub-clusters.
*/
private void splitAnyRequests(List<ResourceRequest> originalResourceRequests,
AllocationBookkeeper allocationBookkeeper) throws YarnException {
for (ResourceRequest resourceRequest : originalResourceRequests) {
// FIRST: pi... | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_addRackRR_rdh | /**
* Add a rack-local request to the final answer.
*/
private void addRackRR(SubClusterId targetId,
ResourceRequest rr) {
Preconditions.checkArgument(!ResourceRequest.isAnyLocation(rr.getResourceName()));
internalAddToAnswer(targetId, rr, true);
} | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_isActiveAndEnabled_rdh | /**
* Returns true is the subcluster request is both active and enabled.
*/
private boolean isActiveAndEnabled(SubClusterId targetId) {
if (targetId == null) {
return false;
} else {
return m1().contains(targetId);
}
} | 3.26 |
hadoop_LocalityMulticastAMRMProxyPolicy_splitIndividualAny_rdh | /**
* Return a projection of this ANY {@link ResourceRequest} that belongs to
* this sub-cluster. This is done based on the "count" of the containers that
* require locality in each sublcuster (if any) or based on the "weights" and
* headroom.
*/
private void splitIndividualAny(ResourceRequest originalResourceRequ... | 3.26 |
hadoop_StoreContextBuilder_setEnableCSE_rdh | /**
* set is client side encryption boolean value.
*
* @param value
* value indicating if client side encryption is enabled or not.
* @return builder instance.
*/ public StoreContextBuilder setEnableCSE(boolean value) {
isCSEEnabled = value;return this;
} | 3.26 |
hadoop_StoreContextBuilder_setAuditor_rdh | /**
* Set builder value.
*
* @param value
* new value
* @return the builder
*/
public StoreContextBuilder setAuditor(final AuditSpanSource<AuditSpanS3A> value) {
auditor = value;
return this;
} | 3.26 |
hadoop_PlacementConstraintManager_validateConstraint_rdh | /**
* Validate a placement constraint and the set of allocation tags that will
* enable it.
*
* @param sourceTags
* the associated allocation tags
* @param placementConstraint
* the constraint
* @return true if constraint and tags are valid
*/
default boolean validateConstraint(Set<String> sourceTags, Plac... | 3.26 |
hadoop_EntityColumnPrefix_getColumnPrefix_rdh | /**
*
* @return the column name value
*/
public String getColumnPrefix() {
return columnPrefix;
} | 3.26 |
hadoop_ReservationInterval_isOverlap_rdh | /**
* Returns whether the interval is active at the specified instant of time
*
* @param tick
* the instance of the time to check
* @return true if active, false otherwise
*/
public boolean isOverlap(long tick) {
return (startTime <= tick) && (tick <= endTime);
} | 3.26 |
hadoop_ReservationInterval_getEndTime_rdh | /**
* Get the end time of the reservation interval
*
* @return the endTime
*/
public long getEndTime() {
return endTime;} | 3.26 |
hadoop_ReservationInterval_getStartTime_rdh | /**
* Get the start time of the reservation interval
*
* @return the startTime
*/
public long getStartTime() {
return
startTime;
} | 3.26 |
hadoop_Times_elapsed_rdh | // A valid elapsed is supposed to be non-negative. If finished/current time
// is ahead of the started time, return -1 to indicate invalid elapsed time,
// and record a warning log.
public static long elapsed(long started, long finished, boolean isRunning) {
if ((finished > 0) && (started > 0)) {
... | 3.26 |
hadoop_Times_parseISO8601ToLocalTimeInMillis_rdh | /**
* Given ISO formatted string with format "yyyy-MM-dd'T'HH:mm:ss.SSSZ", return
* epoch time for local Time zone.
*
* @param isoString
* in format of "yyyy-MM-dd'T'HH:mm:ss.SSSZ".
* @return epoch time for local time zone.
* @throws ParseException
* if given ISO formatted string can not be parsed.
*/
publ... | 3.26 |
hadoop_Times_formatISO8601_rdh | /**
* Given a time stamp returns ISO-8601 formated string in format
* "yyyy-MM-dd'T'HH:mm:ss.SSSZ".
*
* @param ts
* to be formatted in ISO format.
* @return ISO 8601 formatted string.
*/
public static String formatISO8601(long ts) {
return ISO_OFFSET_DATE_TIME.format(Instant.ofEpochMilli(ts));
} | 3.26 |
hadoop_MutableGaugeInt_toString_rdh | /**
*
* @return the value of the metric
*/
public String toString() {return value.toString();
} | 3.26 |
hadoop_MutableGaugeInt_set_rdh | /**
* Set the value of the metric
*
* @param value
* to set
*/public void set(int value) {
this.value.set(value);
setChanged();
} | 3.26 |
hadoop_MutableGaugeInt_decr_rdh | /**
* decrement by delta
*
* @param delta
* of the decrement
*/
public void decr(int delta) {
value.addAndGet(-delta);
setChanged();
} | 3.26 |
hadoop_MutableGaugeInt_incr_rdh | /**
* Increment by delta
*
* @param delta
* of the increment
*/
public void incr(int delta) {
value.addAndGet(delta);
setChanged();
} | 3.26 |
hadoop_BalancerBandwidthCommand_m0_rdh | /**
* Get current value of the max balancer bandwidth in bytes per second.
*
* @return bandwidth Blanacer bandwidth in bytes per second for this datanode.
*/
public long m0() {
return this.bandwidth;
} | 3.26 |
hadoop_QuotaUsage_getStorageTypeHeader_rdh | /**
* return the header of with the StorageTypes.
*
* @param storageTypes
* storage types.
* @return storage header string
*/
public static String getStorageTypeHeader(List<StorageType> storageTypes) {
StringBuilder header = new StringBuilder();
for (StorageType st : storageTypes) {
/* the field... | 3.26 |
hadoop_QuotaUsage_m0_rdh | /**
* Return storage type consumed.
*
* @param type
* storage type.
* @return type consumed.
*/
public long m0(StorageType type) {
return typeConsumed != null ? typeConsumed[type.ordinal()] : 0L;
} | 3.26 |
hadoop_QuotaUsage_getFileAndDirectoryCount_rdh | /**
* Return the directory count.
*
* @return file and directory count.
*/
public long getFileAndDirectoryCount() {
return fileAndDirectoryCount;
} | 3.26 |
hadoop_QuotaUsage_getSpaceConsumed_rdh | /**
* Return (disk) space consumed.
*
* @return space consumed.
*/
public long getSpaceConsumed() {
return spaceConsumed;
} | 3.26 |
hadoop_QuotaUsage_isTypeQuotaSet_rdh | /**
* Return true if any storage type quota has been set.
*
* @return if any storage type quota has been set true, not false.
*/
public boolean isTypeQuotaSet() {
if (typeQuota != null) {
for (StorageType t : StorageType.getTypesSupportingQuota())
{
if (typeQuota[t.ordinal()] > 0L) ... | 3.26 |
hadoop_QuotaUsage_getSpaceQuota_rdh | /**
* Return (disk) space quota.
*
* @return space quota.
*/
public long getSpaceQuota() {
return spaceQuota;
} | 3.26 |
hadoop_QuotaUsage_getHeader_rdh | /**
* Return the header of the output.
*
* @return the header of the output
*/
public static String getHeader() {
return QUOTA_HEADER;
} | 3.26 |
hadoop_QuotaUsage_toString_rdh | /**
* Return the string representation of the object in the output format.
* if hOption is false file sizes are returned in bytes
* if hOption is true file sizes are returned in human readable
*
* @param hOption
* a flag indicating if human readable output if to be used
* @param tOption
* type option.
* @p... | 3.26 |
hadoop_QuotaUsage_formatSize_rdh | /**
* Formats a size to be human readable or in bytes.
*
* @param size
* value to be formatted
* @param humanReadable
* flag indicating human readable or not
* @return String representation of the size
*/
private String formatSize(long
size, boolean humanReadable) {
return humanReadable ? StringUtils.T... | 3.26 |
hadoop_QuotaUsage_getQuota_rdh | /**
* Return the directory quota.
*
* @return quota.
*/
public long getQuota() {
return quota;} | 3.26 |
hadoop_RouterQuotaManager_getPaths_rdh | /**
* Get children paths (can include itself) under specified federation path.
*
* @param parentPath
* Federated path.
* @return Set of children paths.
*/
public Set<String> getPaths(S... | 3.26 |
hadoop_RouterQuotaManager_updateQuota_rdh | /**
* Update quota in cache. The usage will be preserved.
*
* @param path
* Mount table path.
* @param quota
* Corresponding quota value.
*/
public void updateQuota(String path, RouterQuotaUsage quota) {
writeLock.lock();
try {
RouterQuotaUsage.Builder builder = new RouterQuotaUsage.Builder()... | 3.26 |
hadoop_RouterQuotaManager_isQuotaSet_rdh | /**
* Check if the quota was set.
*
* @param quota
* the quota usage.
* @return True if the quota is set.
*/
public static boolean isQuotaSet(QuotaUsage quota) {
if (quota
!= null) {
long nsQuota = quota.getQuota();
long ssQuota = quota.getSpaceQuota();
// once nsQuota or ssQuo... | 3.26 |
hadoop_RouterQuotaManager_clear_rdh | /**
* Clean up the cache.
*/
public void clear() {
writeLock.lock();
try {
this.cache.clear();
} finally {
writeLock.unlock();
}
} | 3.26 |
hadoop_RouterQuotaManager_getQuotaUsage_rdh | /**
* Get the nearest ancestor's quota usage, and meanwhile its quota was set.
*
* @param path
* The path being written.
* @return RouterQuotaUsage Quota usage.
*/
public RouterQuotaUsage getQuotaUsage(String path) {
readLock.lock();
try {
RouterQuotaUsage quotaUsage = this.cache.get(path);
... | 3.26 |
hadoop_RouterQuotaManager_remove_rdh | /**
* Remove the entity from cache.
*
* @param path
* Mount table path.
*/
public void remove(String path) {
writeLock.lock();
try {
this.cache.remove(path);
} finally {
writeLock.unlock();
}
} | 3.26 |
hadoop_RouterQuotaManager_put_rdh | /**
* Put new entity into cache.
*
* @param path
* Mount table path.
* @param quotaUsage
* Corresponding cache value.
*/
public void put(String path, RouterQuotaUsage quotaUsage) {
writeLock.lock();
try {
this.cache.put(path, quotaUsage);
} finally {
writeLock.unlock();
}
} | 3.26 |
hadoop_RouterQuotaManager_isMountEntry_rdh | /**
* Is the path a mount entry.
*
* @param path
* the path.
* @return {@code true} if path is a mount entry; {@code false} otherwise.
*/
boolean isMountEntry(String path) {
readLock.lock();try {
return this.cache.containsKey(path);
} finally {
readLock.unlock();
}
} | 3.26 |
hadoop_RouterQuotaManager_getAll_rdh | /**
* Get all the mount quota paths.
*
* @return All the mount quota paths.
*/
public Set<String> getAll() {
readLock.lock();
try {
return this.cache.keySet();
} finally {
readLock.unlock();
}} | 3.26 |
hadoop_RouterQuotaManager_getParentsContainingQuota_rdh | /**
* Get parent paths (including itself) and quotas of the specified federation
* path. Only parents containing quota are returned.
*
* @param childPath
* Federated path.
* @return TreeMap of parent paths and quotas.
*/
TreeMap<String, RouterQuotaUsage> getParentsContainingQuota(String childPath) {
TreeMa... | 3.26 |
hadoop_Tristate_isBoolean_rdh | /**
* Does this value map to a boolean.
*
* @return true if the state is one of true or false.
*/
public boolean isBoolean() {
return
mapping.isPresent();
} | 3.26 |
hadoop_Tristate_m0_rdh | /**
* Build a tristate from a boolean.
*
* @param b
* source optional
* @return a tristate derived from the argument.
*/
public static Tristate m0(Optional<Boolean> b) {
return b.map(Tristate::fromBool).orElse(UNKNOWN);
} | 3.26 |
hadoop_UriUtils_extractAccountNameFromHostName_rdh | /**
* Extracts the account name from the host name.
*
* @param hostName
* the fully-qualified domain name of the storage service
* endpoint (e.g. {account}.dfs.core.windows.net.
* @return the storage service account name.
*/
public static String extractAccountNameFromHostName(final String hostName) {
if ... | 3.26 |
hadoop_UriUtils_generateUniqueTestPath_rdh | /**
* Generate unique test path for multiple user tests.
*
* @return root test path
*/
public static String generateUniqueTestPath() {
String
testUniqueForkId = System.getProperty("test.unique.fork.id");
return testUniqueForkId == null ? "/test" : ("/" + testUniqueForkId) + "/test";
} | 3.26 |
hadoop_UriUtils_maskUrlQueryParameters_rdh | /**
* Generic function to mask a set of query parameters partially/fully and
* return the resultant query string
*
* @param keyValueList
* List of NameValuePair instances for query keys/values
* @param queryParamsForFullMask
* values for these params will appear as "XXXX"
* @param queryParamsForPartialMask
... | 3.26 |
hadoop_UriUtils_containsAbfsUrl_rdh | /**
* Checks whether a string includes abfs url.
*
* @param string
* the string to check.
* @return true if string has abfs url.
*/
public static boolean containsAbfsUrl(final String string) {
if ((string == null) || string.isEmpty()) {
return false;
}
return ABFS_URI_PATTERN.matcher(strin... | 3.26 |
hadoop_HistoryServerStateStoreService_serviceInit_rdh | /**
* Initialize the state storage
*
* @param conf
* the configuration
* @throws IOException
*/
@Override
public void serviceInit(Configuration conf) throws IOException {
initStorage(conf);
} | 3.26 |
hadoop_HistoryServerStateStoreService_serviceStop_rdh | /**
* Shutdown the state storage.
*
* @throws IOException
*/
@Override
public void serviceStop() throws IOException {
closeStorage();
} | 3.26 |
hadoop_HistoryServerStateStoreService_serviceStart_rdh | /**
* Start the state storage for use
*
* @throws IOException
*/
@Override
public void serviceStart() throws IOException {startStorage();
} | 3.26 |
hadoop_DomainNameResolverFactory_newInstance_rdh | /**
* This function gets the instance based on the config.
*
* @param conf
* Configuration
* @param configKey
* config key name.
* @return Domain name resolver.
*/
public static DomainNameResolver newInstance(Configuration conf, String configKey) {
Class<? extends DomainNameResolver> resolverClass ... | 3.26 |
hadoop_TimelineMetricCalculator_sum_rdh | /**
* Sum up two Numbers.
*
* @param n1
* Number n1
* @param n2
* Number n2
* @return Number represent to (n1 + n2).
*/
public static Number sum(Number n1, Number n2) {
if (n1 == null) {
return n2;
} else if (n2 == null) {
return n1;
}
if ((n1 instanceof Integer) || (n1 instanceof Long)) {
retur... | 3.26 |
hadoop_TimelineMetricCalculator_sub_rdh | /**
* Subtract operation between two Numbers.
*
* @param n1
* Number n1
* @param n2
* Number n2
* @return Number represent to (n1 - n2).
*/
public static Number sub(Number n1, Number n2) {
if (n1 == null) {
throw new YarnRuntimeException("Number to be subtracted shouldn't be null.");
} else if (n2... | 3.26 |
hadoop_ManifestPrinter_println_rdh | /**
* Print a line to the output stream.
*
* @param format
* format string
* @param args
* arguments.
*/
private void println(String format, Object... args) {
out.format(format, args);
out.println();
} | 3.26 |
hadoop_ManifestPrinter_loadAndPrintManifest_rdh | /**
* Load and print a manifest.
*
* @param fs
* filesystem.
* @param path
* path
* @throws IOException
* failure to load
* @return the manifest
*/
public ManifestSuccessData loadAndPrintManifest(FileSystem fs, Path path) throws IOException {
// load the manifest
println("Manifest file: %s", pa... | 3.26 |
hadoop_ManifestPrinter_field_rdh | /**
* Print a field, if non-null.
*
* @param name
* field name.
* @param value
* value.
*/
private void field(String name, Object value) {
if (value != null) {
println("%s: %s", name, value);
}
} | 3.26 |
hadoop_UpdateContainerSchedulerEvent_isIncrease_rdh | /**
* isIncrease.
*
* @return isIncrease.
*/
public boolean isIncrease() {
return containerEvent.isIncrease();
} | 3.26 |
hadoop_UpdateContainerSchedulerEvent_isExecTypeUpdate_rdh | /**
* isExecTypeUpdate.
*
* @return isExecTypeUpdate.
*/
public boolean isExecTypeUpdate() {
return containerEvent.isExecTypeUpdate();
} | 3.26 |
hadoop_UpdateContainerSchedulerEvent_getOriginalToken_rdh | /**
* Original Token before update.
*
* @return Container Token.
*/
public ContainerTokenIdentifier getOriginalToken() {
return this.originalToken;
} | 3.26 |
hadoop_UpdateContainerSchedulerEvent_isResourceChange_rdh | /**
* isResourceChange.
*
* @return isResourceChange.
*/
public boolean isResourceChange() {
return containerEvent.isResourceChange();
} | 3.26 |
hadoop_UpdateContainerSchedulerEvent_getUpdatedToken_rdh | /**
* Update Container Token.
*
* @return Container Token.
*/
public ContainerTokenIdentifier getUpdatedToken() {
return containerEvent.getUpdatedToken();
} | 3.26 |
hadoop_S3ARemoteObjectReader_read_rdh | /**
* Stars reading at {@code offset} and reads upto {@code size} bytes into {@code buffer}.
*
* @param buffer
* the buffer into which data is returned
* @param offset
* the absolute offset into the underlying file where reading starts.
* @param size
* the number of bytes to be read.
* @return number of ... | 3.26 |
hadoop_IOStatisticsStore_addSample_rdh | /**
* Add a statistics sample as a min, max and mean and count.
*
* @param key
* key to add.
* @param count
* count.
*/
default void addSample(String key, long count) {
incrementCounter(key, count);
addMeanStatisticSample(key, count);
addMaximumSample(key, count);
addMinimumSample(key, coun... | 3.26 |
hadoop_IOStatisticsStore_incrementCounter_rdh | /**
* Increment a counter by one.
*
* No-op if the counter is unknown.
*
* @param key
* statistics key
* @return old value or, if the counter is unknown: 0
*/
default long incrementCounter(String key) {
return incrementCounter(key, 1);
} | 3.26 |
hadoop_ExitStatus_getExitCode_rdh | /**
*
* @return the command line exit code.
*/
public int getExitCode() {
return code;} | 3.26 |
hadoop_ServletUtil_getParameter_rdh | /**
* Get a parameter from a ServletRequest.
* Return null if the parameter contains only white spaces.
*
* @param request
* request.
* @param name
* name.
* @return get a parameter from a ServletRequest.
*/
public static String getParameter(ServletRequest request, String name) {
String s = request.get... | 3.26 |
hadoop_ServletUtil_getRawPath_rdh | /**
* Parse the path component from the given request and return w/o decoding.
*
* @param request
* Http request to parse
* @param servletName
* the name of servlet that precedes the path
* @return path component, null if the default charset is not supported
*/
public static String getRawPath(final HttpServ... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.