Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMAllocator ¶
Types ¶
type Allocator ¶
type Allocator interface {
// Allocate allocates a timestamp.
Allocate(ctx context.Context) (uint64, error)
// BarrierUtil make a barrier, next allocate call will generate id greater than barrier.
BarrierUntil(ctx context.Context, barrier uint64) error
// Sync expire the local allocator messages,
// syncs the local allocator and remote allocator.
Sync()
// SyncIfExpired syncs the local allocator and remote allocator if the duration since last sync operation is greater than expire.
SyncIfExpired(expire time.Duration)
}
func NewIDAllocator ¶
func NewIDAllocator(mix *syncutil.Future[types.MixCoordClient]) Allocator
NewIDAllocator creates a new allocator.
func NewTSOAllocator ¶
func NewTSOAllocator(mix *syncutil.Future[types.MixCoordClient]) Allocator
NewTSOAllocator creates a new allocator.
Click to show internal directories.
Click to hide internal directories.