base

package
v3.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LABEL_LABEL   = ":LABEL"
	LABEL_VID     = ":VID"
	LABEL_SRC_VID = ":SRC_VID"
	LABEL_DST_VID = ":DST_VID"
	LABEL_RANK    = ":RANK"
	LABEL_IGNORE  = ":IGNORE"
)
View Source
const STAT_FILEDONE string = "FILEDONE"

Variables

This section is empty.

Functions

func ExtractFilename

func ExtractFilename(uri string) (local bool, filename string, err error)

func FileExists

func FileExists(filename string) bool

func FormatFilePath

func FormatFilePath(filepath string) (path string, err error)

func HasHttpPrefix

func HasHttpPrefix(path string) bool

func IsValidType

func IsValidType(t string) bool

func MustCreateFile

func MustCreateFile(filePath string) *os.File

Types

type ClientRequest

type ClientRequest struct {
	Stmt  string
	ErrCh chan<- ErrData
	Data  []Data
}

type Data

type Data struct {
	Type   OpType
	Record Record
	Bytes  int
}

func DeleteData

func DeleteData(record Record, bytes int) Data

func FinishData

func FinishData() Data

func HeaderData

func HeaderData(record Record, bytes int) Data

func InsertData

func InsertData(record Record, bytes int) Data

type ErrData

type ErrData struct {
	Error error
	Data  []Data
}

type OpType

type OpType int
const (
	DONE   OpType = 0
	INSERT OpType = 1
	DELETE OpType = 2
	HEADER OpType = 100
)

func (OpType) String

func (op OpType) String() string

type Record

type Record []string

type ResponseData

type ResponseData struct {
	Error error
	Stats Stats
}

type StatType

type StatType int
const (
	SUCCESS  StatType = 0
	FAILURE  StatType = 1
	FILEDONE StatType = 2
	OUTPUT   StatType = 3
)

type Stats

type Stats struct {
	Type          StatType
	Latency       int64
	ReqTime       int64
	BatchSize     int
	ImportedBytes int64
	Filename      string
}

func NewFailureStats

func NewFailureStats(batchSize int, importedBytes int64) Stats

func NewFileDoneStats

func NewFileDoneStats(filename string) Stats

func NewOutputStats

func NewOutputStats() Stats

func NewSuccessStats

func NewSuccessStats(latency int64, reqTime int64, batchSize int, importedBytes int64) Stats

type Stmt

type Stmt struct {
	Stmt string
	Data [][]interface{}
}

type Stoppable

type Stoppable interface {
	Stop()
}

Jump to

Keyboard shortcuts

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