virajjasani commented on code in PR #1736:
URL: https://github.com/apache/phoenix/pull/1736#discussion_r1480943791
##########
phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/GroupedAggregateRegionObserver.java:
##########
@@ -230,10 +238,17 @@ private static final class InMemoryGroupByCache
implements GroupByCache {
private final ServerAggregators aggregators;
private final RegionCoprocessorEnvironment env;
private final byte[] customAnnotations;
+ private final ConcurrentMap<ImmutableBytesWritable,
ImmutableBytesWritable>
Review Comment:
No reason as such, ImmutableBytesPtr extends ImmutableBytesWritable anyway,
and both have similar hashcode and equals functions. We can use either one,
`ImmutableBytesWritable` is more generic and while retrieving key/value pair
from the map, we actually use `ImmutableBytesWritable` type data:
```
for (Map.Entry<ImmutableBytesPtr, Aggregator[]> entry :
aggregateMap.entrySet()) {
ImmutableBytesWritable aggregateGroupValPtr = entry.getKey();
Aggregator[] rowAggregators = entry.getValue();
```
Hence, even though aggregateMap has `ImmutableBytesPtr` as key, we still use
`ImmutableBytesWritable` as generic key type.
--
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]