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 Type
    Method
    Description
    findPartitionName(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.
     
    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 database
      partitionKey - partition key field for the data
      Returns:
      name of the partition
      Throws:
      RouterException - if there was an error
    • getAllPartitionNames

      @Nonnull List<String> getAllPartitionNames(@Nonnull String resourceName) throws RouterException
      Throws:
      RouterException
    • getNumPartitions

      int getNumPartitions(@Nonnull String resourceName) throws RouterException
      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