Package org.apache.solr.common.cloud
Class CompositeIdRouter
- java.lang.Object
-
- org.apache.solr.common.cloud.DocRouter
-
- org.apache.solr.common.cloud.HashBasedRouter
-
- org.apache.solr.common.cloud.CompositeIdRouter
-
public class CompositeIdRouter extends HashBasedRouter
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.solr.common.cloud.DocRouter
DocRouter.Range
-
-
Field Summary
Fields Modifier and Type Field Description static int
bitsSeparator
static String
NAME
static String
SEPARATOR
-
Fields inherited from class org.apache.solr.common.cloud.DocRouter
DEFAULT, DEFAULT_NAME
-
-
Constructor Summary
Constructors Constructor Description CompositeIdRouter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
Collection<Slice>
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.DocRouter.Range
keyHashRange(String routeKey)
Get Range for a given CompositeId based route keyList<DocRouter.Range>
partitionRange(int partitions, DocRouter.Range range)
Split the range into partitions.List<DocRouter.Range>
partitionRangeByKey(String key, DocRouter.Range range)
int
sliceHash(String id, SolrInputDocument doc, SolrParams params, DocCollection collection)
-
Methods inherited from class org.apache.solr.common.cloud.HashBasedRouter
getId, getTargetSlice, hashToSlice, isTargetSlice
-
Methods inherited from class org.apache.solr.common.cloud.DocRouter
fromString, fullRange, getDocRouter, getRouteField, getRouterSpec, getSearchSlices, partitionRange
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
SEPARATOR
public static final String SEPARATOR
- See Also:
- Constant Field Values
-
bitsSeparator
public static final int bitsSeparator
- See Also:
- Constant Field Values
-
-
Method Detail
-
sliceHash
public int sliceHash(String id, SolrInputDocument doc, SolrParams params, DocCollection collection)
- Overrides:
sliceHash
in classHashBasedRouter
-
keyHashRange
public DocRouter.Range keyHashRange(String routeKey)
Get Range for a given CompositeId based route key- Parameters:
routeKey
- to return Range for- Returns:
- Range for given routeKey
-
getSearchSlicesSingle
public Collection<Slice> getSearchSlicesSingle(String shardKey, SolrParams params, DocCollection collection)
Description copied from class:DocRouter
This method is consulted to determine what slices should be queried for a request when an explicit shards parameter was not used. This method only accepts a single shard key (or null). If you have a comma separated list of shard keys, call getSearchSlices- Overrides:
getSearchSlicesSingle
in classHashBasedRouter
-
partitionRangeByKey
public List<DocRouter.Range> partitionRangeByKey(String key, DocRouter.Range range)
-
partitionRange
public List<DocRouter.Range> partitionRange(int partitions, DocRouter.Range range)
Description copied from class:DocRouter
Split the range into partitions.- Overrides:
partitionRange
in classDocRouter
- Parameters:
partitions
- number of partitionsrange
- range to split
-
-