gio

package
v0.0.0-...-08a93fc Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HasInitalized bool
)

Functions

func Emit

func Emit(anyObject ...interface{}) error

Emit encode and write a row of data to os.Stdout

func Init

func Init()

Init determines whether the driver program will execute the mapper/reducer or not. If the command line invokes the mapper or reducer, execute it and exit. This function will invoke flag.Parse() first.

func ListRegisteredFunctions

func ListRegisteredFunctions()

ListRegisteredFunctions lists out all registered mappers and reducers

func ToBytes

func ToBytes(val interface{}) []byte

func ToFloat64

func ToFloat64(val interface{}) float64

func ToInt64

func ToInt64(val interface{}) int64

func ToString

func ToString(val interface{}) string

func TsEmit

func TsEmit(ts int64, anyObject ...interface{}) error

TsEmit encode and write a row of data to os.Stdout with ts in milliseconds epoch time

func TsEmitKV

func TsEmitKV(ts int64, keys, values []interface{}) error

Types

type Mapper

type Mapper func([]interface{}) error

type MapperId

type MapperId string

func RegisterMapper

func RegisterMapper(fn Mapper) MapperId

RegisterMapper register a mapper function to process a command

type MapperObject

type MapperObject struct {
	Mapper Mapper
	Name   string
}

func GetMapper

func GetMapper(mapperId MapperId) (mapper MapperObject, found bool)

type Reducer

type Reducer func(x, y interface{}) (interface{}, error)

type ReducerId

type ReducerId string

func RegisterReducer

func RegisterReducer(fn Reducer) ReducerId

type ReducerObject

type ReducerObject struct {
	Reducer Reducer
	Name    string
}

func GetReducer

func GetReducer(reducerId ReducerId) (reducer ReducerObject, found bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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