public class LeaderImpl extends Object implements ILeader
| Constructor and Description |
|---|
LeaderImpl(String leaderId,
String clusterName) |
| Modifier and Type | Method and Description |
|---|---|
void |
addApplication(org.thales.punch.libraries.shiva.api.Application application)
Add a new application to the set of applications known to the leader.
|
void |
addWorker(org.thales.punch.settings.api.ISettingsMap map)
Add a new worker to be known to the leader.
|
org.thales.punch.settings.api.ISettingsMap |
getAssignements(long offset) |
String |
getLeaderId() |
long |
initAssignements(org.thales.punch.settings.api.ISettingsMap map)
Make the leader start from a latest saved assignment.
|
void |
removeApplication(String applicationName)
The user stopped one of the shiva application.
|
void |
removeWorker(String workerId)
Remove a worker from the set of known workers.
|
public void addWorker(org.thales.punch.settings.api.ISettingsMap map)
ILeaderThe settings map used here conforms to the one generated by KafkaShivaUtil.getWorkerDeclarationMap(String, java.util.List)
public void removeWorker(String workerId)
ILeaderremoveWorker in interface ILeaderworkerId - the worker namepublic void addApplication(org.thales.punch.libraries.shiva.api.Application application)
ILeaderThis in turn will make the liader schedule it and assign it to some worker.
addApplication in interface ILeaderapplication - the application to startpublic void removeApplication(String applicationName)
removeApplication in interface ILeaderpublic String getLeaderId()
getLeaderId in interface ILeaderpublic org.thales.punch.settings.api.ISettingsMap getAssignements(long offset)
getAssignements in interface ILeaderoffset - the offset of the latest record readpublic long initAssignements(org.thales.punch.settings.api.ISettingsMap map)
ILeaderinitAssignements in interface ILeadermap - the latest assignment map.Copyright © 2022. All rights reserved.