[
https://issues.apache.org/jira/browse/HADOOP-19941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18102395#comment-18102395
]
ASF GitHub Bot commented on HADOOP-19941:
-----------------------------------------
bhattmanish98 commented on code in PR #8611:
URL: https://github.com/apache/hadoop/pull/8611#discussion_r3727988103
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java:
##########
@@ -367,31 +402,66 @@ public ListResponseData listPath(final String
relativePath, final boolean recurs
url,
requestHeaders);
- op.execute(tracingContext);
- ListResponseData listResponseData = parseListPathResults(op.getResult(),
uri);
- listResponseData.setOp(op);
-
- // Perform Pending Rename Redo Operation on Atomic Rename Paths.
- // Crashed HBase log rename recovery can be done by Filesystem.listStatus.
- if (tracingContext.getOpType() == FSOperationType.LISTSTATUS
- && op.getResult() != null
- && op.getResult().getStatusCode() == HTTP_OK) {
- boolean isRenameRecovered =
retryRenameOnAtomicEntriesInListResults(tracingContext,
- listResponseData.getRenamePendingJsonPaths());
- if (isRenameRecovered) {
- LOG.debug("Retrying list operation after rename recovery.");
- // Retry the list operation to get the updated list of paths after
rename recovery.
- AbfsRestOperation retryListOp = getAbfsRestOperation(
- AbfsRestOperationType.ListBlobs,
- HTTP_METHOD_GET,
- url,
- requestHeaders);
- retryListOp.execute(tracingContext);
- listResponseData = parseListPathResults(retryListOp.getResult(), uri);
- listResponseData.setOp(retryListOp);
+ updatePhotonRequestMetric(photonRequested);
+ final DurationTracker listingLatencyTracker =
+ maybeStartPhotonListingLatencyTracker(photonRequested);
+ try {
+ op.execute(tracingContext);
+ ListResponseData listResponseData =
+ parseListPathResultsWithMetrics(op, uri, photonRequested);
+
+ // Perform Pending Rename Redo Operation on Atomic Rename Paths.
+ // Crashed HBase log rename recovery can be done by
Filesystem.listStatus.
+ if (tracingContext.getOpType() == FSOperationType.LISTSTATUS
+ && op.getResult() != null
+ && op.getResult().getStatusCode() == HTTP_OK) {
+ boolean isRenameRecovered =
retryRenameOnAtomicEntriesInListResults(tracingContext,
+ listResponseData.getRenamePendingJsonPaths());
+ if (isRenameRecovered) {
+ LOG.debug("Retrying list operation after rename recovery.");
+ // Retry the list operation to get the updated list of paths after
rename recovery.
+ AbfsRestOperation retryListOp = getAbfsRestOperation(
+ AbfsRestOperationType.ListBlobs,
+ HTTP_METHOD_GET,
+ url,
+ requestHeaders);
+ retryListOp.execute(tracingContext);
+ listResponseData =
+ parseListPathResultsWithMetrics(retryListOp, uri,
photonRequested);
+ }
+ }
+ return listResponseData;
+ } finally {
+ if (listingLatencyTracker != null) {
+ listingLatencyTracker.close();
}
}
- return listResponseData;
+ }
+
+ /**
+ * Parse a ListBlobs response, emitting the Photon (Apache Arrow) response,
+ * fallback and parse-failure metrics along the way. Shared by the primary
and
+ * the rename-recovery retry list calls.
+ *
+ * @param op the executed ListBlobs REST operation.
+ * @param uri to be used for path conversion.
+ * @param photonRequested whether Arrow was requested for this listing.
+ * @return the parsed {@link ListResponseData}.
+ * @throws AzureBlobFileSystemException if parsing fails.
+ */
+ private ListResponseData parseListPathResultsWithMetrics(
+ final AbfsRestOperation op, final URI uri, final boolean photonRequested)
+ throws AzureBlobFileSystemException {
+ final AbfsHttpOperation result = op.getResult();
+ updatePhotonResponseMetrics(photonRequested, result);
Review Comment:
updatePhotonResponseMetrics now returns early unless result.getStatusCode()
== HTTP_OK, so non-200 error bodies no longer inflate PHOTON_FALLBACK_COUNT.
> ABFS: Support Photon (Apache Arrow) based ListBlobs on Blob endpoint with XML
> fallback
> --------------------------------------------------------------------------------------
>
> Key: HADOOP-19941
> URL: https://issues.apache.org/jira/browse/HADOOP-19941
> Project: Hadoop Common
> Issue Type: New Feature
> Components: fs/azure
> Reporter: Manish Bhatt
> Assignee: Manish Bhatt
> Priority: Major
> Labels: pull-request-available
>
> Add config-gated support (fs.azure.photon.enabled, default off) for consuming
> ListBlobs responses in the Apache Arrow (Photon) format on the ABFS Blob
> endpoint. When enabled, ABFS advertises Arrow via an Accept header; the
> response Content-Type selects an Arrow or the existing XML parser, both
> producing identical FileStatus results, so downstream behaviour is unchanged.
> Includes automatic, transparent fallback to XML, full parsing parity
> (metadata, directory markers, implicit directories, copy properties, native
> timestamp/length vectors), interrupt-safe Arrow parsing, and Photon telemetry
> (request, response, fallback, parse-failure counts and listing latency). No
> public API changes. Covered by unit and integration tests.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]