aerospike

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RecordReader

type RecordReader interface {
	Read(ctx context.Context) (*models.Token, error)
	Close()
}

RecordReader is an interface for reading Aerospike records. implements pipe.Reader for a token.

func NewRecordReader

func NewRecordReader(
	ctx context.Context,
	client scanner,
	cfg *RecordReaderConfig,
	logger *slog.Logger,
	recordsetCloser RecordsetCloser,
) RecordReader

NewRecordReader creates a new RecordReader. If the reader is configured to use page size, it will return a paginatedRecordReader, it enables saving scan position for resuming. Otherwise, it will return a singleRecordReader, that does regular scan in single thread.

type RecordReaderConfig

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

RecordReaderConfig represents the configuration for scanning Aerospike records.

func NewRecordReaderConfig

func NewRecordReaderConfig(namespace string,
	setList []string,
	partitionFilter *a.PartitionFilter,
	scanPolicy *a.ScanPolicy,
	binList []string,
	timeBounds models.TimeBounds,
	scanLimiter *semaphore.Weighted,
	noTTLOnly bool,
	pageSize int64,
	rpsCollector *metrics.Collector,
) *RecordReaderConfig

NewRecordReaderConfig creates a new RecordReaderConfig.

type RecordsetCloser added in v0.6.0

type RecordsetCloser interface {
	Close(recordset *a.Recordset) a.Error
}

RecordsetCloser is an interface for closing Aerospike recordsets. It is required because scanner interacted return concrete type Recordset that is impossible to mock.

func NewRecordsetCloser added in v0.6.0

func NewRecordsetCloser() RecordsetCloser

type RecordsetCloserImpl added in v0.6.0

type RecordsetCloserImpl struct {
}

func (*RecordsetCloserImpl) Close added in v0.6.0

func (r *RecordsetCloserImpl) Close(recordset *a.Recordset) a.Error

type RestoreWriter

type RestoreWriter[T models.TokenConstraint] struct {
	// contains filtered or unexported fields
}

RestoreWriter satisfies the DataWriter interface. It writes the types from the models package to an Aerospike client It is used to restore data from a backup.

func NewRestoreWriter

func NewRestoreWriter[T models.TokenConstraint](
	ctx context.Context,
	asc dbWriter,
	writePolicy *a.WritePolicy,
	stats *models.RestoreStats,
	logger *slog.Logger,
	useBatchWrites bool,
	batchSize int,
	retryPolicy *models.RetryPolicy,
	rpsCollector *metrics.Collector,
	ignoreRecordError bool,
) *RestoreWriter[T]

NewRestoreWriter creates a new RestoreWriter.

func (*RestoreWriter[T]) Close

func (rw *RestoreWriter[T]) Close() error

Close satisfies the DataWriter interface.

func (*RestoreWriter[T]) Write

func (rw *RestoreWriter[T]) Write(_ context.Context, data T) (int, error)

Write writes the types from the models package to an Aerospike DB.

type SindexReader

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

SindexReader satisfies the DataReader interface. It reads secondary indexes from a SIndexGetter and returns them as *models.SecondaryIndex.

func NewSIndexReader

func NewSIndexReader(client sindexGetter, namespace string, logger *slog.Logger) *SindexReader

NewSIndexReader creates a new SIndexReader.

func (*SindexReader) Close

func (r *SindexReader) Close()

Close satisfies the DataReader interface but is a no-op for the SIndexReader.

func (*SindexReader) Read

func (r *SindexReader) Read(ctx context.Context) (*models.Token, error)

Read reads the next secondary index from the SIndexGetter.

type UdfReader

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

UdfReader satisfies the DataReader interface. It reads UDFs from a UDFGetter and returns them as *models.UDF.

func NewUDFReader

func NewUDFReader(client udfGetter, logger *slog.Logger) *UdfReader

NewUDFReader creates a new UdfReader.

func (*UdfReader) Close

func (r *UdfReader) Close()

Close satisfies the DataReader interface but is a no-op for the UDFReader.

func (*UdfReader) Read

func (r *UdfReader) Read(ctx context.Context) (*models.Token, error)

Read reads the next UDF from the UDFGetter.

Directories

Path Synopsis
xdr

Jump to

Keyboard shortcuts

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