Class PushStatusDecider

    • Constructor Detail

      • PushStatusDecider

        public PushStatusDecider()
    • Method Detail

      • 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 is ExecutionStatus.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
      • hasEnoughReplicasForOnePartition

        protected abstract boolean hasEnoughReplicasForOnePartition​(int actual,
                                                                    int expected)
      • getNumberOfToleratedErrors

        protected abstract int getNumberOfToleratedErrors()
      • 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.