本文整理了Java中redis.clients.jedis.Jedis.strlen()
方法的一些代码示例,展示了Jedis.strlen()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jedis.strlen()
方法的具体详情如下:
包路径:redis.clients.jedis.Jedis
类名称:Jedis
方法名:strlen
暂无
代码示例来源:origin: sohutv/cachecloud
@Override
public Long execute(Jedis connection) {
return connection.strlen(key);
}
}.run(key);
代码示例来源:origin: sohutv/cachecloud
@Override
public Long execute(Jedis connection) {
return connection.strlen(key);
}
}.runBinary(key);
代码示例来源:origin: sohutv/cachecloud
@Override
public Long strlen(final byte[] key) {
Jedis j = getShard(key);
return j.strlen(key);
}
代码示例来源:origin: sohutv/cachecloud
@Override
public Long strlen(final String key) {
Jedis j = getShard(key);
return j.strlen(key);
}
代码示例来源:origin: Netflix/conductor
@Override
public Long strlen(String key) {
Jedis jedis = null;
try {
jedis = jedisPool.getResource();
return jedis.strlen(key);
} finally {
if (jedis != null)
jedis.close();
}
}
代码示例来源:origin: apache/ignite
/**
* @throws Exception If failed.
*/
@Test
public void testStrlen() throws Exception {
try (Jedis jedis = pool.getResource()) {
Assert.assertEquals(0, (long)jedis.strlen("strlenKeyNonExisting"));
jcache().put("strlenKey", "abc");
Assert.assertEquals(3, (long)jedis.strlen("strlenKey"));
jcache().put("setDataTypeKey", new HashSet<String>(Arrays.asList("1", "2")));
try {
jedis.strlen("setDataTypeKey");
assert false : "Exception has to be thrown!";
}
catch (JedisDataException e) {
assertTrue(e.getMessage().startsWith("WRONGTYPE"));
}
}
}
代码示例来源:origin: spring-projects/spring-data-redis
@Override
public Long strLen(byte[] key) {
Assert.notNull(key, "Key must not be null!");
try {
if (isPipelined()) {
pipeline(connection.newJedisResult(connection.getRequiredPipeline().strlen(key)));
return null;
}
if (isQueueing()) {
transaction(connection.newJedisResult(connection.getRequiredTransaction().strlen(key)));
return null;
}
return connection.getJedis().strlen(key);
} catch (Exception ex) {
throw convertJedisAccessException(ex);
}
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public Long execute(Jedis connection) {
return connection.strlen(key);
}
}.run(key);
代码示例来源:origin: io.leopard/leopard-redis
@Override
public Object execute(Jedis jedis) {
return jedis.strlen(key);
}
});
代码示例来源:origin: apache/servicemix-bundles
@Override
public Long execute(Jedis connection) {
return connection.strlen(key);
}
}.runBinary(key);
代码示例来源:origin: io.leopard/leopard-redis
@Override
public Long strlen(String key) {
return jedis.strlen(key);
}
代码示例来源:origin: org.tinygroup/org.tinygroup.jedis
public Long strlen(final String key) {
Jedis j = getReadShard(key);
return j.strlen(key);
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public Long strlen(final byte[] key) {
Jedis j = getShard(key);
return j.strlen(key);
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public Long strlen(byte[] key) {
String command = "strlen";
return instrumented(command, () -> delegated.strlen(key));
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public Long strlen(String key) {
String command = "strlen";
return instrumented(command, () -> delegated.strlen(key));
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public Long strlen(final String key) {
Jedis j = getShard(key);
return j.strlen(key);
}
代码示例来源:origin: gresrun/jesque
protected KeyInfo handleString(final Jedis jedis) {
final KeyInfo keyInfo = new KeyInfo(this.key, KeyType.STRING);
keyInfo.setSize(jedis.strlen(this.key));
if (this.doArrayValue) {
final List<String> arrayValue = new ArrayList<String>(1);
arrayValue.add(jedis.get(this.key));
keyInfo.setArrayValue(arrayValue);
}
return keyInfo;
}
代码示例来源:origin: com.netflix.conductor/conductor-redis-persistence
@Override
public Long strlen(String key) {
Jedis jedis = null;
try {
jedis = jedisPool.getResource();
return jedis.strlen(key);
} finally {
if (jedis != null)
jedis.close();
}
}
代码示例来源:origin: org.nutz/nutz-integration-jedis
public Long strlen(String key) {
Jedis jedis = getJedis();
try {
return jedis.strlen(key);
} finally {Streams.safeClose(jedis);}
}
代码示例来源:origin: org.nutz/nutz-integration-jedis
public Long strlen(byte[] key) {
Jedis jedis = getJedis();
try {
return jedis.strlen(key);
} finally {Streams.safeClose(jedis);}
}
内容来源于网络,如有侵权,请联系作者删除!