本文整理汇总了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);
}
}
}