name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hadoop_RemoteMethod_m0_rdh
/** * Get the interface/protocol for this method. For example, ClientProtocol or * NamenodeProtocol. * * @return Protocol for this method. */ public Class<?> m0() { return this.protocol; }
3.26
hadoop_RemoteMethod_getTypes_rdh
/** * Get the calling types for this method. * * @return An array of calling types. */ public Class<?>[] getTypes() { return Arrays.copyOf(this.types, this.types.length); }
3.26
hadoop_RemoteMethod_getMethodName_rdh
/** * Get the name of the method. * * @return Name of the method. */ public String getMethodName() { return this.methodName; }
3.26
hadoop_FederationPolicyInitializationContext_setHomeSubcluster_rdh
/** * Sets in the context the home sub-cluster. Useful for default policy * behaviors. * * @param homeSubcluster * value to set. */ public void setHomeSubcluster(SubClusterId homeSubcluster) { this.homeSubcluster = homeSubcluster; }
3.26
hadoop_FederationPolicyInitializationContext_setFederationStateStoreFacade_rdh
/** * Setter for the {@link FederationStateStoreFacade}. * * @param federationStateStoreFacade * the facade. */public void setFederationStateStoreFacade(FederationStateStoreFacade federationStateStoreFacade) { this.federationStateStoreFacade = federationStateStoreFacade; }
3.26
hadoop_FederationPolicyInitializationContext_setSubClusterPolicyConfiguration_rdh
/** * Setter for the {@link SubClusterPolicyConfiguration}. * * @param fedPolicyConfiguration * the {@link SubClusterPolicyConfiguration} to * be used for initialization. */ public void setSubClusterPolicyConfiguration(SubClusterPolicyConfiguration fedPolicyConfiguration) { this.federationPolicyConfigurat...
3.26
hadoop_FederationPolicyInitializationContext_setFederationSubclusterResolver_rdh
/** * Setter for the {@link SubClusterResolver}. * * @param federationSubclusterResolver * the {@link SubClusterResolver} to be * used for initialization. */ public void setFederationSubclusterResolver(SubClusterResolver federationSubclusterResolver) { this.federationSubclusterResolver = federationSub...
3.26
hadoop_FederationPolicyInitializationContext_getHomeSubcluster_rdh
/** * Returns the current home sub-cluster. Useful for default policy behaviors. * * @return the home sub-cluster. */ public SubClusterId getHomeSubcluster() { return homeSubcluster; }
3.26
hadoop_FederationPolicyInitializationContext_getFederationStateStoreFacade_rdh
/** * Getter for the {@link FederationStateStoreFacade}. * * @return the facade. */ public FederationStateStoreFacade getFederationStateStoreFacade() { return federationStateStoreFacade; }
3.26
hadoop_StripedReconstructor_initDecoderIfNecessary_rdh
// Initialize decoder protected void initDecoderIfNecessary() { if (decoder == null) { decoder = CodecUtil.createRawDecoder(conf, ecPolicy.getCodecName(), coderOptions); } }
3.26
hadoop_StripedReconstructor_initDecodingValidatorIfNecessary_rdh
// Initialize decoding validator protected void initDecodingValidatorIfNecessary() { if (isValidationEnabled && (validator == null)) { validator = new DecodingValidator(decoder); } }
3.26
hadoop_StripedReconstructor_getXmits_rdh
/** * Get the xmits that _will_ be used for this reconstruction task. */ int getXmits() { return stripedReader.getXmits(); }
3.26
hadoop_ReservationClientUtil_createMRReservation_rdh
/** * Creates a request that envelopes a MR jobs, picking max number of maps and * reducers, max durations, and max resources per container. * * @param reservationId * the id of the reservation * @param name * the name of a reservation * @param maxMapRes * maximum resources used by any mapper * @param n...
3.26
hadoop_AuthenticationFilterInitializer_initFilter_rdh
/** * Initializes hadoop-auth AuthenticationFilter. * <p> * Propagates to hadoop-auth AuthenticationFilter configuration all Hadoop * configuration properties prefixed with "hadoop.http.authentication." * * @param container * The filter container * @param conf * Configuration for run-time parameters */ @O...
3.26
hadoop_SelectBinding_buildCsvInput_rdh
/** * Build the CSV input format for a request. * * @param ownerConf * FS owner configuration * @param builderOptions * options on the specific request * @return the input format * @throws IllegalArgumentException * argument failure * @throws IOException * validation failure */ public InputSerializa...
3.26
hadoop_SelectBinding_expandBackslashChars_rdh
/** * Perform escaping. * * @param src * source string. * @return the replaced value */ static String expandBackslashChars(String src) { return // backslash substitution must come last src.replace("\\n", "\n").replace("\\\"", "\"").replace("\\t", "\t").replace("\\r", "\r").replace("\\\"", "\"").replace...
3.26
hadoop_SelectBinding_m0_rdh
/** * Build and execute a select request. * * @param readContext * the read context, which includes the source path. * @param expression * the SQL expression. * @param builderOptions * query options * @param objectAttributes * object attributes from a HEAD request * @return an FSDataInputStream whose...
3.26
hadoop_SelectBinding_buildRequest_rdh
/** * Build the select request from the configuration built up * in {@code S3AFileSystem.openFile(Path)} and the default * options in the cluster configuration. * * Options are picked up in the following order. * <ol> * <li> Options in {@code openFileOptions}.</li> * <li> Options in the owning filesystem co...
3.26
hadoop_SelectBinding_isSelectEnabled_rdh
/** * Static probe for select being enabled. * * @param conf * configuration * @return true iff select is enabled. */ public static boolean isSelectEnabled(Configuration conf) { return conf.getBoolean(FS_S3A_SELECT_ENABLED, true); }
3.26
hadoop_SelectBinding_toString_rdh
/** * Stringify the given SelectObjectContentRequest, as its * toString() operator doesn't. * * @param request * request to convert to a string * @return a string to print. Does not contain secrets. */ public static String toString(final SelectObjectContentRequest request) { StringBuilder sb = new StringB...
3.26
hadoop_SelectBinding_executeSelect_rdh
/** * Execute the select request. * * @param readContext * read context * @param objectAttributes * object attributes from a HEAD request * @param builderOptions * the options which came in from the openFile builder. * @param request * the built up select request. * @return a SelectInputStream * @th...
3.26
hadoop_SelectBinding_xopt_rdh
/** * Get an option with backslash arguments transformed. * These are not trimmed, so whitespace is significant. * * @param selectOpts * options in the select call * @param fsConf * filesystem conf * ...
3.26
hadoop_SelectBinding_buildCSVOutput_rdh
/** * Build CSV output format for a request. * * @param ownerConf * FS owner configuration * @param builderOptions * options on the specific request * @return the output format * @throws IllegalArgumentException * argument failure * @throws IOException * validation failure */ public OutputSerializat...
3.26
hadoop_SelectBinding_buildSelectRequest_rdh
/** * Build a select request. * * @param path * source path. * @param expression * the SQL expression. * @param builderOptions * config to extract other query options from * @return the request to serve * @throws IllegalArgumentException * argument failure * @throws IOException * problem building...
3.26
hadoop_SelectBinding_opt_rdh
/** * Resolve an option. * * @param builderOptions * the options which came in from the openFile builder. * @param fsConf * configuration of the owning FS. * @param base * base option (no s3a: prefix) * @param defVal * default value. Must not be null. * @param trim * should the result be trimmed. ...
3.26
hadoop_SelectBinding_isEnabled_rdh
/** * Is the service supported? * * @return true iff select is enabled. */ public boolean isEnabled() { return enabled; }
3.26
hadoop_CommitContext_getSinglePendingFileSerializer_rdh
/** * Get a serializer for .pending files. * * @return a serializer. */ public JsonSerialization<SinglePendingCommit> getSinglePendingFileSerializer() { return singleCommitSerializer.getForCurrentThread(); }
3.26
hadoop_CommitContext_buildSubmitters_rdh
/** * Build the submitters and thread pools if the number of committerThreads * is greater than zero. * This should only be called in constructors; it is synchronized to keep * SpotBugs happy. */ private synchronized void buildSubmitters() { if (committerThreads != 0) { outerSubmitter = new Poo...
3.26
hadoop_CommitContext_getJobId_rdh
/** * Get the job ID. * * @return job ID. */ public String getJobId() { return jobId; }
3.26
hadoop_CommitContext_isCollectIOStatistics_rdh
/** * Collecting thread level IO statistics? * * @return true if thread level IO stats should be collected. */ public boolean isCollectIOStatistics() { return collectIOStatistics; }
3.26
hadoop_CommitContext_m0_rdh
/** * IOStatistics context of the created thread. * * @return the IOStatistics. */ public IOStatisticsContext m0() { return ioStatisticsContext; }
3.26
hadoop_CommitContext_getPendingSetSerializer_rdh
/** * Get a serializer for .pendingset files. * * @return a serializer. */ public JsonSerialization<PendingSet> getPendingSetSerializer() { return pendingSetSerializer.getForCurrentThread(); }
3.26
hadoop_CommitContext_abortMultipartCommit_rdh
/** * See {@link CommitOperations#abortMultipartCommit(String, String)}.. * * @param destKey * destination key * @param uploadId * upload to cancel * @throws FileNotFoundException * if the abort ID is unknown * @throws IOException * on any failure */ public void abortMultipartCommit(final String dest...
3.26
hadoop_CommitContext_destroyThreadPools_rdh
/** * Destroy any thread pools; wait for that to finish, * but don't overreact if it doesn't finish in time. */private synchronized void destroyThreadPools() { try { IOUtils.cleanupWithLogger(LOG, outerSubmitter, innerSubmitter); } finally { outerSubmitter = null; innerS...
3.26
hadoop_CommitContext_getOuterSubmitter_rdh
/** * Return a submitter. * If created with 0 threads, this returns null so * TaskPool knows to run it in the current thread. * * @return a submitter or null */ public synchronized Submitter getOuterSubmitter() { return outerSubmitter; }
3.26
hadoop_CommitContext_revertCommit_rdh
/** * See {@link CommitOperations#revertCommit(SinglePendingCommit)}. * * @param commit * pending commit * @throws IOException * failure */ public void revertCommit(final SinglePendingCommit commit) throws IOException { commitOperations.revertCommit(commit); }
3.26
hadoop_CommitContext_getJobContext_rdh
/** * Job Context. * * @return job context. */ public JobContext getJobContext() { return jobContext; }
3.26
hadoop_CommitContext_submit_rdh
/** * Forward to the submitter, wrapping in task * context setting, so as to ensure that all operations * have job/task attributes. * * @param task * task to execute * @return the future. */ @Override public Future<?> submit(Runnable task) { return executor.submit(() -> { auditContextUpdater.updateCurren...
3.26
hadoop_CommitContext_commit_rdh
/** * Commit a single pending commit; exceptions are caught * and converted to an outcome. * See {@link CommitOperations#commit(SinglePendingCommit, String)}. * * @param commit * entry to commit * @param origin * origin path/string for outcome text * @return the outcome */ public MaybeIOE commit(SinglePen...
3.26
hadoop_CommitContext_commitOrFail_rdh
/** * Commit the operation, throwing an exception on any failure. * See {@code CommitOperations#commitOrFail(SinglePendingCommit)}. * * @param commit * commit to execute * @throws IOException * on a failure */public void commitOrFail(SinglePendingCommit commit) throws IOException { commitOperations.comm...
3.26
hadoop_CommitContext_getConf_rdh
/** * Job configuration. * * @return configuration (never null) */ public Configuration getConf() { return conf; }
3.26
hadoop_CommitContext_maybeResetIOStatisticsContext_rdh
/** * Reset the IOStatistics context if statistics are being * collected. * Logs at info. */ public void maybeResetIOStatisticsContext() { if (collectIOStatistics) { LOG.info("Resetting IO statistics context {}", ioStatisticsContext.getID()); ...
3.26
hadoop_CommitContext_switchToIOStatisticsContext_rdh
/** * Switch to the context IOStatistics context, * if needed. */ public void switchToIOStatisticsContext() { IOStatisticsContext.setThreadIOStatisticsContext(ioStatisticsContext); }
3.26
hadoop_CommitContext_getInnerSubmitter_rdh
/** * Return a submitter. As this pool is used less often, * create it on demand. * If created with 0 threads, this returns null so * TaskPool knows to run it in the current thread. * * @return a submitter or null */ public synchronized Submitter getInnerSubmitter() { if ((innerSubmitter == null) && (committ...
3.26
hadoop_MountTableStoreImpl_m0_rdh
/** * Check parent path permission recursively. It needs WRITE permission * of the nearest parent entry and other EXECUTE permission. * * @param src * mount entry being checked * @throws AccessControlException * if mount table cannot be accessed */ private void m0(final String src) throws IOException { ...
3.26
hadoop_MountTableStoreImpl_checkMountTableEntryPermission_rdh
/** * Whether a mount table entry can be accessed by the current context. * * @param src * mount entry being accessed * @param action * type of action being performed on the mount entry * @throws AccessControlException * if mount table cannot be accessed */ private void checkMountTableEntryPermission(Str...
3.26
hadoop_NMContainerStatus_getAllocationTags_rdh
/** * Get and set the Allocation tags associated with the container. * * @return Allocation tags. */ public Set<String> getAllocationTags() { return Collections.emptySet(); }
3.26
hadoop_NMContainerStatus_getExecutionType_rdh
/** * Get the <code>ExecutionType</code> of the container. * * @return <code>ExecutionType</code> of the container */ public ExecutionType getExecutionType() { return ExecutionType.GUARANTEED; }
3.26
hadoop_NMContainerStatus_newInstance_rdh
// Used by tests only public static NMContainerStatus newInstance(ContainerId containerId, int version, ContainerState containerState, Resource allocatedResource, String diagnostics, int containerExitStatus, Priority priority, long creationTime) { return newInstance(containerId, version, containerState, allocatedR...
3.26
hadoop_WorkReport_getRetry_rdh
/** * * @return Number of unsuccessful attempts to process work. */ public int getRetry() { return retry; }
3.26
hadoop_WorkReport_getException_rdh
/** * * @return Exception thrown while processing work. */ public Exception getException() { return exception; }
3.26
hadoop_WorkReport_getSuccess_rdh
/** * * @return True if the work was processed successfully. */ public boolean getSuccess() { return success; }
3.26
hadoop_BlockStorageMovementNeeded_markScanCompleted_rdh
/** * Mark directory scan is completed. */ public synchronized void markScanCompleted() { this.fullyScanned = true; }
3.26
hadoop_BlockStorageMovementNeeded_get_rdh
/** * Gets the satisfier files for which block storage movements check necessary * and make the movement if required. * * @return satisfier files */ public synchronized ItemInfo get() { return storageMovementNeeded.poll(); }
3.26
hadoop_BlockStorageMovementNeeded_add_rdh
/** * Add the itemInfo to tracking list for which storage movement expected if * necessary. * * @param itemInfo * - child in the directory * @param scanCompleted * -Indicates whether the ItemInfo start id directory has no more * elements to scan. */ @VisibleForTesting public synchronized void add(ItemInf...
3.26
hadoop_BlockStorageMovementNeeded_removeItemTrackInfo_rdh
/** * Decrease the pending child count for directory once one file blocks moved * successfully. Remove the SPS xAttr if pending child count is zero. */ public synchronized void removeItemTrackInfo(ItemInfo trackInfo, boolean isSuccess) throws IOException { if (trackInfo.isDir()) { // If track is part of some s...
3.26
hadoop_BlockStorageMovementNeeded_clearQueuesWithNotification_rdh
/** * Clean all the movements in spsDirsToBeTraveresed/storageMovementNeeded * and notify to clean up required resources. */ public synchronized void clearQueuesWithNotification() { // Remove xAttr from directories Long trackId; while ((trackId = ctxt.getNextSPSPath()) != null) { try {// Remove xAttr for file ...
3.26
hadoop_BlockStorageMovementNeeded_m0_rdh
/** * Return true if all the pending work is done and directory fully * scanned, otherwise false. */ public synchronized boolean m0() { return (pendingWorkCount <= 0) && fullyScanned; }
3.26
hadoop_BlockStorageMovementNeeded_addPendingWorkCount_rdh
/** * Increment the pending work count for directory. */ public synchronized void addPendingWorkCount(int count) {this.pendingWorkCount = this.pendingWorkCount + count; }
3.26
hadoop_BlockStorageMovementNeeded_size_rdh
/** * Returns queue size. */ public synchronized int size() { return storageMovementNeeded.size(); }
3.26
hadoop_BlockStorageMovementNeeded_decrementPendingWorkCount_rdh
/** * Decrement the pending work count for directory one track info is * completed. */ public synchronized void decrementPendingWorkCount() {this.pendingWorkCount--; }
3.26
hadoop_BlockStorageMovementNeeded_addAll_rdh
/** * Add the itemInfo list to tracking list for which storage movement expected * if necessary. * * @param startPath * - start path * @param itemInfoList * - List of child in the directory * @param scanCompleted * -Indicates whether the start id directory has no more elements to * scan. */ @VisibleF...
3.26
hadoop_FSDirAppendOp_computeQuotaDeltaForUCBlock_rdh
/** * Compute quota change for converting a complete block to a UC block. */ private static QuotaCounts computeQuotaDeltaForUCBlock(FSNamesystem fsn, INodeFile file) { final QuotaCounts delta = new QuotaCounts.Builder().build(); final BlockInfo lastBlock = file.getLastBlock(); if (lastBlock != null) { ...
3.26
hadoop_FSDirAppendOp_appendFile_rdh
/** * Append to an existing file. * <p> * * The method returns the last block of the file if this is a partial block, * which can still be used for writing more data. The client uses the * returned block locations to form the data pipeline for this block.<br> * The {@link LocatedB...
3.26
hadoop_FSDirAppendOp_prepareFileForAppend_rdh
/** * Convert current node to under construction. * Recreate in-memory lease record. * * @param fsn * namespace * @param iip * inodes in the path containing the file * @param leaseHolder * identifier of the lease holder on this file * @param clientMachine * identifier of the client machine * @param ...
3.26
hadoop_CommitterEventHandler_touchz_rdh
// If job commit is repeatable, then we should allow // startCommitFile/endCommitSuccessFile/endCommitFailureFile to be written // by other AM before. private void touchz(Path p, boolean overwrite) throws IOException { fs.create(p, overwrite).close(); }
3.26
hadoop_OBSWriteOperationHelper_writeSuccessful_rdh
/** * Callback on a successful write. * * @param destKey * object key */ void writeSuccessful(final String destKey) { LOG.debug("Finished write to {}", destKey); }
3.26
hadoop_OBSWriteOperationHelper_completeMultipartUpload_rdh
/** * Complete a multipart upload operation. * * @param destKey * Object key * @param uploadId * multipart operation Id * @param partETags * list of partial uploads * @return the result * @throws ObsException * on problems. */ CompleteMultipartUploadResult completeMultipartUpload(final String destKe...
3.26
hadoop_OBSWriteOperationHelper_putObject_rdh
/** * PUT an object directly (i.e. not via the transfer manager). * * @param putObjectRequest * the request * @return the upload initiated * @throws IOException * on problems */ PutObjectResult putObject(final PutObjectRequest putObjectRequest) throws IOException { try { return OBSCommonUtils....
3.26
hadoop_OBSWriteOperationHelper_newUploadPartRequest_rdh
/** * Create request for uploading one part of a multipart task. * * @param destKey * destination object key * @param uploadId * upload id * @param partNumber * part number * @param size * data size * @param uploadStream * upload stream for the part * @return part upload request */ UploadPartReq...
3.26
hadoop_OBSWriteOperationHelper_m0_rdh
/** * Create a {@link PutObjectRequest} request. If {@code length} is set, the * metadata is configured with the size of the upload. * * @param destKey * key of object * @param inputStream * source data * @param length * size, if known. Use -1 for not known * @return the request */ PutObjectRequest m0(...
3.26
hadoop_OBSWriteOperationHelper_newPutRequest_rdh
/** * Create a {@link PutObjectRequest} request to upload a file. * * @param destKey * object key for request * @param sourceFile * source file * @return the request */ PutObjectRequest newPutRequest(final String destKey, final File sourceFile) { int length = ((int) (sourceFile.length())); return O...
3.26
hadoop_OBSWriteOperationHelper_newObjectMetadata_rdh
/** * Create a new object metadata instance. Any standard metadata headers are * added here, for example: encryption. * * @param length * size, if known. Use -1 for not known * @return a new metadata instance */ public ObjectMetadata newObjectMetadata(final long length) { return OBSObjectBucketUtils.newObjectM...
3.26
hadoop_GetClusterNodeLabelsResponsePBImpl_setNodeLabels_rdh
/** * * @deprecated Use {@link #setNodeLabelList(List)} instead. */ @Override @Deprecated public void setNodeLabels(Set<String> labels) { List<NodeLabel> list = new ArrayList<>(); for (String s : labels) { list.add(NodeLabel.newInstance(s)); } setNodeLabelList(list); }
3.26
hadoop_ValidateRenamedFilesStage_addFileCommitted_rdh
/** * Add a file entry to the list of committed files. * * @param entry * entry */ private synchronized void addFileCommitted(FileEntry entry) { filesCommitted.add(entry); }
3.26
hadoop_ValidateRenamedFilesStage_getFilesCommitted_rdh
/** * Get the list of files committed. * * @return a possibly empty list. */ private synchronized List<FileEntry> getFilesCommitted() { return filesCommitted; }
3.26
hadoop_ValidateRenamedFilesStage_validateOneFile_rdh
/** * Validate a file. * * @param entry * entry to probe for * @throws IOException * IO problem. * @throws OutputValidationException * if the entry is not valid */ private void validateOneFile(FileEntry entry) throws IOException { updateAuditContext(OP_STAGE_JOB_VALIDATE_OUTPUT); // report progre...
3.26
hadoop_ErasureCoderOptions_allowVerboseDump_rdh
/** * Allow dump verbose debug info or not. * * @return true if verbose debug info is desired, false otherwise */public boolean allowVerboseDump() { return f1; }
3.26
hadoop_ErasureCoderOptions_getNumParityUnits_rdh
/** * The number of parity output units for the coding. A unit can be a byte, * chunk, buffer or even a block. * * @return count of parity output units */ public int getNumParityUnits() { return numParityUnits; }
3.26
hadoop_ErasureCoderOptions_getNumAllUnits_rdh
/** * The number of all the involved units in the coding. * * @return count of all the data units and parity units */ public int getNumAllUnits() { return numAllUnits; }
3.26
hadoop_ErasureCoderOptions_getNumDataUnits_rdh
/** * The number of data input units for the coding. A unit can be a byte, * chunk or buffer or even a block. * * @return count of data input units */ public int getNumDataUnits() { return f0; }
3.26
hadoop_ErasureCoderOptions_allowChangeInputs_rdh
/** * Allow changing input buffer content (not positions). Maybe better * performance if not allowed. * * @return true if allowing input content to be changed, false otherwise */ public boolean allowChangeInputs() { return allowChangeInputs; }
3.26
hadoop_ResourceInformation_getValue_rdh
/** * Integer value of the resource. * * @return value */ @ApiModelProperty("Integer value of the resource.") @JsonProperty("value") public Long getValue() { return value; }
3.26
hadoop_ResourceInformation_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_ResourceInformation_getUnit_rdh
/** * * @return unit */ @ApiModelProperty("") @JsonProperty("unit") public String getUnit() { return unit == null ? "" : unit; }
3.26
hadoop_OBSPosixBucketUtils_fsRemoveKeysByDepth_rdh
// Batch delete sub objects one depth by one depth to avoid that parents and // children in a same // batch. // A batch deletion might be split into some concurrent deletions to promote // the performance, but // it // can't make sure that an object is deleted before it's children. private static void fsRemoveKeysByDep...
3.26
hadoop_OBSPosixBucketUtils_fsDelete_rdh
// Recursively delete a folder that might be not empty. static boolean fsDelete(final OBSFileSystem owner, final FileStatus status, final boolean recursive) throws IOException, ObsException { long startTime = System.currentTimeMillis(); long threadId = Thread.currentThread().getId(); Path f = status.getPath(); String ...
3.26
hadoop_OBSPosixBucketUtils_fsCreateFolder_rdh
// Used to create a folder static void fsCreateFolder(final OBSFileSystem owner, final String objectName) throws ObsException { for (int retryTime = 1; retryTime < OBSCommonUtils.MAX_RETRY_TIME; retryTime++) { try { innerFsCreateFolder(owner, objectName); return; } catch (ObsException e) { LOG.warn("Failed to crea...
3.26
hadoop_OBSPosixBucketUtils_fsRenameToNewObject_rdh
/** * Used to rename a source object to a destination object which is not existed * before rename. * * @param owner * OBS File System instance * @param srcKey * source object key * @param dstKey * destination object key * @throws IOException * io exception */static void fsRenameToNewObject(final OBS...
3.26
hadoop_OBSPosixBucketUtils_fsRemoveFile_rdh
// Delete a file. private static int fsRemoveFile(final OBSFileSystem owner, final String sonObjectKey, final List<KeyAndVersion> files) throws IOException { files.add(new KeyAndVersion(sonObjectKey)); if (files.size() == owner.getMaxEntriesToDelete()) { // batch delete files. OBSCommonUtils.removeKeys(owner, files, tr...
3.26
hadoop_OBSPosixBucketUtils_renameBasedOnPosix_rdh
/** * The inner rename operation based on Posix bucket. * * @param owner * OBS File System instance * @param src * source path to be renamed from * @param dst * destination path to be renamed to * @return boolean * @throws RenameFailedException * if some criteria for a state changing rename * was ...
3.26
hadoop_OBSPosixBucketUtils_fsNonRecursivelyDelete_rdh
// List all sub objects at first, delete sub objects in batch secondly. private static void fsNonRecursivelyDelete(final OBSFileSystem owner, final Path parent) throws IOException, ObsException { // List sub objects sorted by path depth. FileStatus[] arFileStatus = OBSCommonUtils.innerListStatus(owner, parent, true);...
3.26
hadoop_OBSPosixBucketUtils_fsGetObjectKeyDepth_rdh
/** * Get the depth of an absolute path, that is the number of '/' in the path. * * @param key * object key * @return depth */ static int fsGetObjectKeyDepth(final String key) { int depth = 0; for (int idx = key.indexOf('/'); idx >= 0; idx = key.indexOf('/', idx + 1)) { depth++; } retur...
3.26
hadoop_OBSPosixBucketUtils_innerFsGetObjectStatus_rdh
// Used to get the status of a file or folder in a file-gateway bucket. static OBSFileStatus innerFsGetObjectStatus(final OBSFileSystem owner, final Path f) throws IOException { final Path path = OBSCommonUtils.qualify(owner, f); String key = OBSCommonUtils.pathToKey(owner, path); LOG.debug("Getting...
3.26
hadoop_OBSPosixBucketUtils_fsIsFolder_rdh
/** * Used to judge that an object is a file or folder. * * @param attr * posix object attribute * @return is posix folder */ static boolean fsIsFolder(final ObsFSAttribute attr) { final int ifDir = 0x4000; int mode = attr.getMode(); // object mode is -1 when the object is migrated from // obj...
3.26
hadoop_OBSPosixBucketUtils_fsRenameToNewFolder_rdh
/** * Used to rename a source folder to a destination folder that is not existed * before rename. * * @param owner * OBS File System instance * @param src * source folder key * @param dst * destination folder key that not existed before rename * @throws IOException * any io exception * @throws ObsEx...
3.26
hadoop_OBSPosixBucketUtils_fsRemoveSubdir_rdh
// Delete a sub dir. private static int fsRemoveSubdir(final OBSFileSystem owner, final String subdirKey, final List<KeyAndVersion> subdirList) throws IOException { fsRecursivelyDeleteDir(owner, subdirKey, false); subdirList.add(new KeyAndVersion(subdirKey)); if (subdirList.size() == owner.getMaxEntriesToDelete()) { //...
3.26
hadoop_TwoColumnLayout_preHead_rdh
/** * Do what needs to be done before the header is rendered. This usually * involves setting page variables for Javascript and CSS rendering. * * @param html * the html to use to render. */protected void preHead(Page.HTML<__> html) { }
3.26
hadoop_TwoColumnLayout_render_rdh
/** * A simpler two column layout implementation with a header, a navigation bar * on the left, content on the right, and a footer. Works with resizable themes. * * @see TwoColumnCssLayout */ @InterfaceAudience.LimitedPrivate({ "YARN", "MapReduce" })public class TwoColumnLayout extends HtmlPage { /* (non-Javad...
3.26
hadoop_TwoColumnLayout_header_rdh
/** * * @return the class that will render the header of the page. */ protected Class<? extends SubView> header() { return HeaderBlock.class; }
3.26