[ https://issues.apache.org/jira/browse/GEODE-8233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17129407#comment-17129407 ]
ASF GitHub Bot commented on GEODE-8233: --------------------------------------- jhutchison commented on a change in pull request #5220: URL: https://github.com/apache/geode/pull/5220#discussion_r436953412 ########## File path: geode-redis/src/main/java/org/apache/geode/redis/internal/data/AbstractRedisData.java ########## @@ -183,4 +184,20 @@ protected void storeChanges(Region<ByteArrayWrapper, RedisData> region, ByteArra protected abstract boolean removeFromRegion(); + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AbstractRedisData)) { + return false; + } + AbstractRedisData that = (AbstractRedisData) o; + return getExpirationTimestamp() == that.getExpirationTimestamp(); + } + + @Override + public int hashCode() { + return Objects.hash(getExpirationTimestamp()); Review comment: is an object's expiration time sufficiently unique to act as a hash? I assume you've thought through this, but just curious...seems like in a concurrent world, 2 objects of different redistypes could be added concurrently and set to expire at the same time. Or does our StripedExecutor somehow guard against this? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add equals and hashCode implementations to RedisData classes > ------------------------------------------------------------ > > Key: GEODE-8233 > URL: https://issues.apache.org/jira/browse/GEODE-8233 > Project: Geode > Issue Type: Improvement > Components: redis > Reporter: Darrel Schneider > Assignee: Darrel Schneider > Priority: Major > > The classes that implement RedisData should override equals and hashCode to > have implementations that use the actual data. -- This message was sent by Atlassian Jira (v8.3.4#803005)