adoroszlai commented on code in PR #8607:
URL: https://github.com/apache/ozone/pull/8607#discussion_r2142124479
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/TypedTable.java:
##########
@@ -498,10 +494,15 @@ public List<TypedKeyValue> getSequentialRangeKVs(
List<? extends KeyValue<byte[], byte[]>> rangeKVBytes =
rawTable.getSequentialRangeKVs(startKeyBytes, count,
prefixBytes, filters);
+ return covert(rangeKVBytes);
Review Comment:
```suggestion
return convert(rangeKVBytes);
```
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/TypedTable.java:
##########
@@ -498,10 +494,15 @@ public List<TypedKeyValue> getSequentialRangeKVs(
List<? extends KeyValue<byte[], byte[]>> rangeKVBytes =
rawTable.getSequentialRangeKVs(startKeyBytes, count,
prefixBytes, filters);
+ return covert(rangeKVBytes);
+ }
- List<TypedKeyValue> rangeKVs = new ArrayList<>();
- rangeKVBytes.forEach(byteKV -> rangeKVs.add(new TypedKeyValue(byteKV)));
-
+ private List<KeyValue<KEY, VALUE>> covert(List<? extends KeyValue<byte[],
byte[]>> rangeKVBytes)
Review Comment:
typo:
```suggestion
private List<KeyValue<KEY, VALUE>> convert(List<? extends KeyValue<byte[],
byte[]>> rangeKVBytes)
```
##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/TypedTable.java:
##########
@@ -477,15 +477,11 @@ public List<TypedKeyValue> getRangeKVs(
List<? extends KeyValue<byte[], byte[]>> rangeKVBytes =
rawTable.getRangeKVs(startKeyBytes, count, prefixBytes, filters);
-
- List<TypedKeyValue> rangeKVs = new ArrayList<>();
- rangeKVBytes.forEach(byteKV -> rangeKVs.add(new TypedKeyValue(byteKV)));
-
- return rangeKVs;
+ return covert(rangeKVBytes);
Review Comment:
```suggestion
return convert(rangeKVBytes);
```
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/QuotaRepairTask.java:
##########
@@ -399,22 +399,18 @@ private static <VALUE> void extractCount(
Table.KeyValue<String, VALUE> kv,
Map<String, CountPair> prefixUsageMap,
boolean haveValue) {
- try {
- String prefix = getVolumeBucketPrefix(kv.getKey());
- CountPair usage = prefixUsageMap.get(prefix);
- if (null == usage) {
- return;
- }
- usage.incrNamespace(1L);
- // avoid decode of value
- if (haveValue) {
- VALUE value = kv.getValue();
- if (value instanceof OmKeyInfo) {
- usage.incrSpace(((OmKeyInfo) value).getReplicatedSize());
- }
+ String prefix = getVolumeBucketPrefix(kv.getKey());
+ CountPair usage = prefixUsageMap.get(prefix);
+ if (null == usage) {
+ return;
+ }
+ usage.incrNamespace(1L);
+ // avoid decode of value
Review Comment:
I guess the comment no longer applies, since `KeyValue` stores `value`
already decoded.
--
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]