Documentation
¶
Index ¶
- Constants
- Variables
- type IKeyStorage
- type ILock
- type IManifestStorage
- type IObjectStorage
- type KeyStorage
- func (obj *KeyStorage) AcquireLock(ctx context.Context, key string, duration time.Duration) (ILock, error)
- func (obj *KeyStorage) AddItemsToTablePartition(ctx context.Context, partition elements.Partition, items [][]byte) (int64, error)
- func (obj *KeyStorage) ClaimPartition(ctx context.Context, partition elements.Partition, duration time.Duration) (ILock, error)
- func (obj *KeyStorage) Close() error
- func (obj *KeyStorage) DeleteTablePartitionTimestamp(ctx context.Context, partition elements.Partition) (bool, error)
- func (obj *KeyStorage) DerCtx(ctx context.Context) (context.Context, context.CancelFunc)
- func (obj *KeyStorage) GetTablePartitionItems(ctx context.Context, partition elements.Partition, count int) ([]string, error)
- func (obj *KeyStorage) GetTablePartitionTimestamp(ctx context.Context, partition elements.Partition) (time.Time, error)
- func (obj *KeyStorage) GetTablePartitions(ctx context.Context, tableName string, cursor uint64, count int64) ([]elements.Partition, error)
- func (obj *KeyStorage) Key(key string) string
- func (obj *KeyStorage) ReleaseLock(ctx context.Context, lock ILock) (bool, error)
- func (obj *KeyStorage) ReleasePartitionLock(ctx context.Context, lock ILock) (bool, error)
- func (obj *KeyStorage) SetTablePartitionTimestamp(ctx context.Context, partition elements.Partition) (bool, error)
- type KeyStorageOptions
- type ManifestObject
- type ManifestStorage
- func (obj *ManifestStorage) GetPartitionManifest(ctx context.Context, partition elements.Partition) (*PartitionManifest, error)
- func (obj *ManifestStorage) GetPartitionManifestFile(ctx context.Context, manifest *PartitionManifest, index int, filePath string) error
- func (obj *ManifestStorage) MergePartitionRecordIntoManifest(ctx context.Context, partition elements.Partition, ...) error
- func (obj *ManifestStorage) ReplacePartitionManifest(ctx context.Context, partition elements.Partition, ...) error
- type ManifestStorageOptions
- type ObjectStorage
- func (obj *ObjectStorage) CreateBucket(ctx context.Context, bucket string) error
- func (obj *ObjectStorage) Delete(ctx context.Context, bucket, key string) error
- func (obj *ObjectStorage) Download(ctx context.Context, bucket, key string) ([]byte, error)
- func (obj *ObjectStorage) DownloadFile(ctx context.Context, bucket, key, filePath string) error
- func (obj *ObjectStorage) ListObjects(ctx context.Context, bucket string, prefix string) ([]string, error)
- func (obj *ObjectStorage) Upload(ctx context.Context, bucket, key string, body []byte) error
- func (obj *ObjectStorage) UploadFile(ctx context.Context, bucket, key, filePath string) error
- type ObjectStorageOptions
- type PartitionManifest
- type PartitionManifestBuilder
- type PartitionManifestOptions
Constants ¶
View Source
const (
ObjectStorageAuthTypeStatic = "static"
)
Variables ¶
View Source
var ( ErrLockFailed = redsync.ErrFailed ErrLockAlreadyExpired = redsync.ErrLockAlreadyExpired ErrManifestInvalid = errors.New("manifest is invalid") ErrNoManifestFound = errors.New("no manifest found") )
Functions ¶
This section is empty.
Types ¶
type IKeyStorage ¶
type IKeyStorage interface {
AddItemsToTablePartition(context.Context, elements.Partition, [][]byte) (int64, error)
GetTablePartitionItems(context.Context, elements.Partition, int) ([]string, error)
GetTablePartitions(context.Context, string, uint64, int64) ([]elements.Partition, error)
GetTablePartitionTimestamp(context.Context, elements.Partition) (time.Time, error)
SetTablePartitionTimestamp(context.Context, elements.Partition) (bool, error)
DeleteTablePartitionTimestamp(context.Context, elements.Partition) (bool, error)
ClaimPartition(context.Context, elements.Partition, time.Duration) (ILock, error)
ReleasePartitionLock(context.Context, ILock) (bool, error)
}
type IManifestStorage ¶
type IManifestStorage interface {
GetPartitionManifest(context.Context, elements.Partition) (*PartitionManifest, error)
GetPartitionManifestFile(context.Context, *PartitionManifest, int, string) error
ReplacePartitionManifest(
context.Context,
elements.Partition,
*PartitionManifest,
*PartitionManifest, []string) error
MergePartitionRecordIntoManifest(
context.Context,
elements.Partition,
arrow.Record,
arrow.Record,
[]string,
[]string,
PartitionManifestOptions) error
}
type IObjectStorage ¶
type IObjectStorage interface {
Upload(context.Context, string, string, []byte) error
UploadFile(context.Context, string, string, string) error
Download(context.Context, string, string) ([]byte, error)
DownloadFile(context.Context, string, string, string) error
Delete(context.Context, string, string) error
ListObjects(context.Context, string, string) ([]string, error)
CreateBucket(context.Context, string) error
}
type KeyStorage ¶
type KeyStorage struct {
KeyPrefix string
// contains filtered or unexported fields
}
func NewKeyStorage ¶
func NewKeyStorage( ctx context.Context, logger *slog.Logger, options KeyStorageOptions, ) (*KeyStorage, error)
func (*KeyStorage) AcquireLock ¶
func (*KeyStorage) AddItemsToTablePartition ¶
func (*KeyStorage) ClaimPartition ¶
func (*KeyStorage) Close ¶
func (obj *KeyStorage) Close() error
func (*KeyStorage) DeleteTablePartitionTimestamp ¶
func (*KeyStorage) DerCtx ¶
func (obj *KeyStorage) DerCtx(ctx context.Context) (context.Context, context.CancelFunc)
func (*KeyStorage) GetTablePartitionItems ¶
func (*KeyStorage) GetTablePartitionTimestamp ¶
func (*KeyStorage) GetTablePartitions ¶
func (*KeyStorage) Key ¶
func (obj *KeyStorage) Key(key string) string
func (*KeyStorage) ReleaseLock ¶
func (*KeyStorage) ReleasePartitionLock ¶
func (*KeyStorage) SetTablePartitionTimestamp ¶
type KeyStorageOptions ¶
type ManifestObject ¶
type ManifestObject struct {
Key string `json:"key"`
Index int `json:"index"`
NumRows int64 `json:"num_rows"`
}
func (*ManifestObject) Validate ¶
func (obj *ManifestObject) Validate() error
type ManifestStorage ¶
type ManifestStorage struct {
IObjectStorage
// contains filtered or unexported fields
}
func NewManifestStorage ¶
func NewManifestStorage( ctx context.Context, logger *slog.Logger, mem *memory.GoAllocator, objectStorage IObjectStorage, options ManifestStorageOptions, ) *ManifestStorage
func (*ManifestStorage) GetPartitionManifest ¶
func (obj *ManifestStorage) GetPartitionManifest( ctx context.Context, partition elements.Partition, ) (*PartitionManifest, error)
func (*ManifestStorage) GetPartitionManifestFile ¶
func (obj *ManifestStorage) GetPartitionManifestFile(ctx context.Context, manifest *PartitionManifest, index int, filePath string) error
func (*ManifestStorage) MergePartitionRecordIntoManifest ¶
func (*ManifestStorage) ReplacePartitionManifest ¶
func (obj *ManifestStorage) ReplacePartitionManifest( ctx context.Context, partition elements.Partition, previousManifest *PartitionManifest, manifest *PartitionManifest, filePaths []string, ) error
type ManifestStorageOptions ¶
type ObjectStorage ¶
type ObjectStorage struct {
// contains filtered or unexported fields
}
func NewObjectStorage ¶
func NewObjectStorage( ctx context.Context, logger *slog.Logger, options ObjectStorageOptions, ) (*ObjectStorage, error)
func (*ObjectStorage) CreateBucket ¶
func (obj *ObjectStorage) CreateBucket(ctx context.Context, bucket string) error
func (*ObjectStorage) Delete ¶
func (obj *ObjectStorage) Delete(ctx context.Context, bucket, key string) error
func (*ObjectStorage) DownloadFile ¶
func (obj *ObjectStorage) DownloadFile(ctx context.Context, bucket, key, filePath string) error
func (*ObjectStorage) ListObjects ¶
func (*ObjectStorage) UploadFile ¶
func (obj *ObjectStorage) UploadFile(ctx context.Context, bucket, key, filePath string) error
type ObjectStorageOptions ¶
type ObjectStorageOptions struct {
Endpoint string
Region string
AuthKey string
AuthSecret string
UsePathStyle bool
AuthType string
}
type PartitionManifest ¶
type PartitionManifest struct {
Id string `json:"id"`
TableName string `json:"table_name"`
PartitionKey string `json:"partition_key"`
Version int `json:"version"`
Objects []ManifestObject `json:"objects"`
}
func NewManifestFromBytes ¶
func NewManifestFromBytes(data []byte) (*PartitionManifest, error)
func (*PartitionManifest) SortObjects ¶
func (obj *PartitionManifest) SortObjects()
func (*PartitionManifest) ToBytes ¶
func (obj *PartitionManifest) ToBytes() ([]byte, error)
func (*PartitionManifest) Validate ¶
func (obj *PartitionManifest) Validate() error
type PartitionManifestBuilder ¶
type PartitionManifestBuilder struct {
// contains filtered or unexported fields
}
func NewPartitionManifestBuilder ¶
func NewPartitionManifestBuilder(tableName string, partitionKey string, version int) *PartitionManifestBuilder
func (*PartitionManifestBuilder) AddFile ¶
func (obj *PartitionManifestBuilder) AddFile(pqf arrowops.ParquetFile)
func (*PartitionManifestBuilder) Files ¶
func (obj *PartitionManifestBuilder) Files() []string
func (*PartitionManifestBuilder) Manifest ¶
func (obj *PartitionManifestBuilder) Manifest() *PartitionManifest
Click to show internal directories.
Click to hide internal directories.