Add Redis 2.6 info(section) method to Connections

DATAREDIS-183
This commit is contained in:
Jennifer Hickey
2013-06-24 18:15:39 -07:00
parent e9d1901298
commit 83a507bf1d
13 changed files with 106 additions and 0 deletions

View File

@@ -236,6 +236,10 @@ public class DefaultStringRedisConnection implements StringRedisConnection {
return delegate.info();
}
public Properties info(String section) {
return delegate.info(section);
}
public boolean isClosed() {
return delegate.isClosed();
}

View File

@@ -41,6 +41,8 @@ public interface RedisServerCommands {
Properties info();
Properties info(String section);
void shutdown();
List<String> getConfig(String pattern);

View File

@@ -476,6 +476,11 @@ public class JedisConnection implements RedisConnection {
}
public Properties info(String section) {
throw new UnsupportedOperationException();
}
public Long lastSave() {
try {
if (isQueueing()) {

View File

@@ -276,6 +276,11 @@ public class JredisConnection implements RedisConnection {
}
public Properties info(String section) {
throw new UnsupportedOperationException();
}
public Long lastSave() {
try {
return (Long)jredis.lastsave();

View File

@@ -406,6 +406,19 @@ public class LettuceConnection implements RedisConnection {
}
public Properties info(String section) {
try {
if (isPipelined()) {
pipeline(getAsyncConnection().info(section));
return null;
}
return LettuceUtils.info(getConnection().info(section));
} catch (Exception ex) {
throw convertLettuceAccessException(ex);
}
}
public Long lastSave() {
try {
if (isPipelined()) {

View File

@@ -322,6 +322,19 @@ public class SrpConnection implements RedisConnection {
}
public Properties info(String section) {
try {
if (isPipelined()) {
pipeline(pipeline.info(section));
return null;
}
return SrpUtils.info(client.info(section));
} catch (Exception ex) {
throw convertSrpAccessException(ex);
}
}
public Long lastSave() {
try {
if (isPipelined()) {