Skip to content

Latest commit

 

History

History
65 lines (42 loc) · 1.28 KB

File metadata and controls

65 lines (42 loc) · 1.28 KB

Schedular

Data Structures

StartHeap (Min Heap)

  • Comparison will be based on StartTime of Application_Instace_Id
  • Other Stored Info
    • application_instace_id

EndHeap (Min Heap)

  • Comparison will be based on EndTime of Application_Instace_Id

Working

Thread 1

  • Constantly Check current time with StartHeap top Element
    • In Case of Match → Following msg will be sent to Deployer (Through Kafka)

      run application_instance_id
    • Pop top element → StartTime

    • EndTime → StartTime + Duration

    • push EndTime element to EndHeap

Thread 2

  • Constantly Check current time with EndHeap top Element
    • In Case of Match → Following msg will be sent to Deployer (Through Kafka)

      kill application_instance_id
    • Pop top element → EndTime

    • NewStartTime → EndTime + Interval

    • If Repeatation == True:

      • push NewStartTime to StartHeap

Fault Tollerance

  • Following Info will be continuously updated in SchedularDB

    application_instace_id
    
    start_date
    start_time
    
    end_date
    end_time
    
    duration
    repetition
    interval