github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/kv/kvclient/kvcoord/testing_knobs.go (about) 1 // Copyright 2018 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 package kvcoord 12 13 import "github.com/cockroachdb/cockroach/pkg/base" 14 15 // ClientTestingKnobs contains testing options that dictate the behavior 16 // of the key-value client. 17 type ClientTestingKnobs struct { 18 // The RPC dispatcher. Defaults to grpc but can be changed here for 19 // testing purposes. 20 TransportFactory TransportFactory 21 22 // The maximum number of times a txn will attempt to refresh its 23 // spans for a single transactional batch. 24 // 0 means use a default. -1 means disable refresh. 25 MaxTxnRefreshAttempts int 26 27 // CondenseRefreshSpansFilter, if set, is called when the span refresher is 28 // considering condensing the refresh spans. If it returns false, condensing 29 // will not be attempted and the span refresher will behave as if condensing 30 // failed to save enough memory. 31 CondenseRefreshSpansFilter func() bool 32 } 33 34 var _ base.ModuleTestingKnobs = &ClientTestingKnobs{} 35 36 // ModuleTestingKnobs is part of the base.ModuleTestingKnobs interface. 37 func (*ClientTestingKnobs) ModuleTestingKnobs() {}