recordwriter

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2020 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultClusteredPathbuilder added in v0.0.9

func DefaultClusteredPathbuilder(record interface{}, partition int) string

DefaultClusteredPathbuilder builds a path from the GetPartitions + an incremntal partition id.

func DefaultPathbuilder

func DefaultPathbuilder(record interface{}) string

DefaultPathbuilder builds a path from the GetPartitions

func NewLineJSON

func NewLineJSON(
	it iterator.RecordIterator,
	w io.Writer,
) error

NewLineJSON writes all the records from the records iterator as newline json to the writer. returns the first error from either the record iterator or the json encoding.

func NewLineJSONClustered added in v0.0.9

func NewLineJSONClustered(
	it iterator.LesserIteratorClustered,
	wf writerfactory.WriterFactory,
	pathBuilder func(record interface{}, partition int) string,
) error

NewLineJSONClustered extracts possible partitions from the records yeilded by the sorted iterator and writes them to the cache (and underlying writer) with the cluster-ids which guarrantees sorted order within each cluster Note the writers will NOT be closed by NewLineJSONClustered; that should be handled after it has been returned; as such it is usefull to use a writercache.Cache{}

func NewLineJSONPartitioned

func NewLineJSONPartitioned(
	it iterator.RecordIterator,
	wf writerfactory.WriterFactory,
	pathBuilder func(record interface{}) string,
) error

NewLineJSONPartitioned extracts possible partitions from the records yeilded by the iterator and writes them to the cache (and underlying writer) under the key {record.GetPartitions().ToPartitionKey()}/unsorted_records_s{suffix}.json

Types

This section is empty.

Jump to

Keyboard shortcuts

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