swamirishi commented on code in PR #8305:
URL: https://github.com/apache/ozone/pull/8305#discussion_r2138539871
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerData.java:
##########
@@ -675,4 +548,151 @@ public String toString() {
+ ", ri=" + replicaIndex
+ ", origin=[dn_" + originNodeId + ", pipeline_" + originPipelineId +
"])";
}
+
+ /**
+ * Block byte used, block count and pending deletion count.
+ * This class is immutable.
+ */
+ public static class BlockByteAndCounts {
+ private final long bytes;
+ private final long count;
+ private final long pendingDeletion;
+
+ public BlockByteAndCounts(long bytes, long count, long pendingDeletion) {
+ this.bytes = bytes;
+ this.count = count;
+ this.pendingDeletion = pendingDeletion;
+ }
+
+ public long getBytes() {
+ return bytes;
+ }
+
+ public long getCount() {
+ return count;
+ }
+
+ public long getPendingDeletion() {
+ return pendingDeletion;
+ }
+ }
+
+ /**
+ * Read/write/block statistics of a container.
+ * This class is thread-safe -- all methods are synchronized.
+ */
+ public static class Statistics {
+ private long readBytes;
Review Comment:
nit: Instead of having all methods synchronized. Do you think we can use
AtomicReference to update linked fields together or have separate locks for
different fields. For instance we need not have any snchronization between
[writeBytes.writeCount] and [readBytes, readCount]. Maybe we can have small
subclass for storing ByteCount and we can have synchronization inside this
subclass.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]