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.
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
static String |
LS_APPROVED_WORKERS |
static String |
LS_ID |
static String |
LS_LOCAL_ASSIGNMENTS |
static String |
LS_TOPO_HISTORY |
static String |
LS_WORKER_HEARTBEAT |
Constructor and Description |
---|
LocalState(String backingDir) |
Modifier and Type | Method and Description |
---|---|
void |
addTopologyHistory(LSTopoHistory lsTopoHistory) |
void |
cleanup(int keepVersions) |
void |
filterOldTopologies(long cutOffAge)
Remove topologies from local state which are older than cutOffAge.
|
org.apache.thrift.TBase |
get(String key) |
Map<String,Integer> |
getApprovedWorkers() |
Map<Integer,LocalAssignment> |
getLocalAssignmentsMap() |
String |
getSupervisorId() |
List<LSTopoHistory> |
getTopoHistoryList() |
LSWorkerHeartbeat |
getWorkerHeartBeat() |
void |
put(String key,
org.apache.thrift.TBase val) |
void |
put(String key,
org.apache.thrift.TBase val,
boolean cleanup) |
void |
remove(String key) |
void |
remove(String key,
boolean cleanup) |
void |
setApprovedWorkers(Map<String,Integer> approvedWorkers) |
void |
setLocalAssignmentsMap(Map<Integer,LocalAssignment> localAssignmentMap) |
void |
setSupervisorId(String supervisorId) |
void |
setWorkerHeartBeat(LSWorkerHeartbeat workerHeartBeat) |
Map<String,org.apache.thrift.TBase> |
snapshot() |
public static final org.slf4j.Logger LOG
public static final String LS_WORKER_HEARTBEAT
public static final String LS_ID
public static final String LS_LOCAL_ASSIGNMENTS
public static final String LS_APPROVED_WORKERS
public static final String LS_TOPO_HISTORY
public LocalState(String backingDir) throws IOException
IOException
public org.apache.thrift.TBase get(String key)
public void put(String key, org.apache.thrift.TBase val)
public void put(String key, org.apache.thrift.TBase val, boolean cleanup)
public void remove(String key)
public void remove(String key, boolean cleanup)
public void cleanup(int keepVersions) throws IOException
IOException
public List<LSTopoHistory> getTopoHistoryList()
public void filterOldTopologies(long cutOffAge)
Remove topologies from local state which are older than cutOffAge.
cutOffAge
- public void addTopologyHistory(LSTopoHistory lsTopoHistory)
public String getSupervisorId()
public void setSupervisorId(String supervisorId)
public LSWorkerHeartbeat getWorkerHeartBeat()
public void setWorkerHeartBeat(LSWorkerHeartbeat workerHeartBeat)
public Map<Integer,LocalAssignment> getLocalAssignmentsMap()
public void setLocalAssignmentsMap(Map<Integer,LocalAssignment> localAssignmentMap)
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.