uploader

package
v0.28.16-only-dapper Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GCPBlockDataObjectName

func GCPBlockDataObjectName(computationResult *execution.ComputationResult) string

func WriteComputationResultsTo

func WriteComputationResultsTo(computationResult *execution.ComputationResult, writer io.Writer) error

Types

type AsyncUploader

type AsyncUploader struct {
	module.ReadyDoneAware
	// contains filtered or unexported fields
}

AsyncUploader wraps up another Uploader instance and make its upload asynchronous

func NewAsyncUploader

func NewAsyncUploader(uploader Uploader,
	retryInitialTimeout time.Duration,
	maxRetryNumber uint64,
	log zerolog.Logger,
	metrics module.ExecutionMetrics) *AsyncUploader

func (*AsyncUploader) Done

func (a *AsyncUploader) Done() <-chan struct{}

func (*AsyncUploader) Ready

func (a *AsyncUploader) Ready() <-chan struct{}

func (*AsyncUploader) SetOnCompleteCallback added in v0.28.0

func (a *AsyncUploader) SetOnCompleteCallback(onComplete OnCompleteFunc)

func (*AsyncUploader) Upload

func (a *AsyncUploader) Upload(computationResult *execution.ComputationResult) error

type BadgerRetryableUploaderWrapper added in v0.28.0

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

BadgerRetryableUploaderWrapper is the BadgerDB based implementation to RetryableUploaderWrapper

func NewBadgerRetryableUploaderWrapper added in v0.28.0

func NewBadgerRetryableUploaderWrapper(
	uploader *AsyncUploader,
	blocks storage.Blocks,
	commits storage.Commits,
	collections storage.Collections,
	events storage.Events,
	results storage.ExecutionResults,
	transactionResults storage.TransactionResults,
	uploadStatusStore storage.ComputationResultUploadStatus,
	execDataDownloader execution_data.Downloader,
	metrics module.ExecutionMetrics) *BadgerRetryableUploaderWrapper

func (*BadgerRetryableUploaderWrapper) Done added in v0.28.0

func (b *BadgerRetryableUploaderWrapper) Done() <-chan struct{}

func (*BadgerRetryableUploaderWrapper) Ready added in v0.28.0

func (b *BadgerRetryableUploaderWrapper) Ready() <-chan struct{}

func (*BadgerRetryableUploaderWrapper) RetryUpload added in v0.28.0

func (b *BadgerRetryableUploaderWrapper) RetryUpload() error

func (*BadgerRetryableUploaderWrapper) Upload added in v0.28.0

func (b *BadgerRetryableUploaderWrapper) Upload(computationResult *execution.ComputationResult) error

type BlockData

type BlockData struct {
	Block                *flow.Block
	Collections          []*entity.CompleteCollection
	TxResults            []*flow.TransactionResult
	Events               []*flow.Event
	TrieUpdates          []*ledger.TrieUpdate
	FinalStateCommitment flow.StateCommitment
}

func ComputationResultToBlockData

func ComputationResultToBlockData(computationResult *execution.ComputationResult) *BlockData

type FileUploader

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

func NewFileUploader

func NewFileUploader(dir string) *FileUploader

func (*FileUploader) Upload

func (f *FileUploader) Upload(computationResult *execution.ComputationResult) error

type GCPBucketUploader

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

func NewGCPBucketUploader

func NewGCPBucketUploader(ctx context.Context, bucketName string, log zerolog.Logger) (*GCPBucketUploader, error)

func (*GCPBucketUploader) Upload

func (u *GCPBucketUploader) Upload(computationResult *execution.ComputationResult) error

Upload uploads the computation result to the configured GCP bucket. All errors returned from this function can be considered benign.

type OnCompleteFunc added in v0.28.0

type OnCompleteFunc func(*execution.ComputationResult, error)

OnCompleteFunc is the type of function being called at upload completion.

type RetryableUploaderWrapper added in v0.28.0

type RetryableUploaderWrapper interface {
	Uploader
	RetryUpload() error
}

RetryableUploaderWrapper defines the interface for uploader that is retryable

type S3Uploader added in v0.22.8

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

S3Uploader is a S3 implementation of the uploader interface.

func NewS3Uploader added in v0.22.8

func NewS3Uploader(ctx context.Context, client *s3.Client, bucket string, log zerolog.Logger) *S3Uploader

NewS3Uploader returns a new S3 uploader instance.

func (*S3Uploader) Upload added in v0.22.8

func (u *S3Uploader) Upload(result *execution.ComputationResult) error

Upload uploads the given computation result to the configured S3 bucket.

type Uploader

type Uploader interface {
	Upload(computationResult *execution.ComputationResult) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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