org.apache.solr.common.cloud
Class Slice

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

public class Slice
extends Object
implements JSONWriter.Writable

A Slice contains immutable information about all shards that share the same shard id (shard leader and replicas).


Constructor Summary
Slice(String name, Map<String,ZkNodeProps> shards)
           
 
Method Summary
 String getName()
          Return slice name (shard id).
 Map<String,ZkNodeProps> getShards()
          Get properties for all shards in this slice.
 Map<String,ZkNodeProps> getShardsCopy()
          Get a copy of the shards data this object holds.
 String toString()
           
 void write(JSONWriter jsonWriter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Slice

public Slice(String name,
             Map<String,ZkNodeProps> shards)
Method Detail

getShards

public Map<String,ZkNodeProps> getShards()
Get properties for all shards in this slice.

Returns:
map containing coreNodeName as the key, see ZkStateReader.getCoreNodeName(String, String), ZKNodeProps as the value.

getShardsCopy

public Map<String,ZkNodeProps> getShardsCopy()
Get a copy of the shards data this object holds.


getName

public String getName()
Return slice name (shard id).


toString

public String toString()
Overrides:
toString in class Object

write

public void write(JSONWriter jsonWriter)
Specified by:
write in interface JSONWriter.Writable


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