|
@@ -268,7 +268,8 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
* "innerFile2"
|
|
|
* ]
|
|
|
* } }</pre>
|
|
|
- * @throws IOException
|
|
|
+ * @param fs file system on which a file is written.
|
|
|
+ * @throws IOException Thrown when fail to write file.
|
|
|
*/
|
|
|
public void writeFile(FileSystem fs) throws IOException {
|
|
|
Path path = getRenamePendingFilePath();
|
|
@@ -292,6 +293,8 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
/**
|
|
|
* Return the contents of the JSON file to represent the operations
|
|
|
* to be performed for a folder rename.
|
|
|
+ *
|
|
|
+ * @return JSON string which represents the operation.
|
|
|
*/
|
|
|
public String makeRenamePendingFileContents() {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
|
@@ -418,7 +421,7 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
* when everything is working normally. See redo() for the alternate
|
|
|
* execution path for the case where we're recovering from a folder rename
|
|
|
* failure.
|
|
|
- * @throws IOException
|
|
|
+ * @throws IOException Thrown when fail to renaming.
|
|
|
*/
|
|
|
public void execute() throws IOException {
|
|
|
|
|
@@ -472,7 +475,8 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
}
|
|
|
|
|
|
/** Clean up after execution of rename.
|
|
|
- * @throws IOException */
|
|
|
+ * @throws IOException Thrown when fail to clean up.
|
|
|
+ * */
|
|
|
public void cleanup() throws IOException {
|
|
|
|
|
|
if (fs.getStoreInterface().isAtomicRenameKey(srcKey)) {
|
|
@@ -496,7 +500,7 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
* Recover from a folder rename failure by redoing the intended work,
|
|
|
* as recorded in the -RenamePending.json file.
|
|
|
*
|
|
|
- * @throws IOException
|
|
|
+ * @throws IOException Thrown when fail to redo.
|
|
|
*/
|
|
|
public void redo() throws IOException {
|
|
|
|
|
@@ -1120,6 +1124,7 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
|
|
|
/**
|
|
|
* Creates a new metrics source name that's unique within this process.
|
|
|
+ * @return metric source name
|
|
|
*/
|
|
|
@VisibleForTesting
|
|
|
public static String newMetricsSourceName() {
|
|
@@ -1253,6 +1258,8 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
/**
|
|
|
* Convert the path to a key. By convention, any leading or trailing slash is
|
|
|
* removed, except for the special case of a single slash.
|
|
|
+ * @param path path converted to a key
|
|
|
+ * @return key string
|
|
|
*/
|
|
|
@VisibleForTesting
|
|
|
public String pathToKey(Path path) {
|
|
@@ -1307,7 +1314,7 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
* Get the absolute version of the path (fully qualified).
|
|
|
* This is public for testing purposes.
|
|
|
*
|
|
|
- * @param path
|
|
|
+ * @param path path to be absolute path.
|
|
|
* @return fully qualified path
|
|
|
*/
|
|
|
@VisibleForTesting
|
|
@@ -1415,6 +1422,8 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
|
|
|
/**
|
|
|
* Get a self-renewing lease on the specified file.
|
|
|
+ * @param path path whose lease to be renewed.
|
|
|
+ * @return Lease
|
|
|
*/
|
|
|
public SelfRenewingLease acquireLease(Path path) throws AzureException {
|
|
|
String fullKey = pathToKey(makeAbsolute(path));
|
|
@@ -1662,12 +1671,12 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
* modified time is not necessary, it's easier to just skip
|
|
|
* the modified time update.
|
|
|
*
|
|
|
- * @param f
|
|
|
- * @param recursive
|
|
|
+ * @param f file path to be deleted.
|
|
|
+ * @param recursive specify deleting recursively or not.
|
|
|
* @param skipParentFolderLastModifidedTimeUpdate If true, don't update the folder last
|
|
|
* modified time.
|
|
|
* @return true if and only if the file is deleted
|
|
|
- * @throws IOException
|
|
|
+ * @throws IOException Thrown when fail to delete file or directory.
|
|
|
*/
|
|
|
public boolean delete(Path f, boolean recursive,
|
|
|
boolean skipParentFolderLastModifidedTimeUpdate) throws IOException {
|
|
@@ -2890,7 +2899,7 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
* The root path to consider.
|
|
|
* @param destination
|
|
|
* The destination path to move any recovered files to.
|
|
|
- * @throws IOException
|
|
|
+ * @throws IOException Thrown when fail to recover files.
|
|
|
*/
|
|
|
public void recoverFilesWithDanglingTempData(Path root, Path destination)
|
|
|
throws IOException {
|
|
@@ -2908,7 +2917,7 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
*
|
|
|
* @param root
|
|
|
* The root path to consider.
|
|
|
- * @throws IOException
|
|
|
+ * @throws IOException Thrown when fail to delete.
|
|
|
*/
|
|
|
public void deleteFilesWithDanglingTempData(Path root) throws IOException {
|
|
|
|
|
@@ -2928,7 +2937,7 @@ public class NativeAzureFileSystem extends FileSystem {
|
|
|
* Upload data to a random temporary file then do storage side renaming to
|
|
|
* recover the original key.
|
|
|
*
|
|
|
- * @param aKey
|
|
|
+ * @param aKey a key to be encoded.
|
|
|
* @return Encoded version of the original key.
|
|
|
*/
|
|
|
private static String encodeKey(String aKey) {
|