Loading go-apps/meep-gis-engine/server/gis-engine.go +1 −1 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ func Init() (err error) { log.Info("Connected to Session Manager") // Connect to GIS cache ge.gisCache, err = gc.NewGisCache(redisAddr) ge.gisCache, err = gc.NewGisCache(ge.sandboxName, redisAddr) if err != nil { log.Error("Failed to GIS Cache: ", err.Error()) return err Loading go-apps/meep-loc-serv/sbi/loc-serv-sbi.go +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ func Init(cfg SbiCfg) (err error) { log.Info("Active Scenario Model created") // Connect to GIS cache sbi.gisCache, err = gc.NewGisCache(cfg.RedisAddr) sbi.gisCache, err = gc.NewGisCache(sbi.sandboxName, cfg.RedisAddr) if err != nil { log.Error("Failed to GIS Cache: ", err.Error()) return err Loading go-apps/meep-rnis/sbi/rnis-sbi.go +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ func Init(cfg SbiCfg) (err error) { } // Connect to GIS cache sbi.gisCache, err = gc.NewGisCache(cfg.RedisAddr) sbi.gisCache, err = gc.NewGisCache(sbi.sandboxName, cfg.RedisAddr) if err != nil { log.Error("Failed to GIS Cache: ", err.Error()) return err Loading go-apps/meep-wais/sbi/wais-sbi.go +1 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ func Init(cfg SbiCfg) (err error) { } // Connect to GIS cache sbi.gisCache, err = gc.NewGisCache(cfg.RedisAddr) sbi.gisCache, err = gc.NewGisCache(sbi.sandboxName, cfg.RedisAddr) if err != nil { log.Error("Failed to GIS Cache: ", err.Error()) return err Loading go-packages/meep-gis-cache/gis-cache.go +18 −13 Original line number Diff line number Diff line Loading @@ -42,10 +42,11 @@ const ( fieldRsrq = "rsrq" ) // Root key var keyRoot = dkm.GetKeyRootGlobal() + "gis-cache:" var keyPositions = keyRoot + "pos:" var keyMeasurements = keyRoot + "meas:" const ( gisCacheKey = "gis-cache:" posKey = "pos:" measKey = "meas:" ) type Position struct { Latitude float32 Loading @@ -64,10 +65,11 @@ type Measurement struct { type GisCache struct { rc *redis.Connector baseKey string } // NewGisCache - Creates and initialize a GIS Cache instance func NewGisCache(redisAddr string) (gc *GisCache, err error) { func NewGisCache(sandboxName string, redisAddr string) (gc *GisCache, err error) { // Create new GIS Cache instance gc = new(GisCache) Loading @@ -79,13 +81,16 @@ func NewGisCache(redisAddr string) (gc *GisCache, err error) { } log.Info("Connected to GIS Cache Redis DB") // Get base storage key gc.baseKey = dkm.GetKeyRoot(sandboxName) + gisCacheKey log.Info("Created GIS Cache") return gc, nil } // SetPosition - Create or update entry in DB func (gc *GisCache) SetPosition(typ string, name string, position *Position) error { key := keyPositions + typ + ":" + name key := gc.baseKey + posKey + typ + ":" + name // Prepare data fields := make(map[string]interface{}) Loading @@ -103,7 +108,7 @@ func (gc *GisCache) SetPosition(typ string, name string, position *Position) err // GetAllPositions - Return positions with provided type func (gc *GisCache) GetAllPositions(typ string) (map[string]*Position, error) { keyMatchStr := keyPositions + typ + ":*" keyMatchStr := gc.baseKey + posKey + typ + ":*" // Create position map positionMap := make(map[string]*Position) Loading Loading @@ -140,7 +145,7 @@ func getPosition(key string, fields map[string]string, userData interface{}) err // DelPosition - Remove position with provided name func (gc *GisCache) DelPosition(typ string, name string) { key := keyPositions + typ + ":" + name key := gc.baseKey + posKey + typ + ":" + name err := gc.rc.DelEntry(key) if err != nil { log.Error("Failed to delete position for ", name, " with err: ", err.Error()) Loading @@ -149,7 +154,7 @@ func (gc *GisCache) DelPosition(typ string, name string) { // SetMeasurement - Create or update entry in DB func (gc *GisCache) SetMeasurement(ue string, poa string, meas *Measurement) error { key := keyMeasurements + ue + ":" + poa key := gc.baseKey + measKey + ue + ":" + poa // Prepare data fields := make(map[string]interface{}) Loading @@ -168,7 +173,7 @@ func (gc *GisCache) SetMeasurement(ue string, poa string, meas *Measurement) err // GetAllMeasurements - Return all UE measurements func (gc *GisCache) GetAllMeasurements() (measurementMap map[string]*UeMeasurement, err error) { keyMatchStr := keyMeasurements + "*" keyMatchStr := gc.baseKey + measKey + "*" // Create measurement map measurementMap = make(map[string]*UeMeasurement) Loading Loading @@ -224,7 +229,7 @@ func getMeasurement(key string, fields map[string]string, userData interface{}) // DelMeasurements - Remove measurement with provided name func (gc *GisCache) DelMeasurement(ue string, poa string) { key := keyMeasurements + ue + ":" + poa key := gc.baseKey + measKey + ue + ":" + poa err := gc.rc.DelEntry(key) if err != nil { log.Error("Failed to delete measurement for ue: ", ue, " and poa: ", poa, " with err: ", err.Error()) Loading @@ -233,5 +238,5 @@ func (gc *GisCache) DelMeasurement(ue string, poa string) { // Flush - Remove all GIS cache entries func (gc *GisCache) Flush() { gc.rc.DBFlush(keyRoot) gc.rc.DBFlush(gc.baseKey) } Loading
go-apps/meep-gis-engine/server/gis-engine.go +1 −1 Original line number Diff line number Diff line Loading @@ -157,7 +157,7 @@ func Init() (err error) { log.Info("Connected to Session Manager") // Connect to GIS cache ge.gisCache, err = gc.NewGisCache(redisAddr) ge.gisCache, err = gc.NewGisCache(ge.sandboxName, redisAddr) if err != nil { log.Error("Failed to GIS Cache: ", err.Error()) return err Loading
go-apps/meep-loc-serv/sbi/loc-serv-sbi.go +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ func Init(cfg SbiCfg) (err error) { log.Info("Active Scenario Model created") // Connect to GIS cache sbi.gisCache, err = gc.NewGisCache(cfg.RedisAddr) sbi.gisCache, err = gc.NewGisCache(sbi.sandboxName, cfg.RedisAddr) if err != nil { log.Error("Failed to GIS Cache: ", err.Error()) return err Loading
go-apps/meep-rnis/sbi/rnis-sbi.go +1 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,7 @@ func Init(cfg SbiCfg) (err error) { } // Connect to GIS cache sbi.gisCache, err = gc.NewGisCache(cfg.RedisAddr) sbi.gisCache, err = gc.NewGisCache(sbi.sandboxName, cfg.RedisAddr) if err != nil { log.Error("Failed to GIS Cache: ", err.Error()) return err Loading
go-apps/meep-wais/sbi/wais-sbi.go +1 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ func Init(cfg SbiCfg) (err error) { } // Connect to GIS cache sbi.gisCache, err = gc.NewGisCache(cfg.RedisAddr) sbi.gisCache, err = gc.NewGisCache(sbi.sandboxName, cfg.RedisAddr) if err != nil { log.Error("Failed to GIS Cache: ", err.Error()) return err Loading
go-packages/meep-gis-cache/gis-cache.go +18 −13 Original line number Diff line number Diff line Loading @@ -42,10 +42,11 @@ const ( fieldRsrq = "rsrq" ) // Root key var keyRoot = dkm.GetKeyRootGlobal() + "gis-cache:" var keyPositions = keyRoot + "pos:" var keyMeasurements = keyRoot + "meas:" const ( gisCacheKey = "gis-cache:" posKey = "pos:" measKey = "meas:" ) type Position struct { Latitude float32 Loading @@ -64,10 +65,11 @@ type Measurement struct { type GisCache struct { rc *redis.Connector baseKey string } // NewGisCache - Creates and initialize a GIS Cache instance func NewGisCache(redisAddr string) (gc *GisCache, err error) { func NewGisCache(sandboxName string, redisAddr string) (gc *GisCache, err error) { // Create new GIS Cache instance gc = new(GisCache) Loading @@ -79,13 +81,16 @@ func NewGisCache(redisAddr string) (gc *GisCache, err error) { } log.Info("Connected to GIS Cache Redis DB") // Get base storage key gc.baseKey = dkm.GetKeyRoot(sandboxName) + gisCacheKey log.Info("Created GIS Cache") return gc, nil } // SetPosition - Create or update entry in DB func (gc *GisCache) SetPosition(typ string, name string, position *Position) error { key := keyPositions + typ + ":" + name key := gc.baseKey + posKey + typ + ":" + name // Prepare data fields := make(map[string]interface{}) Loading @@ -103,7 +108,7 @@ func (gc *GisCache) SetPosition(typ string, name string, position *Position) err // GetAllPositions - Return positions with provided type func (gc *GisCache) GetAllPositions(typ string) (map[string]*Position, error) { keyMatchStr := keyPositions + typ + ":*" keyMatchStr := gc.baseKey + posKey + typ + ":*" // Create position map positionMap := make(map[string]*Position) Loading Loading @@ -140,7 +145,7 @@ func getPosition(key string, fields map[string]string, userData interface{}) err // DelPosition - Remove position with provided name func (gc *GisCache) DelPosition(typ string, name string) { key := keyPositions + typ + ":" + name key := gc.baseKey + posKey + typ + ":" + name err := gc.rc.DelEntry(key) if err != nil { log.Error("Failed to delete position for ", name, " with err: ", err.Error()) Loading @@ -149,7 +154,7 @@ func (gc *GisCache) DelPosition(typ string, name string) { // SetMeasurement - Create or update entry in DB func (gc *GisCache) SetMeasurement(ue string, poa string, meas *Measurement) error { key := keyMeasurements + ue + ":" + poa key := gc.baseKey + measKey + ue + ":" + poa // Prepare data fields := make(map[string]interface{}) Loading @@ -168,7 +173,7 @@ func (gc *GisCache) SetMeasurement(ue string, poa string, meas *Measurement) err // GetAllMeasurements - Return all UE measurements func (gc *GisCache) GetAllMeasurements() (measurementMap map[string]*UeMeasurement, err error) { keyMatchStr := keyMeasurements + "*" keyMatchStr := gc.baseKey + measKey + "*" // Create measurement map measurementMap = make(map[string]*UeMeasurement) Loading Loading @@ -224,7 +229,7 @@ func getMeasurement(key string, fields map[string]string, userData interface{}) // DelMeasurements - Remove measurement with provided name func (gc *GisCache) DelMeasurement(ue string, poa string) { key := keyMeasurements + ue + ":" + poa key := gc.baseKey + measKey + ue + ":" + poa err := gc.rc.DelEntry(key) if err != nil { log.Error("Failed to delete measurement for ue: ", ue, " and poa: ", poa, " with err: ", err.Error()) Loading @@ -233,5 +238,5 @@ func (gc *GisCache) DelMeasurement(ue string, poa string) { // Flush - Remove all GIS cache entries func (gc *GisCache) Flush() { gc.rc.DBFlush(keyRoot) gc.rc.DBFlush(gc.baseKey) }