reader

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: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

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

func NewBatch

func NewBatch(mgr *BatchMgr, bufferSize int, clientReq chan base.ClientRequest, errCh chan<- base.ErrData) *Batch

func (*Batch) Add

func (b *Batch) Add(data base.Data)

func (*Batch) Done

func (b *Batch) Done()

func (*Batch) IsFull

func (b *Batch) IsFull() bool

func (*Batch) SendErrorData

func (b *Batch) SendErrorData(d base.Data, err error)

type BatchMgr

type BatchMgr struct {
	Schema           *config.Schema
	Batches          []*Batch
	InsertStmtPrefix string
	// contains filtered or unexported fields
}

func NewBatchMgr

func NewBatchMgr(schema *config.Schema, batchSize int, clientRequestChs []chan base.ClientRequest, errCh chan<- base.ErrData) *BatchMgr

func (*BatchMgr) Add

func (bm *BatchMgr) Add(data base.Data, runnerLogger *logger.RunnerLogger) error

func (*BatchMgr) Done

func (bm *BatchMgr) Done()

func (*BatchMgr) GeneratePropsString

func (bm *BatchMgr) GeneratePropsString(props []*config.Prop) string

func (*BatchMgr) InitSchema

func (bm *BatchMgr) InitSchema(header base.Record, runnerLogger *logger.RunnerLogger) (err error)

func (*BatchMgr) MakeEdgeStmt

func (m *BatchMgr) MakeEdgeStmt(batch []base.Data) (string, error)

func (*BatchMgr) MakeVertexStmt

func (m *BatchMgr) MakeVertexStmt(batch []base.Data) (string, error)

type DataFileReader

type DataFileReader interface {
	InitReader(*os.File, *logger.RunnerLogger)
	ReadLine() (base.Data, error)
	TotalBytes() (int64, error)
}

type FileReader

type FileReader struct {
	FileIdx int
	File    *config.File

	WithHeader  bool
	DataReader  DataFileReader
	Concurrency int
	BatchMgr    *BatchMgr
	StopFlag    bool
	// contains filtered or unexported fields
}

FIXME: private fields

func New

func New(fileIdx int, file *config.File, cleanup bool, clientRequestChs []chan base.ClientRequest,
	errCh chan<- base.ErrData, runnerLogger *logger.RunnerLogger) (*FileReader, error)

func (*FileReader) Read

func (r *FileReader) Read() (numErrorLines int64, err error)

func (*FileReader) Stop

func (r *FileReader) Stop()

Jump to

Keyboard shortcuts

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