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 Details

    • FSTruncate

      public FSTruncate(String path, long newLength)
      Creates a Truncate executor.
      Parameters:
      path - target path to truncate to.
      newLength - The size the file is to be truncated to.
  • Method Details

    • execute

      public org.json.simple.JSONObject execute(org.apache.hadoop.fs.FileSystem fs) throws IOException
      Executes the filesystem operation.
      Specified by:
      execute in interface FileSystemAccess.FileSystemExecutor<org.json.simple.JSONObject>
      Parameters:
      fs - filesystem instance to use.
      Returns:
      true if the file has been truncated to the desired, false if 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.