smengcl commented on code in PR #8587:
URL: https://github.com/apache/ozone/pull/8587#discussion_r2377718263
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java:
##########
@@ -903,6 +904,22 @@ protected static long sumBlockLengths(OmKeyInfo omKeyInfo)
{
return bytesUsed;
}
+ /**
+ * @return the number of bytes used by blocks pointed to by {@code
omKeyInfo}.
+ */
+ public static long sumBlockLengths(OzoneManagerProtocolProtos.KeyInfo
keyInfo) {
+ long bytesUsed = 0;
+ ReplicationConfig replicationConfig =
ReplicationConfig.fromProto(keyInfo.getType(), keyInfo.getFactor(),
+ keyInfo.getEcReplicationConfig());
+ for (OzoneManagerProtocolProtos.KeyLocationList group:
keyInfo.getKeyLocationListList()) {
+ for (OzoneManagerProtocolProtos.KeyLocation locationInfo :
group.getKeyLocationsList()) {
Review Comment:
nit
```suggestion
for (OzoneManagerProtocolProtos.KeyLocation locationInfo:
group.getKeyLocationsList()) {
```
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyRequest.java:
##########
@@ -903,6 +904,22 @@ protected static long sumBlockLengths(OmKeyInfo omKeyInfo)
{
return bytesUsed;
}
+ /**
+ * @return the number of bytes used by blocks pointed to by {@code
omKeyInfo}.
+ */
+ public static long sumBlockLengths(OzoneManagerProtocolProtos.KeyInfo
keyInfo) {
+ long bytesUsed = 0;
+ ReplicationConfig replicationConfig =
ReplicationConfig.fromProto(keyInfo.getType(), keyInfo.getFactor(),
+ keyInfo.getEcReplicationConfig());
+ for (OzoneManagerProtocolProtos.KeyLocationList group:
keyInfo.getKeyLocationListList()) {
Review Comment:
nit
```suggestion
for (OzoneManagerProtocolProtos.KeyLocationList group :
keyInfo.getKeyLocationListList()) {
```
--
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]