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

x33g5p2x  于2022-01-26 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(223)

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

Pipeline.zrem介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public Long zRem(byte[] key, byte[]... values) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(values, "Values must not be null!");
  Assert.noNullElements(values, "Values must not contain null elements!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().zrem(key, values)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().zrem(key, values)));
      return null;
    }
    return connection.getJedis().zrem(key, values);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: Impetus/Kundera

private void unIndex(final AttributeWrapper wrapper, final String member)
{
  Set<String> keys = wrapper.getIndexes().keySet();
  // keys
  for (String key : keys)
  {
    if (this.pipeLineOrConnection.getClass().isAssignableFrom(Transaction.class))
    {
      ((Transaction) this.pipeLineOrConnection).zrem(key, member);
    }
    else
    {
      ((Pipeline) this.pipeLineOrConnection).zrem(key, member);
    }
  }
}

代码示例来源:origin: Impetus/Kundera

/**
 * Deletes inverted indexes from redis.
 * 
 * @param connection
 *            redis instance.
 * @param wrapper
 *            attribute wrapper
 * @param member
 *            sorted set member name.
 */
private void unIndex(final Object connection, final AttributeWrapper wrapper, final String member)
{
  Set<String> keys = wrapper.getIndexes().keySet();
  for (String key : keys)
  {
    if (resource != null && resource.isActive())
    {
      ((Transaction) connection).zrem(key, member);
    }
    else
    {
      ((Pipeline) connection).zrem(key, member);
    }
  }
}

代码示例来源:origin: Netflix/dyno-queues

@Override
public Response<Long> zrem(String key, String member) {
  return pipe.zrem(key, member);
}

代码示例来源:origin: com.netflix.dyno/dyno-jedis

@Override
Response<Long> execute(Pipeline jedisPipeline) throws DynoException {
  return jedisPipeline.zrem(key, member);
}

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public Response<Long> zrem(String key, String... member) {
 String command = "zrem";
 return instrumented(command, () -> delegated.zrem(key, member));
}

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public Response<Long> zrem(byte[] key, byte[]... member) {
 String command = "zrem";
 return instrumented(command, () -> delegated.zrem(key, member));
}

代码示例来源:origin: com.impetus.client/kundera-redis

private void unIndex(final AttributeWrapper wrapper, final String member)
{
  Set<String> keys = wrapper.getIndexes().keySet();
   // keys
  for (String key : keys)
  {
    if (this.pipeLineOrConnection.getClass().isAssignableFrom(Transaction.class))
    {
      ((Transaction) this.pipeLineOrConnection).zrem(key, member);
    }
    else
    {
      ((Pipeline) this.pipeLineOrConnection).zrem(key, member);
    }
  }
}

代码示例来源:origin: Impetus/Kundera

((Pipeline) connection).zrem(
    getHashKey(entityMetadata.getTableName(),
        ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName()), rowKey);

代码示例来源:origin: RedisLabs/redis-quartz

try (Jedis jedis = pool.getResource()) {
   Pipeline p = jedis.pipelined();
   p.zrem(RedisTriggerState.WAITING.getKey(), triggerHashKey);
   p.zrem(RedisTriggerState.PAUSED.getKey(), triggerHashKey);
   p.zrem(RedisTriggerState.BLOCKED.getKey(), triggerHashKey);
   p.zrem(RedisTriggerState.PAUSED_BLOCKED.getKey(), triggerHashKey);
   p.zrem(RedisTriggerState.ACQUIRED.getKey(), triggerHashKey);
   p.zrem(RedisTriggerState.COMPLETED.getKey(), triggerHashKey);
   p.zrem(RedisTriggerState.ERROR.getKey(), triggerHashKey);
   List<Object> results = p.syncAndReturnAll();

代码示例来源:origin: com.impetus.client/kundera-redis

/**
 * Deletes inverted indexes from redis.
 * 
 * @param connection
 *            redis instance.
 * @param wrapper
 *            attribute wrapper
 * @param member
 *            sorted set member name.
 */
private void unIndex(final Object connection, final AttributeWrapper wrapper, final String member)
{
  Set<String> keys = wrapper.getIndexes().keySet();
  for (String key : keys)
  {
    if (resource != null && resource.isActive())
    {
      ((Transaction) connection).zrem(key, member);
    }
    else
    {
      ((Pipeline) connection).zrem(key, member);
    }
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public Long zRem(byte[] key, byte[]... values) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(values, "Values must not be null!");
  Assert.noNullElements(values, "Values must not contain null elements!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().zrem(key, values)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().zrem(key, values)));
      return null;
    }
    return connection.getJedis().zrem(key, values);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: org.springframework.data/spring-data-redis

@Override
public Long zRem(byte[] key, byte[]... values) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(values, "Values must not be null!");
  Assert.noNullElements(values, "Values must not contain null elements!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().zrem(key, values)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().zrem(key, values)));
      return null;
    }
    return connection.getJedis().zrem(key, values);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: pyloque/captain

public void cancel(ServiceItem item) {
  List<String> watchedKeys = new ArrayList<String>(1);
  watchedKeys.add(keyForVersion(item.getName()));
  Holder<Double> score = new Holder<Double>();
  this.redis.execute(jedis -> {
    score.set(jedis.zscore(keyForSet(item.getName()), item.getKey()));
  });
  if (score.value() == null) {
    return;
  }
  this.redis.pipeline(pipe -> {
    pipe.zrem(keyForSet(item.getName()), item.getKey());
    pipe.hdel(keyForPayload(item.getName()), item.getKey());
    pipe.incr(keyForVersion(item.getName()));
    pipe.incr(globalVersionKey);
  });
}

代码示例来源:origin: com.impetus.client/kundera-redis

((Pipeline) connection).zrem(
    getHashKey(entityMetadata.getTableName(),
        ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName()), rowKey);

相关文章

Pipeline类方法