object

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxBucketNameLength = 16
	MaxKeyLength        = 12
	KeyShortPrefix      = "ov"
	// len(KeyShortPrefix) + 2 (for process ID) + 2 (for worker ID)
	KeyPrefixLength = 6
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Object

type Object struct {
	Key        string `json:"key"`
	Size       int    `json:"size"`
	WriteCount int    `json:"writeCount"`
}

func NewObject

func NewObject(objID int64) *Object

func (*Object) Clear

func (obj *Object) Clear()

type ObjectMeta added in v0.4.0

type ObjectMeta struct {
	ObjectList        []Object `json:"objectList"`
	ExistingObjectIDs []int64  `json:"existingObjectIDs"`

	KeyIDOffset int64 `json:"keyIDOffset"`
	KeyPrefix   string
	// contains filtered or unexported fields
}

func NewObjectMeta added in v0.5.3

func NewObjectMeta(numObj int, keyIDOffset int64) *ObjectMeta

func (*ObjectMeta) Exist added in v0.4.0

func (om *ObjectMeta) Exist(key string) bool

func (*ObjectMeta) GetExistingRandomObject added in v0.4.0

func (om *ObjectMeta) GetExistingRandomObject() *Object

func (*ObjectMeta) GetHeadAndTailKey added in v0.4.0

func (om *ObjectMeta) GetHeadAndTailKey() (string, string)

func (*ObjectMeta) GetRandomObject added in v0.4.0

func (om *ObjectMeta) GetRandomObject() *Object

func (*ObjectMeta) PopExistingRandomObject added in v0.4.0

func (om *ObjectMeta) PopExistingRandomObject() *Object

func (*ObjectMeta) RegisterToExistingList added in v0.4.0

func (om *ObjectMeta) RegisterToExistingList(key string)

Caution: this function should be called while the object lock is acquired.

func (*ObjectMeta) TidyUp added in v1.0.0

func (om *ObjectMeta) TidyUp()

Jump to

Keyboard shortcuts

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