org.apache.solr.common.cloud
Class Slice

java.lang.Object
  extended by org.apache.solr.common.cloud.ZkNodeProps
      extended by org.apache.solr.common.cloud.Slice
All Implemented Interfaces:
org.noggit.JSONWriter.Writable

public class Slice
extends ZkNodeProps

A Slice contains immutable information about a logical shard (all replicas that share the same shard id).


Field Summary
static String ACTIVE
           
static String CONSTRUCTION
           
static String INACTIVE
           
static String LEADER
           
static String PARENT
           
static String RANGE
           
static String RECOVERY
           
static String REPLICAS
           
static String STATE
           
 
Fields inherited from class org.apache.solr.common.cloud.ZkNodeProps
propMap
 
Constructor Summary
Slice(String name, Map<String,Replica> replicas, Map<String,Object> props)
           
 
Method Summary
 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 replicas for this slice.
 Map<String,Replica> getReplicasCopy()
           
 Map<String,Replica> getReplicasMap()
          Get the map of coreNodeName to replicas for this slice.
 Map<String,RoutingRule> getRoutingRules()
           
 String getState()
           
 String toString()
           
 void write(org.noggit.JSONWriter jsonWriter)
           
 
Methods inherited from class org.apache.solr.common.cloud.ZkNodeProps
containsKey, fromKeyVals, get, getBool, getInt, getProperties, getStr, getStr, keySet, load, makeMap, shallowCopy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REPLICAS

public static String REPLICAS

RANGE

public static String RANGE

STATE

public static String STATE

LEADER

public static String LEADER

ACTIVE

public static String ACTIVE

INACTIVE

public static String INACTIVE

CONSTRUCTION

public static String CONSTRUCTION

RECOVERY

public static String RECOVERY

PARENT

public static String PARENT
Constructor Detail

Slice

public Slice(String name,
             Map<String,Replica> replicas,
             Map<String,Object> props)
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

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()

getReplica

public Replica getReplica(String replicaName)

getRange

public DocRouter.Range getRange()

getState

public String getState()

getParent

public String getParent()

getRoutingRules

public Map<String,RoutingRule> getRoutingRules()

toString

public String toString()
Overrides:
toString in class ZkNodeProps

write

public void write(org.noggit.JSONWriter jsonWriter)
Specified by:
write in interface org.noggit.JSONWriter.Writable
Overrides:
write in class ZkNodeProps


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.