Package com.linkedin.alpini.router.api
Interface PartitionFinder<K>
- All Known Implementing Classes:
VenicePartitionFinder
public interface PartitionFinder<K>
Provides methods to find the partition name for a piece of data.
-
Method Summary
Modifier and TypeMethodDescriptionfindPartitionName
(String resourceName, K partitionKey) Returns the name of partition for the given key within the given table.int
findPartitionNumber
(K 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
-
Method Details
-
findPartitionName
@Nonnull String findPartitionName(@Nonnull String resourceName, @Nonnull K partitionKey) throws RouterException Returns the name of partition for the given key within the given table.- Parameters:
resourceName
- name of the databasepartitionKey
- partition key field for the data- Returns:
- name of the partition
- Throws:
RouterException
- if there was an error
-
getAllPartitionNames
- Throws:
RouterException
-
getNumPartitions
Returns the number of partitions for a given db- Parameters:
resourceName
- name of the database- Throws:
RouterException
-
findPartitionNumber
int findPartitionNumber(@Nonnull K partitionKey, int numPartitions, String storeName, int versionNumber) throws RouterException Venice-specific API for finding the partition number without the added overhead of parsing a partition name.- Throws:
RouterException
-