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

jojochuang 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 2645ab6d314 HDDS-17112. Avoid decoding BlockData on every single chunk 
PutBlock with incremental chunk list (#11615)
2645ab6d314 is described below

commit 2645ab6d314d2789150b133a1237a3e30b7e736f
Author: Siyao Meng <[email protected]>
AuthorDate: Thu Oct 22 00:43:23 2026 -0700

    HDDS-17112. Avoid decoding BlockData on every single chunk PutBlock with 
incremental chunk list (#11615)
    
    Generated-by: Claude Opus 5.5 (1M context) <[email protected]>
---
 .../container/metadata/DatanodeStoreWithIncrementalChunkList.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/metadata/DatanodeStoreWithIncrementalChunkList.java
 
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/metadata/DatanodeStoreWithIncrementalChunkList.java
index cf17612c3a5..5cca6e1e862 100644
--- 
a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/metadata/DatanodeStoreWithIncrementalChunkList.java
+++ 
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/metadata/DatanodeStoreWithIncrementalChunkList.java
@@ -220,7 +220,6 @@ private void moveLastChunkToBlockData(BatchOperation batch, 
long localID,
   private void putBlockWithPartialChunks(BatchOperation batch, long localID,
       BlockData data, KeyValueContainerData containerData) throws IOException {
     String blockKey = containerData.getBlockKey(localID);
-    BlockData blockData = getBlockDataTable().get(blockKey);
     if (data.getChunks().size() == 1) {
       // Case (3.1) replace/update the last chunk info table
       getLastChunkInfoTable().putWithBatch(
@@ -229,14 +228,16 @@ private void putBlockWithPartialChunks(BatchOperation 
batch, long localID,
       // and the chunk is not full, then add an empty block data to populate 
the block table.
       // This is required because some of the test code and utilities expect 
the block to be
       // present in the block data table, they don't check the last chunk info 
table.
-      if (blockData == null) {
+      // Only existence matters here, so skip decoding the (possibly long) 
chunk list.
+      if (!getBlockDataTable().isExist(blockKey)) {
         // populate blockDataTable with empty chunk list
-        blockData = new BlockData(data.getBlockID());
+        BlockData blockData = new BlockData(data.getBlockID());
         blockData.addMetadata(INCREMENTAL_CHUNK_LIST, "");
         blockData.setBlockCommitSequenceId(data.getBlockCommitSequenceId());
         getBlockDataTable().putWithBatch(batch, blockKey, blockData);
       }
     } else {
+      BlockData blockData = getBlockDataTable().get(blockKey);
       int lastChunkIndex = data.getChunks().size() - 1;
       // received more than one chunk this time
       List<ContainerProtos.ChunkInfo> lastChunkInfo =


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

Reply via email to