本文整理匯總了Java中redis.clients.jedis.Jedis.hexists方法的典型用法代碼示例。如果您正苦於以下問題:Java Jedis.hexists方法的具體用法?Java Jedis.hexists怎麽用?Java Jedis.hexists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類redis.clients.jedis.Jedis
的用法示例。
在下文中一共展示了Jedis.hexists方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: hexists
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
public boolean hexists(String key, String field) {
Jedis jedis = null;
boolean success = true;
try {
jedis = jedisPool.getResource();
if (jedis == null) {
success = false;
return false;
}
return jedis.hexists(key, field);
} catch (Exception e) {
success = false;
returnBrokenResource(jedis, "hexists", e);
} finally {
releaseReidsSource(success, jedis);
}
return false;
}
示例2: mapExists
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
/**
* 判斷Map緩存中的Key是否存在
*
* @param key 鍵
* @param mapKey 值
* @return
*/
public static boolean mapExists(String key, String mapKey) {
boolean result = false;
Jedis jedis = null;
try {
jedis = getResource();
result = jedis.hexists(key, mapKey);
logger.debug("mapExists {} {}", key, mapKey);
} catch (Exception e) {
logger.warn("mapExists {} {}", key, mapKey, e);
} finally {
returnResource(jedis);
}
return result;
}
示例3: mapObjectExists
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
/**
* 判斷Map緩存中的Key是否存在
*
* @param key 鍵
* @param mapKey 值
* @return
*/
public static boolean mapObjectExists(String key, String mapKey) {
boolean result = false;
Jedis jedis = null;
try {
jedis = getResource();
result = jedis.hexists(getBytesKey(key), getBytesKey(mapKey));
logger.debug("mapObjectExists {} {}", key, mapKey);
} catch (Exception e) {
logger.warn("mapObjectExists {} {}", key, mapKey, e);
} finally {
returnResource(jedis);
}
return result;
}
示例4: hexists
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
@Override
public Boolean hexists(String key, String field) {
Jedis jedis = jedisPool.getResource();
Boolean result = jedis.hexists(key, field);
jedis.close();
return result;
}
示例5: mapExists
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
/**
* 判斷Map緩存中的Key是否存在
* @param key 鍵
* @return
*/
public static boolean mapExists(String key, String mapKey) {
boolean result = false;
Jedis jedis = null;
try {
jedis = getResource();
result = jedis.hexists(key, mapKey);
logger.debug("mapExists {} {}", key, mapKey);
} catch (Exception e) {
logger.warn("mapExists {} {}", key, mapKey, e);
} finally {
returnResource(jedis);
}
return result;
}
示例6: mapObjectExists
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
/**
* 判斷Map緩存中的Key是否存在
* @param key 鍵
* @return
*/
public static boolean mapObjectExists(String key, String mapKey) {
boolean result = false;
Jedis jedis = null;
try {
jedis = getResource();
result = jedis.hexists(getBytesKey(key), getBytesKey(mapKey));
logger.debug("mapObjectExists {} {}", key, mapKey);
} catch (Exception e) {
logger.warn("mapObjectExists {} {}", key, mapKey, e);
} finally {
returnResource(jedis);
}
return result;
}
示例7: hexists
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
@Override
public Boolean hexists(String key, String field) {
Jedis jedis = null;
Boolean res = false;
try {
jedis = pool.getResource();
res = jedis.hexists(key, field);
} catch (Exception e) {
LOGGER.error(e.getMessage());
} finally {
returnResource(pool, jedis);
}
return res;
}