RanListManager Design
RanListManager
- An optimization suggestion (APPROVED) - instead managing a list of
[]*NbIdentity,
manage a map of[string]*NbIdentity
, where key is inventoryName and value is thenbIdentity
.
RanListManager
type RanListManager struct { rnibDataService services.RNibDataService mux sync.Mutex nbIdentityMap map[string]*NbIdentity } type IRanListManager interface { InitNbIdentityMap() error AddNbIdentity(nodeType entities.Node_Type, nbIdentity *entities.NbIdentity) error UpdateNbIdentityConnectionStatus(nodeType entities.Node_Type, ranName string, connectionStatus entities.ConnectionStatus) error RemoveNbIdentity(nodeType entities.Node_Type, ranName string) error GetNbIdentityList() []*entities.NbIdentity }
InitNbIdentityList
- Triggered on application init, fetches nb identity list from DB and populate nbIdentityMap data member.
- rnib error →
os.Exit(1)
AddNbIdentity
SaveNodeb Calls will be followed by a ranListManager.AddNbIdentity(nodeType, nbIdentity) call.
AFFECTED FLOWS
- Add Enb REST API
- E2 Setup Request coming from NW
Add Enb REST API
E2 Setup Request coming from NW
UpdateNbIdentityConnectionStatus
- Affects the call to RanStateChangeManager.ChangeStatus in the following flows: Lost Connection | E2T Init | E2T Shutdown | E2 Setup | Red Button
- Does not affect Update Enb since it's always DISCONNECTED
RanStateChangeManager
RemoveNbIdentity
- RemoveEnb call will be followed by ranListManager.RemoveNbIdentity(nodeType, nbIdentity) call
- Currently, there's no RemoveGnb method (there's only RemoveServedNrCells)
AFFECTED FLOWS
- Delete Enb REST API
Delete ENB REST API
GetNbIdentityList
- Returns the in-memory nbIdentity list (iterate map values and append to a []*NbIdentity slice)
- Affected flows: Get Nodeb Ids REST API & Red Button
Get Nodeb States REST API
- Change url from /v1/nodeb/ids to /v1/nodeb/states
- Add ConnectionStatus property to NbIdentity proto (already pushed)
- Get nbIdentity list from memory instead of DB
Red Button REST API
- Similarly, get nbIdentity list from memory instead of DB
RnibWriter Changes
Modify
We shall modify the following methods:
SaveNodeb(nbIdentity *entities.NbIdentity, nodebInfo *entities.NodebInfo) error
- Change signature to:
SaveNodeb(nodebInfo *entities.NodebInfo) error
- Modify implementation:
- Remove UNKNOWN nodeType handling (reason: setup is now deterministic)
- Remove save nbIdentity code - it would be called sequentially externally
- Change signature to:
RemoveEnb(nodebInfo *entities.NodebInfo) error
- Modify implementation:
- Delete remove nbIdentity code - it would be called sequentially externally
- Modify implementation:
Add
AddNbIdentity(nodeType entities.Node_Type, nbIdentity *entities.NbIdentity) error UpdateNbIdentities(nodeType entities.Node_Type, oldNbIdentities []*entities.NbIdentity, newNbIdentities []*entities.NbIdentity) error RemoveNbIdentity(nodeType entities.Node_Type, nbIdentity *entities.NbIdentity) error
RnibReader Changes
Modify
We shall modify the following methods:
GetListNodebIds() ([]*entities.NbIdentity, error)
- Remove UNKNOWN nodeType handling (reason: setup is now deterministic)
Optimization suggestions
- Instead of managing a SET in REDIS DB, manage a HASH (read more: https://redis.io/topics/data-types | https://redis.io/topics/memory-optimization)