inspector

package
v0.10.3-0...-0b9edb6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeTickInfo

type TimeTickInfo struct {
	MessageID              message.MessageID // the message id.
	TimeTick               uint64            // the time tick.
	LastConfirmedMessageID message.MessageID // the last confirmed message id.

}

TimeTickInfo records the information of time tick.

func (*TimeTickInfo) IsZero

func (t *TimeTickInfo) IsZero() bool

IsZero returns true if the time tick info is zero.

type TimeTickNotifier

type TimeTickNotifier struct {
	// contains filtered or unexported fields
}

TimeTickNotifier is a listener for time tick info.

func NewTimeTickNotifier

func NewTimeTickNotifier() *TimeTickNotifier

NewTimeTickNotifier creates a new time tick info listener.

func (*TimeTickNotifier) Get

func (l *TimeTickNotifier) Get() TimeTickInfo

Get gets the time tick info.

func (*TimeTickNotifier) OnlyUpdateTs

func (l *TimeTickNotifier) OnlyUpdateTs(timetick uint64)

OnlyUpdateTs only updates the time tick, and notify the waiter.

func (*TimeTickNotifier) Update

func (l *TimeTickNotifier) Update(info TimeTickInfo)

Update only update the time tick info, but not notify the waiter.

func (*TimeTickNotifier) WatchAtMessageID

func (l *TimeTickNotifier) WatchAtMessageID(messageID message.MessageID, ts uint64) <-chan struct{}

WatchAtMessageID watch the message id. If the message id is not equal to the last message id, return nil channel. Or if the time tick is less than the last time tick, return channel.

type TimeTickSyncInspector

type TimeTickSyncInspector interface {
	// TriggerSync adds a pchannel info and notify the sync operation.
	// manually trigger the sync operation of pchannel.
	TriggerSync(pChannelInfo types.PChannelInfo)

	// RegisterSyncOperator registers a sync operator.
	RegisterSyncOperator(operator TimeTickSyncOperator)

	// MustGetOperator gets the operator by pchannel info, otherwise panic.
	MustGetOperator(types.PChannelInfo) TimeTickSyncOperator

	// UnregisterSyncOperator unregisters a sync operator.
	UnregisterSyncOperator(operator TimeTickSyncOperator)

	// Close closes the inspector.
	Close()
}

TimeTickSyncInspector is the inspector to sync time tick.

func NewTimeTickSyncInspector

func NewTimeTickSyncInspector() TimeTickSyncInspector

NewTimeTickSyncInspector creates a new time tick sync inspector.

type TimeTickSyncOperator

type TimeTickSyncOperator interface {
	TimeTickNotifier() *TimeTickNotifier

	// Channel returns the pchannel info.
	Channel() types.PChannelInfo

	// Sync trigger a sync operation, try to send the timetick message into wal.
	// Sync operation is a blocking operation, and not thread-safe, will only call in one goroutine.
	Sync(ctx context.Context)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL