Class VenicePartitionFinder

  • All Implemented Interfaces:
    PartitionFinder<RouterKey>

    public class VenicePartitionFinder
    extends java.lang.Object
    implements PartitionFinder<RouterKey>
    VenicePartitionFinder provides methods to find the partition name or number for the given data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      VenicePartitioner findPartitioner​(java.lang.String storeName, int versionNum)
      Query the map to find the partitioner in need.
      java.lang.String findPartitionName​(java.lang.String resourceName, RouterKey partitionKey)
      Returns the name of partition for the given key within the given table.
      int findPartitionNumber​(RouterKey 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)  
      int getNumPartitions​(java.lang.String resourceName)
      Returns the number of partitions for a given db
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • findPartitionName

        public java.lang.String findPartitionName​(java.lang.String resourceName,
                                                  RouterKey partitionKey)
        Description copied from interface: PartitionFinder
        Returns the name of partition for the given key within the given table.
        Specified by:
        findPartitionName in interface PartitionFinder<RouterKey>
        Parameters:
        resourceName -
        partitionKey -
        Returns:
        partition Name, ex "store_v3_5"
      • findPartitionNumber

        public int findPartitionNumber​(RouterKey partitionKey,
                                       int numPartitions,
                                       java.lang.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 interface PartitionFinder<RouterKey>
      • getNumPartitions

        public int getNumPartitions​(java.lang.String resourceName)
        Description copied from interface: PartitionFinder
        Returns the number of partitions for a given db
        Specified by:
        getNumPartitions in interface PartitionFinder<RouterKey>
        Parameters:
        resourceName - name of the database