[
https://issues.apache.org/jira/browse/HADOOP-19941?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18099728#comment-18099728
]
ASF GitHub Bot commented on HADOOP-19941:
-----------------------------------------
anmolanmol1234 commented on code in PR #8611:
URL: https://github.com/apache/hadoop/pull/8611#discussion_r3665490740
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestAggregateMetricsManager.java:
##########
@@ -667,6 +667,31 @@ private void runProgramAndCaptureOutput(String program,
}
}
+ /**
+ * Resolves a JDK tool (e.g. {@code javac}, {@code java}) from the JDK that
is
+ * currently running this test, rather than relying on whichever version is
+ * first on the {@code PATH}. The spawned {@code javac} must read the
compiled
+ * classes of this project (and its dependencies) off the classpath; those
are
+ * emitted by the same JDK that runs the tests. If a mismatched compiler is
+ * picked from the {@code PATH} (e.g. a Java 8 {@code javac} against Java 17
+ * bytecode), compilation fails with "class file has wrong version".
Anchoring
+ * on {@code java.home} keeps the toolchain consistent. Falls back to the
bare
+ * tool name when the JDK layout cannot be resolved.
+ *
+ * @param name the tool name, e.g. {@code javac} or {@code java}.
+ * @return an absolute path to the tool inside the running JDK, or {@code
name}.
+ */
+ private static String jdkTool(String name) {
+ String javaHome = System.getProperty("java.home");
Review Comment:
Use constants
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestAggregateMetricsManager.java:
##########
@@ -667,6 +667,31 @@ private void runProgramAndCaptureOutput(String program,
}
}
+ /**
+ * Resolves a JDK tool (e.g. {@code javac}, {@code java}) from the JDK that
is
+ * currently running this test, rather than relying on whichever version is
+ * first on the {@code PATH}. The spawned {@code javac} must read the
compiled
+ * classes of this project (and its dependencies) off the classpath; those
are
+ * emitted by the same JDK that runs the tests. If a mismatched compiler is
+ * picked from the {@code PATH} (e.g. a Java 8 {@code javac} against Java 17
+ * bytecode), compilation fails with "class file has wrong version".
Anchoring
+ * on {@code java.home} keeps the toolchain consistent. Falls back to the
bare
+ * tool name when the JDK layout cannot be resolved.
+ *
+ * @param name the tool name, e.g. {@code javac} or {@code java}.
+ * @return an absolute path to the tool inside the running JDK, or {@code
name}.
+ */
+ private static String jdkTool(String name) {
+ String javaHome = System.getProperty("java.home");
+ if (javaHome != null && !javaHome.isEmpty()) {
+ File tool = new File(new File(javaHome, "bin"), name);
Review Comment:
here as well
> 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]