You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jb...@apache.org on 2021/04/14 00:09:14 UTC

[geode] branch feature/redis-performance-testing updated: Configurable number of replicas via redis.replicas property.

This is an automated email from the ASF dual-hosted git repository.

jbarrett pushed a commit to branch feature/redis-performance-testing
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/redis-performance-testing by this push:
     new 4be39c7  Configurable number of replicas via redis.replicas property.
4be39c7 is described below

commit 4be39c7d5660c9206ef527012f2f10e7b316513b
Author: Jacob Barrett <jb...@pivotal.io>
AuthorDate: Tue Apr 13 17:07:03 2021 -0700

    Configurable number of replicas via redis.replicas property.
---
 .../src/main/java/org/apache/geode/redis/internal/RegionProvider.java   | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/geode-redis/src/main/java/org/apache/geode/redis/internal/RegionProvider.java b/geode-redis/src/main/java/org/apache/geode/redis/internal/RegionProvider.java
index 87383dd..3be82fa 100644
--- a/geode-redis/src/main/java/org/apache/geode/redis/internal/RegionProvider.java
+++ b/geode-redis/src/main/java/org/apache/geode/redis/internal/RegionProvider.java
@@ -29,6 +29,7 @@ public class RegionProvider {
    */
   public static final String REDIS_DATA_REGION = "REDIS_DATA";
   public static final String REDIS_CONFIG_REGION = "__REDIS_CONFIG";
+  public static final int REDIS_REPLICAS = Integer.getInteger("redis.replicas", 1);
   public static final int REDIS_REGION_BUCKETS = Integer.getInteger("redis.region.buckets", 128);
   public static final int REDIS_SLOTS = Integer.getInteger("redis.slots", 16384);
   public static final int REDIS_SLOTS_PER_BUCKET = REDIS_SLOTS / REDIS_REGION_BUCKETS;
@@ -44,6 +45,7 @@ public class RegionProvider {
 
     PartitionAttributesFactory<RedisKey, RedisData> attributesFactory =
         new PartitionAttributesFactory<>();
+    attributesFactory.setRedundantCopies(REDIS_REPLICAS);
     attributesFactory.setPartitionResolver(new RedisPartitionResolver());
     attributesFactory.setTotalNumBuckets(REDIS_REGION_BUCKETS);
     redisDataRegionFactory.setPartitionAttributes(attributesFactory.create());