v3ioutils

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LongType   = "long"
	DoubleType = "double"
	StringType = "string"
	TimeType   = "timestamp"
	BoolType   = "boolean"

	DefaultKeyColumn = "idx"
)

Variables

This section is empty.

Functions

func AsInt64Array

func AsInt64Array(val []byte) []uint64

AsInt64Array convert v3io blob to Int array

func ConvertDTypeToString

func ConvertDTypeToString(dType frames.DType) string

func DeleteTable

func DeleteTable(logger logger.Logger, container v3io.Container, path, filter string, getItemsWorkers int, deleteWorkers int, ignoreMissing bool) error

DeleteTable deletes a table

func NewContainer

func NewContainer(v3ioContext v3io.Context,
	session *frames.Session,
	password string,
	token string,
	logger logger.Logger) (v3io.Container, error)

func ProcessPaths

func ProcessPaths(session *frames.Session, path string, addSlash bool) (string, string, error)

Types

type AsyncItemsCursor

type AsyncItemsCursor struct {
	Cnt int
	// contains filtered or unexported fields
}

AsyncItemsCursor is async item cursor

func NewAsyncItemsCursor

func NewAsyncItemsCursor(container v3io.Container, input *v3io.GetItemsInput, workers int, shardingKeys []string,
	logger logger.Logger, limit int, partitions []string,
	sortKeyRangeStart string, sortKeyRangeEnd string) (*AsyncItemsCursor, error)

NewAsyncItemsCursor return new AsyncItemsCursor

func (*AsyncItemsCursor) All

func (ic *AsyncItemsCursor) All() ([]v3io.Item, error)

All returns all items

func (*AsyncItemsCursor) Err

func (ic *AsyncItemsCursor) Err() error

Err returns the last error

func (*AsyncItemsCursor) GetField

func (ic *AsyncItemsCursor) GetField(name string) interface{}

GetField returns a field

func (*AsyncItemsCursor) GetFieldInt

func (ic *AsyncItemsCursor) GetFieldInt(name string) (int, error)

GetFieldInt returns a field as int

func (*AsyncItemsCursor) GetFieldString

func (ic *AsyncItemsCursor) GetFieldString(name string) (string, error)

GetFieldString returns a field as string

func (*AsyncItemsCursor) GetFields

func (ic *AsyncItemsCursor) GetFields() map[string]interface{}

GetFields returns all fields

func (*AsyncItemsCursor) GetItem

func (ic *AsyncItemsCursor) GetItem() v3io.Item

GetItem returns item

func (*AsyncItemsCursor) Next

func (ic *AsyncItemsCursor) Next() bool

Next gets the next matching item. this may potentially block as this lazy loads items from the collection

func (*AsyncItemsCursor) NextItem

func (ic *AsyncItemsCursor) NextItem() (v3io.Item, error)

NextItem gets the next matching item. this may potentially block as this lazy loads items from the collection

func (*AsyncItemsCursor) Release

func (ic *AsyncItemsCursor) Release()

Release releases a cursor and its underlying resources

type FileContentIterator added in v0.7.6

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

func NewFileContentIterator added in v0.7.6

func NewFileContentIterator(path string, bytesStep int, container v3io.Container, logger logger.Logger) (*FileContentIterator, error)

func (*FileContentIterator) At added in v0.7.6

func (iter *FileContentIterator) At() []byte

func (*FileContentIterator) Error added in v0.7.6

func (iter *FileContentIterator) Error() error

func (*FileContentIterator) Next added in v0.7.6

func (iter *FileContentIterator) Next() bool

type FileContentLineIterator added in v0.7.6

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

func NewFileContentLineIterator added in v0.7.6

func NewFileContentLineIterator(path string, bytesStep int, container v3io.Container, logger logger.Logger) (*FileContentLineIterator, error)

func (*FileContentLineIterator) At added in v0.7.6

func (iter *FileContentLineIterator) At() []byte

func (*FileContentLineIterator) Error added in v0.7.6

func (iter *FileContentLineIterator) Error() error

func (*FileContentLineIterator) Next added in v0.7.6

func (iter *FileContentLineIterator) Next() bool

type FileCursor added in v0.7.9

type FileCursor interface {
	Err() error
	Next() bool
	GetFilePath() string
}

func NewFilesCursor added in v0.7.9

func NewFilesCursor(container v3io.Container, input *v3io.GetContainerContentsInput) (FileCursor, error)

type FilesCursor added in v0.7.9

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

func (*FilesCursor) Err added in v0.7.9

func (ic *FilesCursor) Err() error

error returns the last error

func (*FilesCursor) GetFilePath added in v0.7.9

func (ic *FilesCursor) GetFilePath() string

func (*FilesCursor) Next added in v0.7.9

func (ic *FilesCursor) Next() bool

Next gets the next matching item. this may potentially block as this lazy loads items from the collection

type ItemsCursor

type ItemsCursor interface {
	Err() error
	Next() bool
	GetField(name string) interface{}
	GetFields() map[string]interface{}
}

ItemsCursor iterates over items

type OldSchemaField

type OldSchemaField struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Nullable bool   `json:"nullable"`
}

OldSchemaField is OldV3ioSchema field

func ContainsField

func ContainsField(fields []OldSchemaField, fieldName string) (bool, OldSchemaField)

type OldV3ioSchema

type OldV3ioSchema struct {
	Fields           []OldSchemaField `json:"fields"`
	Key              string           `json:"key"`
	SortingKey       string           `json:"sortingKey,omitempty"`
	HashingBucketNum int              `json:"hashingBucketNum"`
}

OldV3ioSchema is old v3io schema

func (*OldV3ioSchema) AddColumn

func (s *OldV3ioSchema) AddColumn(name string, col frames.Column, nullable bool) error

AddColumn adds a column

func (*OldV3ioSchema) AddField

func (s *OldV3ioSchema) AddField(name string, val interface{}, nullable bool) error

AddField adds a field

func (*OldV3ioSchema) GetField

func (s *OldV3ioSchema) GetField(name string) (OldSchemaField, error)

func (*OldV3ioSchema) UpdateSchema

func (s *OldV3ioSchema) UpdateSchema(container v3io.Container, tablePath string, newSchema V3ioSchema) error

UpdateSchema updates the schema

type V3ioSchema

type V3ioSchema interface {
	AddColumn(name string, col frames.Column, nullable bool) error
	AddField(name string, val interface{}, nullable bool) error
	UpdateSchema(container v3io.Container, tablePath string, newSchema V3ioSchema) error
}

V3ioSchema is schema for v3io

func GetSchema

func GetSchema(tablePath string, container v3io.Container) (V3ioSchema, error)

func NewSchema

func NewSchema(key string, sortingKey string) V3ioSchema

NewSchema returns a new schema

func NewSchemaWithHashingBuckets added in v0.8.0

func NewSchemaWithHashingBuckets(key string, sortingKey string, hashingBucketNum int) V3ioSchema

func SchemaFromJSON

func SchemaFromJSON(data []byte) (V3ioSchema, error)

SchemaFromJSON return a schema from JSON data

Jump to

Keyboard shortcuts

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