-
Notifications
You must be signed in to change notification settings - Fork 695
GEODE-9044: Introduce RedisKey as key object for RedisData entries #6146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GEODE-9044: Introduce RedisKey as key object for RedisData entries #6146
Conversation
|
I tried to break this up into one commit which has the 'actual' change and the other is switching usage of |
nonbinaryprogrammer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
geode-redis/src/main/java/org/apache/geode/redis/internal/data/RedisKey.java
Outdated
Show resolved
Hide resolved
geode-redis/src/main/java/org/apache/geode/redis/internal/data/RedisKey.java
Outdated
Show resolved
Hide resolved
|
This pull request introduces 1 alert when merging 20de8cf into 14e1cfc - view on LGTM.com new alerts:
|
geode-redis/src/main/java/org/apache/geode/redis/internal/data/RedisKey.java
Outdated
Show resolved
Hide resolved
geode-redis/src/main/java/org/apache/geode/redis/internal/executor/cluster/CRC16.java
Show resolved
Hide resolved
...s/src/main/java/org/apache/geode/redis/internal/executor/cluster/RedisPartitionResolver.java
Show resolved
Hide resolved
| public void fromData(DataInput in, DeserializationContext context) | ||
| throws IOException, ClassNotFoundException { | ||
| routingId = DataSerializer.readInteger(in); | ||
| crc16 = in.readInt(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering out loud now if it is even worth serializing the CRC when we could just reconstitute it when deserializing.
|
This pull request introduces 1 alert when merging 6f0f4d4 into 3b422bb - view on LGTM.com new alerts:
|
geode-redis/src/main/java/org/apache/geode/redis/internal/data/RedisKey.java
Show resolved
Hide resolved
...s/src/main/java/org/apache/geode/redis/internal/executor/cluster/RedisPartitionResolver.java
Show resolved
Hide resolved
...s/src/main/java/org/apache/geode/redis/internal/executor/cluster/RedisPartitionResolver.java
Show resolved
Hide resolved
...s/src/main/java/org/apache/geode/redis/internal/executor/cluster/RedisPartitionResolver.java
Outdated
Show resolved
Hide resolved
upthewaterspout
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. With regard to caching the crc16 in the region entry - I agree it probably doesn't need to be serialized. I'm also not sure whether it would be more efficient to cache the hashCode or the CRC16 - I wish we didn't call the PartitionResolver more than once!
At some point there is a tipping point were the serialization of 2 bytes is cheaper than the CPU time to recalculate the CRC remotely. Keeping in mind that for Geode that CPU is also trying to process primary updates too. Or would it even need to be calculated remotely if since it is only used for bucket placement, and that is already known when replicating. Similar question can likely be said for the hash code's 4 bytes. Since to be placed in to correct map slot remotely the hash code must be known so is recalculation on the remote side more costly in CPU than the 4 bytes on the wire? |
- RedisKey extends ByteArrayWrapper and adds a routingId integer value. This is used by the RedisPartitionResolver to map entries to buckets.
9d38f77 to
96c5aa9
Compare
Bill
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allocation of the new id value for REDIS_KEY looks good.
But I'm requesting changes to rectify the lack of sufficient testing of computation of CRC16 in the RedisKey constructor.
...alization/src/main/java/org/apache/geode/internal/serialization/DataSerializableFixedID.java
Show resolved
Hide resolved
geode-redis/src/test/java/org/apache/geode/redis/internal/data/RedisKeyJUnitTest.java
Show resolved
Hide resolved
geode-redis/src/test/java/org/apache/geode/redis/internal/data/RedisKeyJUnitTest.java
Show resolved
Hide resolved
geode-redis/src/main/java/org/apache/geode/redis/internal/data/RedisKey.java
Show resolved
Hide resolved
geode-redis/src/main/java/org/apache/geode/redis/internal/data/RedisKey.java
Show resolved
Hide resolved
geode-redis/src/main/java/org/apache/geode/redis/internal/data/RedisKey.java
Show resolved
Hide resolved
geode-redis/src/main/java/org/apache/geode/redis/internal/data/RedisKey.java
Show resolved
Hide resolved
bschuchardt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't comment on the Redis compatibility changes but I see no problem with the change to DataSerializableFixedID (my only code-owner file in this PR)
Bill
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
…pache#6146) - Refactor all redis key references to use RedisKey - RedisKey extends ByteArrayWrapper and adds a routingId integer value. This is used by the RedisPartitionResolver to map entries to buckets. (cherry picked from commit 3a9baef)
…pache#6146) - Refactor all redis key references to use RedisKey - RedisKey extends ByteArrayWrapper and adds a routingId integer value. This is used by the RedisPartitionResolver to map entries to buckets.
This is used by the RedisPartitionResolver to map entries to buckets.
Thank you for submitting a contribution to Apache Geode.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
Has your PR been rebased against the latest commit within the target branch (typically
develop)?Is your initial contribution a single, squashed commit?
Does
gradlew buildrun cleanly?Have you written or updated unit tests to verify your changes?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
Note:
Please ensure that once the PR is submitted, check Concourse for build issues and
submit an update to your PR as soon as possible. If you need help, please send an
email to dev@geode.apache.org.