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

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

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

Pipeline.sismember介绍

暂无

代码示例

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

@Override
public Boolean sIsMember(byte[] key, byte[] value) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(value, "Value must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().sismember(key, value)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().sismember(key, value)));
      return null;
    }
    return connection.getJedis().sismember(key, value);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

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

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

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

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

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

代码示例来源:origin: org.nanoframework/nano-orm-jedis

allShards.parallelStream().forEach(shard -> {
  Pipeline pipeline = shard.pipelined();
  pipeline.sismember(source, member);
  Response<Long> response = pipeline.smove(source, destination, member);
  pipeline.sync();

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

@Override
public Optional<UserPermission> get(@NonNull String id) {
 try {
  return redisClientDelegate.withMultiKeyPipeline(p -> {
   RawUserPermission userResponseMap = new RawUserPermission();
   RawUserPermission unrestrictedResponseMap = new RawUserPermission();
   Response<Boolean> isUserInRepo = p.sismember(allUsersKey(), id);
   for (ResourceType r : ResourceType.values()) {
    Response<Map<String, String>> resourceMap = p.hgetAll(userKey(id, r));
    userResponseMap.put(r, resourceMap);
    Response<Map<String, String>> unrestrictedMap = p.hgetAll(unrestrictedUserKey(r));
    unrestrictedResponseMap.put(r, unrestrictedMap);
   }
   Response<Boolean> admin = p.sismember(adminKey(), id);
   p.sync();
   if (!isUserInRepo.get()) {
    return Optional.empty();
   }
   userResponseMap.isAdmin = admin.get();
   UserPermission unrestrictedUser = getUserPermission(UNRESTRICTED, unrestrictedResponseMap);
   return Optional.of(getUserPermission(id, userResponseMap).merge(unrestrictedUser));
  });
 } catch (Exception e) {
  log.error("Storage exception reading " + id + " entry.", e);
 }
 return Optional.empty();
}

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

@Override
public Optional<UserPermission> get(@NonNull String id) {
 try {
  return redisClientDelegate.withMultiKeyPipeline(p -> {
   RawUserPermission userResponseMap = new RawUserPermission();
   RawUserPermission unrestrictedResponseMap = new RawUserPermission();
   Response<Boolean> isUserInRepo = p.sismember(allUsersKey(), id);
   for (ResourceType r : ResourceType.values()) {
    Response<Map<String, String>> resourceMap = p.hgetAll(userKey(id, r));
    userResponseMap.put(r, resourceMap);
    Response<Map<String, String>> unrestrictedMap = p.hgetAll(unrestrictedUserKey(r));
    unrestrictedResponseMap.put(r, unrestrictedMap);
   }
   Response<Boolean> admin = p.sismember(adminKey(), id);
   p.sync();
   if (!isUserInRepo.get()) {
    return Optional.empty();
   }
   userResponseMap.isAdmin = admin.get();
   UserPermission unrestrictedUser = getUserPermission(UNRESTRICTED, unrestrictedResponseMap);
   return Optional.of(getUserPermission(id, userResponseMap).merge(unrestrictedUser));
  });
 } catch (Exception e) {
  log.error("Storage exception reading " + id + " entry.", e);
 }
 return Optional.empty();
}

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

@Override
public Boolean sIsMember(byte[] key, byte[] value) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(value, "Value must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().sismember(key, value)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().sismember(key, value)));
      return null;
    }
    return connection.getJedis().sismember(key, value);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
public Boolean sIsMember(byte[] key, byte[] value) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(value, "Value must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().sismember(key, value)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().sismember(key, value)));
      return null;
    }
    return connection.getJedis().sismember(key, value);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

相关文章

Pipeline类方法