public static class NativeAzureFileSystem.FolderRenamePending extends Object
| Constructor and Description |
|---|
FolderRenamePending(Path redoFile,
NativeAzureFileSystem fs) |
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(FileSystem fs)
Write to disk the information needed to redo folder rename,
in JSON format.
|
public static final String SUFFIX
public FolderRenamePending(String srcKey, String dstKey, SelfRenewingLease lease, NativeAzureFileSystem fs) throws IOException
IOExceptionpublic FolderRenamePending(Path redoFile, NativeAzureFileSystem fs) throws IllegalArgumentException, IOException
IllegalArgumentExceptionIOExceptionpublic org.apache.hadoop.fs.azure.FileMetadata[] getFiles()
public SelfRenewingLease getFolderLease()
public void writeFile(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"
]
} IOExceptionpublic String makeRenamePendingFileContents()
public String getSrcKey()
public String getDstKey()
public org.apache.hadoop.fs.azure.FileMetadata getSourceMetadata() throws IOException
IOExceptionpublic void execute()
throws IOException
IOExceptionpublic void cleanup()
throws IOException
IOExceptionpublic void redo()
throws IOException
IOExceptionCopyright © 2018 CERN. All Rights Reserved.