v3ioutils

package
v0.6.5-v0.9.10 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2019 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"
)

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, workers int, ignoreMissing bool) error

DeleteTable deletes a table

func NewContainer

func NewContainer(session *frames.Session, password string, token string, logger logger.Logger, workers int) (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) (*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 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"`
	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 NewSchema

func NewSchema(key string) V3ioSchema

NewSchema returns a new schema

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