public final class RowIDAllocator extends Object implements Serializable
(start, end] is allocated
| 限定符和类型 | 类和说明 |
|---|---|
static class |
RowIDAllocator.RowIDAllocatorType |
| 限定符和类型 | 方法和说明 |
|---|---|
static RowIDAllocator |
create(long dbId,
TiTableInfo table,
TiConfiguration conf,
org.tikv.common.meta.TiTimestamp timestamp,
boolean unsigned,
long shardBits,
long step,
RowIDAllocator.RowIDAllocatorType allocatorType) |
static RowIDAllocator |
createRowIDAllocator(long dbId,
TiTableInfo tableInfo,
TiConfiguration conf,
long step,
org.tikv.common.meta.TiTimestamp timestamp,
RowIDAllocator.RowIDAllocatorType allocatorType) |
static long |
getAllocateId(long dbId,
long tableId,
Snapshot snapshot,
RowIDAllocator.RowIDAllocatorType allocatorType)
read current row id from TiKV according to database id and table id.
|
long |
getAutoIncId(long index) |
long |
getAutoRandomId(long index) |
long |
getEnd() |
static org.tikv.shade.com.google.protobuf.ByteString |
getIdField(long tableId,
RowIDAllocator.RowIDAllocatorType allocatorType) |
long |
getShardRowId(long index) |
long |
getStart() |
static boolean |
shardRowBitsOverflow(long base,
long step,
long shardRowBits,
boolean reservedSignBit) |
long |
updateAllocateId(long dbId,
long tableId,
long step,
Snapshot snapshot,
long shard,
boolean hasSignedBit)
read current row id from TiKV and write the calculated value back to TiKV.
|
public long getAutoIncId(long index)
public long getShardRowId(long index)
index - should >= 1public long getAutoRandomId(long index)
public static RowIDAllocator createRowIDAllocator(long dbId, TiTableInfo tableInfo, TiConfiguration conf, long step, org.tikv.common.meta.TiTimestamp timestamp, RowIDAllocator.RowIDAllocatorType allocatorType)
public static RowIDAllocator create(long dbId, TiTableInfo table, TiConfiguration conf, org.tikv.common.meta.TiTimestamp timestamp, boolean unsigned, long shardBits, long step, RowIDAllocator.RowIDAllocatorType allocatorType)
public long getStart()
public long getEnd()
public static boolean shardRowBitsOverflow(long base,
long step,
long shardRowBits,
boolean reservedSignBit)
public long updateAllocateId(long dbId,
long tableId,
long step,
Snapshot snapshot,
long shard,
boolean hasSignedBit)
public static org.tikv.shade.com.google.protobuf.ByteString getIdField(long tableId,
RowIDAllocator.RowIDAllocatorType allocatorType)
public static long getAllocateId(long dbId,
long tableId,
Snapshot snapshot,
RowIDAllocator.RowIDAllocatorType allocatorType)
Copyright © 2023 PingCAP. All rights reserved.