Package com.linkedin.venice.pushmonitor
Class OfflinePushStatus
java.lang.Object
com.linkedin.venice.pushmonitor.OfflinePushStatus
Class stores all the statuses and history of one offline push.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionOfflinePushStatus
(String kafkaTopic, int numberOfPartition, int replicationFactor, OfflinePushStrategy strategy) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getIncrementalPushStatus
(PartitionAssignment partitionAssignment, String incrementalPushVersion) Returns map of partitionId -> list of status history for all working replicas of that partitiongetLatestIncrementalPushVersion
(PartitionAssignment partitionAssignment) int
getPartitionStatus
(int partitionId) int
protected long
Necessary for the JSON serdelong
boolean
int
hashCode()
boolean
isEOPReceivedInEveryPartition
(boolean isDataRecovery) Checks whether at least one replica of each partition has returnedExecutionStatus.END_OF_PUSH_RECEIVED
This is intended forOfflinePushStatus
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.void
setCurrentStatus
(ExecutionStatus currentStatus) void
setIncrementalPushVersion
(String incrementalPushVersion) void
setPartitionStatus
(PartitionStatus partitionStatus) void
setPartitionStatus
(PartitionStatus partitionStatus, boolean updateDetails) void
setPartitionStatuses
(List<PartitionStatus> partitionStatuses) void
setPushProperties
(Map<String, String> pushProperties) void
setStatusDetails
(String statusDetails) Necessary for the JSON serdevoid
setStatusHistory
(List<StatusSnapshot> statusHistory) void
setSuccessfulPushDurationInSecs
(long successfulPushDurationInSecs) toString()
void
updateStatus
(ExecutionStatus newStatus) void
updateStatus
(ExecutionStatus newStatus, Optional<String> newStatusDetails) boolean
validatePushStatusTransition
(ExecutionStatus newStatus) Judge whether current status could be transferred to the new status.
-
Field Details
-
HELIX_RESOURCE_NOT_CREATED
- See Also:
-
HELIX_ASSIGNMENT_COMPLETED
- See Also:
-
-
Constructor Details
-
OfflinePushStatus
public OfflinePushStatus(String kafkaTopic, int numberOfPartition, int replicationFactor, OfflinePushStrategy strategy)
-
-
Method Details
-
updateStatus
-
updateStatus
-
getStartTimeSec
protected long getStartTimeSec() -
validatePushStatusTransition
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
-
setPartitionStatus
-
getIncrementalPushStatus
public Map<Integer,Map<CharSequence, getIncrementalPushStatusInteger>> (PartitionAssignment partitionAssignment, String incrementalPushVersion) Returns map of partitionId -> list of status history for all working replicas of that partition -
getLatestIncrementalPushVersion
-
hasFatalDataValidationError
public boolean hasFatalDataValidationError() -
getKafkaTopic
-
getNumberOfPartition
public int getNumberOfPartition() -
getReplicationFactor
public int getReplicationFactor() -
getStrategy
-
getCurrentStatus
-
setCurrentStatus
-
getOptionalStatusDetails
-
getStatusDetails
Necessary for the JSON serde -
setStatusDetails
Necessary for the JSON serde -
getStatusHistory
-
setStatusHistory
-
setPartitionStatuses
-
getIncrementalPushVersion
-
setIncrementalPushVersion
-
getSuccessfulPushDurationInSecs
public long getSuccessfulPushDurationInSecs() -
setSuccessfulPushDurationInSecs
public void setSuccessfulPushDurationInSecs(long successfulPushDurationInSecs) -
clonePushStatus
-
getProgress
- Returns:
- a map which's id is replica id and value is the offset that replica already consumed.
-
getPartitionStatuses
-
getPartitionStatus
-
isEOPReceivedInEveryPartition
public boolean isEOPReceivedInEveryPartition(boolean isDataRecovery) Checks whether at least one replica of each partition has returnedExecutionStatus.END_OF_PUSH_RECEIVED
This is intended forOfflinePushStatus
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
-
setPushProperties
-
getStatusUpdateTimestamp
- Returns:
- the UNIX Epoch time corresponding to the earliest time in which
getStatusHistory()
contained anExecutionStatus
equal to thegetCurrentStatus()
, or null if not available.
-
equals
-
hashCode
public int hashCode() -
toString
-