@InterfaceAudience.Private public static class FSOperations.FSTruncate extends Object implements FileSystemAccess.FileSystemExecutor<org.json.simple.JSONObject>
| Constructor and Description | 
|---|
| FSTruncate(String path,
          long newLength)Creates a Truncate executor. | 
| Modifier and Type | Method and Description | 
|---|---|
| org.json.simple.JSONObject | execute(org.apache.hadoop.fs.FileSystem fs)Executes the filesystem operation. | 
public FSTruncate(String path, long newLength)
path - target path to truncate to.newLength - The size the file is to be truncated to.public org.json.simple.JSONObject execute(org.apache.hadoop.fs.FileSystem fs)
                                   throws IOException
execute in interface FileSystemAccess.FileSystemExecutor<org.json.simple.JSONObject>fs - filesystem instance to use.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.IOException - thrown if an IO error occurred.Copyright © 2008–2023 Apache Software Foundation. All rights reserved.