redis.clients.jedis.Jedis.del()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(412)

本文整理了Java中redis.clients.jedis.Jedis.del()方法的一些代码示例,展示了Jedis.del()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jedis.del()方法的具体详情如下:
包路径:redis.clients.jedis.Jedis
类名称:Jedis
方法名:del

Jedis.del介绍

[英]Remove the specified keys. If a given key does not exist no operation is performed for this key. The command returns the number of keys removed. Time complexity: O(1)
[中]删除指定的密钥。如果给定的密钥不存在,则不会对此密钥执行任何操作。该命令返回已删除的键数。时间复杂度:O(1)

代码示例

代码示例来源:origin: apache/storm

@Override
public Long del(byte[] key) {
  return jedis.del(key);
}

代码示例来源:origin: apache/storm

@Override
public Long del(String key) {
  return jedis.del(key);
}

代码示例来源:origin: sohutv/cachecloud

@Override
 public Long execute(Jedis connection) {
  return connection.del(key);
 }
}.runBinary(key);

代码示例来源:origin: sohutv/cachecloud

@Override
 public Long execute(Jedis connection) {
  return connection.del(keys);
 }
}.runBinary(keys.length, keys);

代码示例来源:origin: sohutv/cachecloud

@Override
 public Long execute(Jedis connection) {
  return connection.del(key);
 }
}.run(key);

代码示例来源:origin: sohutv/cachecloud

@Override
 public Long execute(Jedis connection) {
  return connection.del(keys);
 }
}.run(keys.length, keys);

代码示例来源:origin: sohutv/cachecloud

@Override
public Long del(String key) {
 Jedis j = getShard(key);
 return j.del(key);
}

代码示例来源:origin: sohutv/cachecloud

@Override
public Long del(byte[] key) {
 Jedis j = getShard(key);
 return j.del(key);
}

代码示例来源:origin: looly/hutool

/**
 * 从Redis中删除多个值
 * 
 * @param keys 需要删除值对应的键列表
 * @return 删除个数,0表示无key可删除
 */
public Long del(String... keys) {
  try (Jedis jedis = getJedis()) {
    return jedis.del(keys);
  }
}

代码示例来源:origin: looly/hutool

/**
 * 从Redis中删除多个值
 * 
 * @param keys 需要删除值对应的键列表
 * @return 删除个数,0表示无key可删除
 */
public Long del(String... keys) {
  try (Jedis jedis = getJedis()) {
    return jedis.del(keys);
  }
}

代码示例来源:origin: shuzheng/zheng

/**
 * 删除值
 * @param key
 */
public synchronized static void remove(String key) {
  try {
    Jedis jedis = getJedis();
    jedis.del(key);
    jedis.close();
  } catch (Exception e) {
    LOGGER.error("Remove keyex error : " + e);
  }
}

代码示例来源:origin: shuzheng/zheng

/**
 * 删除值
 * @param key
 */
public synchronized static void remove(byte[] key) {
  try {
    Jedis jedis = getJedis();
    jedis.del(key);
    jedis.close();
  } catch (Exception e) {
    LOGGER.error("Remove keyex error : " + e);
  }
}

代码示例来源:origin: yu199195/hmily

@Override
public Long del(final String... keys) {
  try (Jedis jedis = jedisSentinelPool.getResource()) {
    return jedis.del(keys);
  }
}

代码示例来源:origin: code4craft/webmagic

@Override
public void resetDuplicateCheck(Task task) {
  Jedis jedis = pool.getResource();
  try {
    jedis.del(getSetKey(task));
  } finally {
    pool.returnResource(jedis);
  }
}

代码示例来源:origin: code4craft/webmagic

@Override
public void resetDuplicateCheck(Task task)
{
  Jedis jedis = pool.getResource();
  try
  {
    jedis.del(getSetKey(task));
  }
  finally
  {
    pool.returnResource(jedis);
  }
}

代码示例来源:origin: qiurunze123/miaosha

public  Long del(String key){
  Jedis jedis = null;
  Long result = null;
  try {
    jedis =  jedisPool.getResource();
    result = jedis.del(key);
  } catch (Exception e) {
    log.error("del key:{} error",key,e);
    jedisPool.returnBrokenResource(jedis);
    return result;
  }
  jedisPool.returnResource(jedis);
  return result;
}

代码示例来源:origin: qiurunze123/miaosha

/**
 * 删除
 * */
public boolean delete(KeyPrefix prefix, String key) {
   Jedis jedis = null;
   try {
     jedis =  jedisPool.getResource();
    //生成真正的key
    String realKey  = prefix.getPrefix() + key;
    long ret =  jedis.del(realKey);
    return ret > 0;
   }finally {
     returnToPool(jedis);
   }
}

代码示例来源:origin: changmingxie/tcc-transaction

@Override
  public Long doInJedis(Jedis jedis) {
    return jedis.del(RedisHelper.getRedisKey(keyPrefix, transaction.getXid()));
  }
});

代码示例来源:origin: jfinal/jfinal

/**
 * 删除给定的多个 key
 * 不存在的 key 会被忽略。
 */
public Long del(Object... keys) {
  Jedis jedis = getJedis();
  try {
    return jedis.del(keysToBytesArray(keys));
  }
  finally {close(jedis);}
}

代码示例来源:origin: jfinal/jfinal

/**
 * 删除给定的一个 key
 * 不存在的 key 会被忽略。
 */
public Long del(Object key) {
  Jedis jedis = getJedis();
  try {
    return jedis.del(keyToBytes(key));
  }
  finally {close(jedis);}
}

相关文章

Jedis类方法