Package com.linkedin.venice.router.api
Class VenicePartitionFinder
java.lang.Object
com.linkedin.venice.router.api.VenicePartitionFinder
- All Implemented Interfaces:
PartitionFinder<RouterKey>
VenicePartitionFinder
provides methods to find the partition name or number for the given data.-
Constructor Summary
ConstructorDescriptionVenicePartitionFinder
(RoutingDataRepository dataRepository, ReadOnlyStoreRepository metadataRepository) -
Method Summary
Modifier and TypeMethodDescriptionfindPartitioner
(String storeName, int versionNum) Query the map to find the partitioner in need.findPartitionName
(String resourceName, RouterKey partitionKey) Returns the name of partition for the given key within the given table.int
findPartitionNumber
(RouterKey partitionKey, int numPartitions, String storeName, int versionNumber) Venice-specific API for finding the partition number without the added overhead of parsing a partition name.getAllPartitionNames
(String resourceName) int
getNumPartitions
(String resourceName) Returns the number of partitions for a given db
-
Constructor Details
-
VenicePartitionFinder
public VenicePartitionFinder(RoutingDataRepository dataRepository, ReadOnlyStoreRepository metadataRepository)
-
-
Method Details
-
findPartitionName
Description copied from interface:PartitionFinder
Returns the name of partition for the given key within the given table.- Specified by:
findPartitionName
in interfacePartitionFinder<RouterKey>
- Parameters:
resourceName
-partitionKey
-- Returns:
- partition Name, ex "store_v3_5"
-
findPartitionNumber
public int findPartitionNumber(RouterKey partitionKey, int numPartitions, String storeName, int versionNumber) Description copied from interface:PartitionFinder
Venice-specific API for finding the partition number without the added overhead of parsing a partition name.- Specified by:
findPartitionNumber
in interfacePartitionFinder<RouterKey>
-
getAllPartitionNames
- Specified by:
getAllPartitionNames
in interfacePartitionFinder<RouterKey>
-
getNumPartitions
Description copied from interface:PartitionFinder
Returns the number of partitions for a given db- Specified by:
getNumPartitions
in interfacePartitionFinder<RouterKey>
- Parameters:
resourceName
- name of the database
-
findPartitioner
Query the map to find the partitioner in need. If miss, real search using store info happens insearchPartitioner(java.lang.String, int)
-