Package org.apache.storm.daemon.nimbus
Class TopoCache
java.lang.Object
org.apache.storm.daemon.nimbus.TopoCache
Cache topologies and topology confs from the blob store.
 Makes reading this faster because it can skip
 deserialization in many cases.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdd a new topology config.voidaddTopology(String topoId, Subject who, StormTopology topo) Add a new topology.voidclear()Clear all entries from the Cache.voiddeleteTopoConf(String topoId, Subject who) Delete a topology conf when we are done.voiddeleteTopology(String topoId, Subject who) Delete a topology when we are done.readTopoConf(String topoId, Subject who) Read a topology conf.readTopology(String topoId, Subject who) Read a topology.voidUpdate an existing topology conf.voidupdateTopology(String topoId, Subject who, StormTopology topo) Update an existing topology .
- 
Field Details- 
LOGpublic static final org.slf4j.Logger LOG
 
- 
- 
Constructor Details- 
TopoCache
 
- 
- 
Method Details- 
readTopologypublic StormTopology readTopology(String topoId, Subject who) throws KeyNotFoundException, AuthorizationException, IOException Read a topology.- Parameters:
- topoId- the id of the topology to read
- who- who to read it as
- Returns:
- the deserialized topology.
- Throws:
- IOException- on any error while reading the blob.
- AuthorizationException- if who is not allowed to read the blob
- KeyNotFoundException- if the blob could not be found
 
- 
deleteTopologypublic void deleteTopology(String topoId, Subject who) throws AuthorizationException, KeyNotFoundException Delete a topology when we are done.- Parameters:
- topoId- the id of the topology
- who- who is deleting it
- Throws:
- AuthorizationException- if who is not allowed to delete the blob
- KeyNotFoundException- if the blob could not be found
 
- 
addTopologypublic void addTopology(String topoId, Subject who, StormTopology topo) throws AuthorizationException, KeyAlreadyExistsException, IOException Add a new topology.- Parameters:
- topoId- the id of the topology
- who- who is doing it
- topo- the topology itself
- Throws:
- AuthorizationException- if who is not allowed to add a topology
- KeyAlreadyExistsException- if the topology already exists
- IOException- on any error interacting with the blob store
 
- 
updateTopologypublic void updateTopology(String topoId, Subject who, StormTopology topo) throws AuthorizationException, KeyNotFoundException, IOException Update an existing topology .- Parameters:
- topoId- the id of the topology
- who- who is doing it
- topo- the new topology to save
- Throws:
- AuthorizationException- if who is not allowed to update a topology
- KeyNotFoundException- if the topology is not found in the blob store
- IOException- on any error interacting with the blob store
 
- 
readTopoConfpublic Map<String,Object> readTopoConf(String topoId, Subject who) throws KeyNotFoundException, AuthorizationException, IOException Read a topology conf.- Parameters:
- topoId- the id of the topology to read the conf for
- who- who to read it as
- Returns:
- the deserialized config.
- Throws:
- IOException- on any error while reading the blob.
- AuthorizationException- if who is not allowed to read the blob
- KeyNotFoundException- if the blob could not be found
 
- 
deleteTopoConfpublic void deleteTopoConf(String topoId, Subject who) throws AuthorizationException, KeyNotFoundException Delete a topology conf when we are done.- Parameters:
- topoId- the id of the topology
- who- who is deleting it
- Throws:
- AuthorizationException- if who is not allowed to delete the topo conf
- KeyNotFoundException- if the topo conf is not found in the blob store
 
- 
addTopoConfpublic void addTopoConf(String topoId, Subject who, Map<String, Object> topoConf) throws AuthorizationException, KeyAlreadyExistsException, IOExceptionAdd a new topology config.- Parameters:
- topoId- the id of the topology
- who- who is doing it
- topoConf- the topology conf itself
- Throws:
- AuthorizationException- if who is not allowed to add a topology conf
- KeyAlreadyExistsException- if the toplogy conf already exists in the blob store
- IOException- on any error interacting with the blob store.
 
- 
updateTopoConfpublic void updateTopoConf(String topoId, Subject who, Map<String, Object> topoConf) throws AuthorizationException, KeyNotFoundException, IOExceptionUpdate an existing topology conf.- Parameters:
- topoId- the id of the topology
- who- who is doing it
- topoConf- the new topology conf to save
- Throws:
- AuthorizationException- if who is not allowed to update the topology conf
- KeyNotFoundException- if the topology conf is not found in the blob store
- IOException- on any error interacting with the blob store.
 
- 
clearpublic void clear()Clear all entries from the Cache. This typically happens right after becoming a leader, just to be sure nothing has changed while we were not the leader.
 
-