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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringfindPartitionName(java.lang.String resourceName, K partitionKey)Returns the name of partition for the given key within the given table.intfindPartitionNumber(K partitionKey, int numPartitions, java.lang.String storeName, int versionNumber)Venice-specific API for finding the partition number without the added overhead of parsing a partition name.java.util.List<java.lang.String>getAllPartitionNames(java.lang.String resourceName)intgetNumPartitions(java.lang.String resourceName)Returns the number of partitions for a given db
-
-
-
Method Detail
-
findPartitionName
@Nonnull java.lang.String findPartitionName(@Nonnull java.lang.String resourceName, @Nonnull K partitionKey) throws RouterExceptionReturns 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
@Nonnull java.util.List<java.lang.String> getAllPartitionNames(@Nonnull java.lang.String resourceName) throws RouterException- Throws:
RouterException
-
getNumPartitions
int getNumPartitions(@Nonnull java.lang.String resourceName) throws RouterExceptionReturns the number of partitions for a given db- Parameters:
resourceName- name of the database- Throws:
RouterException
-
findPartitionNumber
int findPartitionNumber(@Nonnull K partitionKey, int numPartitions, java.lang.String storeName, int versionNumber) throws RouterExceptionVenice-specific API for finding the partition number without the added overhead of parsing a partition name.- Throws:
RouterException
-
-