public class Slice extends ZkNodeProps implements Iterable<Replica>
| Modifier and Type | Class and Description | 
|---|---|
| static class  | Slice.StateThe slice's state. | 
| Modifier and Type | Field and Description | 
|---|---|
| String | collection | 
| static String | LEADER | 
| static String | PARENT | 
| static String | RANGE | 
| static String | REPLICAS | 
propMap| Constructor and Description | 
|---|
| Slice(String name,
     Map<String,Replica> replicas,
     Map<String,Object> props,
     String collection) | 
| Modifier and Type | Method and Description | 
|---|---|
| String | getCollection() | 
| Replica | getLeader() | 
| String | getName()Return slice name (shard id). | 
| String | getParent() | 
| DocRouter.Range | getRange() | 
| Replica | getReplica(String replicaName) | 
| Collection<Replica> | getReplicas()Gets the list of all replicas for this slice. | 
| List<Replica> | getReplicas(EnumSet<Replica.Type> s)Gets the list of replicas that have a type present in s | 
| List<Replica> | getReplicas(Predicate<Replica> pred)Gets all replicas that match a predicate | 
| Map<String,Replica> | getReplicasCopy() | 
| Map<String,Replica> | getReplicasMap()Get the map of coreNodeName to replicas for this slice. | 
| Map<String,RoutingRule> | getRoutingRules() | 
| Slice.State | getState() | 
| Iterator<Replica> | iterator() | 
| static Map<String,Slice> | loadAllFromMap(String collection,
              Map<String,Object> genericSlices)Loads multiple slices into a Map from a generic Map that probably came from deserialized JSON. | 
| String | toString() | 
| void | write(JSONWriter jsonWriter) | 
containsKey, equals, fromKeyVals, get, getBool, getInt, getProperties, getStr, getStr, keySet, load, plus, plus, shallowCopyclone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic final String collection
public static final String REPLICAS
public static final String RANGE
public static final String LEADER
public static final String PARENT
public Slice(String name, Map<String,Replica> replicas, Map<String,Object> props, String collection)
name - The name of the slicereplicas - The replicas of the slice.  This is used directly and a copy is not made.  If null, replicas will be constructed from props.props - The properties of the slice - a shallow copy will always be made.public static Map<String,Slice> loadAllFromMap(String collection, Map<String,Object> genericSlices)
public String getCollection()
public String getName()
public Collection<Replica> getReplicas()
public List<Replica> getReplicas(Predicate<Replica> pred)
public List<Replica> getReplicas(EnumSet<Replica.Type> s)
public Map<String,Replica> getReplicasMap()
public Replica getLeader()
public DocRouter.Range getRange()
public Slice.State getState()
public String getParent()
public Map<String,RoutingRule> getRoutingRules()
public String toString()
toString in class ZkNodePropspublic void write(JSONWriter jsonWriter)
write in interface JSONWriter.Writablewrite in class ZkNodePropsCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.