From c1e43494af5960eb2b5c2cd4c27323ec80b857c6 Mon Sep 17 00:00:00 2001 From: jlinn Date: Tue, 2 Jul 2019 12:30:59 -0700 Subject: [PATCH] Upgrade to Jedis 3.0.1 --- README.md | 2 +- changelog.md | 3 + pom.xml | 4 +- .../quartz/jobstore/AbstractRedisStorage.java | 7 +- .../quartz/jobstore/RedisClusterStorage.java | 40 +- .../quartz/jobstore/RedisJobStore.java | 10 +- .../jedis/JedisClusterCommandsWrapper.java | 763 ++++++++++++++++++ .../joelinn/quartz/BaseIntegrationTest.java | 2 +- .../java/net/joelinn/quartz/BaseTest.java | 2 +- 9 files changed, 801 insertions(+), 32 deletions(-) create mode 100644 src/main/java/net/joelinn/quartz/jobstore/jedis/JedisClusterCommandsWrapper.java diff --git a/README.md b/README.md index 4aab50c..c57e0a0 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Maven dependency: net.joelinn quartz-redis-jobstore - 1.1.14 + 1.2.0 ``` diff --git a/changelog.md b/changelog.md index da55cc6..bfc0c7b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,7 @@ # Changelog +### 2019-07-02 +* Upgrade to Jedis 3.0.1 + ### 2019-06-26 * Delete job data map set from Redis prior to storing new job data when updating / overwriting a job. This will prevent keys which were removed from the job's data map prior to storage from being preserved. diff --git a/pom.xml b/pom.xml index 613303b..91a4b95 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ net.joelinn quartz-redis-jobstore - 1.1.16-SNAPSHOT + 1.2.0-SNAPSHOT jar quartz-redis-jobstore A Quartz Scheduler JobStore using Redis. @@ -63,7 +63,7 @@ redis.clients jedis - 2.9.0 + 3.0.1 diff --git a/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java b/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java index a3d1ae3..acb75ff 100644 --- a/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java +++ b/src/main/java/net/joelinn/quartz/jobstore/AbstractRedisStorage.java @@ -11,8 +11,9 @@ import org.quartz.utils.ClassUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import redis.clients.jedis.JedisCommands; import redis.clients.jedis.Tuple; +import redis.clients.jedis.commands.JedisCommands; +import redis.clients.jedis.params.SetParams; import java.io.IOException; import java.util.*; @@ -82,7 +83,7 @@ public AbstractRedisStorage setClusterCheckInterval(long clusterCheckInterval) { */ public boolean lock(T jedis){ UUID lockId = UUID.randomUUID(); - final String setResponse = jedis.set(redisSchema.lockKey(), lockId.toString(), "NX", "PX", lockTimeout); + final String setResponse = jedis.set(redisSchema.lockKey(), lockId.toString(), SetParams.setParams().nx().px(lockTimeout)); boolean lockAcquired = !isNullOrEmpty(setResponse) && setResponse.equals("OK"); if(lockAcquired){ // save the random value used to lock so that we can successfully unlock later @@ -787,7 +788,7 @@ protected boolean isJobConcurrentExecutionDisallowed(Class jobCla * @return true if lock was acquired successfully; false otherwise */ protected boolean lockTrigger(TriggerKey triggerKey, T jedis){ - return jedis.set(redisSchema.triggerLockKey(triggerKey), schedulerInstanceId, "NX", "PX", TRIGGER_LOCK_TIMEOUT).equals("OK"); + return jedis.set(redisSchema.triggerLockKey(triggerKey), schedulerInstanceId, SetParams.setParams().nx().px(TRIGGER_LOCK_TIMEOUT)).equals("OK"); } /** diff --git a/src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java b/src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java index 56d133e..6ba265b 100644 --- a/src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java +++ b/src/main/java/net/joelinn/quartz/jobstore/RedisClusterStorage.java @@ -3,6 +3,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; +import net.joelinn.quartz.jobstore.jedis.JedisClusterCommandsWrapper; import org.quartz.Calendar; import org.quartz.*; import org.quartz.impl.matchers.GroupMatcher; @@ -13,7 +14,6 @@ import org.quartz.spi.TriggerFiredResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import redis.clients.jedis.JedisCluster; import java.util.*; @@ -21,7 +21,7 @@ * Joe Linn * 8/22/2015 */ -public class RedisClusterStorage extends AbstractRedisStorage { +public class RedisClusterStorage extends AbstractRedisStorage { private static final Logger logger = LoggerFactory.getLogger(RedisClusterStorage.class); public RedisClusterStorage(RedisJobStoreSchema redisSchema, ObjectMapper mapper, SchedulerSignaler signaler, String schedulerInstanceId, int lockTimeout) { @@ -38,7 +38,7 @@ public RedisClusterStorage(RedisJobStoreSchema redisSchema, ObjectMapper mapper, */ @Override @SuppressWarnings("unchecked") - public void storeJob(JobDetail jobDetail, boolean replaceExisting, JedisCluster jedis) throws ObjectAlreadyExistsException { + public void storeJob(JobDetail jobDetail, boolean replaceExisting, JedisClusterCommandsWrapper jedis) throws ObjectAlreadyExistsException { final String jobHashKey = redisSchema.jobHashKey(jobDetail.getKey()); final String jobDataMapHashKey = redisSchema.jobDataMapHashKey(jobDetail.getKey()); final String jobGroupSetKey = redisSchema.jobGroupSetKey(jobDetail.getKey()); @@ -67,7 +67,7 @@ public void storeJob(JobDetail jobDetail, boolean replaceExisting, JedisCluster * @return true if the job was removed; false if it did not exist */ @Override - public boolean removeJob(JobKey jobKey, JedisCluster jedis) throws JobPersistenceException { + public boolean removeJob(JobKey jobKey, JedisClusterCommandsWrapper jedis) throws JobPersistenceException { final String jobHashKey = redisSchema.jobHashKey(jobKey); final String jobBlockedKey = redisSchema.jobBlockedKey(jobKey); final String jobDataMapHashKey = redisSchema.jobDataMapHashKey(jobKey); @@ -123,7 +123,7 @@ public boolean removeJob(JobKey jobKey, JedisCluster jedis) throws JobPersistenc * @throws ObjectAlreadyExistsException */ @Override - public void storeTrigger(OperableTrigger trigger, boolean replaceExisting, JedisCluster jedis) throws JobPersistenceException { + public void storeTrigger(OperableTrigger trigger, boolean replaceExisting, JedisClusterCommandsWrapper jedis) throws JobPersistenceException { final String triggerHashKey = redisSchema.triggerHashKey(trigger.getKey()); final String triggerGroupSetKey = redisSchema.triggerGroupSetKey(trigger.getKey()); final String jobTriggerSetKey = redisSchema.jobTriggersSetKey(trigger.getJobKey()); @@ -185,7 +185,7 @@ public void storeTrigger(OperableTrigger trigger, boolean replaceExisting, Jedis * @return true if the trigger was found and removed */ @Override - protected boolean removeTrigger(TriggerKey triggerKey, boolean removeNonDurableJob, JedisCluster jedis) throws JobPersistenceException, ClassNotFoundException { + protected boolean removeTrigger(TriggerKey triggerKey, boolean removeNonDurableJob, JedisClusterCommandsWrapper jedis) throws JobPersistenceException, ClassNotFoundException { final String triggerHashKey = redisSchema.triggerHashKey(triggerKey); final String triggerGroupSetKey = redisSchema.triggerGroupSetKey(triggerKey); @@ -240,7 +240,7 @@ protected boolean removeTrigger(TriggerKey triggerKey, boolean removeNonDurableJ * @throws JobPersistenceException if the unset operation failed */ @Override - public boolean unsetTriggerState(String triggerHashKey, JedisCluster jedis) throws JobPersistenceException { + public boolean unsetTriggerState(String triggerHashKey, JedisClusterCommandsWrapper jedis) throws JobPersistenceException { boolean removed = false; List responses = new ArrayList<>(RedisTriggerState.values().length); for (RedisTriggerState state : RedisTriggerState.values()) { @@ -267,7 +267,7 @@ public boolean unsetTriggerState(String triggerHashKey, JedisCluster jedis) thro * @throws JobPersistenceException */ @Override - public void storeCalendar(String name, Calendar calendar, boolean replaceExisting, boolean updateTriggers, JedisCluster jedis) throws JobPersistenceException { + public void storeCalendar(String name, Calendar calendar, boolean replaceExisting, boolean updateTriggers, JedisClusterCommandsWrapper jedis) throws JobPersistenceException { final String calendarHashKey = redisSchema.calendarHashKey(name); if (!replaceExisting && jedis.exists(calendarHashKey)) { throw new ObjectAlreadyExistsException(String.format("Calendar with key %s already exists.", calendarHashKey)); @@ -305,7 +305,7 @@ public void storeCalendar(String name, Calendar calendar, boolean replaceExistin * @return true if a calendar with the given name was found and removed */ @Override - public boolean removeCalendar(String calendarName, JedisCluster jedis) throws JobPersistenceException { + public boolean removeCalendar(String calendarName, JedisClusterCommandsWrapper jedis) throws JobPersistenceException { final String calendarTriggersSetKey = redisSchema.calendarTriggersSetKey(calendarName); if (jedis.scard(calendarTriggersSetKey) > 0) { @@ -326,7 +326,7 @@ public boolean removeCalendar(String calendarName, JedisCluster jedis) throws Jo * @return the set of all JobKeys which have the given group name */ @Override - public Set getJobKeys(GroupMatcher matcher, JedisCluster jedis) { + public Set getJobKeys(GroupMatcher matcher, JedisClusterCommandsWrapper jedis) { Set jobKeys = new HashSet<>(); if (matcher.getCompareWithOperator() == StringMatcher.StringOperatorName.EQUALS) { final String jobGroupSetKey = redisSchema.jobGroupSetKey(new JobKey("", matcher.getCompareToValue())); @@ -362,7 +362,7 @@ public Set getJobKeys(GroupMatcher matcher, JedisCluster jedis) * @return the set of all TriggerKeys which have the given group name */ @Override - public Set getTriggerKeys(GroupMatcher matcher, JedisCluster jedis) { + public Set getTriggerKeys(GroupMatcher matcher, JedisClusterCommandsWrapper jedis) { Set triggerKeys = new HashSet<>(); if (matcher.getCompareWithOperator() == StringMatcher.StringOperatorName.EQUALS) { final String triggerGroupSetKey = redisSchema.triggerGroupSetKey(new TriggerKey("", matcher.getCompareToValue())); @@ -398,7 +398,7 @@ public Set getTriggerKeys(GroupMatcher matcher, JedisClu * @return the state of the trigger */ @Override - public Trigger.TriggerState getTriggerState(TriggerKey triggerKey, JedisCluster jedis) { + public Trigger.TriggerState getTriggerState(TriggerKey triggerKey, JedisClusterCommandsWrapper jedis) { final String triggerHashKey = redisSchema.triggerHashKey(triggerKey); Map scores = new HashMap<>(RedisTriggerState.values().length); for (RedisTriggerState redisTriggerState : RedisTriggerState.values()) { @@ -420,7 +420,7 @@ public Trigger.TriggerState getTriggerState(TriggerKey triggerKey, JedisCluster * @throws JobPersistenceException if the desired trigger does not exist */ @Override - public void pauseTrigger(TriggerKey triggerKey, JedisCluster jedis) throws JobPersistenceException { + public void pauseTrigger(TriggerKey triggerKey, JedisClusterCommandsWrapper jedis) throws JobPersistenceException { final String triggerHashKey = redisSchema.triggerHashKey(triggerKey); Boolean exists = jedis.exists(triggerHashKey); Double completedScore = jedis.zscore(redisSchema.triggerStateKey(RedisTriggerState.COMPLETED), triggerHashKey); @@ -453,7 +453,7 @@ public void pauseTrigger(TriggerKey triggerKey, JedisCluster jedis) throws JobPe * @throws JobPersistenceException */ @Override - public Collection pauseTriggers(GroupMatcher matcher, JedisCluster jedis) throws JobPersistenceException { + public Collection pauseTriggers(GroupMatcher matcher, JedisClusterCommandsWrapper jedis) throws JobPersistenceException { Set pausedTriggerGroups = new HashSet<>(); if (matcher.getCompareWithOperator() == StringMatcher.StringOperatorName.EQUALS) { final String triggerGroupSetKey = redisSchema.triggerGroupSetKey(new TriggerKey("", matcher.getCompareToValue())); @@ -494,7 +494,7 @@ public Collection pauseTriggers(GroupMatcher matcher, JedisC * @throws JobPersistenceException */ @Override - public Collection pauseJobs(GroupMatcher groupMatcher, JedisCluster jedis) throws JobPersistenceException { + public Collection pauseJobs(GroupMatcher groupMatcher, JedisClusterCommandsWrapper jedis) throws JobPersistenceException { Set pausedJobGroups = new HashSet<>(); if (groupMatcher.getCompareWithOperator() == StringMatcher.StringOperatorName.EQUALS) { final String jobGroupSetKey = redisSchema.jobGroupSetKey(new JobKey("", groupMatcher.getCompareToValue())); @@ -531,7 +531,7 @@ public Collection pauseJobs(GroupMatcher groupMatcher, JedisClus * @param jedis a thread-safe Redis connection */ @Override - public void resumeTrigger(TriggerKey triggerKey, JedisCluster jedis) throws JobPersistenceException { + public void resumeTrigger(TriggerKey triggerKey, JedisClusterCommandsWrapper jedis) throws JobPersistenceException { final String triggerHashKey = redisSchema.triggerHashKey(triggerKey); Boolean exists = jedis.sismember(redisSchema.triggersSet(), triggerHashKey); Double isPaused = jedis.zscore(redisSchema.triggerStateKey(RedisTriggerState.PAUSED), triggerHashKey); @@ -567,7 +567,7 @@ public void resumeTrigger(TriggerKey triggerKey, JedisCluster jedis) throws JobP * @return the names of trigger groups which were resumed */ @Override - public Collection resumeTriggers(GroupMatcher matcher, JedisCluster jedis) throws JobPersistenceException { + public Collection resumeTriggers(GroupMatcher matcher, JedisClusterCommandsWrapper jedis) throws JobPersistenceException { Set resumedTriggerGroups = new HashSet<>(); if (matcher.getCompareWithOperator() == StringMatcher.StringOperatorName.EQUALS) { final String triggerGroupSetKey = redisSchema.triggerGroupSetKey(new TriggerKey("", matcher.getCompareToValue())); @@ -596,7 +596,7 @@ public Collection resumeTriggers(GroupMatcher matcher, Jedis * @return the set of job groups which were matched and resumed */ @Override - public Collection resumeJobs(GroupMatcher matcher, JedisCluster jedis) throws JobPersistenceException { + public Collection resumeJobs(GroupMatcher matcher, JedisClusterCommandsWrapper jedis) throws JobPersistenceException { Set resumedJobGroups = new HashSet<>(); if (matcher.getCompareWithOperator() == StringMatcher.StringOperatorName.EQUALS) { final String jobGroupSetKey = redisSchema.jobGroupSetKey(new JobKey("", matcher.getCompareToValue())); @@ -631,7 +631,7 @@ public Collection resumeJobs(GroupMatcher matcher, JedisCluster * could be fired. */ @Override - public List triggersFired(List triggers, JedisCluster jedis) throws JobPersistenceException, ClassNotFoundException { + public List triggersFired(List triggers, JedisClusterCommandsWrapper jedis) throws JobPersistenceException, ClassNotFoundException { List results = new ArrayList<>(); for (OperableTrigger trigger : triggers) { final String triggerHashKey = redisSchema.triggerHashKey(trigger.getKey()); @@ -716,7 +716,7 @@ public List triggersFired(List triggers, Je * @param jedis a thread-safe Redis connection */ @Override - public void triggeredJobComplete(OperableTrigger trigger, JobDetail jobDetail, Trigger.CompletedExecutionInstruction triggerInstCode, JedisCluster jedis) throws JobPersistenceException, ClassNotFoundException { + public void triggeredJobComplete(OperableTrigger trigger, JobDetail jobDetail, Trigger.CompletedExecutionInstruction triggerInstCode, JedisClusterCommandsWrapper jedis) throws JobPersistenceException, ClassNotFoundException { final String jobHashKey = redisSchema.jobHashKey(jobDetail.getKey()); final String jobDataMapHashKey = redisSchema.jobDataMapHashKey(jobDetail.getKey()); final String triggerHashKey = redisSchema.triggerHashKey(trigger.getKey()); diff --git a/src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java b/src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java index bfb5bd0..3d03a20 100644 --- a/src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java +++ b/src/main/java/net/joelinn/quartz/jobstore/RedisJobStore.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; +import net.joelinn.quartz.jobstore.jedis.JedisClusterCommandsWrapper; import net.joelinn.quartz.jobstore.mixin.CronTriggerMixin; import net.joelinn.quartz.jobstore.mixin.HolidayCalendarMixin; import net.joelinn.quartz.jobstore.mixin.JobDetailMixin; @@ -14,7 +15,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import redis.clients.jedis.*; -import redis.clients.util.Pool; +import redis.clients.jedis.commands.JedisCommands; +import redis.clients.jedis.util.Pool; import java.util.*; @@ -28,7 +30,7 @@ public class RedisJobStore implements JobStore { private Pool jedisPool; - private JedisCluster jedisCluster; + private JedisClusterCommandsWrapper jedisCluster; /** * Redis lock timeout in milliseconds @@ -122,7 +124,7 @@ public RedisJobStore setJedisPool(Pool jedisPool) { } - public RedisJobStore setJedisCluster(JedisCluster jedisCluster) { + public RedisJobStore setJedisCluster(JedisClusterCommandsWrapper jedisCluster) { this.jedisCluster = jedisCluster; return this; } @@ -162,7 +164,7 @@ public void initialize(ClassLoadHelper loadHelper, SchedulerSignaler signaler) t if (redisCluster && jedisCluster == null) { Set nodes = buildNodesSetFromHost(); JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); - jedisCluster = new JedisCluster(nodes, this.conTimeout, this.soTimeout, this.conRetries, this.password,jedisPoolConfig); + jedisCluster = new JedisClusterCommandsWrapper(new JedisCluster(nodes, this.conTimeout, this.soTimeout, this.conRetries, this.password,jedisPoolConfig)); storage = new RedisClusterStorage(redisSchema, mapper, signaler, instanceId, lockTimeout); } else if (jedisPool == null) { JedisPoolConfig jedisPoolConfig = new JedisPoolConfig(); diff --git a/src/main/java/net/joelinn/quartz/jobstore/jedis/JedisClusterCommandsWrapper.java b/src/main/java/net/joelinn/quartz/jobstore/jedis/JedisClusterCommandsWrapper.java new file mode 100644 index 0000000..a155131 --- /dev/null +++ b/src/main/java/net/joelinn/quartz/jobstore/jedis/JedisClusterCommandsWrapper.java @@ -0,0 +1,763 @@ +package net.joelinn.quartz.jobstore.jedis; + +import redis.clients.jedis.*; +import redis.clients.jedis.commands.JedisCommands; +import redis.clients.jedis.params.GeoRadiusParam; +import redis.clients.jedis.params.SetParams; +import redis.clients.jedis.params.ZAddParams; +import redis.clients.jedis.params.ZIncrByParams; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Unfortunately, {@link JedisCluster} does not implement the {@link JedisCommands} interface, even though the vast + * majority of its method signatures line up. This class works around that issue. Hopefully future versions of Jedis + * will render this unnecessary. + * @author Joe Linn + * 7/2/2019 + */ +public class JedisClusterCommandsWrapper implements JedisCommands { + private final JedisCluster cluster; + + public JedisClusterCommandsWrapper(JedisCluster cluster) { + this.cluster = cluster; + } + + + @Override + public String set(String s, String s1) { + return cluster.set(s, s1); + } + + @Override + public String set(String s, String s1, SetParams setParams) { + return cluster.set(s, s1, setParams); + } + + @Override + public String get(String s) { + return cluster.get(s); + } + + @Override + public Boolean exists(String s) { + return cluster.exists(s); + } + + @Override + public Long persist(String s) { + return cluster.persist(s); + } + + @Override + public String type(String s) { + return cluster.type(s); + } + + @Override + public byte[] dump(String s) { + return cluster.dump(s); + } + + @Override + public String restore(String s, int i, byte[] bytes) { + return cluster.restore(s, i, bytes); + } + + @Override + public String restoreReplace(String s, int i, byte[] bytes) { + return null; + } + + @Override + public Long expire(String s, int i) { + return cluster.expire(s, i); + } + + @Override + public Long pexpire(String s, long l) { + return cluster.pexpire(s, l); + } + + @Override + public Long expireAt(String s, long l) { + return cluster.expireAt(s, l); + } + + @Override + public Long pexpireAt(String s, long l) { + return cluster.pexpireAt(s, l); + } + + @Override + public Long ttl(String s) { + return cluster.ttl(s); + } + + @Override + public Long pttl(String s) { + return cluster.pttl(s); + } + + @Override + public Long touch(String s) { + return cluster.touch(s); + } + + @Override + public Boolean setbit(String s, long l, boolean b) { + return cluster.setbit(s, l, b); + } + + @Override + public Boolean setbit(String s, long l, String s1) { + return cluster.setbit(s, l, s1); + } + + @Override + public Boolean getbit(String s, long l) { + return cluster.getbit(s, l); + } + + @Override + public Long setrange(String s, long l, String s1) { + return cluster.setrange(s, l, s1); + } + + @Override + public String getrange(String s, long l, long l1) { + return cluster.getrange(s, l, l1); + } + + @Override + public String getSet(String s, String s1) { + return cluster.getSet(s, s1); + } + + @Override + public Long setnx(String s, String s1) { + return cluster.setnx(s, s1); + } + + @Override + public String setex(String s, int i, String s1) { + return cluster.setex(s, i, s1); + } + + @Override + public String psetex(String s, long l, String s1) { + return cluster.psetex(s, l, s1); + } + + @Override + public Long decrBy(String s, long l) { + return cluster.decrBy(s, l); + } + + @Override + public Long decr(String s) { + return cluster.decr(s); + } + + @Override + public Long incrBy(String s, long l) { + return cluster.incrBy(s, l); + } + + @Override + public Double incrByFloat(String s, double v) { + return cluster.incrByFloat(s, v); + } + + @Override + public Long incr(String s) { + return cluster.incr(s); + } + + @Override + public Long append(String s, String s1) { + return cluster.append(s, s1); + } + + @Override + public String substr(String s, int i, int i1) { + return cluster.substr(s, i, i1); + } + + @Override + public Long hset(String s, String s1, String s2) { + return cluster.hset(s, s1, s2); + } + + @Override + public Long hset(String s, Map map) { + return cluster.hset(s, map); + } + + @Override + public String hget(String s, String s1) { + return cluster.hget(s, s1); + } + + @Override + public Long hsetnx(String s, String s1, String s2) { + return cluster.hsetnx(s, s1, s2); + } + + @Override + public String hmset(String s, Map map) { + return cluster.hmset(s, map); + } + + @Override + public List hmget(String s, String... strings) { + return cluster.hmget(s, strings); + } + + @Override + public Long hincrBy(String s, String s1, long l) { + return cluster.hincrBy(s, s1, l); + } + + @Override + public Double hincrByFloat(String s, String s1, double v) { + return cluster.hincrByFloat(s.getBytes(), s1.getBytes(), v); + } + + @Override + public Boolean hexists(String s, String s1) { + return cluster.hexists(s, s1); + } + + @Override + public Long hdel(String s, String... strings) { + return cluster.hdel(s, strings); + } + + @Override + public Long hlen(String s) { + return cluster.hlen(s); + } + + @Override + public Set hkeys(String s) { + return cluster.hkeys(s); + } + + @Override + public List hvals(String s) { + return cluster.hvals(s); + } + + @Override + public Map hgetAll(String s) { + return cluster.hgetAll(s); + } + + @Override + public Long rpush(String s, String... strings) { + return cluster.rpush(s, strings); + } + + @Override + public Long lpush(String s, String... strings) { + return cluster.lpush(s, strings); + } + + @Override + public Long llen(String s) { + return cluster.llen(s); + } + + @Override + public List lrange(String s, long l, long l1) { + return cluster.lrange(s, l, l1); + } + + @Override + public String ltrim(String s, long l, long l1) { + return cluster.ltrim(s, l, l1); + } + + @Override + public String lindex(String s, long l) { + return cluster.lindex(s, l); + } + + @Override + public String lset(String s, long l, String s1) { + return cluster.lset(s, l, s1); + } + + @Override + public Long lrem(String s, long l, String s1) { + return cluster.lrem(s, l, s1); + } + + @Override + public String lpop(String s) { + return cluster.lpop(s); + } + + @Override + public String rpop(String s) { + return cluster.rpop(s); + } + + @Override + public Long sadd(String s, String... strings) { + return cluster.sadd(s, strings); + } + + @Override + public Set smembers(String s) { + return cluster.smembers(s); + } + + @Override + public Long srem(String s, String... strings) { + return cluster.srem(s, strings); + } + + @Override + public String spop(String s) { + return cluster.spop(s); + } + + @Override + public Set spop(String s, long l) { + return cluster.spop(s, l); + } + + @Override + public Long scard(String s) { + return cluster.scard(s); + } + + @Override + public Boolean sismember(String s, String s1) { + return cluster.sismember(s, s1); + } + + @Override + public String srandmember(String s) { + return cluster.srandmember(s); + } + + @Override + public List srandmember(String s, int i) { + return cluster.srandmember(s, i); + } + + @Override + public Long strlen(String s) { + return cluster.strlen(s); + } + + @Override + public Long zadd(String s, double v, String s1) { + return cluster.zadd(s, v, s1); + } + + @Override + public Long zadd(String s, double v, String s1, ZAddParams zAddParams) { + return cluster.zadd(s, v, s1, zAddParams); + } + + @Override + public Long zadd(String s, Map map) { + return cluster.zadd(s, map); + } + + @Override + public Long zadd(String s, Map map, ZAddParams zAddParams) { + return cluster.zadd(s, map, zAddParams); + } + + @Override + public Set zrange(String s, long l, long l1) { + return cluster.zrange(s, l, l1); + } + + @Override + public Long zrem(String s, String... strings) { + return cluster.zrem(s, strings); + } + + @Override + public Double zincrby(String s, double v, String s1) { + return cluster.zincrby(s, v, s1); + } + + @Override + public Double zincrby(String s, double v, String s1, ZIncrByParams zIncrByParams) { + return cluster.zincrby(s, v, s1, zIncrByParams); + } + + @Override + public Long zrank(String s, String s1) { + return cluster.zrank(s, s1); + } + + @Override + public Long zrevrank(String s, String s1) { + return cluster.zrevrank(s, s1); + } + + @Override + public Set zrevrange(String s, long l, long l1) { + return cluster.zrevrange(s, l, l1); + } + + @Override + public Set zrangeWithScores(String s, long l, long l1) { + return cluster.zrangeWithScores(s, l, l1); + } + + @Override + public Set zrevrangeWithScores(String s, long l, long l1) { + return cluster.zrevrangeWithScores(s, l, l1); + } + + @Override + public Long zcard(String s) { + return cluster.zcard(s); + } + + @Override + public Double zscore(String s, String s1) { + return cluster.zscore(s, s1); + } + + @Override + public List sort(String s) { + return cluster.sort(s); + } + + @Override + public List sort(String s, SortingParams sortingParams) { + return cluster.sort(s, sortingParams); + } + + @Override + public Long zcount(String s, double v, double v1) { + return cluster.zcount(s, v, v1); + } + + @Override + public Long zcount(String s, String s1, String s2) { + return cluster.zcount(s, s1, s1); + } + + @Override + public Set zrangeByScore(String s, double v, double v1) { + return cluster.zrangeByScore(s, v, v1); + } + + @Override + public Set zrangeByScore(String s, String s1, String s2) { + return cluster.zrangeByScore(s, s1, s2); + } + + @Override + public Set zrevrangeByScore(String s, double v, double v1) { + return cluster.zrevrangeByScore(s, v, v1); + } + + @Override + public Set zrangeByScore(String s, double v, double v1, int i, int i1) { + return cluster.zrangeByScore(s, v, v1, i, i1); + } + + @Override + public Set zrevrangeByScore(String s, String s1, String s2) { + return cluster.zrevrangeByScore(s, s1, s2); + } + + @Override + public Set zrangeByScore(String s, String s1, String s2, int i, int i1) { + return cluster.zrangeByScore(s, s1, s2, i, i1); + } + + @Override + public Set zrevrangeByScore(String s, double v, double v1, int i, int i1) { + return cluster.zrevrangeByScore(s, v, v1, i, i1); + } + + @Override + public Set zrangeByScoreWithScores(String s, double v, double v1) { + return cluster.zrangeByScoreWithScores(s, v, v1); + } + + @Override + public Set zrevrangeByScoreWithScores(String s, double v, double v1) { + return cluster.zrevrangeByScoreWithScores(s, v, v1); + } + + @Override + public Set zrangeByScoreWithScores(String s, double v, double v1, int i, int i1) { + return cluster.zrangeByScoreWithScores(s, v, v1, i, i1); + } + + @Override + public Set zrevrangeByScore(String s, String s1, String s2, int i, int i1) { + return cluster.zrevrangeByScore(s, s1, s2, i, i1); + } + + @Override + public Set zrangeByScoreWithScores(String s, String s1, String s2) { + return cluster.zrangeByScoreWithScores(s, s1, s2); + } + + @Override + public Set zrevrangeByScoreWithScores(String s, String s1, String s2) { + return cluster.zrevrangeByScoreWithScores(s, s1, s2); + } + + @Override + public Set zrangeByScoreWithScores(String s, String s1, String s2, int i, int i1) { + return cluster.zrangeByScoreWithScores(s, s1, s2, i , i1); + } + + @Override + public Set zrevrangeByScoreWithScores(String s, double v, double v1, int i, int i1) { + return cluster.zrevrangeByScoreWithScores(s, v, v1, i, i1); + } + + @Override + public Set zrevrangeByScoreWithScores(String s, String s1, String s2, int i, int i1) { + return cluster.zrevrangeByScoreWithScores(s, s1, s2, i, i1); + } + + @Override + public Long zremrangeByRank(String s, long l, long l1) { + return cluster.zremrangeByRank(s, l, l1); + } + + @Override + public Long zremrangeByScore(String s, double v, double v1) { + return cluster.zremrangeByScore(s, v, v1); + } + + @Override + public Long zremrangeByScore(String s, String s1, String s2) { + return cluster.zremrangeByScore(s, s1, s2); + } + + @Override + public Long zlexcount(String s, String s1, String s2) { + return cluster.zlexcount(s, s1, s2); + } + + @Override + public Set zrangeByLex(String s, String s1, String s2) { + return cluster.zrangeByLex(s, s1, s2); + } + + @Override + public Set zrangeByLex(String s, String s1, String s2, int i, int i1) { + return cluster.zrangeByLex(s, s1, s2, i, i1); + } + + @Override + public Set zrevrangeByLex(String s, String s1, String s2) { + return cluster.zrevrangeByLex(s, s1, s2); + } + + @Override + public Set zrevrangeByLex(String s, String s1, String s2, int i, int i1) { + return cluster.zrevrangeByLex(s, s1, s2, i, i1); + } + + @Override + public Long zremrangeByLex(String s, String s1, String s2) { + return cluster.zremrangeByLex(s, s1, s2); + } + + @Override + public Long linsert(String s, ListPosition listPosition, String s1, String s2) { + return cluster.linsert(s, listPosition, s1, s2); + } + + @Override + public Long lpushx(String s, String... strings) { + return cluster.lpushx(s, strings); + } + + @Override + public Long rpushx(String s, String... strings) { + return cluster.rpushx(s, strings); + } + + @Override + public List blpop(int i, String s) { + return cluster.blpop(i, s); + } + + @Override + public List brpop(int i, String s) { + return cluster.brpop(i, s); + } + + @Override + public Long del(String s) { + return cluster.del(s); + } + + @Override + public Long unlink(String s) { + return cluster.unlink(s); + } + + @Override + public String echo(String s) { + return cluster.echo(s); + } + + @Override + public Long move(String s, int i) { + throw new UnsupportedOperationException(); + } + + @Override + public Long bitcount(String s) { + return cluster.bitcount(s); + } + + @Override + public Long bitcount(String s, long l, long l1) { + return cluster.bitcount(s, l, l1); + } + + @Override + public Long bitpos(String s, boolean b) { + throw new UnsupportedOperationException(); + } + + @Override + public Long bitpos(String s, boolean b, BitPosParams bitPosParams) { + throw new UnsupportedOperationException(); + } + + @Override + public ScanResult> hscan(String s, String s1) { + return cluster.hscan(s, s1); + } + + @Override + public ScanResult> hscan(String s, String s1, ScanParams scanParams) { + throw new UnsupportedOperationException(); + } + + @Override + public ScanResult sscan(String s, String s1) { + return cluster.sscan(s, s1); + } + + @Override + public ScanResult zscan(String s, String s1) { + return cluster.zscan(s, s1); + } + + @Override + public ScanResult zscan(String s, String s1, ScanParams scanParams) { + return cluster.zscan(s.getBytes(), s1.getBytes(), scanParams); + } + + @Override + public ScanResult sscan(String s, String s1, ScanParams scanParams) { + throw new UnsupportedOperationException(); + } + + @Override + public Long pfadd(String s, String... strings) { + return cluster.pfadd(s, strings); + } + + @Override + public long pfcount(String s) { + return cluster.pfcount(s); + } + + @Override + public Long geoadd(String s, double v, double v1, String s1) { + return cluster.geoadd(s, v, v1, s1); + } + + @Override + public Long geoadd(String s, Map map) { + return cluster.geoadd(s, map); + } + + @Override + public Double geodist(String s, String s1, String s2) { + return cluster.geodist(s, s1, s2); + } + + @Override + public Double geodist(String s, String s1, String s2, GeoUnit geoUnit) { + return cluster.geodist(s, s1, s2, geoUnit); + } + + @Override + public List geohash(String s, String... strings) { + return cluster.geohash(s, strings); + } + + @Override + public List geopos(String s, String... strings) { + return cluster.geopos(s, strings); + } + + @Override + public List georadius(String s, double v, double v1, double v2, GeoUnit geoUnit) { + return cluster.georadius(s, v, v1, v2, geoUnit); + } + + @Override + public List georadiusReadonly(String s, double v, double v1, double v2, GeoUnit geoUnit) { + return cluster.georadiusReadonly(s, v, v1, v2, geoUnit); + } + + @Override + public List georadius(String s, double v, double v1, double v2, GeoUnit geoUnit, GeoRadiusParam geoRadiusParam) { + return cluster.georadiusReadonly(s, v, v1, v2, geoUnit, geoRadiusParam); + } + + @Override + public List georadiusReadonly(String s, double v, double v1, double v2, GeoUnit geoUnit, GeoRadiusParam geoRadiusParam) { + return cluster.georadiusReadonly(s, v, v1, v2, geoUnit, geoRadiusParam); + } + + @Override + public List georadiusByMember(String s, String s1, double v, GeoUnit geoUnit) { + return cluster.georadiusByMember(s, s1, v, geoUnit); + } + + @Override + public List georadiusByMemberReadonly(String s, String s1, double v, GeoUnit geoUnit) { + return cluster.georadiusByMemberReadonly(s, s1, v, geoUnit); + } + + @Override + public List georadiusByMember(String s, String s1, double v, GeoUnit geoUnit, GeoRadiusParam geoRadiusParam) { + return cluster.georadiusByMember(s, s1, v, geoUnit, geoRadiusParam); + } + + @Override + public List georadiusByMemberReadonly(String s, String s1, double v, GeoUnit geoUnit, GeoRadiusParam geoRadiusParam) { + return cluster.georadiusByMemberReadonly(s, s1, v, geoUnit, geoRadiusParam); + } + + @Override + public List bitfield(String s, String... strings) { + return cluster.bitfield(s, strings); + } + + @Override + public Long hstrlen(String s, String s1) { + return cluster.hstrlen(s, s1); + } +} diff --git a/src/test/java/net/joelinn/quartz/BaseIntegrationTest.java b/src/test/java/net/joelinn/quartz/BaseIntegrationTest.java index b30231b..1f8feba 100644 --- a/src/test/java/net/joelinn/quartz/BaseIntegrationTest.java +++ b/src/test/java/net/joelinn/quartz/BaseIntegrationTest.java @@ -12,7 +12,7 @@ import org.slf4j.LoggerFactory; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool; -import redis.clients.util.Pool; +import redis.clients.jedis.util.Pool; import redis.embedded.RedisServer; import java.util.Properties; diff --git a/src/test/java/net/joelinn/quartz/BaseTest.java b/src/test/java/net/joelinn/quartz/BaseTest.java index b4ce45e..f05187b 100644 --- a/src/test/java/net/joelinn/quartz/BaseTest.java +++ b/src/test/java/net/joelinn/quartz/BaseTest.java @@ -16,7 +16,7 @@ import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPoolConfig; import redis.clients.jedis.Protocol; -import redis.clients.util.Pool; +import redis.clients.jedis.util.Pool; import redis.embedded.RedisServer; import java.io.IOException;