Skip to content

Commit

Permalink
address code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
deemoliu committed Sep 20, 2023
1 parent 51b5cae commit f0cf7f2
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,14 @@ public void aggregate(int length, AggregationResultHolder aggregationResultHolde
byte[][] bytesValues = blockValSet.getBytesValuesSV();
try {
HyperLogLogPlus hyperLogLogPlus = aggregationResultHolder.getResult();
if (hyperLogLogPlus != null) {
for (int i = 0; i < length; i++) {
hyperLogLogPlus.addAll(ObjectSerDeUtils.HYPER_LOG_LOG_PLUS_SER_DE.deserialize(bytesValues[i]));
}
} else {
if (hyperLogLogPlus == null) {
hyperLogLogPlus = ObjectSerDeUtils.HYPER_LOG_LOG_PLUS_SER_DE.deserialize(bytesValues[0]);
aggregationResultHolder.setValue(hyperLogLogPlus);
for (int i = 1; i < length; i++) {
hyperLogLogPlus.addAll(ObjectSerDeUtils.HYPER_LOG_LOG_PLUS_SER_DE.deserialize(bytesValues[i]));
}
} else {
hyperLogLogPlus.addAll(ObjectSerDeUtils.HYPER_LOG_LOG_PLUS_SER_DE.deserialize(bytesValues[0]));
}
for (int i = 1; i < length; i++) {
hyperLogLogPlus.addAll(ObjectSerDeUtils.HYPER_LOG_LOG_PLUS_SER_DE.deserialize(bytesValues[i]));
}
} catch (Exception e) {
throw new RuntimeException("Caught exception while merging HyperLogLogPlus", e);
Expand Down

0 comments on commit f0cf7f2

Please sign in to comment.