anujmodi2021 commented on code in PR #7421:
URL: https://github.com/apache/hadoop/pull/7421#discussion_r2013904387
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java:
##########
@@ -1277,57 +1275,14 @@ public String listStatus(final Path path, final String
startFrom,
do {
try (AbfsPerfInfo perfInfo = startTracking("listStatus", "listPath")) {
- AbfsRestOperation op = listingClient.listPath(relativePath, false,
- abfsConfiguration.getListMaxResults(), continuation,
- tracingContext);
+ ListResponseData listResponseData =
listingClient.listPath(relativePath,
+ false, abfsConfiguration.getListMaxResults(), continuation,
+ tracingContext, this.uri);
+ AbfsRestOperation op = listResponseData.getOp();
perfInfo.registerResult(op.getResult());
- continuation =
listingClient.getContinuationFromResponse(op.getResult());
- ListResultSchema retrievedSchema =
op.getResult().getListResultSchema();
- if (retrievedSchema == null) {
- throw new AbfsRestOperationException(
- AzureServiceErrorCode.PATH_NOT_FOUND.getStatusCode(),
- AzureServiceErrorCode.PATH_NOT_FOUND.getErrorCode(),
- "listStatusAsync path not found",
- null, op.getResult());
- }
-
- long blockSize = abfsConfiguration.getAzureBlockSize();
-
- for (ListResultEntrySchema entry : retrievedSchema.paths()) {
- final String owner =
identityTransformer.transformIdentityForGetRequest(entry.owner(), true,
userName);
- final String group =
identityTransformer.transformIdentityForGetRequest(entry.group(), false,
primaryUserGroup);
- final String encryptionContext = entry.getXMsEncryptionContext();
- final FsPermission fsPermission = entry.permissions() == null
- ? new AbfsPermission(FsAction.ALL, FsAction.ALL,
FsAction.ALL)
- : AbfsPermission.valueOf(entry.permissions());
- final boolean hasAcl =
AbfsPermission.isExtendedAcl(entry.permissions());
-
- long lastModifiedMillis = 0;
- long contentLength = entry.contentLength() == null ? 0 :
entry.contentLength();
- boolean isDirectory = entry.isDirectory() == null ? false :
entry.isDirectory();
- if (entry.lastModified() != null && !entry.lastModified().isEmpty())
{
- lastModifiedMillis = DateTimeUtils.parseLastModifiedTime(
- entry.lastModified());
- }
-
- Path entryPath = new Path(File.separator + entry.name());
- entryPath = entryPath.makeQualified(this.uri, entryPath);
-
- fileStatuses.add(
- new VersionedFileStatus(
- owner,
- group,
- fsPermission,
- hasAcl,
- contentLength,
- isDirectory,
- 1,
- blockSize,
- lastModifiedMillis,
- entryPath,
- entry.eTag(),
- encryptionContext));
- }
+ continuation = listResponseData.getContinuationToken();
+ List<FileStatus> fileStatusListInCurrItr =
listResponseData.getFileStatusList();
+ fileStatuses.addAll(fileStatusListInCurrItr);
Review Comment:
Good Suggestion taken
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]