-
Notifications
You must be signed in to change notification settings - Fork 719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store label limit #2674
Store label limit #2674
Conversation
if keyOk { | ||
if limit, err := h.GetLabelStoresLimit(label, 0); err != nil { | ||
return | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
@@ -1695,6 +1695,21 @@ func (c *RaftCluster) GetStoreLimitByType(storeID uint64, typ storelimit.Type) f | |||
return c.opt.GetStoreLimitByType(storeID, typ) | |||
} | |||
|
|||
func (c *RaftCluster) GetLabelStores(label config.StoreLabel) []uint64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method RaftCluster.GetLabelStores should have comment or be unexported
if keyOk { | ||
if limit, err := h.GetLabelStoresLimit(label, 0); err != nil { | ||
return | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
// IsTiFlashStore used to judge flash store. | ||
// FIXME: remove the hack way | ||
func IsTiFlashStore(store *metapb.Store) bool { | ||
// Judge if it needs placement rule. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported function IsPlacementNeeded should be of the form "IsPlacementNeeded ..."
func (o *PersistOptions) GetLabelStoresLimit(label StoreLabel) StoreLimitConfig { | ||
if l, ok := o.GetScheduleConfig().StoreLabelLimit[label.String()]; !ok { | ||
return l | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
@@ -1695,6 +1695,21 @@ func (c *RaftCluster) GetStoreLimitByType(storeID uint64, typ storelimit.Type) f | |||
return c.opt.GetStoreLimitByType(storeID, typ) | |||
} | |||
|
|||
func (c *RaftCluster) GetLabelStores(label config.StoreLabel) []uint64 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method RaftCluster.GetLabelStores should have comment or be unexported
@@ -419,6 +429,15 @@ func (h *Handler) SetAllStoresLimit(ratePerMin float64, limitType storelimit.Typ | |||
return nil | |||
} | |||
|
|||
// GetAllStoresLimit is used to get limit of all stores. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported method Handler.GetLabelStoresLimit should be of the form "GetLabelStoresLimit ..."
What problem does this PR solve?
Solve issue #2568
What is changed and how it works?
Check List
Tests
Code changes
Side effects
Related changes
Release note