public static class NativeAzureFileSystem.FolderRenamePending
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
SUFFIX |
| Constructor | Description |
|---|---|
FolderRenamePending(java.lang.String srcKey,
java.lang.String dstKey,
SelfRenewingLease lease,
NativeAzureFileSystem fs) |
|
FolderRenamePending(org.apache.hadoop.fs.Path redoFile,
NativeAzureFileSystem fs) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
cleanup() |
Clean up after execution of rename.
|
void |
execute() |
Execute a folder rename.
|
java.lang.String |
getDstKey() |
|
org.apache.hadoop.fs.azure.FileMetadata[] |
getFiles() |
|
SelfRenewingLease |
getFolderLease() |
|
org.apache.hadoop.fs.azure.FileMetadata |
getSourceMetadata() |
|
java.lang.String |
getSrcKey() |
|
java.lang.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 java.lang.String SUFFIX
public FolderRenamePending(java.lang.String srcKey,
java.lang.String dstKey,
SelfRenewingLease lease,
NativeAzureFileSystem fs)
throws java.io.IOException
java.io.IOExceptionpublic FolderRenamePending(org.apache.hadoop.fs.Path redoFile,
NativeAzureFileSystem fs)
throws java.lang.IllegalArgumentException,
java.io.IOException
java.lang.IllegalArgumentExceptionjava.io.IOExceptionpublic org.apache.hadoop.fs.azure.FileMetadata[] getFiles()
public SelfRenewingLease getFolderLease()
public void writeFile(NativeAzureFileSystem fs) throws java.io.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.java.io.IOException - Thrown when fail to write file.public java.lang.String makeRenamePendingFileContents()
public java.lang.String getSrcKey()
public java.lang.String getDstKey()
public org.apache.hadoop.fs.azure.FileMetadata getSourceMetadata()
throws java.io.IOException
java.io.IOExceptionpublic void execute()
throws java.io.IOException
java.io.IOException - Thrown when fail to renaming.public void cleanup()
throws java.io.IOException
java.io.IOException - Thrown when fail to clean up.public void redo()
throws java.io.IOException
java.io.IOException - Thrown when fail to redo.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.