public class DefaultReconciler extends java.lang.Object implements Reconciler
Reconciler. See Reconciler for docs.| Constructor and Description |
|---|
DefaultReconciler(StateStore stateStore) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
getCurrentTimeMillis()
Time retrieval broken out into a separate function to allow overriding its behavior in tests.
|
boolean |
isReconciled()
Returns whether reconciliation is complete.
|
void |
reconcile(SchedulerDriver driver)
This function is expected to be called repeatedly.
|
(package private) java.util.Set<java.lang.String> |
remaining()
Returns the list of remaining unreconciled tasks for validation in tests.
|
void |
start()
Starts reconciliation against the provided tasks, which should represent what the Scheduler
currently knows about task status.
|
void |
update(Protos.TaskStatus status)
Used to update the Reconciler with current task status.
|
public DefaultReconciler(StateStore stateStore)
public void start()
ReconcilerNOTE: THIS CALL MUST BE THREAD-SAFE AGAINST OTHER RECONCILER CALLS
start in interface Reconcilerpublic void reconcile(SchedulerDriver driver)
unreconciledList = tasksKnownByScheduler // provided by the StateStore
while (!unreconciledList.isEmpty()) {
// explicit reconciliation (PHASE 1)
if (timerSinceLastCallExpired) {
driver.reconcile(unreconciledList);
}
}
driver.reconcile(emptyList); // implicit reconciliation (PHASE 2)
reconcile in interface Reconcilerdriver - The SchedulerDriver instance that the Reconciler should
use to query the Mesos master for TaskStatus.public void update(Protos.TaskStatus status)
ReconcilerNOTE: THIS CALL MUST BE THREAD-SAFE AGAINST OTHER RECONCILER CALLS
update in interface Reconcilerstatus - The TaskStatus used to update the Reconciler.public boolean isReconciled()
ReconcilerNOTE: THIS CALL MUST BE THREAD-SAFE AGAINST OTHER RECONCILER CALLS
isReconciled in interface Reconcilerjava.util.Set<java.lang.String> remaining()
protected long getCurrentTimeMillis()