public class TaskFailover extends Object implements org.apache.curator.framework.recipes.cache.TreeCacheListener, AutoCloseable
Re-schedule tasks that were running when an instance of Engine failed
| Constructor and Description |
|---|
TaskFailover(org.apache.curator.framework.CuratorFramework client,
TaskStateStorage stateStorage,
org.apache.kafka.clients.producer.Producer<TaskId,TaskState> producer) |
| Modifier and Type | Method and Description |
|---|---|
void |
await()
Block until this instance of
TaskFailover fails with an unhandled error. |
void |
childEvent(org.apache.curator.framework.CuratorFramework client,
org.apache.curator.framework.recipes.cache.TreeCacheEvent event)
We want to requeue anything that is not on one of the currently running engines
|
void |
close() |
boolean |
isAlive()
The TaskRunners should only start/add themselves once a failover is alive
|
public TaskFailover(org.apache.curator.framework.CuratorFramework client,
TaskStateStorage stateStorage,
org.apache.kafka.clients.producer.Producer<TaskId,TaskState> producer)
throws Exception
Exceptionpublic void close()
close in interface AutoCloseablepublic boolean isAlive()
public void await()
TaskFailover fails with an unhandled error.public void childEvent(org.apache.curator.framework.CuratorFramework client,
org.apache.curator.framework.recipes.cache.TreeCacheEvent event)
throws Exception
childEvent in interface org.apache.curator.framework.recipes.cache.TreeCacheListenerExceptionCopyright © 2017 Grakn Labs Ltd. All rights reserved.