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

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

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

Pipeline.srem介绍

暂无

代码示例

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

@Override
public Long sRem(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().srem(key, values)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().srem(key, values)));
      return null;
    }
    return connection.getJedis().srem(key, values);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

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

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

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

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

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

代码示例来源:origin: com.netflix.spinnaker.fiat/fiat-roles

@Override
public void remove(@NonNull String id) {
 try {
  redisClientDelegate.withCommandsClient(jedis -> {
   Map<String, String> userRolesById = jedis.hgetAll(userKey(id, ResourceType.ROLE));
   redisClientDelegate.withMultiKeyPipeline(p -> {
    p.srem(allUsersKey(), id);
    for (String roleName : userRolesById.keySet()) {
     p.srem(roleKey(roleName), id);
    }
    for (ResourceType r : ResourceType.values()) {
     p.del(userKey(id, r));
    }
    p.srem(adminKey(), id);
    p.sync();
   });
  });
 } catch (Exception e) {
  log.error("Storage exception reading " + id + " entry.", e);
 }
}

代码示例来源:origin: spinnaker/fiat

@Override
public void remove(@NonNull String id) {
 try {
  redisClientDelegate.withCommandsClient(jedis -> {
   Map<String, String> userRolesById = jedis.hgetAll(userKey(id, ResourceType.ROLE));
   redisClientDelegate.withMultiKeyPipeline(p -> {
    p.srem(allUsersKey(), id);
    for (String roleName : userRolesById.keySet()) {
     p.srem(roleKey(roleName), id);
    }
    for (ResourceType r : ResourceType.values()) {
     p.del(userKey(id, r));
    }
    p.srem(adminKey(), id);
    p.sync();
   });
  });
 } catch (Exception e) {
  log.error("Storage exception reading " + id + " entry.", e);
 }
}

代码示例来源:origin: com.netflix.spinnaker.clouddriver/clouddriver-core

for (List<String> idPartition : Lists.partition(onDemandKeysToRemove, redisCacheOptions.getMaxDelSize())) {
 String[] ids = idPartition.toArray(new String[idPartition.size()]);
 pipeline.srem(onDemandSetName, ids);

代码示例来源:origin: com.netflix.spinnaker.fiat/fiat-roles

pipeline.sadd(adminKey(), userId);
} else {
 pipeline.srem(adminKey(), userId);
existingRoles.stream()
 .filter(it -> !permission.getRoles().contains(it))
 .forEach(role -> pipeline.srem(roleKey(role), userId));

代码示例来源:origin: spinnaker/fiat

pipeline.sadd(adminKey(), userId);
} else {
 pipeline.srem(adminKey(), userId);
existingRoles.stream()
 .filter(it -> !permission.getRoles().contains(it))
 .forEach(role -> pipeline.srem(roleKey(role), userId));

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

public void delete(String key) {
  redis.pipeline(pipe -> {
    pipe.del(keyForItem(key));
    pipe.del(keyForVersion(key));
    pipe.srem(globalAllKeys, key);
    pipe.incr(globalVersionKey);
  });
}

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

@Override
public Long sRem(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().srem(key, values)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().srem(key, values)));
      return null;
    }
    return connection.getJedis().srem(key, values);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
public Long sRem(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().srem(key, values)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().srem(key, values)));
      return null;
    }
    return connection.getJedis().srem(key, values);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

相关文章

Pipeline类方法