public interface ILeader
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)
Remove an app.
|
void |
removeWorker(String name)
Remove a worker from the set of known workers.
|
org.thales.punch.settings.api.ISettingsMap getAssignements(long offset)
offset
- the offset of the latest record readlong initAssignements(org.thales.punch.settings.api.ISettingsMap map)
map
- the latest assignment map.void addApplication(org.thales.punch.libraries.shiva.api.Application application)
This in turn will make the liader schedule it and assign it to some worker.
application
- the application to startoffset
- the corresponding offset. It is used to make sure we kown which version of the application we speak about.void removeApplication(String applicationName)
name
- the task namevoid addWorker(org.thales.punch.settings.api.ISettingsMap map)
The settings map used here conforms to the one generated by KafkaShivaUtil.getWorkerDeclarationMap(String, java.util.List)
map
- the worker information.void removeWorker(String name)
name
- the worker nameString getLeaderId()
Copyright © 2022. All rights reserved.