dynamodblogstore

package
v0.0.0-...-963cbb1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package dynamodblogstore contains the resources required to create a DynamoDB log store.

Index

Constants

View Source
const (
	// TablePath is the DynamoDB table attribute representing table path.
	TablePath attribute = "tablePath"
	// FileName is the DynamoDB table attribute representing file name.
	FileName attribute = "fileName"
	// TempPath is the DynamoDB table attribute representing temp path.
	TempPath attribute = "tempPath"
	// Complete is the DynamoDB table attribute representing transaction completeness.
	Complete attribute = "complete"
	// ExpireTime is the DynamoDB table attribute representing expire time.
	ExpireTime attribute = "expireTime"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LogStore

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

LogStore uses a DynamoDB table to provide mutual exclusion during calls to `Put`.

DynamoDB entries are of the form - key -- tablePath (HASH, STRING) -- fileName (RANGE, STRING)

- attributes -- tempPath (STRING, relative to the Delta log) -- complete (STRING, representing boolean, "true" or "false") -- expireTime (NUMBER, epoch seconds)

func New

func New(o Options) (*LogStore, error)

New creates a new LogStore instance.

func (LogStore) Client

func (ls LogStore) Client() any

Client gets the DynamoDB client.

func (LogStore) ExpirationDelaySeconds

func (ls LogStore) ExpirationDelaySeconds() uint64

ExpirationDelaySeconds gets the number of seconds until a commit entry expires.

func (*LogStore) Get

func (ls *LogStore) Get(tablePath storage.Path, fileName storage.Path) (*logstore.CommitEntry, error)

Get gets a commit entry corresponding to the commit log identified by the given table path and file name.

func (*LogStore) Latest

func (ls *LogStore) Latest(tablePath storage.Path) (*logstore.CommitEntry, error)

Latest gets the commit entry corresponding to the latest commit log for a given table path.

func (LogStore) MaxRetryTableCreateAttempts

func (ls LogStore) MaxRetryTableCreateAttempts() uint16

MaxRetryTableCreateAttempts gets the maximum number of table creation attempts.

func (*LogStore) Put

func (ls *LogStore) Put(entry *logstore.CommitEntry, overwrite bool) error

Put puts a commit entry into a log store in an exclusive way.

func (LogStore) TableName

func (ls LogStore) TableName() string

TableName gets the DynamoDB table name.

type Options

type Options struct {
	Client                 dynamodbutils.Client
	TableName              string
	ExpirationDelaySeconds uint64
	MaxTableCreateAttempts uint16
	// The number of read capacity units which can be consumed per second (https://aws.amazon.com/dynamodb/pricing/provisioned/).
	RCU int64
	// The number of write capacity units which can be consumed per second (https://aws.amazon.com/dynamodb/pricing/provisioned/).
	WCU int64
}

Options contains settings that can be adjusted to change the behavior of LogStore.

Jump to

Keyboard shortcuts

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