Class PushStatusStoreReader

java.lang.Object
com.linkedin.venice.pushstatushelper.PushStatusStoreReader
All Implemented Interfaces:
Closeable, AutoCloseable

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

    • PushStatusStoreReader

      public PushStatusStoreReader(com.linkedin.d2.balancer.D2Client d2Client, String clusterDiscoveryD2ServiceName, long heartbeatExpirationTimeInSeconds)
  • Method Details

    • getVersionStatus

      public Map<CharSequence,Integer> getVersionStatus(String storeName, int version, Optional<String> incrementalPushVersion)
    • getPartitionStatus

      public Map<CharSequence,Integer> getPartitionStatus(String storeName, int version, int partitionId, Optional<String> incrementalPushVersion)
    • getPartitionStatus

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

      public Map<Integer,Map<CharSequence,Integer>> getPartitionStatuses(String storeName, int storeVersion, 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 Map<Integer,Map<CharSequence,Integer>> getPartitionStatuses(String storeName, int storeVersion, String incrementalPushVersion, int numberOfPartitions, int batchGetLimit)
    • getPartitionStatuses

      public Map<Integer,Map<CharSequence,Integer>> getPartitionStatuses(String storeName, int storeVersion, String incrementalPushVersion, Set<Integer> partitionIds, Optional<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(String storeName, String instanceName)
      Parameters:
      instanceName - = [hostname + appName]
    • isInstanceAlive

      public boolean isInstanceAlive(String storeName, String instanceName)
    • getInstanceStatus

      public PushStatusStoreReader.InstanceStatus getInstanceStatus(String storeName, String instanceName)
    • getSupposedlyOngoingIncrementalPushVersions

      public Map<CharSequence,Integer> getSupposedlyOngoingIncrementalPushVersions(String storeName, int storeVersion)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable