pivotal-jbarrett commented on a change in pull request #6117:
URL: https://github.com/apache/geode/pull/6117#discussion_r593464155
##########
File path:
geode-redis/src/main/java/org/apache/geode/redis/internal/RegionProvider.java
##########
@@ -51,4 +67,24 @@ public RegionProvider(InternalCache cache) {
public Region<String, Object> getConfigRegion() {
return configRegion;
}
+
+ /**
+ * Validates that the value passed in is a power of 2 and that it is not
greater than
+ * {@link #REDIS_SLOTS}
+ *
+ * @throws ManagementException if there is a problem with the value
+ */
+ protected static void validateBucketCount(int buckets) {
+ if (buckets <= 0 || ((buckets & (buckets - 1)) != 0)) {
+ throw new ManagementException(
+ String.format(
+ "Could not start Redis Server - System property '%s' must be a
power of 2. Configured value is invalid: %d",
Review comment:
If the slots count, fixed at 16k, is not evenly divisible by the bucket
count then you end up with less slots in some buckets. If the data is evenly
distributed across the buckets, as described in the Redis docs by use of CRC16,
then data would be imbalanced too.
----------------------------------------------------------------
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:
[email protected]