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)
ILeader
The settings map used here conforms to the one generated by KafkaShivaUtil.getWorkerDeclarationMap(String, java.util.List)
public void removeWorker(String workerId)
ILeader
removeWorker
in interface ILeader
workerId
- the worker namepublic void addApplication(org.thales.punch.libraries.shiva.api.Application application)
ILeader
This in turn will make the liader schedule it and assign it to some worker.
addApplication
in interface ILeader
application
- the application to startpublic void removeApplication(String applicationName)
removeApplication
in interface ILeader
public String getLeaderId()
getLeaderId
in interface ILeader
public org.thales.punch.settings.api.ISettingsMap getAssignements(long offset)
getAssignements
in interface ILeader
offset
- the offset of the latest record readpublic long initAssignements(org.thales.punch.settings.api.ISettingsMap map)
ILeader
initAssignements
in interface ILeader
map
- the latest assignment map.Copyright © 2022. All rights reserved.