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 d6e9c5cd93 HDDS-9540. Inconsistent API definitions in BlockManager 
(#5520)
d6e9c5cd93 is described below

commit d6e9c5cd939df6340717c71d834d92b5a2236ecb
Author: Tejaskriya <[email protected]>
AuthorDate: Fri Nov 3 21:25:51 2023 +0530

    HDDS-9540. Inconsistent API definitions in BlockManager (#5520)
---
 .../container/keyvalue/impl/BlockManagerImpl.java  | 48 +++-------------------
 .../keyvalue/interfaces/BlockManager.java          | 27 ++++++------
 2 files changed, 20 insertions(+), 55 deletions(-)

diff --git 
a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/BlockManagerImpl.java
 
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/BlockManagerImpl.java
index e51baf29ec..ff0f25bff6 100644
--- 
a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/BlockManagerImpl.java
+++ 
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/impl/BlockManagerImpl.java
@@ -75,28 +75,11 @@ public class BlockManagerImpl implements BlockManager {
         StorageUnit.BYTES);
   }
 
-  /**
-   * Puts or overwrites a block.
-   *
-   * @param container - Container for which block need to be added.
-   * @param data     - BlockData.
-   * @return length of the block.
-   * @throws IOException
-   */
   @Override
   public long putBlock(Container container, BlockData data) throws IOException 
{
     return putBlock(container, data, true);
   }
-  /**
-   * Puts or overwrites a block.
-   *
-   * @param container - Container for which block need to be added.
-   * @param data - BlockData.
-   * @param endOfBlock - The last putBlock call for this block (when
-   *                   all the chunks are written and stream is closed)
-   * @return length of the block.
-   * @throws IOException
-   */
+
   @Override
   public long putBlock(Container container, BlockData data,
       boolean endOfBlock) throws IOException {
@@ -222,14 +205,6 @@ public class BlockManagerImpl implements BlockManager {
     }
   }
 
-  /**
-   * Gets an existing block.
-   *
-   * @param container - Container from which block need to be fetched.
-   * @param blockID - BlockID of the block.
-   * @return Key Data.
-   * @throws IOException
-   */
   @Override
   public BlockData getBlock(Container container, BlockID blockID)
       throws IOException {
@@ -264,14 +239,6 @@ public class BlockManagerImpl implements BlockManager {
     }
   }
 
-  /**
-   * Returns the length of the committed block.
-   *
-   * @param container - Container from which block need to be fetched.
-   * @param blockID - BlockID of the block.
-   * @return length of the block.
-   * @throws IOException in case, the block key does not exist in db.
-   */
   @Override
   public long getCommittedBlockLength(Container container, BlockID blockID)
       throws IOException {
@@ -293,6 +260,11 @@ public class BlockManagerImpl implements BlockManager {
 
   /**
    * Deletes an existing block.
+   * As Deletion is handled by BlockDeletingService,
+   * UnsupportedOperationException is thrown always
+   *
+   * @param container - Container from which block need to be deleted.
+   * @param blockID - ID of the block.
    */
   @Override
   public void deleteBlock(Container container, BlockID blockID) throws
@@ -303,14 +275,6 @@ public class BlockManagerImpl implements BlockManager {
     throw new UnsupportedOperationException();
   }
 
-  /**
-   * List blocks in a container.
-   *
-   * @param container - Container from which blocks need to be listed.
-   * @param startLocalID  - Key to start from, 0 to begin.
-   * @param count    - Number of blocks to return.
-   * @return List of Blocks that match the criteria.
-   */
   @Override
   public List<BlockData> listBlock(Container container, long startLocalID, int
       count) throws IOException {
diff --git 
a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/interfaces/BlockManager.java
 
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/interfaces/BlockManager.java
index 66dbe6d3df..aa7285a232 100644
--- 
a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/interfaces/BlockManager.java
+++ 
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/interfaces/BlockManager.java
@@ -18,7 +18,6 @@
 package org.apache.hadoop.ozone.container.keyvalue.interfaces;
 
 import org.apache.hadoop.hdds.client.BlockID;
-import 
org.apache.hadoop.hdds.scm.container.common.helpers.StorageContainerException;
 import org.apache.hadoop.ozone.container.common.helpers.BlockData;
 import org.apache.hadoop.ozone.container.common.interfaces.Container;
 
@@ -34,9 +33,8 @@ public interface BlockManager {
    * Puts or overwrites a block.
    *
    * @param container - Container for which block need to be added.
-   * @param data     - Block Data.
+   * @param data - Block Data.
    * @return length of the Block.
-   * @throws IOException
    */
   long putBlock(Container container, BlockData data) throws IOException;
 
@@ -44,21 +42,21 @@ public interface BlockManager {
    * Puts or overwrites a block.
    *
    * @param container - Container for which block need to be added.
-   * @param data     - Block Data.
-   * @param incrKeyCount - Whether to increase container key count.
+   * @param data - Block Data.
+   * @param endOfBlock - The last putBlock call for this block (when
+   *                     all the chunks are written and stream is closed)
    * @return length of the Block.
-   * @throws IOException
    */
-  long putBlock(Container container, BlockData data, boolean incrKeyCount)
+  long putBlock(Container container, BlockData data, boolean endOfBlock)
       throws IOException;
 
   /**
    * Gets an existing block.
    *
-   * @param container - Container from which block need to be get.
+   * @param container - Container from which block needs to be fetched.
    * @param blockID - BlockID of the Block.
    * @return Block Data.
-   * @throws IOException
+   * @throws IOException when BcsId is unknown or mismatched
    */
   BlockData getBlock(Container container, BlockID blockID)
       throws IOException;
@@ -68,7 +66,6 @@ public interface BlockManager {
    *
    * @param container - Container from which block need to be deleted.
    * @param blockID - ID of the block.
-   * @throws StorageContainerException
    */
   void deleteBlock(Container container, BlockID blockID) throws IOException;
 
@@ -77,15 +74,19 @@ public interface BlockManager {
    *
    * @param container - Container from which blocks need to be listed.
    * @param startLocalID  - Block to start from, 0 to begin.
-   * @param count    - Number of blocks to return.
+   * @param count - Number of blocks to return.
    * @return List of Blocks that match the criteria.
    */
   List<BlockData> listBlock(Container container, long startLocalID, int count)
       throws IOException;
 
   /**
-   * Returns the last committed block length for the block.
-   * @param blockID blockId
+   * Returns last committed length of the block.
+   *
+   * @param container - Container from which block need to be fetched.
+   * @param blockID - BlockID of the block.
+   * @return length of the block.
+   * @throws IOException in case, the block key does not exist in db.
    */
   long getCommittedBlockLength(Container container, BlockID blockID)
       throws IOException;


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

Reply via email to