name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hadoop_AbfsInputStream_getStreamStatistics_rdh
/** * Getter for AbfsInputStreamStatistics. * * @return an instance of AbfsInputStreamStatistics. */ @VisibleForTesting public AbfsInputStreamStatistics getStreamStatistics() { return streamStatistics; }
3.26
hadoop_AbfsInputStream_seek_rdh
/** * Seek to given position in stream. * * @param n * position to seek to * @throws IOException * if there is an error * @throws EOFException * if attempting to seek past end of file */ @Override public synchronized void seek(long n) throws IOException { LOG.debug("requested seek to position {}", n); i...
3.26
hadoop_AbfsInputStream_mark_rdh
/** * Not supported by this stream. Throws {@link UnsupportedOperationException} * * @param readlimit * ignored */ @Override public synchronized void mark(int readlimit) { throw new UnsupportedOperationException("mark()/reset() not supported on this stream"); }
3.26
hadoop_AbfsInputStream_reset_rdh
/** * Not supported by this stream. Throws {@link UnsupportedOperationException} */ @Override public synchronized void reset() throws IOException { throw new UnsupportedOperationException("mark()/reset() not supported on this stream"); }
3.26
hadoop_AbfsInputStream_incrementReadOps_rdh
/** * Increment Read Operations. */ private void incrementReadOps() { if (statistics != null) { statistics.incrementReadOps(1); } }
3.26
hadoop_AbfsInputStream_toString_rdh
/** * Get the statistics of the stream. * * @return a string value. */ @Override public String toString() { final StringBuilder sb = new StringBuilder(super.toString()); sb.append("AbfsInputStream@(").append(this.hashCode()).append("){"); sb.append(("[" + CAPABILITY_SAFE_READAHEAD) + "]"); if (strea...
3.26
hadoop_AbfsInputStream_getBytesFromReadAhead_rdh
/** * Getter for bytes read from readAhead buffer that fills asynchronously. * * @return value of the counter in long. */ @VisibleForTesting public long getBytesFromReadAhead() { return bytesFromReadAhead; }
3.26
hadoop_AbfsInputStream_available_rdh
/** * Return the size of the remaining available bytes * if the size is less than or equal to {@link Integer#MAX_VALUE}, * otherwise, return {@link Integer#MAX_VALUE}. * * This is to match the behavior of DFSInputStream.available(), * which some clients may rely on (HBase write-ahead log reading in * particular)...
3.26
hadoop_AbfsInputStream_getPos_rdh
/** * Return the current offset from the start of the file * * @throws IOException * throws {@link IOException} if there is an error */ @Override public synchronized long getPos() throws IOException { if (closed) { throw new IOException(FSExceptionMessages.STREAM_IS_CLOSED);} return nextReadPos < 0 ? 0 : nex...
3.26
hadoop_AbfsInputStream_seekToNewSource_rdh
/** * Seeks a different copy of the data. Returns true if * found a new source, false otherwise. * * @throws IOException * throws {@link IOException} if there is an error */ @Override public boolean seekToNewSource(long l) throws IOException { return false; }
3.26
hadoop_AbstractDNSToSwitchMapping_isSingleSwitch_rdh
/** * Predicate that indicates that the switch mapping is known to be * single-switch. The base class returns false: it assumes all mappings are * multi-rack. Subclasses may override this with methods that are more aware * of their topologies. * * <p> * * This method is used when parts of Hadoop need know wheth...
3.26
hadoop_AbstractDNSToSwitchMapping_getSwitchMap_rdh
/** * Get a copy of the map (for diagnostics) * * @return a clone of the map or null for none known */ public Map<String, String> getSwitchMap() { return null; }
3.26
hadoop_PeriodicRLESparseResourceAllocation_removeInterval_rdh
/** * Removes a resource for the specified interval. * * @param interval * the {@link ReservationInterval} for which the resource is * to be removed. * @param resource * the {@link Resource} to be removed. * @return true if removal is successful, false otherwise */ public boolean removeInterval(Reservati...
3.26
hadoop_PeriodicRLESparseResourceAllocation_addInterval_rdh
/** * Add resource for the specified interval. This function will be used by * {@link InMemoryPlan} while placing reservations between 0 and timePeriod. * The interval may include 0, but the end time must be strictly less than * timePeriod. * * @param interval * {@link ReservationInterval} to which the specifi...
3.26
hadoop_PeriodicRLESparseResourceAllocation_getMaximumPeriodicCapacity_rdh
/** * Get maximum capacity at periodic offsets from the specified time. * * @param tick * UTC time base from which offsets are specified for finding the * maximum capacity. * @param period * periodic offset at which capacities are evaluated. * @return the maximum {@link Resource} across the specified time...
3.26
hadoop_PeriodicRLESparseResourceAllocation_getCapacityAtTime_rdh
/** * Get capacity at time based on periodic repetition. * * @param tick * UTC time for which the allocated {@link Resource} is queried. * @return {@link Resource} allocated at specified time */ public Resource getCapacityAtTime(long tick) { long convertedTime = tick % timePeriod; return super.getCapaci...
3.26
hadoop_PeriodicRLESparseResourceAllocation_m0_rdh
/** * Get time period of PeriodicRLESparseResourceAllocation. * * @return timePeriod time period represented in ms. */ public long m0() { return this.timePeriod; }
3.26
hadoop_ExecutionSummarizer_getTraceSignature_rdh
// Generates a signature for the trace file based on // - filename // - modification time // - file length // - owner protected static String getTraceSignature(String input) throws IOException { Path inputPath = new Path(input); FileSystem fs = inputPath.getFileSystem(new Configuration());FileStatus status = fs.getFil...
3.26
hadoop_ExecutionSummarizer_stringifyDataStatistics_rdh
// Gets the stringified version of DataStatistics static String stringifyDataStatistics(DataStatistics stats) { if (stats != null) { StringBuffer buffer = new StringBuffer(); String compressionStatus = (stats.isDataCompressed()) ? "Compressed" : "Uncompressed"; buffer.append(compressionStatus).append("...
3.26
hadoop_ExecutionSummarizer_m0_rdh
// Getters protected String m0() { return expectedDataSize; }
3.26
hadoop_ExecutionSummarizer_toString_rdh
/** * Summarizes the current {@link Gridmix} run. */ @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("Execution Summary:-"); builder.append("\nInput trace: ").append(getInputTraceLocation()); builder.append("\nInput trace signature: ").append(getInputTraceSignature());...
3.26
hadoop_SocksSocketFactory_setProxy_rdh
/** * Set the proxy of this socket factory as described in the string * parameter * * @param proxyStr * the proxy address using the format "host:port" */ private void setProxy(String proxyStr) { String[] strs = proxyStr.split(":", 2);if (strs.length != 2) throw new RuntimeException("Bad SOCKS proxy paramete...
3.26
hadoop_RouterSafemodeService_enter_rdh
/** * Enter safe mode. */ private void enter() { LOG.info("Entering safe mode"); enterSafeModeTime = monotonicNow();safeMode = true; router.updateRouterState(RouterServiceState.SAFEMODE); }
3.26
hadoop_RouterSafemodeService_leave_rdh
/** * Leave safe mode. */ private void leave() { // Cache recently updated, leave safemode long timeInSafemode = monotonicNow() - enterSafeModeTime; LOG.info("Leaving safe mode after {} milliseconds", timeInSafemode); RouterMetrics routerMetrics = router.getRouterMetrics(); if (routerMetrics == nu...
3.26
hadoop_RouterSafemodeService_isInSafeMode_rdh
/** * Return whether the current Router is in safe mode. */ boolean isInSafeMode() { return this.safeMode; }
3.26
hadoop_RouterSafemodeService_setManualSafeMode_rdh
/** * Set the flag to indicate that the safe mode for this Router is set manually * via the Router admin command. */ void setManualSafeMode(boolean mode) { this.safeMode = mode; this.isSafeModeSetManually = mode; }
3.26
hadoop_PutTracker_initialize_rdh
/** * Startup event. * * @return true if the multipart should start immediately. * @throws IOException * any IO problem. */ public boolean initialize() throws IOException { return false; }
3.26
hadoop_PutTracker_getDestKey_rdh
/** * get the destination key. The default implementation returns the * key passed in: there is no adjustment of the destination. * * @return the destination to use in PUT requests. */ public String getDestKey() { return destKey; }
3.26
hadoop_PutTracker_m0_rdh
/** * Flag to indicate that output is not immediately visible after the stream * is closed. Default: false. * * @return true if the output's visibility will be delayed. */ public boolean m0() { return true; }
3.26
hadoop_ClientRegistryBinder_homePathForUser_rdh
/** * Buld the user path -switches to the system path if the user is "". * It also cross-converts the username to ascii via punycode * * @param username * username or "" * @return the path to the user */ public static String homePathForUser(String username) { Preconditions.checkArgument(username != null, "...
3.26
hadoop_ClientRegistryBinder_getEndpoint_rdh
/** * Get an endpont by API * * @param record * service record * @param api * API * @param external * flag to indicate this is an external record * @return the endpoint or null */ public static Endpoint getEndpoint(ServiceRecord record, String api, boolean external) { return external ? record.getExt...
3.26
hadoop_ClientRegistryBinder_qualifyUser_rdh
/** * Qualify a user. * <ol> * <li> <code>"~"</code> maps to user home path home</li> * <li> <code>"~user"</code> maps to <code>/users/$user</code></li> * <li> <code>"/"</code> maps to <code>/services/</code></li> * </ol> * * @param user * the username * @return the base path */ public static String ...
3.26
hadoop_ClientRegistryBinder_m0_rdh
/** * Look up an external REST API * * @param user * user which will be qualified as per {@link #qualifyUser(String)} * @param serviceClass * service class * @param instance * instance name * @param api * API * @return the API, or an exception is raised. * @throws IOException */ public String m0(St...
3.26
hadoop_IdentityTransformer_transformAclEntriesForSetRequest_rdh
/** * Perform Identity transformation when calling setAcl(),removeAclEntries() and modifyAclEntries() * If the AclEntry type is a user or group, and its name is one of the following: * 1.short name; 2.$superuser; 3.Fully qualified name; 4. principal id. * <pre> * Short name could be transformed to: * - A servi...
3.26
hadoop_IdentityTransformer_isShortUserName_rdh
/** * Internal method to identify if owner name returned by the ADLS backend is short name or not. * If name contains "@", this code assumes that whatever comes after '@' is domain name and ignores it. * * @param owner * @return */ private boolean isShortUserName(String owner) { return (owner != null) && (!owner....
3.26
hadoop_IdentityTransformer_transformAclEntriesForGetRequest_rdh
/** * Perform Identity transformation when calling GetAclStatus() * If the AclEntry type is a user or group, and its name is one of the following: * <pre> * 1. $superuser: * by default it will be transformed to local user/group, this can be disabled by setting * "fs.azure.identity.transformer.skip.superus...
3.26
hadoop_IdentityTransformer_transformIdentityForGetRequest_rdh
/** * Perform identity transformation for the Get request results in AzureBlobFileSystemStore: * getFileStatus(), listStatus(), getAclStatus(). * Input originalIdentity can be one of the following: * <pre> * 1. $superuser: * by default it will be transformed to local user/group, th...
3.26
hadoop_HsSingleCounterPage_m0_rdh
/** * The content of this page is the CountersBlock now. * * @return CountersBlock.class */ @Override protected Class<? extends SubView> m0() { return SingleCounterBlock.class;}
3.26
hadoop_HsSingleCounterPage_preHead_rdh
/* (non-Javadoc) @see org.apache.hadoop.mapreduce.v2.hs.webapp.HsView#preHead(org.apache.hadoop.yarn.webapp.hamlet.Hamlet.HTML) */ @Override protected void preHead(Page.HTML<__> html) { commonPreHead(html); setActiveNavColumnForTask(); set(DATATABLES_ID, "singleCounter"); set(initID(DATATABLES, "singl...
3.26
hadoop_StorageStatisticsFromIOStatistics_toLongStatistic_rdh
/** * Convert a counter/gauge entry to a long statistics. * * @param e * entry * @return statistic */ private LongStatistic toLongStatistic(final Map.Entry<String, Long> e) { return new LongStatistic(e.getKey(), e.getValue()); }
3.26
hadoop_ErrorMetricUpdater_hook_rdh
/** * Hooks a new listener to the given operationContext that will update the * error metrics for the WASB file system appropriately in response to * ResponseReceived events. * * @param operationContext * The operationContext to hook. * @param instrumentation * The metrics source to update. */ public stati...
3.26
hadoop_KMSExceptionsProvider_toResponse_rdh
/** * Maps different exceptions thrown by KMS to HTTP status codes. */ @Override public Response toResponse(Exception exception) { Response.Status status; boolean doAudit = true; Throwable throwable = exception; if (exception instanceof ContainerException)...
3.26
hadoop_TaskInfo_getInputRecords_rdh
/** * * @return Number of records input to this task. */ public int getInputRecords() { return recsIn; }
3.26
hadoop_TaskInfo_getTaskVCores_rdh
/** * * @return Vcores used by the task. */ public long getTaskVCores() { return maxVcores; }
3.26
hadoop_TaskInfo_getResourceUsageMetrics_rdh
/** * * @return Resource usage metrics */ public ResourceUsageMetrics getResourceUsageMetrics() { return metrics; }
3.26
hadoop_TaskInfo_getTaskMemory_rdh
/** * * @return Memory used by the task leq the heap size. */ public long getTaskMemory() { return maxMemory; }
3.26
hadoop_TimelineReaderClient_createTimelineReaderClient_rdh
/** * Create a new instance of Timeline Reader Client. * * @return instance of Timeline Reader Client. */ @InterfaceAudience.Public public static TimelineReaderClient createTimelineReaderClient() { return new TimelineReaderClientImpl(); }
3.26
hadoop_RegexMountPointResolvedDstPathReplaceInterceptor_interceptRemainingPath_rdh
/** * The interceptRemainingPath will just return the remainingPath passed in. */ @Override public Path interceptRemainingPath(Path remainingPath) { return remainingPath; }
3.26
hadoop_RegexMountPointResolvedDstPathReplaceInterceptor_interceptSource_rdh
/** * Source won't be changed in the interceptor. * * @return source param string passed in. */ @Override public String interceptSource(String source) { return source; }
3.26
hadoop_RegexMountPointResolvedDstPathReplaceInterceptor_deserializeFromString_rdh
/** * Create interceptor from config string. The string should be in * replaceresolvedpath:wordToReplace:replaceString * Note that we'll assume there's no ':' in the regex for the moment. * * @return Interceptor instance or null on bad config. */ public static RegexMountPointResolvedDstPathReplaceInterceptor dese...
3.26
hadoop_RegexMountPointResolvedDstPathReplaceInterceptor_m1_rdh
/** * Intercept resolved path, e.g. * Mount point /^(\\w+)/, ${1}.hadoop.net * If incoming path is /user1/home/tmp/job1, * then the resolved path str will be user1. * * @return intercepted string */ @Override public String m1(String parsedDestPathStr) { Matcher matcher = srcRegexPattern.matcher(parsedDestPa...
3.26
hadoop_MountTableProcedure_updateMountTableDestination_rdh
/** * Update the destination of the mount point to target namespace and target * path. * * @param mount * the mount point. * @param dstNs * the target namespace. * @param dstPath * the target path * @param conf * the configuration of the router. */ private static void updateMountTableDestination(Str...
3.26
hadoop_MountTableProcedure_enableWrite_rdh
/** * Enable write by cancelling the mount point readonly. * * @param mount * the mount point to cancel readonly. * @param conf * the configuration of the router. */ static void enableWrite(String mount, Configuration conf) throws IOException { setMountReadOnly(mount, false, conf); }
3.26
hadoop_MountTableProcedure_setMountReadOnly_rdh
/** * Enable or disable readonly of the mount point. * * @param mount * the mount point. * @param readOnly * enable or disable readonly. * @param conf * the configuration of the router. */ private static void setMountReadOnly(String mount, boolean readOnly, Con...
3.26
hadoop_MountTableProcedure_getMountEntry_rdh
/** * Gets the mount table entry. * * @param mount * name of the mount entry. * @param mountTable * the mount table. * @return corresponding mount entry. * @throws IOException * in case of failure to retrieve mount entry. */ public static MountTable getMountEntry(String mount, MountTableManager mountTab...
3.26
hadoop_MountTableProcedure_disableWrite_rdh
/** * Disable write by making the mount point readonly. * * @param mount * the mount point to set readonly. * @param conf * the configuration of the router. */ static void disableWrite(String mount, Configuration conf) throws IOException { setMountReadOnly(mount, true, conf); }
3.26
hadoop_MutableCounterInt_incr_rdh
/** * Increment the value by a delta * * @param delta * of the increment */ public synchronized void incr(int delta) { value.addAndGet(delta); setChanged(); }
3.26
hadoop_LongLong_set_rdh
/** * Set the values. */ LongLong set(long d0, long d1) { this.d0 = d0; this.d1 = d1; return this; }
3.26
hadoop_LongLong_and_rdh
/** * And operation (&). */ long and(long mask) { return d0 & mask; }
3.26
hadoop_LongLong_multiplication_rdh
/** * Compute a*b and store the result to r. * * @return r */ static LongLong multiplication(final LongLong r, final long a, final long b) { /* final long x0 = a & LOWER_MASK; final long x1 = (a & UPPER_MASK) >> MID; final long y0 = b & LOWER_MASK; final long y1 = (b & UPPER_MASK) >> MID; fina...
3.26
hadoop_LongLong_plusEqual_rdh
/** * Plus equal operation (+=). */ LongLong plusEqual(LongLong that) { this.d0 += that.d0; this.d1 += that.d1; return this; }
3.26
hadoop_LongLong_toBigInteger_rdh
/** * Convert this to a BigInteger. */ BigInteger toBigInteger() { return BigInteger.valueOf(d1).shiftLeft(BITS_PER_LONG).add(BigInteger.valueOf(d0)); }
3.26
hadoop_LongLong_shiftRight_rdh
/** * Shift right operation (>>). */ long shiftRight(int n) { return (d1 << (BITS_PER_LONG - n)) + (d0 >>> n); }
3.26
hadoop_LongLong_toString_rdh
/** * {@inheritDoc } */ @Override public String toString() { final int remainder = BITS_PER_LONG % 4; return String.format("%x*2^%d + %016x", d1 << remainder, BITS_PER_LONG - remainder, d0); }
3.26
hadoop_RemoteEditLogManifest_checkState_rdh
/** * Check that the logs are non-overlapping sequences of transactions, * in sorted order. They do not need to be contiguous. * * @throws IllegalStateException * if incorrect */private void checkState() { Preconditions.checkNotNull(logs); RemoteEditLog prev = null; for (RemoteEditLog log : log...
3.26
hadoop_ZKSignerSecretProvider_createCuratorClient_rdh
/** * This method creates the Curator client and connects to ZooKeeper. * * @param config * configuration properties * @return A Curator client */ protected CuratorFramework createCuratorClient(Properties config) { String connectionString = config.getProperty(ZOOKEEPER_CONNECTION_STRING, "localhost:2181"); Stri...
3.26
hadoop_ZKSignerSecretProvider_generateZKData_rdh
/** * Serialize the data to attempt to push into ZooKeeper. The format is this: * <p> * [DATA_VERSION, newSecretLength, newSecret, currentSecretLength, currentSecret, previousSecretLength, previousSecret, nextRolloverDate] * <p> * Only previousSecret can be null, in which case the format looks like this: * <p> ...
3.26
hadoop_ZKSignerSecretProvider_m0_rdh
/** * Pushes proposed data to ZooKeeper. If a different server pushes its data * first, it gives up. * * @param newSecret * The new secret to use * @param currentSecret * The current secret * @param previousSecret * The previous secret */ private synchronized void m0(byte[] newSecret, byte[] currentSec...
3.26
hadoop_ZKSignerSecretProvider_pullFromZK_rdh
/** * Pulls data from ZooKeeper. If isInit is false, it will only parse the * next secret and version. If isInit is true, it will also parse the current * and previous secrets, and the next rollover date; it will also init the * secrets. Hence, isInit should only be true on startup. * * @param isInit * see ...
3.26
hadoop_ZKSignerSecretProvider_destroy_rdh
/** * Disconnects from ZooKeeper unless told not to. */ @Override public void destroy() { if (shouldDisconnect && (client != null)) { client.close(); } super.destroy(); }
3.26
hadoop_TaskContainerDefinition_withDurationLegacy_rdh
/** * Also support "duration.ms" for backward compatibility. * * @param jsonTask * the json representation of the task. * @param key * The json key. * @return the builder */ public Builder withDurationLegacy(Map<String, String> jsonTask, String key) { if (jsonTask.containsKey(key)) { this.durati...
3.26
hadoop_HHUtil_findFirstValidInput_rdh
/** * Find the valid input from all the inputs. * * @param <T> * Generics Type T. * @param inputs * input buffers to look for valid input * @return the first valid input */ public static <T> T findFirstValidInput(T[] inputs) { for (T input : inputs) { if (input != null) { return input; } } t...
3.26
hadoop_Validate_checkRequired_rdh
/** * Validates that the expression (that checks a required field is present) is true. * * @param isPresent * indicates whether the given argument is present. * @param argName * the name of the argument being validated. */ public static void checkRequired(boolean isPresent, String argName) { checkArgumen...
3.26
hadoop_Validate_checkNotNullAndNumberOfElements_rdh
/** * Validates that the given set is not null and has an exact number of items. * * @param <T> * the type of collection's elements. * @param collection * the argument reference to validate. * @param numElements * the expected number of elements in the collection. * @param argName * the name of the ar...
3.26
hadoop_Validate_checkGreater_rdh
/** * Validates that the first value is greater than the second value. * * @param value1 * the first value to check. * @param value1Name * the name of the first argument. * @param value2 * the second value to check. * @param value2Name * the name of the second argument. */ public static void checkGre...
3.26
hadoop_Validate_checkNotNegative_rdh
/** * Validates that the given integer argument is not negative. * * @param value * the argument value to validate * @param argName * the name of the argument being validated. */ public static void checkNotNegative(long value, String argName) { checkArgument(value >= 0, "'%s' must not be negative.", arg...
3.26
hadoop_Validate_checkIntegerMultiple_rdh
/** * Validates that the first value is an integer multiple of the second value. * * @param value1 * the first value to check. * @param value1Name * the name of the first argument. * @param value2 * the second value to check. * @param value2Name * the name of the second argument. */ public static voi...
3.26
hadoop_Validate_checkPositiveInteger_rdh
/** * Validates that the given integer argument is not zero or negative. * * @param value * the argument value to validate * @param argName * the name of the argument being validated. */ public static void checkPositiveInteger(long value, String argName) { checkArgument(value > 0, "'%s' must be a positi...
3.26
hadoop_Validate_checkGreaterOrEqual_rdh
/** * Validates that the first value is greater than or equal to the second value. * * @param value1 * the first value to check. * @param value1Name * the name of the first argument. * @param value2 * the second value to check. * @param value2Name * the name of the second argument. */ public static v...
3.26
hadoop_Validate_checkWithinRange_rdh
/** * Validates that the given value is within the given range of values. * * @param value * the value to check. * @param valueName * the name of the argument. * @param minValueInclusive * inclusive lower limit for the value. * @param maxValueInclusive * inclusive upper limit for the value. */ public...
3.26
hadoop_Validate_checkValuesEqual_rdh
/** * Validates that the given two values are equal. * * @param value1 * the first value to check. * @param value1Name * the name of the first argument. * @param value2 * the second value to check. * @param value2Name * the name of the second argument. */ public static void checkValuesEqual(long valu...
3.26
hadoop_Validate_checkLessOrEqual_rdh
/** * Validates that the first value is less than or equal to the second value. * * @param value1 * the first value to check. * @param value1Name * the name of the first argument. * @param value2 * the second value to check. * @param value2Name * the name of the second argument. */ public static void...
3.26
hadoop_Validate_checkNotNull_rdh
/** * Validates that the given reference argument is not null. * * @param obj * the argument reference to validate. * @param argName * the name of the argument being validated. */ public static void checkNotNull(Object obj, String argName) { checkArgument(obj != null, "'%s' must not be null.", argName); ...
3.26
hadoop_Validate_checkPathExists_rdh
/** * Validates that the given path exists. * * @param path * the path to check. * @param argName * the name of the argument being validated. */ public static void checkPathExists(Path path, String argName) { checkNotNull(path, argName); checkArgument(Files.exists(path), "Path %s (%s) does not exist....
3.26
hadoop_Validate_checkPathExistsAsDir_rdh
/** * Validates that the given path exists and is a directory. * * @param path * the path to check. * @param argName * the name of the argument being validated. */ public static void checkPathExistsAsDir(Path path, String argName) { checkPathExists(path, argName); checkArgument(Files.isDirectory(path...
3.26
hadoop_Validate_checkPathExistsAsFile_rdh
/** * Validates that the given path exists and is a file. * * @param path * the path to check. * @param argName * the name of the argument being validated. */public static void checkPathExistsAsFile(Path path, String argName) { checkPathExists(path, argName); checkArgument(Files.isRegularFile(path),...
3.26
hadoop_Validate_checkValid_rdh
/** * Validates that the expression (that checks a field is valid) is true. * * @param isValid * indicates whether the given argument is valid. * @param argName * the name of the argument being validated. */ public static void checkValid(boolean isValid, String argName) { checkArgument(isValid, "'%s' is ...
3.26
hadoop_Validate_checkNotNullAndNotEmpty_rdh
/** * Validates that the given buffer is not null and has non-zero capacity. * * @param <T> * the type of iterable's elements. * @param iter * the argument reference to validate. * @param argName * the name of the argument being validated. */ public static <T> void checkNotNullAndNotEmpty(Iterable<T> ite...
3.26
hadoop_StagingCommitter_getConflictResolutionMode_rdh
/** * Returns the {@link ConflictResolution} mode for this commit. * * @param context * the JobContext for this commit * @param fsConf * filesystem config * @return the ConflictResolution mode */ public final ConflictResolution getConflictResolutionMode(JobContext context, Configuration fsConf) { if (confli...
3.26
hadoop_StagingCommitter_createWrappedCommitter_rdh
/** * Create the wrapped committer. * This includes customizing its options, and setting up the destination * directory. * * @param context * job/task context. * @param conf * config * @return the inner committer * @throws IOException * on a failure */ protected FileOutputCommitter createWrappedCommit...
3.26
hadoop_StagingCommitter_getJobPath_rdh
/** * Compute the path under which all job attempts will be placed. * * @return the path to store job attempt data. */ protected Path getJobPath() {return getPendingJobAttemptsPath(commitsDirectory); }
3.26
hadoop_StagingCommitter_getFinalPath_rdh
/** * Returns the final S3 location for a relative path as a Hadoop {@link Path}. * This is a final method that calls {@link #getFinalKey(String, JobContext)} * to determine the final location. * * @param relative * the path of a file relative to the task attempt path * @param context * the JobContext or Ta...
3.26
hadoop_StagingCommitter_deleteTaskWorkingPathQuietly_rdh
/** * Delete the working path of a task; no-op if there is none, that * is: this is a job. * * @param context * job/task context */ protected void deleteTaskWorkingPathQuietly(JobContext context) { ignoreIOExceptions(LOG, "Delete working path", "", () -> { Path path = buildWorkPath(context, getUUID());if (pa...
3.26
hadoop_StagingCommitter_m3_rdh
/** * Generate a {@link PathExistsException} because the destination exists. * Lists some of the child entries first, to help diagnose the problem. * * @param path * path which exists * @param description * description (usually task/job ID) * @return an exception to throw */ protected PathExistsException m...
3.26
hadoop_StagingCommitter_listPendingUploadsToCommit_rdh
/** * Get the list of pending uploads for this job attempt. * * @param commitContext * job context * @return a list of pending uploads. * @throws IOException * Any IO failure */ @Override protected ActiveCommit listPendingUploadsToCommit(CommitContext commitContext) throws IOException { return listPending...
3.26
hadoop_StagingCommitter_getConfictModeOption_rdh
/** * Get the conflict mode option string. * * @param context * context with the config * @param fsConf * filesystem config * @param defVal * default value. * @return the trimmed configuration option, upper case. */ public static String getConfictModeOption(JobContext context, Configuration fsConf, Stri...
3.26
hadoop_StagingCommitter_m2_rdh
/** * Compute the path where the output of a committed task is stored until the * entire job is committed for a specific application attempt. * * @param appAttemptId * the ID of the application attempt to use * @param context * the context of any task. * @return the path where the output of a committed task...
3.26
hadoop_StagingCommitter_setupJob_rdh
/** * Set up the job, including calling the same method on the * wrapped committer. * * @param context * job context * @throws IOException * IO failure. */ @Override public void setupJob(JobContext context) throws IOException { super.setupJob(context); wrappedCommitter.setupJob(context); }
3.26
hadoop_StagingCommitter_deleteDestinationPaths_rdh
/** * Delete the working paths of a job. * <ol> * <li>{@code $dest/__temporary}</li> * <li>the local working directory for staged files</li> * </ol> * Does not attempt to clean up the work of the wrapped committer. * * @param context * job context * @throws IOException * IO failure */protected void ...
3.26
hadoop_StagingCommitter_buildWorkPath_rdh
/** * Get the work path for a task. * * @param context * job/task complex * @param uuid * UUID * @return a path or null if the context is not of a task * @throws IOException * failure to build the path */ private static Path buildWorkPath(JobContext context, String uuid) throws IOException { if (con...
3.26