Package org.apache.storm.assignments
Interface ILocalAssignmentsBackend
- 
- All Superinterfaces:
- AutoCloseable
 - All Known Implementing Classes:
- InMemoryAssignmentBackend
 
 public interface ILocalAssignmentsBackend extends AutoCloseable Interface for storing local assignments.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method 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.voidclearStateForStorm(String stormId)Clear all the state for a storm.voidclose()Function to release resource.voiddeleteStormId(String stormName)Delete a local cache of stormId which is mapped to a specific storm name.AssignmentgetAssignment(String stormId)Get assignment asAssignmentfor a storm.StringgetStormId(String stormName)Get storm runtime id from local.booleanisSynchronized()Decide if the assignments is synchronized from remote state-store.voidkeepOrUpdateAssignment(String stormId, Assignment assignment)Keep a storm assignment to local state or update old assignment.voidkeepStormId(String stormName, String stormId)Keep a mapping storm-name -> storm-id to local state.voidprepare(Map conf)Initial function for creating backend.voidremoveAssignment(String stormId)voidsetSynchronized()Mark this backend as synchronized when sync work is done.voidsyncRemoteAssignments(Map<String,byte[]> remote)Sync remote assignments to local, if remote is null, we will sync it from zk.voidsyncRemoteIds(Map<String,String> remote)Sync remote storm ids to local, will just used for nimbus.
 
- 
- 
- 
Method Detail- 
isSynchronizedboolean isSynchronized() Decide if the assignments is synchronized from remote state-store.
 - 
setSynchronizedvoid setSynchronized() Mark this backend as synchronized when sync work is done.
 - 
preparevoid prepare(Map conf) Initial function for creating backend.- Parameters:
- conf- config
 
 - 
keepOrUpdateAssignmentvoid keepOrUpdateAssignment(String stormId, Assignment assignment) Keep a storm assignment to local state or update old assignment.- Parameters:
- stormId- storm runtime id
- assignment- assignment as thrift
 
 - 
getAssignmentAssignment getAssignment(String stormId) Get assignment asAssignmentfor a storm.- Parameters:
- stormId- storm runtime id
- Returns:
- assignment
 
 - 
removeAssignmentvoid removeAssignment(String stormId) 
 - 
assignmentsList<String> assignments() List all the storm runtime ids of local assignments.- Returns:
- a list of storm ids
 
 - 
assignmentsInfoMap<String,Assignment> assignmentsInfo() Get all the local assignments of local state.- Returns:
- mapping of storm-id -> assignment
 
 - 
syncRemoteAssignmentsvoid syncRemoteAssignments(Map<String,byte[]> remote) Sync remote assignments to local, if remote is null, we will sync it from zk.- Parameters:
- remote- specific remote assignments, if it is null, it will sync from zookeeper[only used for nimbus]
 
 - 
keepStormIdvoid keepStormId(String stormName, String stormId) Keep a mapping storm-name -> storm-id to local state.- Parameters:
- stormName- storm name
- stormId- storm runtime id
 
 - 
getStormIdString getStormId(String stormName) Get storm runtime id from local.- Parameters:
- stormName- name of a storm
- Returns:
- runtime storm id
 
 - 
syncRemoteIdsvoid syncRemoteIds(Map<String,String> remote) Sync remote storm ids to local, will just used for nimbus.- Parameters:
- remote- remote ids from state store
 
 - 
deleteStormIdvoid deleteStormId(String stormName) Delete a local cache of stormId which is mapped to a specific storm name.- Parameters:
- stormName- storm name
 
 - 
clearStateForStormvoid clearStateForStorm(String stormId) Clear all the state for a storm.- Parameters:
- stormId- storm id
 
 - 
closevoid close() Function to release resource.- Specified by:
- closein interface- AutoCloseable
 
 
- 
 
-