public class DocCollection extends ZkNodeProps implements Iterable<Slice>
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
DOC_ROUTER |
static String |
PARTITIONS |
static String |
PER_REPLICA_STATE |
static String |
ROUTER_FIELD |
static String |
ROUTER_NAME |
static String |
ROUTER_PARTITIONS |
static String |
RULE
已过时。
to be removed in Solr 9.0 (see SOLR-14930)
|
static String |
SHARDS |
static String |
SNITCH
已过时。
to be removed in Solr 9.0 (see SOLR-14930)
|
static String |
STATE_FORMAT |
propMap, STORE_BASE_URL| 构造器和说明 |
|---|
DocCollection(String name,
Map<String,Slice> slices,
Map<String,Object> props,
DocRouter router) |
DocCollection(String name,
Map<String,Slice> slices,
Map<String,Object> props,
DocRouter router,
int zkVersion,
String znode) |
| 限定符和类型 | 方法和说明 |
|---|---|
DocCollection |
copyWith(PerReplicaStates newPerReplicaStates)
Update our state with a state of a
Replica
Used to create a new Collection State when only a replica is updated |
DocCollection |
copyWithSlices(Map<String,Slice> slices)
Use this to make an exact copy of DocCollection with a new set of Slices and every other property as is
|
boolean |
equals(Object that) |
void |
forEachReplica(BiConsumer<String,Replica> consumer) |
Collection<Slice> |
getActiveSlices()
Return the list of active slices for this collection.
|
Slice[] |
getActiveSlicesArr()
Return array of active slices for this collection (performance optimization).
|
Map<String,Slice> |
getActiveSlicesMap()
Get the map of active slices (sliceName->Slice) for this collection.
|
boolean |
getAutoAddReplicas() |
int |
getChildNodesVersion() |
int |
getExpectedReplicaCount(Replica.Type type,
int def) |
Replica |
getLeader(String sliceName) |
List<Replica> |
getLeaderReplicas(String nodeName)
Get the list of all leaders hosted on the given node or
null if none. |
int |
getMaxShardsPerNode() |
String |
getName()
Return collection name.
|
Integer |
getNumNrtReplicas() |
Integer |
getNumPullReplicas() |
Integer |
getNumTlogReplicas() |
PerReplicaStates |
getPerReplicaStates() |
String |
getPolicyName() |
Replica |
getReplica(BiPredicate<String,Replica> predicate) |
Replica |
getReplica(String coreNodeName) |
List<Replica> |
getReplicas() |
List<Replica> |
getReplicas(EnumSet<Replica.Type> s) |
List<Replica> |
getReplicas(String nodeName)
Get the list of replicas hosted on the given node or
null if none. |
Integer |
getReplicationFactor() |
DocRouter |
getRouter() |
String |
getShardId(String nodeName,
String coreName)
Get the shardId of a core on a specific node
|
Slice |
getSlice(String sliceName) |
Collection<Slice> |
getSlices()
Gets the list of all slices for this collection.
|
Map<String,Slice> |
getSlicesMap()
Get the map of all slices (sliceName->Slice) for this collection.
|
int |
getStateFormat() |
String |
getStoragePolicy() |
Integer |
getTTL() |
String |
getUniqueKey() |
Map<String,List<String>> |
getUrlMap() |
String |
getZNode() |
int |
getZNodeVersion() |
int |
hashCode() |
static boolean |
isFullyActive(Set<String> liveNodes,
DocCollection collectionState,
int expectedShards,
int expectedReplicas)
Check that all replicas in a collection are live
|
boolean |
isModified(int dataVersion,
int childVersion) |
boolean |
isPerReplicaState() |
boolean |
isReadOnly() |
Iterator<Slice> |
iterator() |
void |
setUrlMap(Map<String,List<String>> urlMap) |
String |
toString() |
static Object |
verifyProp(Map<String,Object> props,
String propName) |
static Object |
verifyProp(Map<String,Object> props,
String propName,
Object def) |
void |
write(JSONWriter jsonWriter) |
containsKey, fromKeyVals, get, getBool, getInt, getProperties, getStr, getStr, keySet, load, plus, plus, shallowCopyforEach, spliteratorpublic DocCollection(String name, Map<String,Slice> slices, Map<String,Object> props, DocRouter router)
public DocCollection(String name, Map<String,Slice> slices, Map<String,Object> props, DocRouter router, int zkVersion, String znode)
name - The name of the collectionslices - The logical shards of the collection. This is used directly and a copy is not made.props - The properties of the slice. This is used directly and a copy is not made.public DocCollection copyWith(PerReplicaStates newPerReplicaStates)
Replica
Used to create a new Collection State when only a replica is updatedpublic DocCollection copyWithSlices(Map<String,Slice> slices)
slices - the new set of Slicespublic String getName()
public void forEachReplica(BiConsumer<String,Replica> consumer)
consumer - consume shardName vs. replicapublic Collection<Slice> getSlices()
public Collection<Slice> getActiveSlices()
public Slice[] getActiveSlicesArr()
public Map<String,Slice> getSlicesMap()
public Map<String,Slice> getActiveSlicesMap()
public List<Replica> getReplicas(String nodeName)
null if none.public List<Replica> getLeaderReplicas(String nodeName)
null if none.public int getZNodeVersion()
public int getChildNodesVersion()
public boolean isModified(int dataVersion,
int childVersion)
public int getStateFormat()
public Integer getReplicationFactor()
public boolean getAutoAddReplicas()
public int getMaxShardsPerNode()
public String getZNode()
public DocRouter getRouter()
public boolean isReadOnly()
public Integer getTTL()
public String getUniqueKey()
public String getStoragePolicy()
public String toString()
toString 在类中 ZkNodePropspublic void write(JSONWriter jsonWriter)
write 在接口中 JSONWriter.Writablewrite 在类中 ZkNodePropspublic static boolean isFullyActive(Set<String> liveNodes, DocCollection collectionState, int expectedShards, int expectedReplicas)
CollectionStatePredicatepublic Replica getReplica(BiPredicate<String,Replica> predicate)
predicate - test against shardName vs. replicapublic List<Replica> getReplicas(EnumSet<Replica.Type> s)
public String getShardId(String nodeName, String coreName)
public boolean equals(Object that)
equals 在类中 ZkNodePropspublic int hashCode()
hashCode 在类中 ZkNodePropspublic Integer getNumNrtReplicas()
Replica.Type.NRT this collection was created withpublic Integer getNumTlogReplicas()
Replica.Type.TLOG this collection was created withpublic Integer getNumPullReplicas()
Replica.Type.PULL this collection was created withpublic String getPolicyName()
public boolean isPerReplicaState()
public PerReplicaStates getPerReplicaStates()
public int getExpectedReplicaCount(Replica.Type type, int def)
Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.