Documentation ¶
Index ¶
- Constants
- func RunDistributedGCJob(ctx context.Context, regionLockResolver tikv.RegionLockResolver, ...) error
- func RunGCJob(ctx context.Context, regionLockResolver tikv.RegionLockResolver, ...) error
- func RunResolveLocks(ctx context.Context, s tikv.Storage, pd pd.Client, safePoint uint64, ...) error
- type GCWorker
- type MockGCWorker
Constants ¶
View Source
const ( // ConcurrencyDivisor reduces the input concurrency to avoid overwhelming the system ConcurrencyDivisor = 4 // RequestsPerThread is the number of requests handled by a single thread RequestsPerThread = 100000 )
Variables ¶
This section is empty.
Functions ¶
func RunDistributedGCJob ¶
func RunDistributedGCJob(ctx context.Context, regionLockResolver tikv.RegionLockResolver, s tikv.Storage, pd pd.Client, safePoint uint64, identifier string, concurrency int) error
RunDistributedGCJob notifies TiKVs to do GC. It is exported for kv api, do not use it with GCWorker at the same time. This function may not finish immediately because it may take some time to do resolveLocks. Param concurrency specifies the concurrency of resolveLocks phase.
func RunGCJob ¶
func RunGCJob(ctx context.Context, regionLockResolver tikv.RegionLockResolver, s tikv.Storage, pd pd.Client, safePoint uint64, identifier string, concurrency int) error
RunGCJob sends GC command to KV. It is exported for kv api, do not use it with GCWorker at the same time. only use for test
Types ¶
type GCWorker ¶
type GCWorker struct {
// contains filtered or unexported fields
}
GCWorker periodically triggers GC process on tikv server.
func NewGCWorker ¶
NewGCWorker creates a GCWorker instance.
type MockGCWorker ¶
type MockGCWorker struct {
// contains filtered or unexported fields
}
MockGCWorker is for test.
func NewMockGCWorker ¶
func NewMockGCWorker(store kv.Storage) (*MockGCWorker, error)
NewMockGCWorker creates a MockGCWorker instance ONLY for test.
func (*MockGCWorker) DeleteRanges ¶
func (w *MockGCWorker) DeleteRanges(ctx context.Context, safePoint uint64) error
DeleteRanges calls deleteRanges internally, just for test.
Click to show internal directories.
Click to hide internal directories.