arp7 commented on a change in pull request #832: HDDS-1535. Space tracking for
Open Containers : Handle Node Startup. Contributed by Supratim Deka
URL: https://github.com/apache/hadoop/pull/832#discussion_r286291569
##########
File path:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerReader.java
##########
@@ -215,4 +224,27 @@ public void verifyContainerData(ContainerData
containerData)
ContainerProtos.Result.UNKNOWN_CONTAINER_TYPE);
}
}
+
+ private void initializeUsedBytes(KeyValueContainer container)
+ throws IOException {
+ KeyValueBlockIterator blockIter = new KeyValueBlockIterator(
+ container.getContainerData().getContainerID(),
+ new File(container.getContainerData().getContainerPath()));
+ long usedBytes = 0;
+
+ while (blockIter.hasNext()) {
+ BlockData block = blockIter.nextBlock();
+ long blockLen = 0;
+
+ List<ContainerProtos.ChunkInfo> chunkInfoList = block.getChunks();
Review comment:
Looked at this some more and even on the container write path the update is
done on block commit. So this is consistent.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]