Interface AsyncPartitionFinder<K>


  • public interface AsyncPartitionFinder<K>
    Created by acurtis on 1/26/18.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      static <K> AsyncPartitionFinder<K> adapt​(PartitionFinder<K> partitionFinder, java.util.concurrent.Executor executor)  
      default java.util.concurrent.CompletionStage<java.lang.String> findPartitionName​(Pair<java.lang.String,​K> resource)  
      java.util.concurrent.CompletionStage<java.lang.String> findPartitionName​(java.lang.String resourceName, K partitionKey)
      Returns the name of partition for the given key within the given table.
      java.util.concurrent.CompletionStage<java.lang.Integer> findPartitionNumber​(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.concurrent.CompletionStage<java.util.List<java.lang.String>> getAllPartitionNames​(java.lang.String resourceName)  
      java.util.concurrent.CompletionStage<java.lang.Integer> getNumPartitions​(java.lang.String resourceName)
      Returns the number of partitions for a given db
    • Method Detail

      • findPartitionName

        @Nonnull
        java.util.concurrent.CompletionStage<java.lang.String> findPartitionName​(@Nonnull
                                                                                 java.lang.String resourceName,
                                                                                 @Nonnull
                                                                                 K partitionKey)
        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
      • findPartitionName

        @Nonnull
        default java.util.concurrent.CompletionStage<java.lang.String> findPartitionName​(@Nonnull
                                                                                         Pair<java.lang.String,​K> resource)
      • getAllPartitionNames

        @Nonnull
        java.util.concurrent.CompletionStage<java.util.List<java.lang.String>> getAllPartitionNames​(@Nonnull
                                                                                                    java.lang.String resourceName)
      • getNumPartitions

        java.util.concurrent.CompletionStage<java.lang.Integer> getNumPartitions​(@Nonnull
                                                                                 java.lang.String resourceName)
        Returns the number of partitions for a given db
        Parameters:
        resourceName - name of the database
      • findPartitionNumber

        java.util.concurrent.CompletionStage<java.lang.Integer> findPartitionNumber​(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.