本文整理了Java中redis.clients.jedis.Jedis.getDB()
方法的一些代码示例,展示了Jedis.getDB()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jedis.getDB()
方法的具体详情如下:
包路径:redis.clients.jedis.Jedis
类名称:Jedis
方法名:getDB
暂无
代码示例来源:origin: spring-projects/spring-data-redis
/**
* Constructs a new <code>JedisConnection</code> instance backed by a jedis pool.
*
* @param jedis
* @param pool can be null, if no pool is used
* @param dbIndex
* @param clientName the client name, can be {@literal null}.
* @since 1.8
*/
protected JedisConnection(Jedis jedis, @Nullable Pool<Jedis> pool, int dbIndex, String clientName) {
this.jedis = jedis;
this.pool = pool;
this.dbIndex = dbIndex;
this.clientName = clientName;
// select the db
// if this fail, do manual clean-up before propagating the exception
// as we're inside the constructor
if (dbIndex != jedis.getDB()) {
try {
select(dbIndex);
} catch (DataAccessException ex) {
close();
throw ex;
}
}
}
代码示例来源:origin: io.leopard/leopard-redis
@Override
public Long getDB() {
return jedis.getDB();
}
代码示例来源:origin: penggle/jedis-ms-sentinel
public Long getDB() {
return master.getDB();
}
代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis
@Override
public Long getDB() {
String command = "getDB";
return instrumented(command, () -> delegated.getDB());
}
代码示例来源:origin: org.nutz/nutz-integration-jedis
public Long getDB() {
Jedis jedis = getJedis();
try {
return jedis.getDB();
} finally {Streams.safeClose(jedis);}
}
代码示例来源:origin: org.springframework.data/spring-data-redis
/**
* Constructs a new <code>JedisConnection</code> instance backed by a jedis pool.
*
* @param jedis
* @param pool can be null, if no pool is used
* @param dbIndex
* @param clientName the client name, can be {@literal null}.
* @since 1.8
*/
protected JedisConnection(Jedis jedis, @Nullable Pool<Jedis> pool, int dbIndex, String clientName) {
this.jedis = jedis;
this.pool = pool;
this.dbIndex = dbIndex;
this.clientName = clientName;
// select the db
// if this fail, do manual clean-up before propagating the exception
// as we're inside the constructor
if (dbIndex != jedis.getDB()) {
try {
select(dbIndex);
} catch (DataAccessException ex) {
close();
throw ex;
}
}
}
代码示例来源:origin: apache/servicemix-bundles
/**
* Constructs a new <code>JedisConnection</code> instance backed by a jedis pool.
*
* @param jedis
* @param pool can be null, if no pool is used
* @param dbIndex
* @param clientName the client name, can be {@literal null}.
* @since 1.8
*/
protected JedisConnection(Jedis jedis, @Nullable Pool<Jedis> pool, int dbIndex, String clientName) {
this.jedis = jedis;
this.pool = pool;
this.dbIndex = dbIndex;
this.clientName = clientName;
// select the db
// if this fail, do manual clean-up before propagating the exception
// as we're inside the constructor
if (dbIndex != jedis.getDB()) {
try {
select(dbIndex);
} catch (DataAccessException ex) {
close();
throw ex;
}
}
}
内容来源于网络,如有侵权,请联系作者删除!