This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 938f4e6578d HDDS-17204. Remove duplicate getBlocksLatestVersionOnly() 
call in getFileBlockLocations (#11655)
938f4e6578d is described below

commit 938f4e6578d3773bbb0ede5ef756c11a9cec739b
Author: Prithvi S <[email protected]>
AuthorDate: Thu Oct 22 23:12:35 2026 +0530

    HDDS-17204. Remove duplicate getBlocksLatestVersionOnly() call in 
getFileBlockLocations (#11655)
---
 .../org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java   | 8 ++++----
 .../apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git 
a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java
 
b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java
index a06c2f8b258..685eb00b68a 100644
--- 
a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java
+++ 
b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java
@@ -629,13 +629,13 @@ private BlockLocation[] getBlockLocations(OzoneFileStatus 
fileStatus) {
 
     OmKeyLocationInfoGroup omKeyLocationInfoGroup =
         keyInfo.getLatestVersionLocations();
-    BlockLocation[] blockLocations = new BlockLocation[
-        omKeyLocationInfoGroup.getBlocksLatestVersionOnly().size()];
+    List<OmKeyLocationInfo> blocks =
+        omKeyLocationInfoGroup.getBlocksLatestVersionOnly();
+    BlockLocation[] blockLocations = new BlockLocation[blocks.size()];
 
     int i = 0;
     long offsetOfBlockInFile = 0L;
-    for (OmKeyLocationInfo omKeyLocationInfo :
-        omKeyLocationInfoGroup.getBlocksLatestVersionOnly()) {
+    for (OmKeyLocationInfo omKeyLocationInfo : blocks) {
       List<String> hostList = new ArrayList<>();
       List<String> nameList = new ArrayList<>();
       omKeyLocationInfo.getPipeline().getNodes()
diff --git 
a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java
 
b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java
index 7edd69c3c8e..cb0832ee769 100644
--- 
a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java
+++ 
b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java
@@ -1253,13 +1253,13 @@ private BlockLocation[] 
getBlockLocations(OzoneFileStatus fileStatus) {
 
     OmKeyLocationInfoGroup omKeyLocationInfoGroup =
         keyInfo.getLatestVersionLocations();
-    BlockLocation[] blockLocations = new BlockLocation[
-        omKeyLocationInfoGroup.getBlocksLatestVersionOnly().size()];
+    List<OmKeyLocationInfo> blocks =
+        omKeyLocationInfoGroup.getBlocksLatestVersionOnly();
+    BlockLocation[] blockLocations = new BlockLocation[blocks.size()];
 
     int i = 0;
     long offsetOfBlockInFile = 0L;
-    for (OmKeyLocationInfo omKeyLocationInfo :
-        omKeyLocationInfoGroup.getBlocksLatestVersionOnly()) {
+    for (OmKeyLocationInfo omKeyLocationInfo : blocks) {
       List<String> hostList = new ArrayList<>();
       List<String> nameList = new ArrayList<>();
       omKeyLocationInfo.getPipeline().getNodes()


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to