Available Methods
- close ( )
- set ( )
- del ( )
- get ( )
- exists ( )
- expire ( )
- select ( )
- hset ( )
- rpush ( )
- publish ( )
- hget ( )
- lpush ( )
- incr ( )
- sadd ( )
- hdel ( )
- lrange ( )
- setex ( )
- keys ( )
- auth ( )
- hgetAll ( )
- flushAll ( )
- pipelined ( )
- srem ( )
- hmset ( )
- smembers ( )
- scard ( )
- setnx ( )
- connect ( )
- decr ( )
- eval ( )
- multi ( )
- sort ( )
- sismember ( )
- zrangeByScore ( )
- zadd ( )
- hvals ( )
- lpop ( )
- zrange ( )
- rpop ( )
- incrBy ( )
- hmget ( )
- hkeys ( )
- llen ( )
- watch ( )
- brpop ( )
- zrem ( )
- ttl ( )
- linsert ( )
- mget ( )
- configSet ( )
- hexists ( )
- spop ( )
- decrBy ( )
- sdiffstore ( )
- setrange ( )
- zscore ( )
- ltrim ( )
- hlen ( )
- scan ( )
- getSet ( )
- zrevrangeByScoreWithScores ( )
- append ( )
- sdiff ( )
- zcard ( )
- lindex ( )
- subscribe ( )
- rename ( )
- sinter ( )
- lrem ( )
- clientSetname ( )
- persist ( )
- sendCommand ( )
- zrangeWithScores ( )
- zscan ( )
- psubscribe ( )
- zrevrank ( )
- mset ( )
- zrevrangeByScore ( )
- slowlogGet ( )
- flushDB ( )
- sunionstore ( )
- strlen ( )
- disconnect ( )
Related Classes
- java.util.Arrays
- java.util.Collections
- java.util.Date
- java.util.concurrent.TimeUnit
- org.junit.Before
- java.util.UUID
- java.net.URI
- java.util.Map.Entry
- org.junit.Assert
- java.util.Optional
- javax.servlet.http.HttpServletRequest
- com.google.gson.Gson
- org.springframework.context.annotation.Bean
- org.json.JSONObject
- org.apache.commons.lang3.StringUtils
- org.apache.commons.io.IOUtils
- com.google.common.collect.Lists
- org.apache.commons.lang.StringUtils
- org.springframework.util.StringUtils
- com.alibaba.fastjson.JSON
- javax.ws.rs.core.Response
- com.alibaba.fastjson.JSONObject
- redis.clients.jedis.JedisPool
- redis.clients.jedis.JedisPoolConfig
- org.apache.commons.pool2.impl.GenericObjectPoolConfig
Java Code Examples for redis.clients.jedis.Jedis#clientSetname()
The following examples show how to use
redis.clients.jedis.Jedis#clientSetname() .
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: ScriptingCommandsTest.java From cachecloud with Apache License 2.0 | 6 votes |
@Test public void scriptExistsWithBrokenConnection() { Jedis deadClient = new Jedis(jedis.getClient().getHost(), jedis.getClient().getPort()); deadClient.auth("foobared"); deadClient.clientSetname("DEAD"); ClientKillerUtil.killClient(deadClient, "DEAD"); // sure, script doesn't exist, but it's just for checking connection try { deadClient.scriptExists("abcdefg"); } catch (JedisConnectionException e) { // ignore it } assertEquals(true, deadClient.getClient().isBroken()); deadClient.close(); }
Example 2
Source File: ClientKillerUtil.java From cachecloud with Apache License 2.0 | 4 votes |
public static void tagClient(Jedis j, String name) { j.clientSetname(name); }
Example 3
Source File: ShardedJedisTest.java From cachecloud with Apache License 2.0 | 4 votes |
/** * Test for "Issue - BinaryShardedJedis.disconnect() may occur memory leak". You can find more * detailed information at https://github.com/xetorthio/jedis/issues/808 * @throws InterruptedException */ @Test public void testAvoidLeaksUponDisconnect() throws InterruptedException { List<JedisShardInfo> shards = new ArrayList<JedisShardInfo>(2); // 6379 JedisShardInfo shard1 = new JedisShardInfo(redis1.getHost(), redis1.getPort()); shard1.setPassword("foobared"); shards.add(shard1); // 6380 JedisShardInfo shard2 = new JedisShardInfo(redis2.getHost(), redis2.getPort()); shard2.setPassword("foobared"); shards.add(shard2); @SuppressWarnings("resource") ShardedJedis shardedJedis = new ShardedJedis(shards); // establish the connection for two redis servers shardedJedis.set("a", "bar"); JedisShardInfo ak = shardedJedis.getShardInfo("a"); assertEquals(shard2, ak); shardedJedis.set("b", "bar1"); JedisShardInfo bk = shardedJedis.getShardInfo("b"); assertEquals(shard1, bk); // We set a name to the instance so it's easy to find it Iterator<Jedis> it = shardedJedis.getAllShards().iterator(); Jedis deadClient = it.next(); deadClient.clientSetname("DEAD"); ClientKillerUtil.killClient(deadClient, "DEAD"); assertEquals(true, deadClient.isConnected()); assertEquals(false, deadClient.getClient().getSocket().isClosed()); assertEquals(false, deadClient.getClient().isBroken()); // normal - not found shardedJedis.disconnect(); assertEquals(false, deadClient.isConnected()); assertEquals(true, deadClient.getClient().getSocket().isClosed()); assertEquals(true, deadClient.getClient().isBroken()); Jedis jedis2 = it.next(); assertEquals(false, jedis2.isConnected()); assertEquals(true, jedis2.getClient().getSocket().isClosed()); assertEquals(false, jedis2.getClient().isBroken()); }
Example 4
Source File: DefaultRedis.java From craft-atom with MIT License | 4 votes |
private String clientsetname0(Jedis j, String connectionname) { return j.clientSetname(connectionname); }