public static class NativeAzureFileSystem.FolderRenamePending extends Object
Constructor and Description |
---|
NativeAzureFileSystem.FolderRenamePending(org.apache.hadoop.fs.Path redoFile,
NativeAzureFileSystem fs) |
NativeAzureFileSystem.FolderRenamePending(String srcKey,
String dstKey,
SelfRenewingLease lease,
NativeAzureFileSystem fs) |
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Clean up after execution of rename.
|
void |
execute()
Execute a folder rename.
|
String |
getDstKey() |
org.apache.hadoop.fs.azure.FileMetadata[] |
getFiles() |
SelfRenewingLease |
getFolderLease() |
org.apache.hadoop.fs.azure.FileMetadata |
getSourceMetadata() |
String |
getSrcKey() |
String |
makeRenamePendingFileContents()
Return the contents of the JSON file to represent the operations
to be performed for a folder rename.
|
void |
redo()
Recover from a folder rename failure by redoing the intended work,
as recorded in the -RenamePending.json file.
|
void |
writeFile(org.apache.hadoop.fs.FileSystem fs)
Write to disk the information needed to redo folder rename,
in JSON format.
|
public static final String SUFFIX
public NativeAzureFileSystem.FolderRenamePending(String srcKey, String dstKey, SelfRenewingLease lease, NativeAzureFileSystem fs) throws IOException
IOException
public NativeAzureFileSystem.FolderRenamePending(org.apache.hadoop.fs.Path redoFile, NativeAzureFileSystem fs) throws IllegalArgumentException, IOException
IllegalArgumentException
IOException
public org.apache.hadoop.fs.azure.FileMetadata[] getFiles()
public SelfRenewingLease getFolderLease()
public void writeFile(org.apache.hadoop.fs.FileSystem fs) throws IOException
wasb://<sourceFolderPrefix>/folderName-RenamePending.json
The file format will be:
{
FormatVersion: "1.0",
OperationTime: "<YYYY-MM-DD HH:MM:SS.MMM>",
OldFolderName: "<key>",
NewFolderName: "<key>",
FileList: [ <string> , <string> , ... ]
}
Here's a sample:
{
FormatVersion: "1.0",
OperationUTCTime: "2014-07-01 23:50:35.572",
OldFolderName: "user/ehans/folderToRename",
NewFolderName: "user/ehans/renamedFolder",
FileList: [
"innerFile",
"innerFile2"
]
}
IOException
public String makeRenamePendingFileContents()
public String getSrcKey()
public String getDstKey()
public org.apache.hadoop.fs.azure.FileMetadata getSourceMetadata() throws IOException
IOException
public void execute() throws IOException
IOException
public void cleanup() throws IOException
IOException
public void redo() throws IOException
IOException
Copyright © 2019 Apache Software Foundation. All Rights Reserved.