Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Commit

Permalink
rename const variable
Browse files Browse the repository at this point in the history
  • Loading branch information
glorv committed Nov 9, 2020
1 parent 2a00eba commit 13d8a7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lightning/backend/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const (
// See: https://github.com/tikv/tikv/blob/e030a0aae9622f3774df89c62f21b2171a72a69e/etc/config-template.toml#L360
regionMaxKeyCount = 1_440_000

PROP_RANGE_INDEX = "tikv.range_index"
propRangeIndex = "tikv.range_index"

defaultPropSizeIndexDistance = 4 * 1024 * 1024 // 4MB
defaultPropKeysIndexDistance = 40 * 1024
Expand Down Expand Up @@ -130,7 +130,7 @@ func (e *LocalFile) getSizeProperties() (*sizeProperties, error) {
sizeProps := newSizeProperties()
for _, level := range sstables {
for _, info := range level {
if prop, ok := info.Properties.UserProperties[PROP_RANGE_INDEX]; ok {
if prop, ok := info.Properties.UserProperties[propRangeIndex]; ok {
data := hack.Slice(prop)
rangeProps, err := decodeRangeProperties(data)
if err != nil {
Expand Down Expand Up @@ -1446,13 +1446,13 @@ func (c *RangePropertiesCollector) Finish(userProps map[string]string) error {
c.insertNewPoint(c.lastKey)
}

userProps[PROP_RANGE_INDEX] = string(c.props.Encode())
userProps[propRangeIndex] = string(c.props.Encode())
return nil
}

// The name of the property collector.
func (c *RangePropertiesCollector) Name() string {
return PROP_RANGE_INDEX
return propRangeIndex
}

type sizeProperties struct {
Expand Down
2 changes: 1 addition & 1 deletion lightning/backend/local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (s *localSuite) TestRangeProperties(c *C) {
userProperties := make(map[string]string, 1)
_ = collector.Finish(userProperties)

props, err := decodeRangeProperties(hack.Slice(userProperties[PROP_RANGE_INDEX]))
props, err := decodeRangeProperties(hack.Slice(userProperties[propRangeIndex]))
c.Assert(err, IsNil)

// Smallest key in props.
Expand Down

0 comments on commit 13d8a7a

Please sign in to comment.