Added indexed_selects option per subsystem

This commit is contained in:
Trial97
2019-03-12 10:34:35 +02:00
committed by Dan Christian Bogos
parent f4f5e6b061
commit dfda3ffe72
26 changed files with 78 additions and 25 deletions

View File

@@ -21,6 +21,7 @@ package config
// AttributeSCfg is the configuration of attribute service
type AttributeSCfg struct {
Enabled bool
IndexedSelects bool
StringIndexedFields *[]string
PrefixIndexedFields *[]string
ProcessRuns int
@@ -33,6 +34,9 @@ func (alS *AttributeSCfg) loadFromJsonCfg(jsnCfg *AttributeSJsonCfg) (err error)
if jsnCfg.Enabled != nil {
alS.Enabled = *jsnCfg.Enabled
}
if jsnCfg.Indexed_selects != nil {
alS.IndexedSelects = *jsnCfg.Indexed_selects
}
if jsnCfg.String_indexed_fields != nil {
sif := make([]string, len(*jsnCfg.String_indexed_fields))
for i, fID := range *jsnCfg.String_indexed_fields {

View File

@@ -21,6 +21,7 @@ package config
// SupplierSCfg is the configuration of supplier service
type ChargerSCfg struct {
Enabled bool
IndexedSelects bool
AttributeSConns []*HaPoolConfig
StringIndexedFields *[]string
PrefixIndexedFields *[]string
@@ -33,6 +34,9 @@ func (cS *ChargerSCfg) loadFromJsonCfg(jsnCfg *ChargerSJsonCfg) (err error) {
if jsnCfg.Enabled != nil {
cS.Enabled = *jsnCfg.Enabled
}
if jsnCfg.Indexed_selects != nil {
cS.IndexedSelects = *jsnCfg.Indexed_selects
}
if jsnCfg.Attributes_conns != nil {
cS.AttributeSConns = make([]*HaPoolConfig, len(*jsnCfg.Attributes_conns))
for idx, jsnHaCfg := range *jsnCfg.Attributes_conns {

View File

@@ -154,7 +154,6 @@ const CGRATES_CFG_JSON = `
"filters": { // Filters configuration (*new)
"stats_conns": [], // connections to StatS for <*stats> filters, empty to disable stats functionality: <""|*internal|x.y.z.y:1234>
"resources_conns": [], // connections to ResourceS for <*resources> filters, empty to disable stats functionality: <""|*internal|x.y.z.y:1234>
"indexed_selects":true, // enable profile matching exclusively on indexes
},
@@ -448,6 +447,7 @@ const CGRATES_CFG_JSON = `
"attributes": { // AttributeS config
"enabled": false, // starts attribute service: <true|false>.
"indexed_selects":true, // enable profile matching exclusively on indexes
//"string_indexed_fields": [], // query indexes based on these fields for faster processing
"prefix_indexed_fields": [], // query indexes based on these fields for faster processing
"process_runs": 1, // number of run loops when processing event
@@ -456,6 +456,7 @@ const CGRATES_CFG_JSON = `
"chargers": { // ChargerS config
"enabled": false, // starts charger service: <true|false>.
"indexed_selects":true, // enable profile matching exclusively on indexes
"attributes_conns": [], // connections to AttributeS for event fields altering <""|127.0.0.1:2013>
//"string_indexed_fields": [], // query indexes based on these fields for faster processing
"prefix_indexed_fields": [], // query indexes based on these fields for faster processing
@@ -464,6 +465,7 @@ const CGRATES_CFG_JSON = `
"resources": { // ResourceS config
"enabled": false, // starts ResourceLimiter service: <true|false>.
"indexed_selects":true, // enable profile matching exclusively on indexes
"store_interval": "", // dump cache regularly to dataDB, 0 - dump at start/shutdown: <""|$dur>
"thresholds_conns": [], // connections to ThresholdS for resource reporting, empty to disable thresholds functionality: <""|*internal|x.y.z.y:1234>
//"string_indexed_fields": [], // query indexes based on these fields for faster processing
@@ -473,6 +475,7 @@ const CGRATES_CFG_JSON = `
"stats": { // StatS config
"enabled": false, // starts Stat service: <true|false>.
"indexed_selects":true, // enable profile matching exclusively on indexes
"store_interval": "", // dump cache regularly to dataDB, 0 - dump at start/shutdown: <""|$dur>
"thresholds_conns": [], // connections to ThresholdS for StatUpdates, empty to disable thresholds functionality: <""|*internal|x.y.z.y:1234>
//"string_indexed_fields": [], // query indexes based on these fields for faster processing
@@ -482,6 +485,7 @@ const CGRATES_CFG_JSON = `
"thresholds": { // ThresholdS
"enabled": false, // starts ThresholdS service: <true|false>.
"indexed_selects":true, // enable profile matching exclusively on indexes
"store_interval": "", // dump cache regularly to dataDB, 0 - dump at start/shutdown: <""|$dur>
//"string_indexed_fields": [], // query indexes based on these fields for faster processing
"prefix_indexed_fields": [], // query indexes based on these fields for faster processing
@@ -490,6 +494,7 @@ const CGRATES_CFG_JSON = `
"suppliers": { // SupplierS config
"enabled": false, // starts SupplierS service: <true|false>.
"indexed_selects":true, // enable profile matching exclusively on indexes
//"string_indexed_fields": [], // query indexes based on these fields for faster processing
"prefix_indexed_fields": [], // query indexes based on these fields for faster processing
"attributes_conns": [], // connections to AttributeS for altering events before supplier queries: <""|*internal|127.0.0.1:2013>
@@ -726,6 +731,7 @@ const CGRATES_CFG_JSON = `
"dispatchers":{ // DispatcherS config
"enabled": false, // starts DispatcherS service: <true|false>.
"indexed_selects":true, // enable profile matching exclusively on indexes
//"string_indexed_fields": [], // query indexes based on these fields for faster processing
"prefix_indexed_fields": [], // query indexes based on these fields for faster processing
"attributes_conns": [], // connections to AttributeS for API authorization, empty to disable auth functionality: <""|*internal|x.y.z.y:1234>

View File

@@ -727,6 +727,7 @@ func TestHttpAgentJsonCfg(t *testing.T) {
func TestDfAttributeServJsonCfg(t *testing.T) {
eCfg := &AttributeSJsonCfg{
Enabled: utils.BoolPointer(false),
Indexed_selects: utils.BoolPointer(true),
String_indexed_fields: nil,
Prefix_indexed_fields: &[]string{},
Process_runs: utils.IntPointer(1),
@@ -741,6 +742,7 @@ func TestDfAttributeServJsonCfg(t *testing.T) {
func TestDfChargerServJsonCfg(t *testing.T) {
eCfg := &ChargerSJsonCfg{
Enabled: utils.BoolPointer(false),
Indexed_selects: utils.BoolPointer(true),
Attributes_conns: &[]*HaPoolJsonCfg{},
String_indexed_fields: nil,
Prefix_indexed_fields: &[]string{},
@@ -756,7 +758,6 @@ func TestDfFilterSJsonCfg(t *testing.T) {
eCfg := &FilterSJsonCfg{
Stats_conns: &[]*HaPoolJsonCfg{},
Resources_conns: &[]*HaPoolJsonCfg{},
Indexed_selects: utils.BoolPointer(true),
}
if cfg, err := dfCgrJsonCfg.FilterSJsonCfg(); err != nil {
t.Error(err)
@@ -768,6 +769,7 @@ func TestDfFilterSJsonCfg(t *testing.T) {
func TestDfResourceLimiterSJsonCfg(t *testing.T) {
eCfg := &ResourceSJsonCfg{
Enabled: utils.BoolPointer(false),
Indexed_selects: utils.BoolPointer(true),
Thresholds_conns: &[]*HaPoolJsonCfg{},
Store_interval: utils.StringPointer(""),
String_indexed_fields: nil,
@@ -783,6 +785,7 @@ func TestDfResourceLimiterSJsonCfg(t *testing.T) {
func TestDfStatServiceJsonCfg(t *testing.T) {
eCfg := &StatServJsonCfg{
Enabled: utils.BoolPointer(false),
Indexed_selects: utils.BoolPointer(true),
Store_interval: utils.StringPointer(""),
Thresholds_conns: &[]*HaPoolJsonCfg{},
String_indexed_fields: nil,
@@ -798,6 +801,7 @@ func TestDfStatServiceJsonCfg(t *testing.T) {
func TestDfThresholdSJsonCfg(t *testing.T) {
eCfg := &ThresholdSJsonCfg{
Enabled: utils.BoolPointer(false),
Indexed_selects: utils.BoolPointer(true),
Store_interval: utils.StringPointer(""),
String_indexed_fields: nil,
Prefix_indexed_fields: &[]string{},
@@ -812,6 +816,7 @@ func TestDfThresholdSJsonCfg(t *testing.T) {
func TestDfSupplierSJsonCfg(t *testing.T) {
eCfg := &SupplierSJsonCfg{
Enabled: utils.BoolPointer(false),
Indexed_selects: utils.BoolPointer(true),
String_indexed_fields: nil,
Prefix_indexed_fields: &[]string{},
Attributes_conns: &[]*HaPoolJsonCfg{},
@@ -1392,6 +1397,7 @@ func TestDfHttpJsonCfg(t *testing.T) {
func TestDfDispatcherSJsonCfg(t *testing.T) {
eCfg := &DispatcherSJsonCfg{
Enabled: utils.BoolPointer(false),
Indexed_selects: utils.BoolPointer(true),
String_indexed_fields: nil,
Prefix_indexed_fields: &[]string{},
Attributes_conns: &[]*HaPoolJsonCfg{},

View File

@@ -772,7 +772,6 @@ func TestCgrCfgJSONDefaultFiltersCfg(t *testing.T) {
eFiltersCfg := &FilterSCfg{
StatSConns: []*HaPoolConfig{},
ResourceSConns: []*HaPoolConfig{},
IndexedSelects: true,
}
if !reflect.DeepEqual(cgrCfg.filterSCfg, eFiltersCfg) {
t.Errorf("received: %+v, expecting: %+v", cgrCfg.filterSCfg, eFiltersCfg)
@@ -782,6 +781,7 @@ func TestCgrCfgJSONDefaultFiltersCfg(t *testing.T) {
func TestCgrCfgJSONDefaultSChargerSCfg(t *testing.T) {
eChargerSCfg := &ChargerSCfg{
Enabled: false,
IndexedSelects: true,
AttributeSConns: []*HaPoolConfig{},
StringIndexedFields: nil,
PrefixIndexedFields: &[]string{},
@@ -794,6 +794,7 @@ func TestCgrCfgJSONDefaultSChargerSCfg(t *testing.T) {
func TestCgrCfgJSONDefaultsResLimCfg(t *testing.T) {
eResLiCfg := &ResourceSConfig{
Enabled: false,
IndexedSelects: true,
ThresholdSConns: []*HaPoolConfig{},
StoreInterval: 0,
StringIndexedFields: nil,
@@ -808,6 +809,7 @@ func TestCgrCfgJSONDefaultsResLimCfg(t *testing.T) {
func TestCgrCfgJSONDefaultStatsCfg(t *testing.T) {
eStatsCfg := &StatSCfg{
Enabled: false,
IndexedSelects: true,
StoreInterval: 0,
ThresholdSConns: []*HaPoolConfig{},
StringIndexedFields: nil,
@@ -821,6 +823,7 @@ func TestCgrCfgJSONDefaultStatsCfg(t *testing.T) {
func TestCgrCfgJSONDefaultThresholdSCfg(t *testing.T) {
eThresholdSCfg := &ThresholdSCfg{
Enabled: false,
IndexedSelects: true,
StoreInterval: 0,
StringIndexedFields: nil,
PrefixIndexedFields: &[]string{},
@@ -833,6 +836,7 @@ func TestCgrCfgJSONDefaultThresholdSCfg(t *testing.T) {
func TestCgrCfgJSONDefaultSupplierSCfg(t *testing.T) {
eSupplSCfg := &SupplierSCfg{
Enabled: false,
IndexedSelects: true,
StringIndexedFields: nil,
PrefixIndexedFields: &[]string{},
AttributeSConns: []*HaPoolConfig{},
@@ -1457,6 +1461,7 @@ func TestCgrLoaderCfgITDefaults(t *testing.T) {
func TestCgrCfgJSONDefaultDispatcherSCfg(t *testing.T) {
eDspSCfg := &DispatcherSCfg{
Enabled: false,
IndexedSelects: true,
StringIndexedFields: nil,
PrefixIndexedFields: &[]string{},
AttributeSConns: []*HaPoolConfig{},

View File

@@ -21,6 +21,7 @@ package config
// DispatcherSCfg is the configuration of dispatcher service
type DispatcherSCfg struct {
Enabled bool
IndexedSelects bool
StringIndexedFields *[]string
PrefixIndexedFields *[]string
AttributeSConns []*HaPoolConfig
@@ -34,6 +35,9 @@ func (dps *DispatcherSCfg) loadFromJsonCfg(jsnCfg *DispatcherSJsonCfg) (err erro
if jsnCfg.Enabled != nil {
dps.Enabled = *jsnCfg.Enabled
}
if jsnCfg.Indexed_selects != nil {
dps.IndexedSelects = *jsnCfg.Indexed_selects
}
if jsnCfg.String_indexed_fields != nil {
sif := make([]string, len(*jsnCfg.String_indexed_fields))
for i, fID := range *jsnCfg.String_indexed_fields {

View File

@@ -21,7 +21,6 @@ package config
type FilterSCfg struct {
StatSConns []*HaPoolConfig
ResourceSConns []*HaPoolConfig
IndexedSelects bool
}
func (fSCfg *FilterSCfg) loadFromJsonCfg(jsnCfg *FilterSJsonCfg) (err error) {
@@ -42,8 +41,5 @@ func (fSCfg *FilterSCfg) loadFromJsonCfg(jsnCfg *FilterSJsonCfg) (err error) {
fSCfg.ResourceSConns[idx].loadFromJsonCfg(jsnHaCfg)
}
}
if jsnCfg.Indexed_selects != nil {
fSCfg.IndexedSelects = *jsnCfg.Indexed_selects
}
return
}

View File

@@ -40,12 +40,10 @@ func TestFilterSCfgloadFromJsonCfg(t *testing.T) {
cfgJSONStr := `{
"filters": { // Filters configuration (*new)
"stats_conns": [{"Address":"127.0.0.1","Transport":"","Synchronous":true}], // address where to reach the stat service, empty to disable stats functionality: <""|*internal|x.y.z.y:1234>
"indexed_selects":true, // enable profile matching exclusively on indexes
},
}`
expected = FilterSCfg{
IndexedSelects: true,
StatSConns: []*HaPoolConfig{{Address: "127.0.0.1", Transport: "", Synchronous: true}},
StatSConns: []*HaPoolConfig{{Address: "127.0.0.1", Transport: "", Synchronous: true}},
}
if jsnCfg, err := NewCgrJsonCfgFromReader(strings.NewReader(cfgJSONStr)); err != nil {
t.Error(err)

View File

@@ -92,7 +92,6 @@ type DbJsonCfg struct {
// Filters config
type FilterSJsonCfg struct {
Stats_conns *[]*HaPoolJsonCfg
Indexed_selects *bool
Resources_conns *[]*HaPoolJsonCfg
}
@@ -404,6 +403,7 @@ type HistServJsonCfg struct {
// Attribute service config section
type AttributeSJsonCfg struct {
Enabled *bool
Indexed_selects *bool
String_indexed_fields *[]string
Prefix_indexed_fields *[]string
Process_runs *int
@@ -412,6 +412,7 @@ type AttributeSJsonCfg struct {
// ChargerSJsonCfg service config section
type ChargerSJsonCfg struct {
Enabled *bool
Indexed_selects *bool
Attributes_conns *[]*HaPoolJsonCfg
String_indexed_fields *[]string
Prefix_indexed_fields *[]string
@@ -420,6 +421,7 @@ type ChargerSJsonCfg struct {
// ResourceLimiter service config section
type ResourceSJsonCfg struct {
Enabled *bool
Indexed_selects *bool
Thresholds_conns *[]*HaPoolJsonCfg
Store_interval *string
String_indexed_fields *[]string
@@ -429,6 +431,7 @@ type ResourceSJsonCfg struct {
// Stat service config section
type StatServJsonCfg struct {
Enabled *bool
Indexed_selects *bool
Store_interval *string
Thresholds_conns *[]*HaPoolJsonCfg
String_indexed_fields *[]string
@@ -438,6 +441,7 @@ type StatServJsonCfg struct {
// Threshold service config section
type ThresholdSJsonCfg struct {
Enabled *bool
Indexed_selects *bool
Store_interval *string
String_indexed_fields *[]string
Prefix_indexed_fields *[]string
@@ -446,6 +450,7 @@ type ThresholdSJsonCfg struct {
// Supplier service config section
type SupplierSJsonCfg struct {
Enabled *bool
Indexed_selects *bool
String_indexed_fields *[]string
Prefix_indexed_fields *[]string
Attributes_conns *[]*HaPoolJsonCfg
@@ -514,6 +519,7 @@ type SureTaxJsonCfg struct {
type DispatcherSJsonCfg struct {
Enabled *bool
Indexed_selects *bool
String_indexed_fields *[]string
Prefix_indexed_fields *[]string
Attributes_conns *[]*HaPoolJsonCfg

View File

@@ -26,6 +26,7 @@ import (
type ResourceSConfig struct {
Enabled bool
IndexedSelects bool
ThresholdSConns []*HaPoolConfig // Connections towards StatS
StoreInterval time.Duration // Dump regularly from cache into dataDB
StringIndexedFields *[]string
@@ -39,6 +40,9 @@ func (rlcfg *ResourceSConfig) loadFromJsonCfg(jsnCfg *ResourceSJsonCfg) (err err
if jsnCfg.Enabled != nil {
rlcfg.Enabled = *jsnCfg.Enabled
}
if jsnCfg.Indexed_selects != nil {
rlcfg.IndexedSelects = *jsnCfg.Indexed_selects
}
if jsnCfg.Thresholds_conns != nil {
rlcfg.ThresholdSConns = make([]*HaPoolConfig, len(*jsnCfg.Thresholds_conns))
for idx, jsnHaCfg := range *jsnCfg.Thresholds_conns {

View File

@@ -26,6 +26,7 @@ import (
type StatSCfg struct {
Enabled bool
IndexedSelects bool
StoreInterval time.Duration // Dump regularly from cache into dataDB
ThresholdSConns []*HaPoolConfig
StringIndexedFields *[]string
@@ -39,6 +40,9 @@ func (st *StatSCfg) loadFromJsonCfg(jsnCfg *StatServJsonCfg) (err error) {
if jsnCfg.Enabled != nil {
st.Enabled = *jsnCfg.Enabled
}
if jsnCfg.Indexed_selects != nil {
st.IndexedSelects = *jsnCfg.Indexed_selects
}
if jsnCfg.Store_interval != nil {
if st.StoreInterval, err = utils.ParseDurationWithNanosecs(*jsnCfg.Store_interval); err != nil {
return err

View File

@@ -21,6 +21,7 @@ package config
// SupplierSCfg is the configuration of supplier service
type SupplierSCfg struct {
Enabled bool
IndexedSelects bool
StringIndexedFields *[]string
PrefixIndexedFields *[]string
AttributeSConns []*HaPoolConfig
@@ -36,6 +37,9 @@ func (spl *SupplierSCfg) loadFromJsonCfg(jsnCfg *SupplierSJsonCfg) (err error) {
if jsnCfg.Enabled != nil {
spl.Enabled = *jsnCfg.Enabled
}
if jsnCfg.Indexed_selects != nil {
spl.IndexedSelects = *jsnCfg.Indexed_selects
}
if jsnCfg.String_indexed_fields != nil {
sif := make([]string, len(*jsnCfg.String_indexed_fields))
for i, fID := range *jsnCfg.String_indexed_fields {

View File

@@ -26,6 +26,7 @@ import (
type ThresholdSCfg struct {
Enabled bool
IndexedSelects bool
StoreInterval time.Duration // Dump regularly from cache into dataDB
StringIndexedFields *[]string
PrefixIndexedFields *[]string
@@ -38,6 +39,9 @@ func (t *ThresholdSCfg) loadFromJsonCfg(jsnCfg *ThresholdSJsonCfg) (err error) {
if jsnCfg.Enabled != nil {
t.Enabled = *jsnCfg.Enabled
}
if jsnCfg.Indexed_selects != nil {
t.IndexedSelects = *jsnCfg.Indexed_selects
}
if jsnCfg.Store_interval != nil {
if t.StoreInterval, err = utils.ParseDurationWithNanosecs(*jsnCfg.Store_interval); err != nil {
return err

View File

@@ -133,7 +133,6 @@
// "filters": { // Filters configuration (*new)
// "stats_conns": [], // connections to StatS for <*stats> filters, empty to disable stats functionality: <""|*internal|x.y.z.y:1234>
// "resources_conns": [], // connections to ResourceS for <*resources> filters, empty to disable stats functionality: <""|*internal|x.y.z.y:1234>
// "indexed_selects":true, // enable profile matching exclusively on indexes
// },
@@ -427,6 +426,7 @@
// "attributes": { // AttributeS config
// "enabled": false, // starts attribute service: <true|false>.
// "indexed_selects":true, // enable profile matching exclusively on indexes
// //"string_indexed_fields": [], // query indexes based on these fields for faster processing
// "prefix_indexed_fields": [], // query indexes based on these fields for faster processing
// "process_runs": 1, // number of run loops when processing event
@@ -435,6 +435,7 @@
// "chargers": { // ChargerS config
// "enabled": false, // starts charger service: <true|false>.
// "indexed_selects":true, // enable profile matching exclusively on indexes
// "attributes_conns": [], // connections to AttributeS for event fields altering <""|127.0.0.1:2013>
// //"string_indexed_fields": [], // query indexes based on these fields for faster processing
// "prefix_indexed_fields": [], // query indexes based on these fields for faster processing
@@ -443,6 +444,7 @@
// "resources": { // ResourceS config
// "enabled": false, // starts ResourceLimiter service: <true|false>.
// "indexed_selects":true, // enable profile matching exclusively on indexes
// "store_interval": "", // dump cache regularly to dataDB, 0 - dump at start/shutdown: <""|$dur>
// "thresholds_conns": [], // connections to ThresholdS for resource reporting, empty to disable thresholds functionality: <""|*internal|x.y.z.y:1234>
// //"string_indexed_fields": [], // query indexes based on these fields for faster processing
@@ -452,6 +454,7 @@
// "stats": { // StatS config
// "enabled": false, // starts Stat service: <true|false>.
// "indexed_selects":true, // enable profile matching exclusively on indexes
// "store_interval": "", // dump cache regularly to dataDB, 0 - dump at start/shutdown: <""|$dur>
// "thresholds_conns": [], // connections to ThresholdS for StatUpdates, empty to disable thresholds functionality: <""|*internal|x.y.z.y:1234>
// //"string_indexed_fields": [], // query indexes based on these fields for faster processing
@@ -461,6 +464,7 @@
// "thresholds": { // ThresholdS
// "enabled": false, // starts ThresholdS service: <true|false>.
// "indexed_selects":true, // enable profile matching exclusively on indexes
// "store_interval": "", // dump cache regularly to dataDB, 0 - dump at start/shutdown: <""|$dur>
// //"string_indexed_fields": [], // query indexes based on these fields for faster processing
// "prefix_indexed_fields": [], // query indexes based on these fields for faster processing
@@ -469,6 +473,7 @@
// "suppliers": { // SupplierS config
// "enabled": false, // starts SupplierS service: <true|false>.
// "indexed_selects":true, // enable profile matching exclusively on indexes
// //"string_indexed_fields": [], // query indexes based on these fields for faster processing
// "prefix_indexed_fields": [], // query indexes based on these fields for faster processing
// "attributes_conns": [], // connections to AttributeS for altering events before supplier queries: <""|*internal|127.0.0.1:2013>
@@ -705,6 +710,7 @@
// "dispatchers":{ // DispatcherS config
// "enabled": false, // starts DispatcherS service: <true|false>.
// "indexed_selects":true, // enable profile matching exclusively on indexes
// //"string_indexed_fields": [], // query indexes based on these fields for faster processing
// "prefix_indexed_fields": [], // query indexes based on these fields for faster processing
// "attributes_conns": [], // connections to AttributeS for API authorization, empty to disable auth functionality: <""|*internal|x.y.z.y:1234>

View File

@@ -43,24 +43,26 @@
"resources_conns": [
{"address": "127.0.0.1:2012", "transport":"*json"},
],
"indexed_selects":false,
},
"resources": {
"enabled": true,
"indexed_selects":false,
"store_interval": "1s",
},
"stats": {
"enabled": true,
"indexed_selects":false,
"store_interval": "1s",
},
"thresholds": {
"enabled": true,
"indexed_selects":false,
"store_interval": "1s",
},

View File

@@ -81,7 +81,7 @@ func (dS *DispatcherService) dispatcherForEvent(ev *utils.CGREvent,
dS.cfg.DispatcherSCfg().StringIndexedFields,
dS.cfg.DispatcherSCfg().PrefixIndexedFields,
dS.dm, utils.CacheDispatcherFilterIndexes,
idxKeyPrfx, dS.cfg.FilterSCfg().IndexedSelects)
idxKeyPrfx, dS.cfg.DispatcherSCfg().IndexedSelects)
if err != nil {
// return nil, err
if err != utils.ErrNotFound {
@@ -91,7 +91,7 @@ func (dS *DispatcherService) dispatcherForEvent(ev *utils.CGREvent,
dS.cfg.DispatcherSCfg().StringIndexedFields,
dS.cfg.DispatcherSCfg().PrefixIndexedFields,
dS.dm, utils.CacheDispatcherFilterIndexes,
anyIdxPrfx, dS.cfg.FilterSCfg().IndexedSelects)
anyIdxPrfx, dS.cfg.DispatcherSCfg().IndexedSelects)
if err != nil {
return nil, err
}

View File

@@ -69,14 +69,14 @@ func (alS *AttributeService) attributeProfileForEvent(args *AttrArgsProcessEvent
attrIDs = args.AttributeIDs
} else {
aPrflIDs, err := MatchingItemIDsForEvent(args.Event, alS.stringIndexedFields, alS.prefixIndexedFields,
alS.dm, utils.CacheAttributeFilterIndexes, attrIdxKey, alS.filterS.cfg.FilterSCfg().IndexedSelects)
alS.dm, utils.CacheAttributeFilterIndexes, attrIdxKey, alS.filterS.cfg.AttributeSCfg().IndexedSelects)
if err != nil {
if err != utils.ErrNotFound {
return nil, err
}
if aPrflIDs, err = MatchingItemIDsForEvent(args.Event, alS.stringIndexedFields, alS.prefixIndexedFields,
alS.dm, utils.CacheAttributeFilterIndexes, utils.ConcatenatedKey(args.Tenant, utils.META_ANY),
alS.filterS.cfg.FilterSCfg().IndexedSelects); err != nil {
alS.filterS.cfg.AttributeSCfg().IndexedSelects); err != nil {
return nil, err
}
}

View File

@@ -65,7 +65,7 @@ func (cS *ChargerService) Shutdown() (err error) {
func (cS *ChargerService) matchingChargerProfilesForEvent(cgrEv *utils.CGREvent) (cPs ChargerProfiles, err error) {
cpIDs, err := MatchingItemIDsForEvent(cgrEv.Event,
cS.cfg.ChargerSCfg().StringIndexedFields, cS.cfg.ChargerSCfg().PrefixIndexedFields,
cS.dm, utils.CacheChargerFilterIndexes, cgrEv.Tenant, cS.cfg.FilterSCfg().IndexedSelects)
cS.dm, utils.CacheChargerFilterIndexes, cgrEv.Tenant, cS.cfg.ChargerSCfg().IndexedSelects)
if err != nil {
return nil, err
}

View File

@@ -444,7 +444,7 @@ func (rS *ResourceService) cachedResourcesForEvent(evUUID string) (rs Resources)
func (rS *ResourceService) matchingResourcesForEvent(ev *utils.CGREvent, usageTTL *time.Duration) (rs Resources, err error) {
matchingResources := make(map[string]*Resource)
rIDs, err := MatchingItemIDsForEvent(ev.Event, rS.stringIndexedFields, rS.prefixIndexedFields,
rS.dm, utils.CacheResourceFilterIndexes, ev.Tenant, rS.filterS.cfg.FilterSCfg().IndexedSelects)
rS.dm, utils.CacheResourceFilterIndexes, ev.Tenant, rS.filterS.cfg.ResourceSCfg().IndexedSelects)
if err != nil {
return nil, err
}

View File

@@ -685,7 +685,7 @@ func TestResourceUsageTTLCase4(t *testing.T) {
}
func TestResourceMatchWithIndexFalse(t *testing.T) {
resService.filterS.cfg.FilterSCfg().IndexedSelects = false
resService.filterS.cfg.ResourceSCfg().IndexedSelects = false
mres, err := resService.matchingResourcesForEvent(resEvs[0], &timeDurationExample)
if err != nil {
t.Errorf("Error: %+v", err)

View File

@@ -152,7 +152,7 @@ func (sS *StatService) matchingStatQueuesForEvent(args *StatsArgsProcessEvent) (
sqIDs = args.StatIDs
} else {
mapIDs, err := MatchingItemIDsForEvent(args.Event, sS.stringIndexedFields, sS.prefixIndexedFields,
sS.dm, utils.CacheStatFilterIndexes, args.Tenant, sS.filterS.cfg.FilterSCfg().IndexedSelects)
sS.dm, utils.CacheStatFilterIndexes, args.Tenant, sS.filterS.cfg.StatSCfg().IndexedSelects)
if err != nil {
return nil, err
}

View File

@@ -308,7 +308,7 @@ func TestStatQueuesProcessEvent(t *testing.T) {
}
func TestStatQueuesMatchWithIndexFalse(t *testing.T) {
statService.filterS.cfg.FilterSCfg().IndexedSelects = false
statService.filterS.cfg.StatSCfg().IndexedSelects = false
msq, err := statService.matchingStatQueuesForEvent(statsEvs[0])
if err != nil {
t.Errorf("Error: %+v", err)

View File

@@ -127,7 +127,7 @@ func (spS *SupplierService) Shutdown() error {
// matchingSupplierProfilesForEvent returns ordered list of matching resources which are active by the time of the call
func (spS *SupplierService) matchingSupplierProfilesForEvent(ev *utils.CGREvent) (matchingLP *SupplierProfile, err error) {
sPrflIDs, err := MatchingItemIDsForEvent(ev.Event, spS.stringIndexedFields, spS.prefixIndexedFields,
spS.dm, utils.CacheSupplierFilterIndexes, ev.Tenant, spS.filterS.cfg.FilterSCfg().IndexedSelects)
spS.dm, utils.CacheSupplierFilterIndexes, ev.Tenant, spS.filterS.cfg.SupplierSCfg().IndexedSelects)
if err != nil {
return nil, err
}

View File

@@ -629,7 +629,7 @@ func TestSuppliersAsOptsGetSuppliersMaxCost(t *testing.T) {
}
func TestSuppliersMatchWithIndexFalse(t *testing.T) {
splService.filterS.cfg.FilterSCfg().IndexedSelects = false
splService.filterS.cfg.SupplierSCfg().IndexedSelects = false
sprf, err := splService.matchingSupplierProfilesForEvent(&argsGetSuppliers[0].CGREvent)
if err != nil {
t.Errorf("Error: %+v", err)

View File

@@ -225,7 +225,7 @@ func (tS *ThresholdService) matchingThresholdsForEvent(args *ArgsProcessEvent) (
} else {
tIDsMap, err := MatchingItemIDsForEvent(args.Event, tS.stringIndexedFields,
tS.prefixIndexedFields, tS.dm, utils.CacheThresholdFilterIndexes,
args.Tenant, tS.filterS.cfg.FilterSCfg().IndexedSelects)
args.Tenant, tS.filterS.cfg.ThresholdSCfg().IndexedSelects)
if err != nil {
return nil, err
}