Implemented CONFIG
This commit is contained in:
@@ -547,4 +547,12 @@ public class Client extends Connection {
|
|||||||
public void slaveofNoOne() {
|
public void slaveofNoOne() {
|
||||||
sendCommand("SLAVEOF", "no", "one");
|
sendCommand("SLAVEOF", "no", "one");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void configGet(String pattern) {
|
||||||
|
sendCommand("CONFIG", "GET", pattern);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void configSet(String parameter, String value) {
|
||||||
|
sendCommand("CONFIG", "SET", parameter, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -670,4 +670,14 @@ public class Jedis {
|
|||||||
return client.getStatusCodeReply();
|
return client.getStatusCodeReply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<String> configGet(String pattern) {
|
||||||
|
client.configGet(pattern);
|
||||||
|
return client.getMultiBulkReply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String configSet(String parameter, String value) {
|
||||||
|
client.configSet(parameter, value);
|
||||||
|
return client.getStatusCodeReply();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package redis.clients.jedis.tests.commands;
|
package redis.clients.jedis.tests.commands;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import redis.clients.jedis.JedisException;
|
import redis.clients.jedis.JedisException;
|
||||||
@@ -55,4 +57,19 @@ public class ControlCommandsTest extends JedisCommandTestBase {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void configGet() {
|
||||||
|
List<String> info = jedis.configGet("m*");
|
||||||
|
assertNotNull(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void configSet() {
|
||||||
|
List<String> info = jedis.configGet("maxmemory");
|
||||||
|
String memory = info.get(1);
|
||||||
|
String status = jedis.configSet("maxmemory", "200");
|
||||||
|
assertEquals("OK", status);
|
||||||
|
jedis.configSet("maxmemory", memory);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user