diff --git a/Makefile b/Makefile
index a5328e22fa..46e2c0e8d6 100644
--- a/Makefile
+++ b/Makefile
@@ -65,6 +65,29 @@ appendonly no
slaveof localhost 6379
endef
+define REDIS7_CONF
+daemonize yes
+port 6385
+requirepass foobared
+masterauth foobared
+pidfile /tmp/redis7.pid
+logfile /tmp/redis7.log
+save ""
+appendonly no
+endef
+
+define REDIS8_CONF
+daemonize yes
+port 6386
+requirepass foobared
+masterauth foobared
+pidfile /tmp/redis8.pid
+logfile /tmp/redis8.log
+save ""
+appendonly no
+slaveof localhost 6385
+endef
+
# SENTINELS
define REDIS_SENTINEL1
port 26379
@@ -102,6 +125,18 @@ pidfile /tmp/sentinel3.pid
logfile /tmp/sentinel3.log
endef
+define REDIS_SENTINEL4
+port 26382
+daemonize yes
+sentinel monitor mymasterfailover 127.0.0.1 6385 1
+sentinel auth-pass mymasterfailover foobared
+sentinel down-after-milliseconds mymasterfailover 3000
+sentinel failover-timeout mymasterfailover 900000
+sentinel parallel-syncs mymasterfailover 1
+pidfile /tmp/sentinel4.pid
+logfile /tmp/sentinel4.log
+endef
+
# CLUSTER REDIS NODES
define REDIS_CLUSTER_NODE1_CONF
daemonize yes
@@ -142,9 +177,12 @@ export REDIS3_CONF
export REDIS4_CONF
export REDIS5_CONF
export REDIS6_CONF
+export REDIS7_CONF
+export REDIS8_CONF
export REDIS_SENTINEL1
export REDIS_SENTINEL2
export REDIS_SENTINEL3
+export REDIS_SENTINEL4
export REDIS_CLUSTER_NODE1_CONF
export REDIS_CLUSTER_NODE2_CONF
export REDIS_CLUSTER_NODE3_CONF
@@ -156,11 +194,15 @@ start: cleanup
echo "$$REDIS4_CONF" | redis-server -
echo "$$REDIS5_CONF" | redis-server -
echo "$$REDIS6_CONF" | redis-server -
+ echo "$$REDIS7_CONF" | redis-server -
+ echo "$$REDIS8_CONF" | redis-server -
echo "$$REDIS_SENTINEL1" > /tmp/sentinel1.conf && redis-server /tmp/sentinel1.conf --sentinel
@sleep 0.5
echo "$$REDIS_SENTINEL2" > /tmp/sentinel2.conf && redis-server /tmp/sentinel2.conf --sentinel
@sleep 0.5
echo "$$REDIS_SENTINEL3" > /tmp/sentinel3.conf && redis-server /tmp/sentinel3.conf --sentinel
+ @sleep 0.5
+ echo "$$REDIS_SENTINEL4" > /tmp/sentinel4.conf && redis-server /tmp/sentinel4.conf --sentinel
echo "$$REDIS_CLUSTER_NODE1_CONF" | redis-server -
echo "$$REDIS_CLUSTER_NODE2_CONF" | redis-server -
echo "$$REDIS_CLUSTER_NODE3_CONF" | redis-server -
@@ -177,12 +219,19 @@ stop:
kill `cat /tmp/redis4.pid` || true
kill `cat /tmp/redis5.pid` || true
kill `cat /tmp/redis6.pid` || true
+ kill `cat /tmp/redis7.pid`
+ kill `cat /tmp/redis8.pid`
kill `cat /tmp/sentinel1.pid`
kill `cat /tmp/sentinel2.pid`
kill `cat /tmp/sentinel3.pid`
+ kill `cat /tmp/sentinel4.pid`
kill `cat /tmp/redis_cluster_node1.pid` || true
kill `cat /tmp/redis_cluster_node2.pid` || true
kill `cat /tmp/redis_cluster_node3.pid` || true
+ rm -f /tmp/sentinel1.conf
+ rm -f /tmp/sentinel2.conf
+ rm -f /tmp/sentinel3.conf
+ rm -f /tmp/sentinel4.conf
rm -f /tmp/redis_cluster_node1.conf
rm -f /tmp/redis_cluster_node2.conf
rm -f /tmp/redis_cluster_node3.conf
diff --git a/pom.xml b/pom.xml
index 1e5cd735dd..52f50af176 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,8 +45,8 @@
- localhost:6379,localhost:6380,localhost:6381,localhost:6382,localhost:6383,localhost:6384
- localhost:26379,localhost:26380,localhost:26381
+ localhost:6379,localhost:6380,localhost:6381,localhost:6382,localhost:6383,localhost:6384,localhost:6385,localhost:6386
+ localhost:26379,localhost:26380,localhost:26381,localhost:26382
localhost:7379,localhost:7380,localhost:7381
github
diff --git a/src/main/java/redis/clients/jedis/Jedis.java b/src/main/java/redis/clients/jedis/Jedis.java
index 9501da81ba..4961f42b9f 100644
--- a/src/main/java/redis/clients/jedis/Jedis.java
+++ b/src/main/java/redis/clients/jedis/Jedis.java
@@ -8,6 +8,7 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import redis.clients.jedis.BinaryClient.LIST_POSITION;
@@ -3012,6 +3013,40 @@ public List