upgrade to Jedis 2.1.0 incl. prev unsupported methods

DATAREDIS-90
the upgrade provides a fix as well when connecting to Jedis 2.0.0 for
backwards compatibility
This commit is contained in:
Costin Leau
2012-05-23 21:08:18 +03:00
parent a98f94d15d
commit c44f9d4140
2 changed files with 16 additions and 8 deletions

View File

@@ -5,7 +5,7 @@ log4jVersion = 1.2.16
slf4jVersion = 1.6.4
# Common libraries
springVersion = 3.1.0.RELEASE
springVersion = 3.1.1.RELEASE
jacksonVersion = 1.8.6
# Testing
@@ -13,7 +13,7 @@ junitVersion = 4.8.1
mockitoVersion = 1.8.5
# Drivers
jedisVersion = 2.0.0
jedisVersion = 2.1.0
jredisVersion = 03122010
rjcVersion= 0.6.4
@@ -21,7 +21,7 @@ rjcVersion= 0.6.4
## OSGi ranges
spring.range = "[3.1.0, 4.0.0)"
jedis.range = "[2.0.0, 2.0.0]"
jedis.range = "[2.1.0, 2.1.0]"
jackson.range = "[1.6, 2.0.0)"
rjc.range = "[0.6.4, 0.6.4]"

View File

@@ -1021,7 +1021,14 @@ public class JedisConnection implements RedisConnection {
if (isPipelined()) {
throw new UnsupportedOperationException();
}
return (jedis.getbit(key, offset) == 0 ? Boolean.FALSE : Boolean.TRUE);
// compatibility check for Jedis 2.0.0
Object getBit = jedis.getbit(key, offset);
// Jedis 2.0
if (getBit instanceof Long) {
return (((Long)getBit) == 0 ? Boolean.FALSE : Boolean.TRUE);
}
// Jedis 2.1
return ((Boolean) getBit);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
@@ -1846,7 +1853,7 @@ public class JedisConnection implements RedisConnection {
if (isPipelined()) {
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
return jedis.zrevrangeByScore(key, max, min, (int) offset, (int) count);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
@@ -1861,7 +1868,7 @@ public class JedisConnection implements RedisConnection {
if (isPipelined()) {
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
return jedis.zrevrangeByScore(key, max, min);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
@@ -1876,7 +1883,8 @@ public class JedisConnection implements RedisConnection {
if (isPipelined()) {
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
return JedisUtils.convertJedisTuple(jedis.zrevrangeByScoreWithScores(key, max, min, (int) offset,
(int) count));
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
@@ -1891,7 +1899,7 @@ public class JedisConnection implements RedisConnection {
if (isPipelined()) {
throw new UnsupportedOperationException();
}
throw new UnsupportedOperationException();
return JedisUtils.convertJedisTuple(jedis.zrevrangeByScoreWithScores(key, max, min));
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}