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:
- JSONWriter.Writable
public class Slice
- extends ZkNodeProps
A Slice contains immutable information about a logical shard (all replicas that share the same shard id).
REPLICAS
public static String REPLICAS
RANGE
public static String RANGE
LEADER
public static String LEADER
Slice
public Slice(String name,
Map<String,Replica> replicas,
Map<String,Object> props)
- 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.
getName
public String getName()
- Return slice name (shard id).
getReplicas
public Collection<Replica> getReplicas()
- Gets the list of replicas for this slice.
getReplicasMap
public Map<String,Replica> getReplicasMap()
- Get the map of coreNodeName to replicas for this slice.
getReplicasCopy
public Map<String,Replica> getReplicasCopy()
getLeader
public Replica getLeader()
toString
public String toString()
- Overrides:
toString in class ZkNodeProps
write
public void write(JSONWriter jsonWriter)
- Specified by:
write in interface JSONWriter.Writable- Overrides:
write in class ZkNodeProps
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.