Java Code Examples for redis.clients.jedis.Jedis#configSet()
The following examples show how to use
redis.clients.jedis.Jedis#configSet() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Redis.java From SPADE with GNU General Public License v3.0 | 6 votes |
/** * This method is invoked by the kernel to initialize the storage. * * @param arguments The directory path of the scaffold storage. * @return True if the storage was initialized successfully. */ @Override public boolean initialize(String arguments) { try { childScaffold = new Jedis("localhost"); parentScaffold = new Jedis("localhost"); childScaffold.configSet("dir", "/space/spade/tc/SPADE_v3/db/scaffold/"); childScaffold.configSet("maxmemory", "5GB" ); childScaffold.configSet("maxmemory-policy", "allkeys-lfu" ); logger.log(Level.INFO, "Scaffold initialized successfully!"); } catch(Exception ex) { logger.log(Level.SEVERE, "Unable to initialize scaffold!", ex); return false; } return true; }
Example 2
Source File: JedisCommandTestBase.java From cachecloud with Apache License 2.0 | 5 votes |
@Before public void setUp() throws Exception { jedis = new Jedis(hnp.getHost(), hnp.getPort(), 500); jedis.connect(); jedis.auth("foobared"); jedis.configSet("timeout", "300"); jedis.flushAll(); }
Example 3
Source File: JedisTest.java From cachecloud with Apache License 2.0 | 5 votes |
@Test(expected = JedisConnectionException.class) public void timeoutConnection() throws Exception { jedis = new Jedis("localhost", 6379, 15000); jedis.auth("foobared"); jedis.configSet("timeout", "1"); Thread.sleep(2000); jedis.hmget("foobar", "foo"); }
Example 4
Source File: JedisTest.java From cachecloud with Apache License 2.0 | 5 votes |
@Test(expected = JedisConnectionException.class) public void timeoutConnectionWithURI() throws Exception { jedis = new Jedis(new URI("redis://:foobared@localhost:6380/2"), 15000); jedis.configSet("timeout", "1"); Thread.sleep(2000); jedis.hmget("foobar", "foo"); }
Example 5
Source File: XRedisXpipeCommandTest.java From x-pipe with Apache License 2.0 | 4 votes |
@Test public void testReplall() throws IOException { RedisMeta redis = new RedisMeta().setIp("127.0.0.1").setPort(6379); RedisMeta redisSlave = new RedisMeta().setIp("127.0.0.1").setPort(6479); RedisMeta redisSlaveSlave = new RedisMeta().setIp("127.0.0.1").setPort(6579); startRedis(redis); startRedis(redisSlave, redis); startRedis(redisSlaveSlave, redisSlave); Jedis jedisSlave = createJedis(redisSlave); Jedis jedisSlaveSlave = createJedis(redisSlaveSlave); jedisSlave.configSet("slave-read-only", "no"); assertReplicate(jedisSlave, false, jedisSlaveSlave); jedisSlave.configSet("slave-repl-all", "yes"); assertReplicate(jedisSlave, true, jedisSlaveSlave); jedisSlave.configSet("slave-repl-all", "no"); assertReplicate(jedisSlave, false, jedisSlaveSlave); }
Example 6
Source File: DefaultRedis.java From craft-atom with MIT License | 4 votes |
private String configset0(Jedis j, String parameter, String value) { return j.configSet(parameter, value); }