public final class RowIDAllocator extends Object implements Serializable
(start, end] is allocated
| 限定符和类型 | 方法和说明 |
|---|---|
static RowIDAllocator |
create(long dbId,
TiTableInfo table,
TiConfiguration conf,
boolean unsigned,
long step) |
static long |
getAllocateId(long dbId,
long tableId,
Snapshot snapshot)
read current row id from TiKV according to database id and table id.
|
long |
getAutoIncId(long index) |
long |
getEnd() |
long |
getShardRowId(long index) |
long |
getStart() |
static boolean |
shardRowBitsOverflow(long base,
long step,
long shardRowBits,
boolean reservedSignBit) |
long |
udpateAllocateId(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 static RowIDAllocator create(long dbId, TiTableInfo table, TiConfiguration conf, boolean unsigned, long step)
public long getStart()
public long getEnd()
public static boolean shardRowBitsOverflow(long base,
long step,
long shardRowBits,
boolean reservedSignBit)
public long udpateAllocateId(long dbId,
long tableId,
long step,
Snapshot snapshot,
long shard,
boolean hasSignedBit)
public static long getAllocateId(long dbId,
long tableId,
Snapshot snapshot)
Copyright © 2022 PingCAP. All rights reserved.