Add ProcessGetNode function
This commit is contained in:
parent
88739e3f7f
commit
3df1075548
@ -251,6 +251,18 @@ func (s *store) ProcessGetNodeMap() map[string]string {
|
||||
return m
|
||||
}
|
||||
|
||||
func (s *store) ProcessGetNode(id app.ProcessID) (string, error) {
|
||||
s.lock.RLock()
|
||||
defer s.lock.RUnlock()
|
||||
|
||||
nodeid, hasProcess := s.data.ProcessNodeMap[id.String()]
|
||||
if !hasProcess {
|
||||
return "", ErrNotFound
|
||||
}
|
||||
|
||||
return nodeid, nil
|
||||
}
|
||||
|
||||
func (s *store) ProcessGetRelocateMap() map[string]string {
|
||||
s.lock.RLock()
|
||||
defer s.lock.RUnlock()
|
||||
|
||||
@ -22,6 +22,7 @@ type Store interface {
|
||||
|
||||
ProcessList() []Process
|
||||
ProcessGet(id app.ProcessID) (Process, error)
|
||||
ProcessGetNode(id app.ProcessID) (string, error)
|
||||
ProcessGetNodeMap() map[string]string
|
||||
ProcessGetRelocateMap() map[string]string
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user