httpuploader

package
v0.0.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const MemReserveFactor = 1.2

Variables

This section is empty.

Functions

func MarshalCItoJSON

func MarshalCItoJSON(row abstract.ChangeItem, rules *MarshallingRules, buf *bytes.Buffer) error

Types

type GFMap

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

func NewGrishaFMap

func NewGrishaFMap(names []string, input map[string]int) *GFMap

NewGrishaFMap is a lookuper for name indexes, we accept expected order of names the idea is to have map lookup only when it's needed, i.e. when order of names is not a same as key this give guite a huge perf boost, map lookup on certain json-marshal workloads may consume up to 35% of CPU map named in honor to @GrigoryPervakov, since he was the one who suggest this hack.

func (*GFMap) Lookup

func (g *GFMap) Lookup(key string, expectedPos int) (int, bool)

type MarshallingRules

type MarshallingRules struct {
	ColSchema      []abstract.ColSchema
	ColNameToIndex map[string]int
	ColTypes       columntypes.TypeMapping
	AnyAsString    bool
	// contains filtered or unexported fields
}

func NewRules

func NewRules(names []string, colSchema []abstract.ColSchema, colNameToIndex map[string]int, colTypes columntypes.TypeMapping, anyAsString bool) *MarshallingRules

func (*MarshallingRules) SetColType

func (r *MarshallingRules) SetColType(name string, description *columntypes.TypeDescription)

type UploadStats

type UploadStats struct {
	Bytes           int
	StartTime       time.Time
	UploadStartTime time.Time
}

func UploadCIBatch

func UploadCIBatch(
	batch []abstract.ChangeItem,
	rules *MarshallingRules,
	config model.ChSinkServerParams,
	table string,
	avgRowSize int,
	lgr log.Logger) (*UploadStats, error)

Jump to

Keyboard shortcuts

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