package
9.0.0-alpha+incompatible
Repository: https://github.com/pingcap/tidb.git
Documentation: pkg.go.dev
# Functions
AutoRandomRangeBitsNormalize normalizes the auto random range bits.
AutoRandomShardBitsNormalize normalizes the auto random shard bits.
CalcNeededBatchSize is used to calculate batch size for autoID allocation.
CalcSequenceBatchSize calculate the next sequence batch size.
DecodeCmpUintToInt decodes the u that encoded by EncodeIntToCmpUint.
EncodeIntToCmpUint make int v to comparable uint type.
GetStep gets the defautStep value.
NewAllocator returns a new auto increment id generator on the store.
NewAllocatorFromTempTblInfo creates an in-memory allocator from a temporary table info.
NewAllocatorRuntimeStats return a new AllocatorRuntimeStats.
NewAllocators packs multiple `Allocator`s into Allocators.
NewAllocatorsFromTblInfo creates an array of allocators of different types with the information of model.TableInfo.
NewClientDiscover creates a ClientDiscover object.
NewSequenceAllocator returns a new sequence value generator on the store.
NewShardIDFormat create an instance of ShardIDFormat.
NextStep return new auto id step according to previous step and consuming time.
SeekToFirstAutoIDSigned seeks to the next valid signed position.
SeekToFirstAutoIDUnSigned seeks to the next valid unsigned position.
SeekToFirstSequenceValue seeks to the next valid value (must be in range of [MIN, max]), the bool indicates whether the first value is got.
SetStep is only used by tests.
TestModifyBaseAndEndInjection exported for testing modifying the base and end.
# Constants
AutoIncrementType indicates the allocator is used to allocate auto increment value.
AutoRandomAllocatorNotFound is reported when auto_random ID allocator not found during changing from auto_inc to auto_random.
AutoRandomAlterAddColumn is reported when adding an auto_random column.
AutoRandomAlterChangeFromAutoInc is reported when the column is changing from a non-auto_increment or a non-primary key.
AutoRandomAlterErrMsg is reported when a user is trying to add/drop/modify the value of auto_random attribute.
AutoRandomAvailableAllocTimesNote is reported when a table containing auto_random is created.
AutoRandomDecreaseBitErrMsg is reported when the auto_random shard bits is decreased.
AutoRandomExplicitInsertDisabledErrMsg is reported when auto_random column value is explicitly specified, but the session var 'allow_auto_random_explicit_insert' is false.
AutoRandomIncBitsMin is the min number of auto random incremental bits.
AutoRandomIncompatibleWithAutoIncErrMsg is reported when auto_random and auto_increment are specified on the same column.
AutoRandomIncompatibleWithDefaultValueErrMsg is reported when auto_random and default are specified on the same column.
AutoRandomIncrementalBitsTooSmall is reported when the auto_random available use space is too small.
AutoRandomInvalidRangeBits is reported when the auto_random_range_bits is invalid.
AutoRandomModifyColTypeErrMsg is reported when a user is trying to modify the type of a column specified with auto_random.
AutoRandomMustFirstColumnInPK is reported when auto_random is not the first column in primary key.
AutoRandomNoClusteredPKErrMsg indicates the primary key is not clustered.
AutoRandomNonPositive is reported then a user specifies a non-positive value for auto_random.
AutoRandomOnNonBigIntColumn is reported when define auto random to non bigint column.
AutoRandomOverflowErrMsg is reported when auto_random is greater than max length of a MySQL data type.
AutoRandomRangeBitsDefault is the default number of range bits.
AutoRandomRangeBitsMax is the max number of range bits.
AutoRandomRangeBitsMin is the min number of range bits.
AutoRandomRebaseNotApplicable is reported when alter auto_random base on a non auto_random table.
AutoRandomRebaseOverflow is reported when alter auto_random_base to a value that overflows the incremental bits.
AutoRandomShardBitsDefault is the default number of shard bits.
AutoRandomShardBitsMax is the max number of shard bits.
AutoRandomType indicates the allocator is used to allocate auto-shard id.
AutoRandomUnsupportedAlterRangeBits is reported when the auto_random range_bits is changed.
InformationSchemaDBID is the information_schema schema id, it's exports for test.
MetricSchemaDBID is the metrics_schema schema id, it's exported for test.
PerformanceSchemaDBID is the performance_schema schema id, it's exports for test.
RowIDAllocType indicates the allocator is used to allocate row id.
RowIDBitLength is the bit number of a row id in TiDB.
SequenceType indicates the allocator is used to allocate sequence value.
SystemSchemaIDFlag is the system schema/table id flag, uses the highest bit position as system schema ID flag, it's exports for test.
# Variables
AllocatorRuntimeStatsCtxKey is the context key of allocator runtime stats.
Error instances.
Error instances.
Error instances.
Error instances.
MockForTest is exported for testing.
# Structs
AllocatorRuntimeStats is the execution stats of auto id allocator.
Allocators represents a set of `Allocator`s.
ClientDiscover is used to get the AutoIDAllocClient, it creates the grpc connection with autoid service leader.
ShardIDFormat is used to calculate the bit length of different segments in auto id.
# Interfaces
Allocator is an auto increment id generator.
AllocOption is a interface to define allocator custom options coming in future.
Requirement is the parameter required by NewAllocator.
# Type aliases
AllocatorType is the type of allocator for generating auto-id.
AllocOptionTableInfoVersion is used to pass the TableInfo.Version to the allocator.
CustomAutoIncCacheOption is one kind of AllocOption to customize the allocator step length.