Package org.apache.hadoop.fs.http.server
Class FSOperations.FSTruncate
java.lang.Object
org.apache.hadoop.fs.http.server.FSOperations.FSTruncate
- All Implemented Interfaces:
FileSystemAccess.FileSystemExecutor<org.json.simple.JSONObject>
- Enclosing class:
- FSOperations
@Private
public static class FSOperations.FSTruncate
extends Object
implements FileSystemAccess.FileSystemExecutor<org.json.simple.JSONObject>
Executor that performs a truncate FileSystemAccess files system operation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.json.simple.JSONObjectexecute(org.apache.hadoop.fs.FileSystem fs) Executes the filesystem operation.
-
Constructor Details
-
FSTruncate
Creates a Truncate executor.- Parameters:
path- target path to truncate to.newLength- The size the file is to be truncated to.
-
-
Method Details
-
execute
Executes the filesystem operation.- Specified by:
executein interfaceFileSystemAccess.FileSystemExecutor<org.json.simple.JSONObject>- Parameters:
fs- filesystem instance to use.- Returns:
trueif the file has been truncated to the desired,falseif a background process of adjusting the length of the last block has been started, and clients should wait for it to complete before proceeding with further file updates.- Throws:
IOException- thrown if an IO error occurred.
-