Bill commented on a change in pull request #7103:
URL: https://github.com/apache/geode/pull/7103#discussion_r765371896
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/InterestRegistrationEventImpl.java
##########
@@ -73,84 +75,81 @@ public InterestRegistrationEventImpl() {}
*
* @param regionName The name of the region to which this interest event
belongs
*/
-
- public InterestRegistrationEventImpl(CacheClientProxy clientSession, String
regionName,
- Set keysOfInterest, int interestType, boolean isRegister) {
- this.cache = clientSession.getCache();
+ public InterestRegistrationEventImpl(final @NotNull CacheClientProxy
clientSession,
+ final @NotNull String regionName, final @NotNull Set<?> keysOfInterest,
+ final @NotNull InterestType interestType, final boolean isRegister) {
+ cache = clientSession.getCache();
this.clientSession = clientSession;
this.regionName = regionName;
this.keysOfInterest = keysOfInterest;
- this.interestType = interestType;
+ this.interestType = interestType.ordinal();
this.isRegister = isRegister;
}
-
@Override
public ClientSession getClientSession() {
- return this.clientSession;
+ return clientSession;
}
@Override
public String getRegionName() {
- return this.regionName;
+ return regionName;
}
@Override
- public Region getRegion() {
- return this.cache.getRegion(this.regionName);
+ public Region<?, ?> getRegion() {
+ return cache.getRegion(regionName);
}
@Override
- public Set getKeysOfInterest() {
- return this.keysOfInterest;
+ public Set<?> getKeysOfInterest() {
+ return keysOfInterest;
}
@Override
public int getInterestType() {
- return this.interestType;
+ return interestType;
Review comment:
I love how this PR pushes the ordinal access closer to the wire, so
we're passing around more non-`int` objects between methods.
I'm curious though: why are we storing the ordinal as a field here, rather
than storing the object? If we stored the object, couldn't this method return
the object? That would also make the comparisons in `isKey()` and
`isRegularExpression()` simpler.
--
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]