Package org.apache.solr.common.cloud
Class Slice
- java.lang.Object
- 
- org.apache.solr.common.cloud.ZkNodeProps
- 
- org.apache.solr.common.cloud.Slice
 
 
- 
- All Implemented Interfaces:
- Iterable<Replica>,- MapSerializable,- MapWriter,- NavigableObject,- org.noggit.JSONWriter.Writable
 
 public class Slice extends ZkNodeProps implements Iterable<Replica> A Slice contains immutable information about a logical shard (all replicas that share the same shard id).
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceSlice.SliceStatePropsJSON properties related to a slice's state.static classSlice.StateThe slice's state.- 
Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriterMapWriter.EntryWriter
 
- 
 - 
Field SummaryFields Modifier and Type Field Description Stringcollection- 
Fields inherited from class org.apache.solr.common.cloud.ZkNodePropspropMap
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SlicecopyWith(Replica modified)Make a copy with a modified replicaStringgetCollection()ReplicagetLeader()StringgetName()Return slice name (shard id).intgetNumLeaderReplicas()StringgetParent()DocRouter.RangegetRange()ReplicagetReplica(String replicaName)Set<String>getReplicaNames()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 sList<Replica>getReplicas(Predicate<Replica> pred)Gets all replicas that match a predicateMap<String,Replica>getReplicasCopy()Map<String,Replica>getReplicasMap()Get the map of coreNodeName to replicas for this slice.Map<String,RoutingRule>getRoutingRules()Slice.StategetState()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.StringtoString()- 
Methods inherited from class org.apache.solr.common.cloud.ZkNodePropscontainsKey, equals, fromKeyVals, get, getBool, getInt, getProperties, getStr, getStr, hashCode, keySet, load, plus, plus, shallowCopy, writeMap
 - 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.lang.IterableforEach, spliterator
 - 
Methods inherited from interface org.apache.solr.common.NavigableObject_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size
 
- 
 
- 
- 
- 
Field Detail- 
collectionpublic final String collection 
 
- 
 - 
Constructor Detail- 
Slicepublic Slice(String name, Map<String,Replica> replicas, Map<String,Object> props, String collection) - Parameters:
- name- The name of the slice
- replicas- 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.
 
 
- 
 - 
Method Detail- 
loadAllFromMappublic 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.
 - 
getCollectionpublic String getCollection() 
 - 
getNamepublic String getName() Return slice name (shard id).
 - 
getReplicaspublic Collection<Replica> getReplicas() Gets the list of all replicas for this slice.
 - 
getReplicaspublic List<Replica> getReplicas(Predicate<Replica> pred) Gets all replicas that match a predicate
 - 
getReplicaspublic List<Replica> getReplicas(EnumSet<Replica.Type> s) Gets the list of replicas that have a type present in s
 - 
getReplicasMappublic Map<String,Replica> getReplicasMap() Get the map of coreNodeName to replicas for this slice.
 - 
getLeaderpublic Replica getLeader() 
 - 
getNumLeaderReplicaspublic int getNumLeaderReplicas() 
 - 
getRangepublic DocRouter.Range getRange() 
 - 
getStatepublic Slice.State getState() 
 - 
getParentpublic String getParent() 
 - 
getRoutingRulespublic Map<String,RoutingRule> getRoutingRules() 
 - 
toStringpublic String toString() - Overrides:
- toStringin class- ZkNodeProps
 
 
- 
 
-