public class ZooKeeperMesosWorkerStore extends Object implements MesosWorkerStore
MesosWorkerStore.Worker, MesosWorkerStore.WorkerState
TASKID_FORMAT
Constructor and Description |
---|
ZooKeeperMesosWorkerStore(ZooKeeperStateHandleStore<MesosWorkerStore.Worker> workersInZooKeeper,
ZooKeeperSharedValue frameworkIdInZooKeeper,
ZooKeeperSharedCount totalTaskCountInZooKeeper) |
Modifier and Type | Method and Description |
---|---|
scala.Option<org.apache.mesos.Protos.FrameworkID> |
getFrameworkID()
Get the persisted framework ID.
|
org.apache.mesos.Protos.TaskID |
newTaskID()
Generates a new task ID.
|
void |
putWorker(MesosWorkerStore.Worker worker)
Put a worker into storage.
|
List<MesosWorkerStore.Worker> |
recoverWorkers()
Recover the stored workers.
|
boolean |
removeWorker(org.apache.mesos.Protos.TaskID taskID)
Remove a worker from storage.
|
void |
setFrameworkID(scala.Option<org.apache.mesos.Protos.FrameworkID> frameworkID)
Update the persisted framework ID.
|
void |
start()
Start the worker store.
|
void |
stop(boolean cleanup)
Stop the worker store.
|
public ZooKeeperMesosWorkerStore(ZooKeeperStateHandleStore<MesosWorkerStore.Worker> workersInZooKeeper, ZooKeeperSharedValue frameworkIdInZooKeeper, ZooKeeperSharedCount totalTaskCountInZooKeeper) throws Exception
Exception
public void start() throws Exception
MesosWorkerStore
start
in interface MesosWorkerStore
Exception
public void stop(boolean cleanup) throws Exception
MesosWorkerStore
stop
in interface MesosWorkerStore
cleanup
- if true, cleanup any stored information.Exception
public scala.Option<org.apache.mesos.Protos.FrameworkID> getFrameworkID() throws Exception
getFrameworkID
in interface MesosWorkerStore
Exception
- on ZK failures, interruptions.public void setFrameworkID(scala.Option<org.apache.mesos.Protos.FrameworkID> frameworkID) throws Exception
setFrameworkID
in interface MesosWorkerStore
frameworkID
- the new ID or empty to remove the persisted ID.Exception
- on ZK failures, interruptions.public org.apache.mesos.Protos.TaskID newTaskID() throws Exception
newTaskID
in interface MesosWorkerStore
Exception
public List<MesosWorkerStore.Worker> recoverWorkers() throws Exception
MesosWorkerStore
recoverWorkers
in interface MesosWorkerStore
Exception
public void putWorker(MesosWorkerStore.Worker worker) throws Exception
MesosWorkerStore
putWorker
in interface MesosWorkerStore
Exception
public boolean removeWorker(org.apache.mesos.Protos.TaskID taskID) throws Exception
MesosWorkerStore
removeWorker
in interface MesosWorkerStore
Exception
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.