Documentation ¶
Overview ¶
Package crdbqm defines a CockroachDB-based quota.Manager implementation.
Index ¶
Constants ¶
const ( // DefaultMaxUnsequenced is a suggested value for MaxUnsequencedRows. // Note that this is a Global/Write quota suggestion, so it applies across trees. DefaultMaxUnsequenced = 500000 // About 2h of non-stop signing at 70QPS. )
const QuotaManagerName = "crdb"
QuotaManagerName identifies the CockroachDB quota implementation.
Variables ¶
var ErrTooManyUnsequencedRows = errors.New("too many unsequenced rows")
ErrTooManyUnsequencedRows is returned when tokens are requested but Unsequenced has grown beyond the configured limit.
Functions ¶
This section is empty.
Types ¶
type QuotaManager ¶
QuotaManager is a CockroachDB-based quota.Manager implementation.
QuotaManager only implements Global/Write quotas, which is based on the number of Unsequenced rows (to be exact, tokens = MaxUnsequencedRows - actualUnsequencedRows). Other quotas are considered infinite.
func (*QuotaManager) GetTokens ¶
GetTokens implements quota.Manager.GetTokens. It doesn't actually reserve or retrieve tokens, instead it allows access based on the number of rows in the Unsequenced table.
func (*QuotaManager) PutTokens ¶
PutTokens implements quota.Manager.PutTokens. It's a noop for QuotaManager.
func (*QuotaManager) ResetQuota ¶
ResetQuota implements quota.Manager.ResetQuota. It's a noop for QuotaManager.