piecestore

package
v0.1.1-pprof-3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// S3Store defines storage type for s3
	S3Store = "s3"
	// MinioStore defines storage type for minio
	MinioStore = "minio"
	// DiskFileStore defines storage type for file
	DiskFileStore = "file"
	// MemoryStore defines storage type for memory
	MemoryStore = "memory"
)

define storage type constants

View Source
const (
	// AKSKIAMType defines IAM type config which uses access key and secret key to access aws s3
	AKSKIAMType = "AKSK"
	// SAIAMType defines IAM type config which uses service account to access aws s3
	SAIAMType = "SA"

	// AWSRoleARN defines env variable for aws role arn
	AWSRoleARN = "AWS_ROLE_ARN"
	// AWSWebIdentityTokenFile defines env variable for aws identity token file
	AWSWebIdentityTokenFile = "AWS_WEB_IDENTITY_TOKEN_FILE"

	// BucketURL defines env variable name for bucket url
	BucketURL = "BUCKET_URL"
	// AWSAccessKey defines env variable name for aws access key
	AWSAccessKey = "AWS_ACCESS_KEY"
	// AWSSecretKey defines env variable name for aws secret key
	AWSSecretKey = "AWS_SECRET_KEY"
	// AWSSessionToken defines env variable name for aws session token
	AWSSessionToken = "AWS_SESSION_TOKEN"

	// MinioRegion defines env variable name for minio region
	MinioRegion = "MINIO_REGION"
	// MinioAccessKey defines env variable name for minio access key
	MinioAccessKey = "MINIO_ACCESS_KEY"
	// MinioSecretKey defines env variable name for minio secret key
	MinioSecretKey = "MINIO_SECRET_KEY"
	// MinioSessionToken defines env variable name for minio session token
	MinioSessionToken = "MINIO_SESSION_TOKEN"
)

piece store storage config and environment constants

View Source
const (
	// BufPoolSize define buffer pool size
	BufPoolSize = 32 << 10
	// ChecksumAlgo define validation algorithm name
	ChecksumAlgo = "Crc32c"
)

define piece store constants.

Variables

This section is empty.

Functions

func CheckECPieceKey

func CheckECPieceKey(keys []string) bool

CheckECPieceKey checks EC piece key is correct

func CheckSegmentPieceKey

func CheckSegmentPieceKey(keys []string) bool

CheckSegmentPieceKey checks ec piece key is correct

func ComputeApproximatePieceSize added in v0.1.1

func ComputeApproximatePieceSize(object *storagetypes.ObjectInfo, maxSegmentPieceSize uint64, dataChunkNum uint32,
	pieceType model.PieceType, idx uint32) (int, error)

ComputeApproximatePieceSize return the size of piece data

func ComputeSegmentCount

func ComputeSegmentCount(size uint64, spiltSize uint64) uint32

ComputeSegmentCount return the segments count by payload size.

func DecodeECPieceKey

func DecodeECPieceKey(pieceKey string) (uint64, uint32, uint32, error)

DecodeECPieceKey decodes ec piece store key Valid EC piece key: objectID_s0_p0

func DecodeSegmentPieceKey

func DecodeSegmentPieceKey(pieceKey string) (uint64, uint32, error)

DecodeSegmentPieceKey decodes segment piece store key Valid segment piece key: objectID_s0

func EncodeECPieceKey

func EncodeECPieceKey(objectID uint64, segmentIndex, ecIndex uint32) string

EncodeECPieceKey encodes ec piece store key

func EncodeSegmentPieceKey

func EncodeSegmentPieceKey(objectID uint64, segmentIndex uint32) string

EncodeSegmentPieceKey encodes segment piece store key

Types

This section is empty.

Jump to

Keyboard shortcuts

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