本文整理匯總了Java中redis.clients.jedis.Jedis.srem方法的典型用法代碼示例。如果您正苦於以下問題:Java Jedis.srem方法的具體用法?Java Jedis.srem怎麽用?Java Jedis.srem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類redis.clients.jedis.Jedis
的用法示例。
在下文中一共展示了Jedis.srem方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: sremString
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
public long sremString(String key, String value) {
Jedis jedis = null;
boolean success = true;
long ret = 0L;
try {
jedis = jedisPool.getResource();
if (jedis == null) {
success = false;
return ret;
}
ret = jedis.srem(key, value);
} catch (Exception e) {
success = false;
returnBrokenResource(jedis, "sremString" + key, e);
} finally {
releaseReidsSource(success, jedis);
}
return ret;
}
示例2: sremStrings
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
public long sremStrings(String key, String... values) {
Jedis jedis = null;
boolean success = true;
long ret = 0L;
try {
jedis = jedisPool.getResource();
if (jedis == null) {
success = false;
return ret;
}
ret = jedis.srem(key, values);
} catch (Exception e) {
success = false;
returnBrokenResource(jedis, "sremStrings" + key, e);
} finally {
releaseReidsSource(success, jedis);
}
return ret;
}
示例3: delSetByKey
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
/**
* 刪除Set
* @param dkey
* @return
*/
public Long delSetByKey(String key,String...dkey) throws Exception {
Jedis jds = null;
try {
jds = getJedis();
jds.select(0);
Long result = 0L;
if(null == dkey){
result = jds.srem(key);
}else{
result = jds.del(key);
}
return result;
} catch (Exception e) {
throw e;
} finally {
if(jds != null)
{
jds.close();
}
}
}
示例4: resetRequestRepeatCheck
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
@Override
public void resetRequestRepeatCheck(Task task, Request request) {
Jedis jedis = jedisPool.getResource();
try {
jedis.srem(RedisKeys.getSetKey(task), request.key());
} finally {
jedis.close();
}
}
示例5: srem
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
@Override
public Long srem(String key, String... members) {
Jedis jedis = null;
Long res = null;
try {
jedis = pool.getResource();
res = jedis.srem(key, members);
} catch (Exception e) {
LOGGER.error(e.getMessage());
} finally {
returnResource(pool, jedis);
}
return res;
}
示例6: onJoin
import redis.clients.jedis.Jedis; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.LOWEST)
public void onJoin(PlayerJoinEvent event)
{
final Player player = event.getPlayer();
if (forceUrl != null)
{
currentlyDownloading.add(player.getUniqueId());
sendPack(player, forceUrl);
//Kick if still downloading after 1 minute
Bukkit.getScheduler().runTaskLater(SamaGamesAPI.get().getPlugin(),
() -> {
if(currentlyDownloading.contains(player.getUniqueId()) && player.isOnline())
{
if (callback == null || callback.automaticKick(player))
{
player.kickPlayer(rejectMessage);
}
currentlyDownloading.remove(player.getUniqueId());
APIPlugin.getInstance().getLogger().info("Player " + player.getName() + " timed out resource pack");
}
}, 1200L);//20*60
} else
{
Jedis jedis = api.getBungeeResource();
Long l = jedis.srem("playersWithPack", player.getUniqueId().toString());
jedis.close();
if (l > 0)
{
//Better to check than force resourcepack
player.setResourcePack(resetUrl);
APIPlugin.getInstance().getLogger().info("Sending pack to " + player.getName() + " : " + resetUrl);
}
}
}