models

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// VoidTimeNeverExpire is used when a record should never expire.
	VoidTimeNeverExpire int64 = 0
	// ExpirationNever is the Aerospike server's special TTL value for records
	// that should never expire.
	ExpirationNever uint32 = math.MaxUint32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupStats

type BackupStats struct {

	// total number of records in database
	TotalRecords uint64
	// contains filtered or unexported fields
}

BackupStats stores the status of a backup job. Stats are updated in realtime by backup jobs.

func (*BackupStats) AddSIndexes

func (s *BackupStats) AddSIndexes(num uint32)

func (*BackupStats) AddUDFs

func (s *BackupStats) AddUDFs(num uint32)

func (*BackupStats) GetBytesWritten

func (s *BackupStats) GetBytesWritten() uint64

func (*BackupStats) GetDuration

func (s *BackupStats) GetDuration() time.Duration

func (*BackupStats) GetFileCount

func (b *BackupStats) GetFileCount() uint64

GetFileCount returns the number of files per backup.

func (*BackupStats) GetReadRecords

func (s *BackupStats) GetReadRecords() uint64

func (*BackupStats) GetSIndexes

func (s *BackupStats) GetSIndexes() uint32

func (*BackupStats) GetUDFs

func (s *BackupStats) GetUDFs() uint32

func (*BackupStats) IncFiles

func (b *BackupStats) IncFiles()

IncFiles increments by one the number of files per backup.

func (*BackupStats) IsEmpty

func (b *BackupStats) IsEmpty() bool

IsEmpty determines whether the BackupStats is empty.

func (*BackupStats) Start

func (s *BackupStats) Start()

func (*BackupStats) Stop

func (s *BackupStats) Stop()

type PartitionFilterSerialized added in v0.2.0

type PartitionFilterSerialized struct {
	Begin  int
	Count  int
	Digest []byte
	Cursor []byte
	// Worker number.
	N int
}

PartitionFilterSerialized represent serialized a.PartitionFilter. To save cursor state.

func NewPartitionFilterSerialized added in v0.2.0

func NewPartitionFilterSerialized(pf *a.PartitionFilter) (PartitionFilterSerialized, error)

NewPartitionFilterSerialized serialize *a.PartitionFilter and returns new PartitionFilterSerialized instance.

func (*PartitionFilterSerialized) Decode added in v0.2.0

Decode decodes *PartitionFilterSerialized to *a.PartitionFilter

func (*PartitionFilterSerialized) IsEmpty added in v0.2.0

func (p *PartitionFilterSerialized) IsEmpty() bool

type Record

type Record struct {
	*a.Record

	// VoidTime is the time in seconds since the citrusleaf epoch when the
	// record will expire.
	VoidTime int64
}

type RestoreStats

type RestoreStats struct {

	// The number of records dropped because they were expired.
	RecordsExpired atomic.Uint64
	// The number of records dropped because they didn't contain any of the
	// selected bins or didn't belong to any of the selected sets.
	RecordsSkipped atomic.Uint64
	// The number of records ignored because of record level permanent error while
	// restoring.
	// E.g.: if RestoreConfig.IgnoreRecordError = true.
	RecordsIgnored atomic.Uint64

	// Total number of bytes read from source.
	TotalBytesRead atomic.Uint64
	// contains filtered or unexported fields
}

RestoreStats stores the stats of a restore operation from the reader job.

func (*RestoreStats) AddSIndexes

func (s *RestoreStats) AddSIndexes(num uint32)

func (*RestoreStats) AddUDFs

func (s *RestoreStats) AddUDFs(num uint32)

func (*RestoreStats) GetBytesWritten

func (s *RestoreStats) GetBytesWritten() uint64

func (*RestoreStats) GetDuration

func (s *RestoreStats) GetDuration() time.Duration

func (*RestoreStats) GetReadRecords

func (s *RestoreStats) GetReadRecords() uint64

func (*RestoreStats) GetRecordsExisted

func (rs *RestoreStats) GetRecordsExisted() uint64

func (*RestoreStats) GetRecordsExpired

func (rs *RestoreStats) GetRecordsExpired() uint64

func (*RestoreStats) GetRecordsFresher

func (rs *RestoreStats) GetRecordsFresher() uint64

func (*RestoreStats) GetRecordsIgnored added in v0.2.0

func (rs *RestoreStats) GetRecordsIgnored() uint64

func (*RestoreStats) GetRecordsInserted

func (rs *RestoreStats) GetRecordsInserted() uint64

func (*RestoreStats) GetRecordsSkipped

func (rs *RestoreStats) GetRecordsSkipped() uint64

func (*RestoreStats) GetSIndexes

func (s *RestoreStats) GetSIndexes() uint32

func (*RestoreStats) GetTotalBytesRead

func (rs *RestoreStats) GetTotalBytesRead() uint64

func (*RestoreStats) GetUDFs

func (s *RestoreStats) GetUDFs() uint32

func (*RestoreStats) IncrRecordsExisted

func (rs *RestoreStats) IncrRecordsExisted()

func (*RestoreStats) IncrRecordsFresher

func (rs *RestoreStats) IncrRecordsFresher()

func (*RestoreStats) IncrRecordsIgnored added in v0.2.0

func (rs *RestoreStats) IncrRecordsIgnored()

func (*RestoreStats) IncrRecordsInserted

func (rs *RestoreStats) IncrRecordsInserted()

func (*RestoreStats) Start

func (s *RestoreStats) Start()

func (*RestoreStats) Stop

func (s *RestoreStats) Stop()

type RetryPolicy

type RetryPolicy struct {
	// BaseTimeout is the initial delay between retry attempts.
	BaseTimeout time.Duration

	// Multiplier is used to increase the delay between subsequent retry attempts.
	// The actual delay is calculated as: BaseTimeout * (Multiplier ^ attemptNumber)
	Multiplier float64

	// MaxRetries is the maximum number of retry attempts that will be made.
	// If set to 0, no retries will be performed.
	MaxRetries uint
}

RetryPolicy defines the configuration for retry attempts in case of failures.

func NewRetryPolicy added in v0.2.0

func NewRetryPolicy(baseTimeout time.Duration, multiplier float64, maxRetries uint) *RetryPolicy

NewRetryPolicy returns new configuration for retry attempts in case of failures.

type SIPathBinType

type SIPathBinType byte
const (
	InvalidSIDataType     SIPathBinType = 0
	NumericSIDataType     SIPathBinType = 'N'
	StringSIDataType      SIPathBinType = 'S'
	GEO2DSphereSIDataType SIPathBinType = 'G'
	BlobSIDataType        SIPathBinType = 'B'
)

type SIndex

type SIndex struct {
	Namespace string
	Set       string
	Name      string
	Path      SIndexPath
	IndexType SIndexType
}

type SIndexPath

type SIndexPath struct {
	BinName    string
	B64Context string
	BinType    SIPathBinType
}

type SIndexType

type SIndexType byte
const (
	InvalidSIndex     SIndexType = 0
	BinSIndex         SIndexType = 'N'
	ListElementSIndex SIndexType = 'L'
	MapKeySIndex      SIndexType = 'K'
	MapValueSIndex    SIndexType = 'V'
)

type TimeBounds

type TimeBounds struct {
	FromTime *time.Time
	ToTime   *time.Time
}

TimeBounds represents a period of time between two timestamps.

type Token

type Token struct {
	SIndex *SIndex
	UDF    *UDF
	Record *Record
	Type   TokenType
	Size   uint64
	// Filter represents serialized partition filter for page, that record belongs to.
	// Is used only on pagination read, to save reading states.
	Filter *PartitionFilterSerialized
}

Token encompasses the other data models. The fields should be accessed based on the tokenType.

func NewRecordToken

func NewRecordToken(r *Record, size uint64, filter *PartitionFilterSerialized) *Token

NewRecordToken creates a new token with the given record.

func NewSIndexToken

func NewSIndexToken(s *SIndex, size uint64) *Token

NewSIndexToken creates a new token with the given secondary index.

func NewUDFToken

func NewUDFToken(u *UDF, size uint64) *Token

NewUDFToken creates a new token with the given UDF.

type TokenType

type TokenType uint8
const (
	TokenTypeInvalid TokenType = iota
	TokenTypeRecord
	TokenTypeSIndex
	TokenTypeUDF
)

type UDF

type UDF struct {
	Name    string
	Content []byte
	UDFType UDFType
}

type UDFType

type UDFType byte
const (
	UDFTypeLUA UDFType = 'L'
)

Jump to

Keyboard shortcuts

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