Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ public void rename(final Path source, final Path destination,
}

renameBlobDir(source, destination, tracingContext, listBlobQueue,
blobPropOnSrc, srcDirLease, isAtomicRename);
srcDirLease, isAtomicRename);

if (renameAtomicityUtils != null) {
renameAtomicityUtils.cleanup();
Expand Down Expand Up @@ -1615,7 +1615,7 @@ private void renameBlobDir(final Path source,
final Path destination,
final TracingContext tracingContext,
final ListBlobQueue listBlobQueue,
final BlobProperty blobPropOnSrc, final AbfsBlobLease srcDirBlobLease,
final AbfsBlobLease srcDirBlobLease,
final Boolean isAtomicRename) throws AzureBlobFileSystemException {
List<BlobProperty> blobList;
ListBlobConsumer listBlobConsumer = new ListBlobConsumer(listBlobQueue);
Expand Down Expand Up @@ -1650,7 +1650,7 @@ private void renameBlobDir(final Path source,
renameBlob(
blobProperty.getPath(),
createDestinationPathForBlobPartOfRenameSrcDir(destination,
blobProperty, source),
blobProperty.getPath(), source),
blobLease != null ? blobLease.getLeaseID() : null,
tracingContext);
} catch (AzureBlobFileSystemException e) {
Expand All @@ -1673,8 +1673,8 @@ private void renameBlobDir(final Path source,
renameBlobExecutorService.shutdown();

renameBlob(
blobPropOnSrc.getPath(), createDestinationPathForBlobPartOfRenameSrcDir(destination,
blobPropOnSrc, source),
source, createDestinationPathForBlobPartOfRenameSrcDir(destination,
source, source),
srcDirBlobLease != null ? srcDirBlobLease.getLeaseID() : null,
tracingContext);
}
Expand All @@ -1686,17 +1686,18 @@ private Boolean isCreateOperationOnBlobEndpoint() {
/**
* Translates the destination path for a blob part of a source directory getting
* renamed.
*
* @param destinationDir destination directory for the rename operation
* @param srcBlobProperty blob part of the source directory getting renamed
* @param blobPath path of blob inside sourceDir being renamed.
* @param sourceDir source directory for the rename operation
*
* @return translated path for the blob
*/
private Path createDestinationPathForBlobPartOfRenameSrcDir(final Path destinationDir,
final BlobProperty srcBlobProperty,
final Path sourceDir) {
final Path blobPath, final Path sourceDir) {
String destinationPathStr = destinationDir.toUri().getPath();
String sourcePathStr = sourceDir.toUri().getPath();
String srcBlobPropertyPathStr = srcBlobProperty.getPath().toUri().getPath();
String srcBlobPropertyPathStr = blobPath.toUri().getPath();
if (sourcePathStr.equals(srcBlobPropertyPathStr)) {
return destinationDir;
}
Expand Down Expand Up @@ -2567,11 +2568,10 @@ public void redo(final Path destination, final Path src)
String listSrc = listSrcBuilder.toString();
new ListBlobProducer(listSrc, client, listBlobQueue, null,
tracingContext);
BlobProperty srcBlobProperty = getBlobProperty(src, tracingContext);
AbfsBlobLease abfsBlobLease = new AbfsBlobLease(client,
src.toUri().getPath(), BLOB_LEASE_ONE_MINUTE_DURATION, tracingContext);
renameBlobDir(src, destination, tracingContext, listBlobQueue,
srcBlobProperty, abfsBlobLease, true);
abfsBlobLease, true);
}
};
}
Expand Down