Added DEBUG command

This commit is contained in:
Jonathan Leibiusky
2010-09-15 20:17:30 -03:00
parent 3d1546131a
commit 1312c4d4ae
4 changed files with 63 additions and 0 deletions

View File

@@ -596,4 +596,8 @@ public class Client extends Connection {
String value) {
sendCommand("LINSERT", key, where.toString(), pivot, value);
}
public void debug(DebugParams params) {
sendCommand("DEBUG", params.getCommand());
}
}

View File

@@ -0,0 +1,43 @@
package redis.clients.jedis;
public class DebugParams {
private String[] command;
public String[] getCommand() {
return command;
}
private DebugParams() {
}
public static DebugParams SEGFAULT() {
DebugParams debugParams = new DebugParams();
debugParams.command = new String[] { "SEGFAULT" };
return debugParams;
}
public static DebugParams OBJECT(String key) {
DebugParams debugParams = new DebugParams();
debugParams.command = new String[] { "OBJECT", key };
return debugParams;
}
public static DebugParams SWAPIN(String key) {
DebugParams debugParams = new DebugParams();
debugParams.command = new String[] { "SWAPIN", key };
return debugParams;
}
public static DebugParams RELOAD() {
DebugParams debugParams = new DebugParams();
debugParams.command = new String[] { "RELOAD" };
return debugParams;
}
public static DebugParams SWAPOUT(String key) {
DebugParams debugParams = new DebugParams();
debugParams.command = new String[] { "SWAPOUT", key };
return debugParams;
}
}

View File

@@ -838,4 +838,9 @@ public class Jedis {
client.linsert(key, where, pivot, value);
return client.getIntegerReply();
}
public String debug(DebugParams params) {
client.debug(params);
return client.getStatusCodeReply();
}
}