Package com.linkedin.venice.pushmonitor
Class PushStatusDecider
java.lang.Object
com.linkedin.venice.pushmonitor.PushStatusDecider
- Direct Known Subclasses:
WaitAllPushStatusDecider
,WaitNMinusOnePushStatusDecider
Decide the offline push status by checking all replicas statuses under different offline push strategies.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncheckPushStatusAndDetailsByPartitionsStatus
(OfflinePushStatus pushStatus, PartitionAssignment partitionAssignment, DisableReplicaCallback callback) Check the current status based onPartitionStatus
protected abstract int
protected ExecutionStatus
getPartitionStatus
(PartitionStatus partitionStatus, int replicationFactor, Map<Instance, HelixState> instanceToStateMap, DisableReplicaCallback callback) getReadyToServeInstances
(PartitionStatus partitionStatus, PartitionAssignment partitionAssignment, int partitionId) getReadyToServeInstances
(Map<CharSequence, StoreReplicaStatus> replicaStatusMap) Replicas will be considered ready to serve if their status isExecutionStatus.COMPLETED
.static ExecutionStatus
getReplicaCurrentStatus
(List<StatusSnapshot> historicStatusList) The helper function is used by both controller and router (leader/follower stores); please be cautious when modifying it because it would affect both components.abstract OfflinePushStrategy
hasEnoughNodesToStartPush
(String kafkaTopic, int replicationFactor, ResourceAssignment resourceAssignment, Optional<String> previousReason) protected abstract boolean
hasEnoughReplicasForOnePartition
(int actual, int expected)
-
Constructor Details
-
PushStatusDecider
public PushStatusDecider()
-
-
Method Details
-
checkPushStatusAndDetailsByPartitionsStatus
public ExecutionStatusWithDetails checkPushStatusAndDetailsByPartitionsStatus(OfflinePushStatus pushStatus, PartitionAssignment partitionAssignment, DisableReplicaCallback callback) Check the current status based onPartitionStatus
-
getReadyToServeInstances
public static List<Instance> getReadyToServeInstances(PartitionStatus partitionStatus, PartitionAssignment partitionAssignment, int partitionId) -
getReadyToServeInstances
public static List<String> getReadyToServeInstances(Map<CharSequence, StoreReplicaStatus> replicaStatusMap) Replicas will be considered ready to serve if their status isExecutionStatus.COMPLETED
. More information is needed if you'd like to change/support other behaviors such as routing to the leader replica.- Parameters:
replicaStatusMap
-- Returns:
- List of ready to serve instance ids
-
hasEnoughNodesToStartPush
public Optional<String> hasEnoughNodesToStartPush(String kafkaTopic, int replicationFactor, ResourceAssignment resourceAssignment, Optional<String> previousReason) - Returns:
- status details: if empty, push has enough replicas in every partition, otherwise, message contains details
-
getStrategy
-
hasEnoughReplicasForOnePartition
protected abstract boolean hasEnoughReplicasForOnePartition(int actual, int expected) -
getNumberOfToleratedErrors
protected abstract int getNumberOfToleratedErrors() -
getPartitionStatus
protected ExecutionStatus getPartitionStatus(PartitionStatus partitionStatus, int replicationFactor, Map<Instance, HelixState> instanceToStateMap, DisableReplicaCallback callback) -
getReplicaCurrentStatus
The helper function is used by both controller and router (leader/follower stores); please be cautious when modifying it because it would affect both components.
-