Class PushStatusStoreReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class PushStatusStoreReader
    extends java.lang.Object
    implements java.io.Closeable
    This class is a helper class for Venice controller to read PushStatus / Heartbeat messages.
    • Constructor Summary

      Constructors 
      Constructor Description
      PushStatusStoreReader​(com.linkedin.d2.balancer.D2Client d2Client, java.lang.String clusterDiscoveryD2ServiceName, long heartbeatExpirationTimeInSeconds)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      long getHeartbeat​(java.lang.String storeName, java.lang.String instanceName)  
      PushStatusStoreReader.InstanceStatus getInstanceStatus​(java.lang.String storeName, java.lang.String instanceName)  
      java.util.Map<java.lang.CharSequence,​java.lang.Integer> getPartitionStatus​(java.lang.String storeName, int version, int partitionId, java.util.Optional<java.lang.String> incrementalPushVersion)  
      java.util.Map<java.lang.CharSequence,​java.lang.Integer> getPartitionStatus​(java.lang.String storeName, int version, int partitionId, java.util.Optional<java.lang.String> incrementalPushVersion, java.util.Optional<java.lang.String> incrementalPushPrefix)  
      java.util.Map<java.lang.Integer,​java.util.Map<java.lang.CharSequence,​java.lang.Integer>> getPartitionStatuses​(java.lang.String storeName, int storeVersion, java.lang.String incrementalPushVersion, int numberOfPartitions)
      Return statuses of all replicas belonging to partitions with partitionIds in the range [0 (inclusive), numberOfPartitions (exclusive)) {partitionId: {instance:status, instance:status,...},...}
      java.util.Map<java.lang.Integer,​java.util.Map<java.lang.CharSequence,​java.lang.Integer>> getPartitionStatuses​(java.lang.String storeName, int storeVersion, java.lang.String incrementalPushVersion, int numberOfPartitions, int batchGetLimit)  
      java.util.Map<java.lang.Integer,​java.util.Map<java.lang.CharSequence,​java.lang.Integer>> getPartitionStatuses​(java.lang.String storeName, int storeVersion, java.lang.String incrementalPushVersion, java.util.Set<java.lang.Integer> partitionIds, java.util.Optional<java.lang.Integer> batchGetLimitOption)
      Return statuses of all replicas belonging to partitions mentioned in partitionIds.
      java.util.Map<java.lang.CharSequence,​java.lang.Integer> getSupposedlyOngoingIncrementalPushVersions​(java.lang.String storeName, int storeVersion)  
      java.util.Map<java.lang.CharSequence,​java.lang.Integer> getVersionStatus​(java.lang.String storeName, int version)  
      boolean isInstanceAlive​(java.lang.String storeName, java.lang.String instanceName)  
      • Methods inherited from class java.lang.Object

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

      • PushStatusStoreReader

        public PushStatusStoreReader​(com.linkedin.d2.balancer.D2Client d2Client,
                                     java.lang.String clusterDiscoveryD2ServiceName,
                                     long heartbeatExpirationTimeInSeconds)
    • Method Detail

      • getVersionStatus

        public java.util.Map<java.lang.CharSequence,​java.lang.Integer> getVersionStatus​(java.lang.String storeName,
                                                                                              int version)
      • getPartitionStatus

        public java.util.Map<java.lang.CharSequence,​java.lang.Integer> getPartitionStatus​(java.lang.String storeName,
                                                                                                int version,
                                                                                                int partitionId,
                                                                                                java.util.Optional<java.lang.String> incrementalPushVersion)
      • getPartitionStatus

        public java.util.Map<java.lang.CharSequence,​java.lang.Integer> getPartitionStatus​(java.lang.String storeName,
                                                                                                int version,
                                                                                                int partitionId,
                                                                                                java.util.Optional<java.lang.String> incrementalPushVersion,
                                                                                                java.util.Optional<java.lang.String> incrementalPushPrefix)
      • getPartitionStatuses

        public java.util.Map<java.lang.Integer,​java.util.Map<java.lang.CharSequence,​java.lang.Integer>> getPartitionStatuses​(java.lang.String storeName,
                                                                                                                                         int storeVersion,
                                                                                                                                         java.lang.String incrementalPushVersion,
                                                                                                                                         int numberOfPartitions)
        Return statuses of all replicas belonging to partitions with partitionIds in the range [0 (inclusive), numberOfPartitions (exclusive)) {partitionId: {instance:status, instance:status,...},...}
      • getPartitionStatuses

        public java.util.Map<java.lang.Integer,​java.util.Map<java.lang.CharSequence,​java.lang.Integer>> getPartitionStatuses​(java.lang.String storeName,
                                                                                                                                         int storeVersion,
                                                                                                                                         java.lang.String incrementalPushVersion,
                                                                                                                                         int numberOfPartitions,
                                                                                                                                         int batchGetLimit)
      • getPartitionStatuses

        public java.util.Map<java.lang.Integer,​java.util.Map<java.lang.CharSequence,​java.lang.Integer>> getPartitionStatuses​(java.lang.String storeName,
                                                                                                                                         int storeVersion,
                                                                                                                                         java.lang.String incrementalPushVersion,
                                                                                                                                         java.util.Set<java.lang.Integer> partitionIds,
                                                                                                                                         java.util.Optional<java.lang.Integer> batchGetLimitOption)
        Return statuses of all replicas belonging to partitions mentioned in partitionIds. If status is not available for a partition then empty map will be returned as a value for that partition. {partitionId: {instance:status, instance:status,...},...}
      • getHeartbeat

        public long getHeartbeat​(java.lang.String storeName,
                                 java.lang.String instanceName)
        Parameters:
        instanceName - = [hostname + appName]
      • isInstanceAlive

        public boolean isInstanceAlive​(java.lang.String storeName,
                                       java.lang.String instanceName)
      • getSupposedlyOngoingIncrementalPushVersions

        public java.util.Map<java.lang.CharSequence,​java.lang.Integer> getSupposedlyOngoingIncrementalPushVersions​(java.lang.String storeName,
                                                                                                                         int storeVersion)
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable