Skip to content

Commit

Permalink
store: cleanup useless code (pingcap#16103)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackysp authored Apr 8, 2020
1 parent 96d96ce commit eeac2eb
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 24 deletions.
1 change: 1 addition & 0 deletions store/tikv/delete_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package tikv
import (
"bytes"
"context"

"github.com/pingcap/errors"
"github.com/pingcap/kvproto/pkg/kvrpcpb"
"github.com/pingcap/tidb/kv"
Expand Down
File renamed without changes.
5 changes: 0 additions & 5 deletions store/tikv/range_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ func (s *RangeTaskRunner) SetRegionsPerTask(regionsPerTask int) {
s.regionsPerTask = regionsPerTask
}

// SetStatLogInterval sets the time interval to log the stats.
func (s *RangeTaskRunner) SetStatLogInterval(interval time.Duration) {
s.statLogInterval = interval
}

// RunOnRange runs the task on the given range.
// Empty startKey or endKey means unbounded.
func (s *RangeTaskRunner) RunOnRange(ctx context.Context, startKey, endKey kv.Key) error {
Expand Down
19 changes: 0 additions & 19 deletions store/tikv/region_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,6 @@ type RPCContext struct {
Addr string
}

// GetStoreID returns StoreID.
func (c *RPCContext) GetStoreID() uint64 {
if c.Store != nil {
return c.Store.storeID
}
return 0
}

func (c *RPCContext) String() string {
return fmt.Sprintf("region ID: %d, meta: %s, peer: %s, addr: %s, idx: %d",
c.Region.GetID(), c.Meta, c.Peer, c.Addr, c.PeerIdx)
Expand Down Expand Up @@ -466,17 +458,6 @@ func (c *RegionCache) LocateKey(bo *Backoffer, key []byte) (*KeyLocation, error)
}, nil
}

func (c *RegionCache) loadAndInsertRegion(bo *Backoffer, key []byte) (*Region, error) {
r, err := c.loadRegion(bo, key, false)
if err != nil {
return nil, err
}
c.mu.Lock()
c.insertRegionToCache(r)
c.mu.Unlock()
return r, nil
}

// LocateEndKey searches for the region and range that the key is located.
// Unlike LocateKey, start key of a region is exclusive and end key is inclusive.
func (c *RegionCache) LocateEndKey(bo *Backoffer, key []byte) (*KeyLocation, error) {
Expand Down

0 comments on commit eeac2eb

Please sign in to comment.