Package com.linkedin.venice.pushmonitor
Class PushStatusDecider
- java.lang.Object
-
- com.linkedin.venice.pushmonitor.PushStatusDecider
-
- Direct Known Subclasses:
WaitAllPushStatusDecider
,WaitNMinusOnePushStatusDecider
public abstract class PushStatusDecider extends java.lang.Object
Decide the offline push status by checking all replicas statuses under different offline push strategies.
-
-
Constructor Summary
Constructors Constructor Description PushStatusDecider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ExecutionStatusWithDetails
checkPushStatusAndDetailsByPartitionsStatus(OfflinePushStatus pushStatus, PartitionAssignment partitionAssignment, DisableReplicaCallback callback)
Check the current status based onPartitionStatus
protected abstract int
getNumberOfToleratedErrors()
protected ExecutionStatus
getPartitionStatus(PartitionStatus partitionStatus, int replicationFactor, java.util.Map<Instance,HelixState> instanceToStateMap, DisableReplicaCallback callback)
static java.util.List<Instance>
getReadyToServeInstances(PartitionStatus partitionStatus, PartitionAssignment partitionAssignment, int partitionId)
static java.util.List<java.lang.String>
getReadyToServeInstances(java.util.Map<java.lang.CharSequence,StoreReplicaStatus> replicaStatusMap)
Replicas will be considered ready to serve if their status isExecutionStatus.COMPLETED
.static ExecutionStatus
getReplicaCurrentStatus(java.util.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
getStrategy()
java.util.Optional<java.lang.String>
hasEnoughNodesToStartPush(java.lang.String kafkaTopic, int replicationFactor, ResourceAssignment resourceAssignment, java.util.Optional<java.lang.String> previousReason)
protected abstract boolean
hasEnoughReplicasForOnePartition(int actual, int expected)
-
-
-
Method Detail
-
checkPushStatusAndDetailsByPartitionsStatus
public ExecutionStatusWithDetails checkPushStatusAndDetailsByPartitionsStatus(OfflinePushStatus pushStatus, PartitionAssignment partitionAssignment, DisableReplicaCallback callback)
Check the current status based onPartitionStatus
-
getReadyToServeInstances
public static java.util.List<Instance> getReadyToServeInstances(PartitionStatus partitionStatus, PartitionAssignment partitionAssignment, int partitionId)
-
getReadyToServeInstances
public static java.util.List<java.lang.String> getReadyToServeInstances(java.util.Map<java.lang.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 java.util.Optional<java.lang.String> hasEnoughNodesToStartPush(java.lang.String kafkaTopic, int replicationFactor, ResourceAssignment resourceAssignment, java.util.Optional<java.lang.String> previousReason)
- Returns:
- status details: if empty, push has enough replicas in every partition, otherwise, message contains details
-
getStrategy
public abstract OfflinePushStrategy getStrategy()
-
hasEnoughReplicasForOnePartition
protected abstract boolean hasEnoughReplicasForOnePartition(int actual, int expected)
-
getNumberOfToleratedErrors
protected abstract int getNumberOfToleratedErrors()
-
getPartitionStatus
protected ExecutionStatus getPartitionStatus(PartitionStatus partitionStatus, int replicationFactor, java.util.Map<Instance,HelixState> instanceToStateMap, DisableReplicaCallback callback)
-
getReplicaCurrentStatus
public static ExecutionStatus getReplicaCurrentStatus(java.util.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.
-
-