Skip to content

Commit

Permalink
remove unused fields from policy
Browse files Browse the repository at this point in the history
  • Loading branch information
taylanisikdemir committed Jun 24, 2024
1 parent 8c34272 commit 2aaa4a0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
8 changes: 4 additions & 4 deletions common/mapq/client_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ func TestAck(t *testing.T) {
defer cl.Stop(context.Background())

err = cl.Ack(context.Background(), nil)
if err != nil || err.Error() != "not implemented" {
t.Errorf("Ack() error: %v, want %v", err, "not implemented")
if err == nil || err.Error() != "not implemented" {
t.Errorf("Ack() error: %q, want %q", err, "not implemented")
}
}

Expand All @@ -155,7 +155,7 @@ func TestNack(t *testing.T) {
defer cl.Stop(context.Background())

err = cl.Nack(context.Background(), nil)
if err != nil || err.Error() != "not implemented" {
t.Errorf("Ack() error: %v, want %v", err, "not implemented")
if err == nil || err.Error() != "not implemented" {
t.Errorf("Ack() error: %q, want %q", err, "not implemented")
}
}
5 changes: 0 additions & 5 deletions common/mapq/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,10 @@ func TestExample(t *testing.T) {
// level 2: nodes per <type, sub-type> pairs
// - default 1000 RPS for per sub-type node
// - split by domain. predefined split for d3 domain
// - allow top 5 domains to be split based on burst
{
Path: "*/./.",
SplitPolicy: &types.SplitPolicy{
MaxNumChildren: 5, // allow top 4 tomains to be split. 5th domain will be catch-all
PredefinedSplits: []any{"d3"},
Strategy: &types.SplitStrategy{
SplitEnqueueRPSThreshold: 100,
},
},
},
// override for timer delete history event:
Expand Down
5 changes: 1 addition & 4 deletions common/mapq/types/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,10 @@ type SplitPolicy struct {
// PredefinedSplits is a list of predefined splits for the attribute key
// Child nodes for these attributes will be created during initialization
PredefinedSplits []any `json:"predefinedSplits,omitempty"`

// The max number of children to split the node into.
MaxNumChildren int `json:"maxNumChildren,omitempty"`
}

func (sp SplitPolicy) String() string {
return fmt.Sprintf("SplitPolicy{Disabled:%v, PredefinedSplits:%v, MaxNumChildren:%d}", sp.Disabled, sp.PredefinedSplits, sp.MaxNumChildren)
return fmt.Sprintf("SplitPolicy{Disabled:%v, PredefinedSplits:%v}", sp.Disabled, sp.PredefinedSplits)
}

type NodePolicy struct {
Expand Down

0 comments on commit 2aaa4a0

Please sign in to comment.