Class OfflinePushStatus

java.lang.Object
com.linkedin.venice.pushmonitor.OfflinePushStatus

public class OfflinePushStatus extends Object
Class stores all the statuses and history of one offline push.
  • Field Details

  • Constructor Details

    • OfflinePushStatus

      public OfflinePushStatus(String kafkaTopic, int numberOfPartition, int replicationFactor, OfflinePushStrategy strategy)
  • Method Details

    • updateStatus

      public void updateStatus(ExecutionStatus newStatus)
    • updateStatus

      public void updateStatus(ExecutionStatus newStatus, Optional<String> newStatusDetails)
    • getStartTimeSec

      protected long getStartTimeSec()
    • validatePushStatusTransition

      public boolean validatePushStatusTransition(ExecutionStatus newStatus)
      Judge whether current status could be transferred to the new status.

      Push's state machine:

      • NOT_STARTED->STARTED
      • NOT_STARTED->ERROR
      • STARTED->STARTED
      • STARTED->COMPLETED
      • STARTED->ERROR
      • STARTED->END_OF_PUSH_RECEIVED
      • END_OF_PUSH_RECEIVED->COMPLETED
      • END_OF_PUSH_RECEIVED->ERROR
      • COMPLETED->ARCHIVED
      • ERROR->ARCHIVED
      Parameters:
      newStatus -
      Returns:
    • setPartitionStatus

      public void setPartitionStatus(PartitionStatus partitionStatus)
    • setPartitionStatus

      public void setPartitionStatus(PartitionStatus partitionStatus, boolean updateDetails)
    • getIncrementalPushStatus

      public Map<Integer,Map<CharSequence,Integer>> getIncrementalPushStatus(PartitionAssignment partitionAssignment, String incrementalPushVersion)
      Returns map of partitionId -> list of status history for all working replicas of that partition
    • getLatestIncrementalPushVersion

      public String getLatestIncrementalPushVersion(PartitionAssignment partitionAssignment)
    • hasFatalDataValidationError

      public boolean hasFatalDataValidationError()
    • getKafkaTopic

      public String getKafkaTopic()
    • getNumberOfPartition

      public int getNumberOfPartition()
    • getReplicationFactor

      public int getReplicationFactor()
    • getStrategy

      public OfflinePushStrategy getStrategy()
    • getCurrentStatus

      public ExecutionStatus getCurrentStatus()
    • setCurrentStatus

      public void setCurrentStatus(ExecutionStatus currentStatus)
    • getOptionalStatusDetails

      public Optional<String> getOptionalStatusDetails()
    • getStatusDetails

      public String getStatusDetails()
      Necessary for the JSON serde
    • setStatusDetails

      public void setStatusDetails(String statusDetails)
      Necessary for the JSON serde
    • getStatusHistory

      public List<StatusSnapshot> getStatusHistory()
    • setStatusHistory

      public void setStatusHistory(List<StatusSnapshot> statusHistory)
    • setPartitionStatuses

      public void setPartitionStatuses(List<PartitionStatus> partitionStatuses)
    • getIncrementalPushVersion

      public String getIncrementalPushVersion()
    • setIncrementalPushVersion

      public void setIncrementalPushVersion(String incrementalPushVersion)
    • getSuccessfulPushDurationInSecs

      public long getSuccessfulPushDurationInSecs()
    • setSuccessfulPushDurationInSecs

      public void setSuccessfulPushDurationInSecs(long successfulPushDurationInSecs)
    • clonePushStatus

      public OfflinePushStatus clonePushStatus()
    • getProgress

      public Map<String,Long> getProgress()
      Returns:
      a map which's id is replica id and value is the offset that replica already consumed.
    • getPartitionStatuses

      public Collection<PartitionStatus> getPartitionStatuses()
    • getPartitionStatus

      public PartitionStatus getPartitionStatus(int partitionId)
    • isEOPReceivedInEveryPartition

      public boolean isEOPReceivedInEveryPartition(boolean isDataRecovery)
      Checks whether at least one replica of each partition has returned ExecutionStatus.END_OF_PUSH_RECEIVED This is intended for OfflinePushStatus instances which belong to Hybrid Stores, though there should be no negative side-effects if called on an instance tied to a non-hybrid store.
      Returns:
      true if at least one replica of each partition has consumed an EOP control message, false otherwise
    • getPushProperties

      public Map<String,String> getPushProperties()
    • setPushProperties

      public void setPushProperties(Map<String,String> pushProperties)
    • getStatusUpdateTimestamp

      public Long getStatusUpdateTimestamp()
      Returns:
      the UNIX Epoch time corresponding to the earliest time in which getStatusHistory() contained an ExecutionStatus equal to the getCurrentStatus(), or null if not available.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object