All Downloads are FREE. Search and download functionalities are using the official Maven repository.

redis.clients.jedis.resps.ClusterShardInfo Maven / Gradle / Ivy

The newest version!
package redis.clients.jedis.resps;

import java.util.List;
import java.util.Map;

/**
 * This class holds information about a shard of the cluster with command {@code CLUSTER SHARDS}.
 * They can be accessed via getters. There is also {@link ClusterShardInfo#getClusterShardInfo()}
 * method that returns a generic {@link Map} in case more info are returned from the server.
 */
public class ClusterShardInfo {

  public static final String SLOTS = "slots";
  public static final String NODES = "nodes";

  private final List> slots;
  private final List nodes;

  private final Map clusterShardInfo;

  /**
   * @param map contains key-value pairs with cluster shard info
   */
  @SuppressWarnings("unchecked")
  public ClusterShardInfo(Map map) {
    slots = (List>) map.get(SLOTS);
    nodes = (List) map.get(NODES);

    clusterShardInfo = map;
  }

  public List> getSlots() {
    return slots;
  }

  public List getNodes() {
    return nodes;
  }

  public Map getClusterShardInfo() {
    return clusterShardInfo;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy