public class Slice extends ZkNodeProps implements Iterable<Replica>
| 限定符和类型 | 类和说明 |
|---|---|
static class |
Slice.State
The slice's state.
|
| 限定符和类型 | 字段和说明 |
|---|---|
String |
collection |
static String |
LEADER |
static String |
PARENT |
static String |
RANGE |
static String |
REPLICAS |
propMap, STORE_BASE_URL| 构造器和说明 |
|---|
Slice(String name,
Map<String,Replica> replicas,
Map<String,Object> props,
String collection) |
| 限定符和类型 | 方法和说明 |
|---|---|
Slice |
copyWith(Replica modified)
Make a copy with a modified replica
|
String |
getCollection() |
Replica |
getLeader() |
String |
getName()
Return slice name (shard id).
|
String |
getParent() |
DocRouter.Range |
getRange() |
Replica |
getReplica(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 s
|
List<Replica> |
getReplicas(Predicate<Replica> pred)
Gets all replicas that match a predicate
|
Map<String,Replica> |
getReplicasCopy() |
Map<String,Replica> |
getReplicasMap()
Get the map of coreNodeName to replicas for this slice.
|
Map<String,RoutingRule> |
getRoutingRules() |
Slice.State |
getState() |
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.
|
String |
toString() |
void |
write(JSONWriter jsonWriter) |
containsKey, equals, fromKeyVals, get, getBool, getInt, getProperties, getStr, getStr, hashCode, keySet, load, plus, plus, shallowCopyforEach, spliteratorpublic final String collection
public Slice(String name, Map<String,Replica> replicas, Map<String,Object> props, String collection)
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.public static Map<String,Slice> loadAllFromMap(String collection, Map<String,Object> genericSlices)
public String getCollection()
public String getName()
public Collection<Replica> getReplicas()
public List<Replica> getReplicas(Predicate<Replica> pred)
public List<Replica> getReplicas(EnumSet<Replica.Type> s)
public Map<String,Replica> getReplicasMap()
public Replica getLeader()
public DocRouter.Range getRange()
public Slice.State getState()
public String getParent()
public Map<String,RoutingRule> getRoutingRules()
public String toString()
toString 在类中 ZkNodePropspublic void write(JSONWriter jsonWriter)
write 在接口中 JSONWriter.Writablewrite 在类中 ZkNodePropsCopyright © 2006–2022 The Apache Software Foundation. All rights reserved.