Class LocalState

java.lang.Object
org.apache.storm.utils.LocalState

public class LocalState extends Object
A simple, durable, atomic K/V database. *Very inefficient*, should only be used for occasional reads/writes. Every read/write hits disk.
  • Field Details

  • Constructor Details

  • Method Details

    • snapshot

      public Map<String,org.apache.storm.thrift.TBase> snapshot()
    • get

      public org.apache.storm.thrift.TBase get(String key)
    • put

      public void put(String key, org.apache.storm.thrift.TBase val)
    • put

      public void put(String key, org.apache.storm.thrift.TBase val, boolean cleanup)
    • remove

      public void remove(String key)
    • remove

      public void remove(String key, boolean cleanup)
    • cleanup

      public void cleanup(int keepVersions) throws IOException
      Throws:
      IOException
    • getTopoHistoryList

      public List<LSTopoHistory> getTopoHistoryList()
    • filterOldTopologies

      public void filterOldTopologies(long cutOffAge)
      Remove topologies from local state which are older than cutOffAge.
    • addTopologyHistory

      public void addTopologyHistory(LSTopoHistory lsTopoHistory)
    • getSupervisorId

      public String getSupervisorId()
    • setSupervisorId

      public void setSupervisorId(String supervisorId)
    • getApprovedWorkers

      public Map<String,Integer> getApprovedWorkers()
    • setApprovedWorkers

      public void setApprovedWorkers(Map<String,Integer> approvedWorkers)
    • getWorkerHeartBeat

      public LSWorkerHeartbeat getWorkerHeartBeat()
    • setWorkerHeartBeat

      public void setWorkerHeartBeat(LSWorkerHeartbeat workerHeartBeat)
    • getLocalAssignmentsMap

      public Map<Integer,LocalAssignment> getLocalAssignmentsMap()
    • setLocalAssignmentsMap

      public void setLocalAssignmentsMap(Map<Integer,LocalAssignment> localAssignmentMap)