public interface ILocalAssignmentsBackend extends AutoCloseable
Interface for storing local assignments.
Modifier and Type | Method and Description |
---|---|
List<String> |
assignments()
List all the storm runtime ids of local assignments.
|
Map<String,Assignment> |
assignmentsInfo()
Get all the local assignments of local state.
|
void |
clearStateForStorm(String stormId)
Clear all the state for a storm.
|
void |
close()
Function to release resource.
|
void |
deleteStormId(String stormName)
Delete a local cache of stormId which is mapped to a specific storm name.
|
Assignment |
getAssignment(String stormId)
Get assignment as
Assignment for a storm. |
String |
getStormId(String stormName)
Get storm runtime id from local.
|
boolean |
isSynchronized()
Decide if the assignments is synchronized from remote state-store.
|
void |
keepOrUpdateAssignment(String stormId,
Assignment assignment)
Keep a storm assignment to local state or update old assignment.
|
void |
keepStormId(String stormName,
String stormId)
Keep a mapping storm-name -> storm-id to local state.
|
void |
prepare(Map conf)
Initial function for creating backend.
|
void |
removeAssignment(String stormId) |
void |
setSynchronized()
Mark this backend as synchronized when sync work is done.
|
void |
syncRemoteAssignments(Map<String,byte[]> remote)
Sync remote assignments to local, if remote is null, we will sync it from zk.
|
void |
syncRemoteIds(Map<String,String> remote)
Sync remote storm ids to local, will just used for nimbus.
|
boolean isSynchronized()
Decide if the assignments is synchronized from remote state-store.
void setSynchronized()
Mark this backend as synchronized when sync work is done.
void prepare(Map conf)
Initial function for creating backend.
conf
- configvoid keepOrUpdateAssignment(String stormId, Assignment assignment)
Keep a storm assignment to local state or update old assignment.
stormId
- storm runtime idassignment
- assignment as thriftAssignment getAssignment(String stormId)
Get assignment as Assignment
for a storm.
stormId
- storm runtime idvoid removeAssignment(String stormId)
List<String> assignments()
List all the storm runtime ids of local assignments.
Map<String,Assignment> assignmentsInfo()
Get all the local assignments of local state.
void syncRemoteAssignments(Map<String,byte[]> remote)
Sync remote assignments to local, if remote is null, we will sync it from zk.
remote
- specific remote assignments, if it is null, it will sync from zookeeper[only used for nimbus]void keepStormId(String stormName, String stormId)
Keep a mapping storm-name -> storm-id to local state.
stormName
- storm namestormId
- storm runtime idString getStormId(String stormName)
Get storm runtime id from local.
stormName
- name of a stormvoid syncRemoteIds(Map<String,String> remote)
Sync remote storm ids to local, will just used for nimbus.
remote
- remote ids from state storevoid deleteStormId(String stormName)
Delete a local cache of stormId which is mapped to a specific storm name.
stormName
- storm namevoid clearStateForStorm(String stormId)
Clear all the state for a storm.
stormId
- storm idvoid close()
Function to release resource.
close
in interface AutoCloseable
Copyright © 2020 The Apache Software Foundation. All rights reserved.