forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rac2: introduce stream token counter provider interface
Introduce the `StreamTokenCounterProvider` interface, which will be used by replication flow control v2 to access the `TokenCounter` for a given tenant, store stream. Note the original interface in the v2 prototype included two additional methods for metrics gathering which are omitted here. Resolves: cockroachdb#128010 Release note: None
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2024 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package rac2 | ||
|
||
import "github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvflowcontrol" | ||
|
||
// StreamTokenCounterProvider is the interface for retrieving token counters | ||
// for a given stream. | ||
type StreamTokenCounterProvider interface { | ||
// Eval returns the evaluation token counter for the given stream. | ||
Eval(kvflowcontrol.Stream) TokenCounter | ||
// Send returns the send token counter for the given stream. | ||
Send(kvflowcontrol.Stream) TokenCounter | ||
} |