lokeshj1703 commented on a change in pull request #1561:
URL: https://github.com/apache/ozone/pull/1561#discussion_r522674905
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/block/BlockManagerImpl.java
##########
@@ -285,28 +286,30 @@ private AllocatedBlock newBlock(ContainerInfo
containerInfo) {
* successful, given blocks are
* entering pending deletion state and becomes invisible from SCM namespace.
*
- * @param blockIDs block IDs. This is often the list of blocks of a
- * particular object key.
+ * @param keyBlocksInfoList . This is the list of BlockGroup which contains
+ * groupID of keys and list of BlockIDs associated with them.
* @throws IOException if exception happens, non of the blocks is deleted.
*/
@Override
- public void deleteBlocks(List<BlockID> blockIDs) throws IOException {
+ public void deleteBlocks(List<BlockGroup> keyBlocksInfoList)
+ throws IOException {
ScmUtils.preCheck(ScmOps.deleteBlock, safeModePrecheck);
- LOG.info("Deleting blocks {}", StringUtils.join(",", blockIDs));
Map<Long, List<Long>> containerBlocks = new HashMap<>();
// TODO: track the block size info so that we can reclaim the container
// TODO: used space when the block is deleted.
- for (BlockID block : blockIDs) {
- // Merge blocks to a container to blocks mapping,
- // prepare to persist this info to the deletedBlocksLog.
- long containerID = block.getContainerID();
- if (containerBlocks.containsKey(containerID)) {
- containerBlocks.get(containerID).add(block.getLocalID());
- } else {
- List<Long> item = new ArrayList<>();
- item.add(block.getLocalID());
- containerBlocks.put(containerID, item);
+ for(BlockGroup bg : keyBlocksInfoList){
Review comment:
NIT: There should be a space between brackets. I think there are similar
adjustments in the entire patch.
```suggestion
for (BlockGroup bg : keyBlocksInfoList) {
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]