public static class NativeAzureFileSystem.FolderRenamePending extends Object
| Constructor and Description |
|---|
FolderRenamePending(org.apache.hadoop.fs.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(NativeAzureFileSystem 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(org.apache.hadoop.fs.Path redoFile,
NativeAzureFileSystem fs)
throws IllegalArgumentException,
IOException
IllegalArgumentExceptionIOExceptionpublic org.apache.hadoop.fs.azure.FileMetadata[] getFiles()
public SelfRenewingLease getFolderLease()
public void writeFile(NativeAzureFileSystem 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"
]
} fs - file system on which a file is written.IOException - Thrown when fail to write file.public String makeRenamePendingFileContents()
public String getSrcKey()
public String getDstKey()
public org.apache.hadoop.fs.azure.FileMetadata getSourceMetadata()
throws IOException
IOExceptionpublic void execute()
throws IOException
IOException - Thrown when fail to renaming.public void cleanup()
throws IOException
IOException - Thrown when fail to clean up.public void redo()
throws IOException
IOException - Thrown when fail to redo.Copyright © 2008–2020 Apache Software Foundation. All rights reserved.