From 7411db3a3132732af733e9b8cfabf8a7d5de6c6c Mon Sep 17 00:00:00 2001 From: Trial97 Date: Thu, 17 Jun 2021 10:53:41 +0300 Subject: [PATCH] Renamed structures IndexHealthReply --- engine/libindex.go | 18 +++++++++--------- engine/z_libindex_health_test.go | 32 ++++++++++++++++---------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/engine/libindex.go b/engine/libindex.go index ff4c8bea3..52c03bb05 100644 --- a/engine/libindex.go +++ b/engine/libindex.go @@ -831,14 +831,14 @@ type IndexHealthArgs struct { ObjectCacheStaticTTL bool } -type IndexHealthReply struct { - MissingObjects []string // list of object that are referenced in indexes but are not found in the dataDB - MissingIndexes map[string][]string // list of missing indexes for each object (the map has the key as the objectID and a list of indexes) - BrokenReferences map[string][]string // list of broken references (the map has the key as the objectID and a list of indexes) +type AccountActionPlanIHReply struct { + MissingActionPlans []string // list of object that are referenced in indexes but are not found in the dataDB + MissingAccountActionPlans map[string][]string // list of missing indexes for each object (the map has the key as the objectID and a list of indexes) + BrokenReferences map[string][]string // list of broken references (the map has the key as the objectID and a list of indexes) } // add cache in args API -func GetAccountActionPlanIndexHealth(dm *DataManager, objLimit, indexLimit int, objTTL, indexTTL time.Duration, objStaticTTL, indexStaticTTL bool) (rply *IndexHealthReply, err error) { +func GetAccountActionPlanIndexHealth(dm *DataManager, objLimit, indexLimit int, objTTL, indexTTL time.Duration, objStaticTTL, indexStaticTTL bool) (rply *AccountActionPlanIHReply, err error) { // posible errors missingAP := utils.StringSet{} // the index are present but the action plans are not //missing actionplans brokenRef := map[string][]string{} // the actionPlans match the index but they are missing the account // broken reference @@ -943,10 +943,10 @@ func GetAccountActionPlanIndexHealth(dm *DataManager, objLimit, indexLimit int, } } - rply = &IndexHealthReply{ - MissingObjects: missingAP.AsSlice(), - MissingIndexes: missingIndex, - BrokenReferences: brokenRef, + rply = &AccountActionPlanIHReply{ + MissingActionPlans: missingAP.AsSlice(), + MissingAccountActionPlans: missingIndex, + BrokenReferences: brokenRef, } return } diff --git a/engine/z_libindex_health_test.go b/engine/z_libindex_health_test.go index 133e8a5b5..bd1d3c70a 100644 --- a/engine/z_libindex_health_test.go +++ b/engine/z_libindex_health_test.go @@ -43,10 +43,10 @@ func TestHealthAccountAction(t *testing.T) { t.Fatal(err) } - exp := &IndexHealthReply{ - MissingObjects: []string{"AP1"}, - MissingIndexes: map[string][]string{"AP2": {"1002"}}, - BrokenReferences: map[string][]string{"AP2": {"1001"}}, + exp := &AccountActionPlanIHReply{ + MissingActionPlans: []string{"AP1"}, + MissingAccountActionPlans: map[string][]string{"AP2": {"1002"}}, + BrokenReferences: map[string][]string{"AP2": {"1001"}}, } if rply, err := GetAccountActionPlanIndexHealth(dm, -1, -1, -1, -1, false, false); err != nil { t.Fatal(err) @@ -72,10 +72,10 @@ func TestHealthAccountAction2(t *testing.T) { t.Fatal(err) } - exp := &IndexHealthReply{ - MissingObjects: []string{"AP1"}, - MissingIndexes: map[string][]string{}, - BrokenReferences: map[string][]string{}, + exp := &AccountActionPlanIHReply{ + MissingActionPlans: []string{"AP1"}, + MissingAccountActionPlans: map[string][]string{}, + BrokenReferences: map[string][]string{}, } if rply, err := GetAccountActionPlanIndexHealth(dm, -1, -1, -1, -1, false, false); err != nil { t.Fatal(err) @@ -108,10 +108,10 @@ func TestHealthAccountAction3(t *testing.T) { t.Fatal(err) } - exp := &IndexHealthReply{ - MissingObjects: []string{}, - MissingIndexes: map[string][]string{"AP2": {"1002"}}, - BrokenReferences: map[string][]string{}, + exp := &AccountActionPlanIHReply{ + MissingActionPlans: []string{}, + MissingAccountActionPlans: map[string][]string{"AP2": {"1002"}}, + BrokenReferences: map[string][]string{}, } if rply, err := GetAccountActionPlanIndexHealth(dm, -1, -1, -1, -1, false, false); err != nil { t.Fatal(err) @@ -147,10 +147,10 @@ func TestHealthAccountAction4(t *testing.T) { t.Fatal(err) } - exp := &IndexHealthReply{ - MissingObjects: []string{}, - MissingIndexes: map[string][]string{}, - BrokenReferences: map[string][]string{"AP2": {"1002"}}, + exp := &AccountActionPlanIHReply{ + MissingActionPlans: []string{}, + MissingAccountActionPlans: map[string][]string{}, + BrokenReferences: map[string][]string{"AP2": {"1002"}}, } if rply, err := GetAccountActionPlanIndexHealth(dm, -1, -1, -1, -1, false, false); err != nil { t.Fatal(err)