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

peterxcli 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 e1b005792f5 HDDS-17759. Simplify getLocationInfoList in 
BlockOutputStreamEntryPool. (#12020)
e1b005792f5 is described below

commit e1b005792f5e2f6ed8f6dbcfb656f69633f46946
Author: len548 <[email protected]>
AuthorDate: Wed Nov 11 19:59:55 2026 +0900

    HDDS-17759. Simplify getLocationInfoList in BlockOutputStreamEntryPool. 
(#12020)
---
 .../client/io/BlockOutputStreamEntryPool.java      | 27 +++++-----------------
 1 file changed, 6 insertions(+), 21 deletions(-)

diff --git 
a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockOutputStreamEntryPool.java
 
b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockOutputStreamEntryPool.java
index 0abfc001ee0..b71223277a5 100644
--- 
a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockOutputStreamEntryPool.java
+++ 
b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockOutputStreamEntryPool.java
@@ -182,38 +182,23 @@ private synchronized void 
addKeyLocationInfo(OmKeyLocationInfo subKeyInfo, boole
    * where the blocks of the key have been written.
    * @return the location info list of written blocks.
    */
-  @VisibleForTesting
-  public List<OmKeyLocationInfo> getLocationInfoList() {
-    List<OmKeyLocationInfo> locationInfoList;
-    List<OmKeyLocationInfo> currBlocksLocationInfoList =
-        getOmKeyLocationInfos(streamEntries);
-    locationInfoList = currBlocksLocationInfoList;
-    return locationInfoList;
-  }
-
-  private List<OmKeyLocationInfo> getOmKeyLocationInfos(
-      List<BlockOutputStreamEntry> streams) {
+  List<OmKeyLocationInfo> getLocationInfoList() {
     List<OmKeyLocationInfo> locationInfoList = new ArrayList<>();
-    for (BlockOutputStreamEntry streamEntry : streams) {
+    for (BlockOutputStreamEntry streamEntry : streamEntries) {
       long length = streamEntry.getCurrentPosition();
       // Commit only those blocks to OzoneManager which are not empty
-      if (length != 0) {
+      if (length > 0) {
         OmKeyLocationInfo info =
             new OmKeyLocationInfo.Builder()
                 .setBlockID(streamEntry.getBlockID())
-                .setLength(streamEntry.getCurrentPosition())
-                .setOffset(0)
+                .setLength(length)
                 .setToken(streamEntry.getToken())
                 .setPipeline(streamEntry.getPipeline())
                 .build();
         locationInfoList.add(info);
       }
-      if (LOG.isDebugEnabled()) {
-        LOG.debug(
-            "block written " + streamEntry.getBlockID() + ", length " + length
-                + " bcsID " + streamEntry.getBlockID()
-                .getBlockCommitSequenceId());
-      }
+      LOG.debug("Block written: {} length: {}; bcsID: {}",
+          streamEntry.getBlockID(), length, 
streamEntry.getBlockID().getBlockCommitSequenceId());
     }
     return locationInfoList;
   }


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

Reply via email to