Skip to content

HADOOP-19941. ABFS: Support Photon (Apache Arrow) ListBlobs on the Blob endpoint#8611

Open
bhattmanish98 wants to merge 4 commits into
apache:trunkfrom
ABFSDriver:HADOOP-19941
Open

HADOOP-19941. ABFS: Support Photon (Apache Arrow) ListBlobs on the Blob endpoint#8611
bhattmanish98 wants to merge 4 commits into
apache:trunkfrom
ABFSDriver:HADOOP-19941

Conversation

@bhattmanish98

Copy link
Copy Markdown
Contributor

Description of PR

Adds config-gated support for consuming ListBlobs responses in the Apache Arrow (Photon) format on the ABFS Blob endpoint, with automatic, transparent fallback to the existing XML path and no public API changes.

JIRA: HADOOP-19941

Behaviour

  • New config fs.azure.photon.enabled (default false, opt-in). When enabled, ABFS advertises Arrow on ListBlobs via an Accept header (application/vnd.apache.arrow.stream, application/xml); the service may honour it or fall back to XML.
  • Response handling selects a parser by the response Content-Type — Arrow routes to the new Arrow parser, otherwise the existing XML SAX parser is used. Both produce the same BlobListResultSchema, so all downstream processing (rename-pending filtering, pagination, directory rectification) is unchanged.
  • Malformed Arrow responses surface as AbfsDriverException through the existing error-handling model rather than silently degrading.

Implementation

  • ResponseParserFactory chooses between XmlListBlobResponseParser and ArrowListBlobParser behind the ListBlobResponseParser interface.
  • ArrowListBlobParser reaches full parity with the XML parser: blob user metadata (Metadata map column), hdi_isfolder=true directory markers (case-insensitive; empty mkdir directories), implicit directories (BlobPrefix / ResourceType blobprefix|directory), copy properties, native TimeStampSec/UInt8 vectors, and continuation via schema NextMarker metadata.
  • Arrow/XML timestamps normalized to a single RFC 1123 GMT representation for identical FileStatus values; Arrow allocator memory limit is configurable.
  • Interrupt-safe parsing: reads the (already fully buffered) body through a non-interruptible channel instead of ArrowStreamReader's interruptible NIO channel, avoiding ClosedByInterruptException on interrupted threads — matching the XML path.

Telemetry

Adds Photon metrics: request count, response (Arrow served) count, fallback (XML returned) count, parse-failure count, and an end-to-end listing-latency duration tracker.

How was this patch tested?

  • Unit tests: parser selection, Arrow parsing (metadata/directory markers, blobprefix, native vector types, multi-page, special characters, allocator-limit, malformed streams, interrupt tolerance), request-header application, and metrics.
  • Integration tests: XML/Arrow parity, fallback, pagination, and metrics against a Blob-endpoint account, plus additions to the existing list-status ITest.
  • Documentation updated in blobEndpoint.md.

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-19941. Your PR title ...')?
  • Object storage: has the patch been tested against the target store (Azure Blob endpoint)?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF? (adds org.apache.arrow:arrow-vector, Apache-2.0)

bhattmanish98 and others added 3 commits July 14, 2026 11:23
…oint

Add config-gated support for consuming ListBlobs responses in the Apache Arrow
(Photon) format on the ABFS Blob endpoint, with automatic, transparent fallback
to the existing XML path and no public API changes.

Behaviour
- New config fs.azure.photon.enabled (default false, opt-in). When enabled, ABFS
  advertises Arrow on ListBlobs via an Accept header
  (application/vnd.apache.arrow.stream, application/xml); the service may honour
  it or fall back to XML.
- Response handling selects a parser by the response Content-Type: an Arrow
  content type routes to the new Arrow parser, otherwise the existing XML SAX
  parser is used. Both produce the same BlobListResultSchema, so all downstream
  processing (rename-pending filtering, pagination, directory rectification) is
  unchanged.
- Malformed Arrow responses surface as AbfsDriverException through the existing
  error-handling model rather than silently degrading.

Parser
- ResponseParserFactory chooses between XmlListBlobResponseParser and
  ArrowListBlobParser behind the ListBlobResponseParser interface.
- ArrowListBlobParser reads the Arrow IPC stream and reaches full parity with
  the XML parser: blob user metadata (Metadata map column), hdi_isfolder=true
  directory markers (case-insensitive; empty mkdir directories), implicit
  directories (BlobPrefix rows / ResourceType blobprefix|directory), copy
  properties, native timestamp (TimeStampSec) and unsigned length (UInt8)
  vectors normalized to the XML representation, and continuation via the schema
  NextMarker custom metadata (empty normalized to null).
- The Arrow allocator memory limit is configurable, and Arrow/XML timestamps are
  normalized to a single RFC 1123 GMT representation so both paths yield
  identical FileStatus values and epochs.
- Parsing is immune to thread interrupts: instead of letting ArrowStreamReader
  wrap the (already fully buffered) body in an interruptible NIO channel - which
  would abort with ClosedByInterruptException when the caller's interrupt flag is
  set, e.g. task cancellation - it reads through a non-interruptible channel,
  matching the interrupt-tolerant XML SAX path.

Telemetry
- Adds Photon metrics: request count, response (Arrow served) count, fallback
  (XML returned) count, parse-failure count, and an end-to-end listing-latency
  duration tracker, wired through AbfsCountersImpl and emitted from listPath.

Tests
- Unit tests for parser selection (TestResponseParserFactory), Arrow parsing
  scenarios including metadata/directory markers, blobprefix, native vector
  types, multi-page, special characters, allocator-limit and malformed streams,
  and interrupt tolerance (TestArrowListBlobParser), Photon request-header
  application (TestAbfsBlobClientPhotonHeaders), and metrics (TestPhotonList
  BlobMetrics).
- Integration tests for XML/Arrow parity, fallback, pagination and metrics
  (ITestAbfsPhotonListStatus) plus additions to the existing list-status ITest.
- Documentation updated in blobEndpoint.md; Arrow INFO logs quieted in the test
  log4j configuration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tBlobs

Address code review feedback on the Photon (Apache Arrow) ListBlobs support:

* ArrowListBlobParser: cap the per-read heap staging buffer in the
  non-interruptible channel adapter at 8 KB instead of allocating a buffer
  sized to the reader's full request. ArrowStreamReader reads record-batch
  bodies through direct (off-heap) ByteBuffers, which take the staging path,
  so unbounded requests caused large transient allocations and GC pressure
  during listings. Arrow's readFully() loops on partial reads, so capping the
  chunk is safe and mirrors the JDK Channels.newChannel transfer-size cap.

* ResponseParserFactory.isArrowResponse(): match the negotiated Arrow IPC
  stream media type (application/vnd.apache.arrow.stream), tolerating
  parameters such as charset, instead of a loose substring check for "arrow".
  This prevents unrelated content types from being misrouted to the Arrow
  parser. Removed the now-unused CONTENT_TYPE_ARROW_TOKEN constant and added
  a regression test for content types that merely contain "arrow".

* pom.xml: remove the redundant --add-opens=java.base/java.nio=ALL-UNNAMED
  from the per-profile surefire argLine entries; it is already contributed by
  the shared ${maven-surefire-plugin.argLine} property.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…oton ListBlobs

* ITestAzureBlobFileSystemListStatus: make the list-parse failure assertion
  tolerant of the XML-fallback case. The wrapping error message is derived from
  the parser selected by the response Content-Type, not from the Photon config,
  so a Photon-enabled account that returns XML yields ERR_BLOB_LIST_PARSING.
  Assert the message contains either the Arrow or XML parsing failure string to
  avoid flakiness across accounts/service versions.

* DateTimeUtils: attach the caught DateTimeException as the log cause when an
  Arrow timestamp fails to parse, preserving the stack/details for debugging
  instead of only logging the raw value.

* ArrowListBlobParser: reuse a single fixed-size staging buffer per
  non-interruptible channel instance for direct-ByteBuffer reads instead of
  allocating a temporary array on every read, removing avoidable allocation/GC
  pressure during listing. Parsing drives the channel single-threaded, so the
  shared buffer is safe.

* AbfsHttpConstants: document that bumping ApiVersion.getCurrentVersion() to
  JUN_06_2026 is an intentional global default change required by the Photon
  (Arrow) ListBlobs contract, validated across all endpoint/operation
  combinations and therefore safe as the driver-wide default.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hadoop-yetus

Copy link
Copy Markdown

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 53s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 7 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 47m 19s trunk passed
+1 💚 compile 1m 1s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 1m 2s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 0m 57s trunk passed
+1 💚 mvnsite 1m 6s trunk passed
+1 💚 javadoc 0m 58s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 56s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 1m 37s trunk passed
+1 💚 shadedclient 35m 5s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 45s the patch passed
+1 💚 compile 0m 32s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 32s the patch passed
+1 💚 compile 0m 35s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 35s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 27s /results-checkstyle-hadoop-tools_hadoop-azure.txt hadoop-tools/hadoop-azure: The patch generated 28 new + 8 unchanged - 0 fixed = 36 total (was 8)
+1 💚 mvnsite 0m 40s the patch passed
+1 💚 javadoc 0m 28s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 29s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
-1 ❌ spotbugs 1m 19s /new-spotbugs-hadoop-tools_hadoop-azure.html hadoop-tools/hadoop-azure generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
+1 💚 shadedclient 33m 53s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 2m 16s hadoop-azure in the patch passed.
+1 💚 asflicense 0m 35s The patch does not generate ASF License warnings.
135m 1s
Reason Tests
SpotBugs module:hadoop-tools/hadoop-azure
instanceof will always return true for all non-null values in org.apache.hadoop.fs.azurebfs.contracts.services.ArrowListBlobParser.readMetadata(MapVector, int), since all java.util.List are instances of java.util.List At ArrowListBlobParser.java:for all non-null values in org.apache.hadoop.fs.azurebfs.contracts.services.ArrowListBlobParser.readMetadata(MapVector, int), since all java.util.List are instances of java.util.List At ArrowListBlobParser.java:[line 405]
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8611/1/artifact/out/Dockerfile
GITHUB PR #8611
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle markdownlint
uname Linux 5510ac8ff99c 5.15.0-181-generic #191-Ubuntu SMP Fri May 22 19:09:02 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 91fd5a8
Default Java Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.11+10-1-24.04.2-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8611/1/testReport/
Max. process+thread count 585 (vs. ulimit of 10000)
modules C: hadoop-tools/hadoop-azure U: hadoop-tools/hadoop-azure
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8611/1/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

- Remove redundant lastModifiedTime()/creationTime() accessors from
  BlobListResultEntrySchema; use lastModified()/creation() consistently.
- Fix BC_VACUOUS_INSTANCEOF in ArrowListBlobParser.readMetadata by using
  the typed List<?> returned by MapVector.getObject with a null check.
- Replace checkstyle MagicNumber literals with named constants in
  DateTimeUtils and the Photon Arrow tests.
- Anchor javac/java to the running JDK (java.home) in
  TestAggregateMetricsManager to avoid toolchain-version mismatch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hadoop-yetus

Copy link
Copy Markdown

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 19m 28s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 8 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 47m 38s trunk passed
+1 💚 compile 1m 1s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 compile 1m 2s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 checkstyle 0m 56s trunk passed
+1 💚 mvnsite 1m 6s trunk passed
+1 💚 javadoc 1m 0s trunk passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 56s trunk passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 1m 36s trunk passed
+1 💚 shadedclient 35m 39s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 47s the patch passed
+1 💚 compile 0m 33s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 33s the patch passed
+1 💚 compile 0m 35s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 javac 0m 35s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 26s the patch passed
+1 💚 mvnsite 0m 39s the patch passed
+1 💚 javadoc 0m 29s the patch passed with JDK Ubuntu-21.0.11+10-1-24.04.2-Ubuntu
+1 💚 javadoc 0m 29s the patch passed with JDK Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
+1 💚 spotbugs 1m 20s the patch passed
+1 💚 shadedclient 33m 54s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 2m 16s hadoop-azure in the patch passed.
+1 💚 asflicense 0m 36s The patch does not generate ASF License warnings.
154m 29s
Subsystem Report/Notes
Docker ClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8611/2/artifact/out/Dockerfile
GITHUB PR #8611
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle markdownlint
uname Linux a01c1c7aa4c0 5.15.0-181-generic #191-Ubuntu SMP Fri May 22 19:09:02 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / b4d0cdf
Default Java Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
Multi-JDK versions /usr/lib/jvm/java-21-openjdk-amd64:Ubuntu-21.0.11+10-1-24.04.2-Ubuntu /usr/lib/jvm/java-17-openjdk-amd64:Ubuntu-17.0.19+10-1-24.04.2-Ubuntu
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8611/2/testReport/
Max. process+thread count 568 (vs. ulimit of 10000)
modules C: hadoop-tools/hadoop-azure U: hadoop-tools/hadoop-azure
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-8611/2/console
versions git=2.43.0 maven=3.9.15 spotbugs=4.9.7
Powered by Apache Yetus 0.14.1 https://yetus.apache.org

This message was automatically generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants