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
A Slice contains immutable information about a logical shard (all replicas that share the same
shard id).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceJSON properties related to a slice's state.static enumThe slice's state.Nested classes/interfaces inherited from interface org.apache.solr.common.MapWriter
MapWriter.EntryWriter -
Field Summary
FieldsFields inherited from class org.apache.solr.common.cloud.ZkNodeProps
propMap -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMake a copy with a modified replicagetName()Return slice name (shard id).intgetRange()getReplica(String replicaName) Gets the list of all replicas for this slice.Gets the list of replicas that have a type present in sgetReplicas(Predicate<Replica> pred) Gets all replicas that match a predicateGet the map of coreNodeName to replicas for this slice.getState()iterator()loadAllFromMap(String collection, Map<String, Object> genericSlices) Loads multiple slices into a Map from a generic Map that probably came from deserialized JSON.toString()Methods inherited from class org.apache.solr.common.cloud.ZkNodeProps
containsKey, equals, get, getBool, getInt, getProperties, getStr, getStr, hashCode, keySet, load, plus, plus, shallowCopy, writeMapMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.apache.solr.common.NavigableObject
_forEachEntry, _forEachEntry, _forEachEntry, _get, _get, _getStr, _getStr, _size
-
Field Details
-
collection
-
-
Constructor Details
-
Slice
public Slice(String name, Map<String, Replica> replicas, Map<String, Object> props, String collection) - Parameters:
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.
-
-
Method Details
-
loadAllFromMap
Loads multiple slices into a Map from a generic Map that probably came from deserialized JSON. -
iterator
-
copyWith
Make a copy with a modified replica -
getCollection
-
getName
Return slice name (shard id). -
getReplicas
Gets the list of all replicas for this slice. -
getReplicaNames
-
getReplicas
Gets all replicas that match a predicate -
getReplicas
Gets the list of replicas that have a type present in s -
getReplicasMap
Get the map of coreNodeName to replicas for this slice. -
getReplicasCopy
-
getLeader
-
getNumLeaderReplicas
public int getNumLeaderReplicas() -
getReplica
-
getRange
-
getState
-
getParent
-
getRoutingRules
-
toString
- Overrides:
toStringin classZkNodeProps
-