# Uses of Class
org.apache.solr.common.cloud.DocCollection

Packages that use DocCollection
Package
Description
org.apache.solr.client.solrj.impl
Implementations of some client API classes, and their friends.
org.apache.solr.client.solrj.request
Convenience classes for dealing with various types of Solr requests.
org.apache.solr.common.cloud
Common Solr Cloud and ZooKeeper related classes reused on both clients & server.

## Uses of DocCollection in org.apache.solr.client.solrj.impl

Methods in org.apache.solr.client.solrj.impl that return DocCollection
Modifier and Type
Method
Description
`DocCollection`
BaseHttpClusterStateProvider.`getCollection(String collection)`
`default DocCollection`
ClusterStateProvider.`getCollection(String name)`
`DocCollection`
DelegatingClusterStateProvider.`getCollection(String name)`
`protected DocCollection`
CloudSolrClient.`getDocCollection(String collection, Integer expectedVersion)`
Methods in org.apache.solr.client.solrj.impl with parameters of type DocCollection
Modifier and Type
Method
Description
`protected Map<String,? extends LBSolrClient.Req>`
CloudSolrClient.`createRoutes(UpdateRequest updateRequest, ModifiableSolrParams routableParams, DocCollection col, DocRouter router, Map<String,List<String>> urlMap, String routeField)`
Method parameters in org.apache.solr.client.solrj.impl with type arguments of type DocCollection
Modifier and Type
Method
Description
`protected NamedList<Object>`
CloudSolrClient.`requestWithRetryOnStaleState(SolrRequest<?> request, int retryCount, List<String> inputCollections, boolean skipStateVersion, Map<String,CompletableFuture<DocCollection>> pendingRefreshes, boolean waitedForRefresh)`
As this class doesn't watch external collections on the client side, there's a chance that the request will fail due to cached stale state, which means the state must be refreshed from ZK and retried.

## Uses of DocCollection in org.apache.solr.client.solrj.request

Methods in org.apache.solr.client.solrj.request with parameters of type DocCollection
Modifier and Type
Method
Description
`Map<String,LBSolrClient.Req>`
UpdateRequest.`getRoutesToCollection(DocRouter router, DocCollection col, Map<String,List<String>> urlMap, ModifiableSolrParams params, String idField)`

## Uses of DocCollection in org.apache.solr.common.cloud

Methods in org.apache.solr.common.cloud that return DocCollection
Modifier and Type
Method
Description
`static DocCollection`
ClusterState.`collectionFromObjects(String name, Map<String,Object> objs, int version, Instant creationTime, DocCollection.PrsSupplier prsSupplier)`
`DocCollection`
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
`static DocCollection`
DocCollection.`create(String name, Map<String,Slice> slices, Map<String,Object> props, DocRouter router, int zkVersion, Instant creationTime, DocCollection.PrsSupplier prsSupplier)`
Builds a DocCollection with an optional PrsSupplier
`DocCollection`
ClusterState.CollectionRef.`get()`
Return the DocCollection, always re-fetching if lazy.
`DocCollection`
ClusterState.CollectionRef.`get(boolean allowCached)`
Return the DocCollection
`DocCollection`
ClusterState.`getCollection(String collection)`
Get the named DocCollection object, or throw an exception if it doesn't exist.
`DocCollection`
ClusterState.`getCollectionOrNull(String collectionName)`
Returns the corresponding `DocCollection` object for the given collection name if such a collection exists.
`DocCollection`
ClusterState.`getCollectionOrNull(String collectionName, boolean allowCached)`
Returns the corresponding `DocCollection` object for the given collection name if such a collection exists.
`final DocCollection`
DocCollection.`setPerReplicaStates(PerReplicaStates newPerReplicaStates)`
Update our state with a state of a `PerReplicaStates` which could override states of `Replica`.
Methods in org.apache.solr.common.cloud that return types with arguments of type DocCollection
Modifier and Type
Method
Description
`Stream<DocCollection>`
ClusterState.`collectionStream()`
Streams the resolved `DocCollection`s, which will often fetch from ZooKeeper for each one for a many-collection scenario.
Methods in org.apache.solr.common.cloud with parameters of type DocCollection
Modifier and Type
Method
Description
`ClusterState`
ClusterState.`copyWith(String collectionName, DocCollection collection)`
Returns a new cluster state object modified with the given collection.
`static ReplicaCount`
ReplicaCount.`fromMessage(ZkNodeProps message, DocCollection collection)`
`static ReplicaCount`
ReplicaCount.`fromMessage(ZkNodeProps message, DocCollection collection, Integer defaultReplicationFactor)`
Creates a `ReplicaCount` from a message.
`String`
DocRouter.`getRouteField(DocCollection coll)`
`DocRouter.Range`
CompositeIdRouter.`getSearchRangeSingle(String shardKey, SolrParams params, DocCollection collection)`
`DocRouter.Range`
DocRouter.`getSearchRangeSingle(String shardKey, SolrParams params, DocCollection collection)`
This method is consulted to determine what search range (the part of the hash ring) should be queried for a request when an explicit shards' parameter was not used.
`Collection<Slice>`
DocRouter.`getSearchSlices(String shardKeys, SolrParams params, DocCollection collection)`
This method is consulted to determine what slices should be queried for a request when an explicit shards' parameter was not used.
`Collection<Slice>`
CompositeIdRouter.`getSearchSlicesSingle(String shardKey, SolrParams params, DocCollection collection)`
`abstract Collection<Slice>`
DocRouter.`getSearchSlicesSingle(String shardKey, SolrParams params, DocCollection collection)`
This method is consulted to determine what slices should be queried for a request when an explicit shards' parameter was not used.
`Collection<Slice>`
HashBasedRouter.`getSearchSlicesSingle(String shardKey, SolrParams params, DocCollection collection)`
`Collection<Slice>`
ImplicitDocRouter.`getSearchSlicesSingle(String shardKey, SolrParams params, DocCollection collection)`
`Slice`
CompositeIdRouter.`getTargetSlice(String id, SolrInputDocument sdoc, String route, SolrParams params, DocCollection collection)`
`abstract Slice`
DocRouter.`getTargetSlice(String id, SolrInputDocument sdoc, String route, SolrParams params, DocCollection collection)`
Returns the Slice that the document should reside on, or null if there is not enough information
`Slice`
HashBasedRouter.`getTargetSlice(String id, SolrInputDocument sdoc, String route, SolrParams params, DocCollection collection)`
`Slice`
ImplicitDocRouter.`getTargetSlice(String id, SolrInputDocument sdoc, String route, SolrParams params, DocCollection collection)`
`protected Slice`
HashBasedRouter.`hashToSlice(int hash, DocCollection collection)`
`abstract boolean`
DocRouter.`isTargetSlice(String id, SolrInputDocument sdoc, SolrParams params, String shardId, DocCollection collection)`
`boolean`
HashBasedRouter.`isTargetSlice(String id, SolrInputDocument sdoc, SolrParams params, String shardId, DocCollection collection)`
`boolean`
ImplicitDocRouter.`isTargetSlice(String id, SolrInputDocument sdoc, SolrParams params, String shardId, DocCollection collection)`
`boolean`
CollectionStatePredicate.`matches(Set<String> liveNodes, DocCollection collectionState)`
Check if the set of liveNodes and the collection state matches a required state
`int`
CompositeIdRouter.`sliceHash(String id, SolrInputDocument doc, SolrParams params, DocCollection collection)`
`int`
HashBasedRouter.`sliceHash(String id, SolrInputDocument sdoc, SolrParams params, DocCollection collection)`
Constructors in org.apache.solr.common.cloud with parameters of type DocCollection
Modifier
Constructor
Description
``
`CollectionRef(DocCollection coll)`
Constructor parameters in org.apache.solr.common.cloud with type arguments of type DocCollection
Modifier
Constructor
Description
``
`ClusterState(Set<String> liveNodes, Map<String,DocCollection> collectionStates)`
Use this constr when ClusterState is meant for consumption.