Documentation ¶
Index ¶
- type AckDetail
- type AckDetails
- func (ad *AckDetails) AddDetails(details sortedDetails)
- func (ad *AckDetails) Clear()
- func (ad *AckDetails) EarliestLastConfirmedMessageID() message.MessageID
- func (ad *AckDetails) Empty() bool
- func (ad *AckDetails) IsNoPersistedMessage() bool
- func (ad *AckDetails) LastAllAcknowledgedTimestamp() uint64
- func (ad *AckDetails) Len() int
- func (ad *AckDetails) Range(fn func(detail *AckDetail) bool)
- type AckManager
- type AckOption
- type Acker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AckDetail ¶
type AckDetail struct { BeginTimestamp uint64 // the timestamp when acker is allocated. EndTimestamp uint64 // the timestamp when acker is acknowledged. // for avoiding allocation of timestamp failure, the timestamp will use the ack manager last allocated timestamp. LastConfirmedMessageID message.MessageID MessageID message.MessageID TxnSession *txn.TxnSession IsSync bool Err error }
AckDetail records the information of acker.
type AckDetails ¶
type AckDetails struct {
// contains filtered or unexported fields
}
AckDetails records the information of AckDetail. Used to analyze the all acknowledged details. TODO: add more analysis methods. e.g. such as counter function with filter.
func (*AckDetails) AddDetails ¶
func (ad *AckDetails) AddDetails(details sortedDetails)
AddDetails adds details to AckDetails. The input details must be sorted by timestamp.
func (*AckDetails) EarliestLastConfirmedMessageID ¶
func (ad *AckDetails) EarliestLastConfirmedMessageID() message.MessageID
EarliestLastConfirmedMessageID returns the last confirmed message id.
func (*AckDetails) Empty ¶
func (ad *AckDetails) Empty() bool
Empty returns true if the AckDetails is empty.
func (*AckDetails) IsNoPersistedMessage ¶
func (ad *AckDetails) IsNoPersistedMessage() bool
IsNoPersistedMessage returns true if no persisted message.
func (*AckDetails) LastAllAcknowledgedTimestamp ¶
func (ad *AckDetails) LastAllAcknowledgedTimestamp() uint64
LastAllAcknowledgedTimestamp returns the last timestamp which all timestamps before it have been acknowledged. panic if no timestamp has been acknowledged.
func (*AckDetails) Range ¶
func (ad *AckDetails) Range(fn func(detail *AckDetail) bool)
Range iterates the AckDetail.
type AckManager ¶
type AckManager struct {
// contains filtered or unexported fields
}
AckManager manages the timestampAck.
func NewAckManager ¶
func NewAckManager( lastConfirmedTimeTick uint64, lastConfirmedMessageID message.MessageID, metrics *metricsutil.TimeTickMetrics, ) *AckManager
NewAckManager creates a new timestampAckHelper.
func (*AckManager) Allocate ¶
func (ta *AckManager) Allocate(ctx context.Context) (*Acker, error)
Allocate allocates a timestamp. Concurrent safe to call with Sync and Allocate.
func (*AckManager) AllocateWithBarrier ¶
func (ta *AckManager) AllocateWithBarrier(ctx context.Context, barrierTimeTick uint64) (*Acker, error)
AllocateWithBarrier allocates a timestamp with a barrier.
func (*AckManager) SyncAndGetAcknowledged ¶
func (ta *AckManager) SyncAndGetAcknowledged(ctx context.Context) ([]*AckDetail, error)
SyncAndGetAcknowledged syncs the ack records with allocator, and get the last all acknowledged info. Concurrent safe to call with Allocate.
type AckOption ¶
type AckOption func(*AckDetail)
AckOption is the option for acker.
func OptMessageID ¶
OptMessageID marks the message id for acker.
func OptTxnSession ¶
func OptTxnSession(session *txn.TxnSession) AckOption
OptTxnSession marks the session for acker.
type Acker ¶
type Acker struct {
// contains filtered or unexported fields
}
Acker records the timestamp and last confirmed message id that has not been acknowledged.
func (*Acker) LastConfirmedMessageID ¶
LastConfirmedMessageID returns the last confirmed message id.