mapreduce

package module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

README

mrkit-go

github build status Go Reference

mrkit-go is a MapReduce toolkit in Go with a config-driven batch runner.

Primary path for new users:

  • define source / transform / sink in JSON
  • run ./cmd/batch with that config
  • support MySQL/Redis source and sink combinations

Quickstart (Config-Driven)

1) Prepare demo data (optional)
MYSQL_HOST=localhost MYSQL_PORT=3306 MYSQL_USER=root MYSQL_PASSWORD=123456 \
MYSQL_DB=mysql SOURCE_TABLE=source_events TARGET_TABLE=agg_results \
ROWS=5000 KEY_MOD=100 \
go run ./cmd/batch -mode prepare
2) Validate a config
go run ./cmd/batch -check -config example/batch-minimal/flows/smoke/flow.mysql.count.json
3) Run a flow
go run ./cmd/batch -config example/batch-minimal/flows/smoke/flow.mysql.count.json

For cross-DB, seed, benchmark, and plugin scenarios, use the docs below.

Quickstart (Docker)

Build local image:

docker build -t mrkit-go-batch:local .

Validate config in container:

docker run --rm \
  -v "$(pwd)/example/batch-minimal/flows:/app/flows:ro" \
  mrkit-go-batch:local \
  -check -config /app/flows/smoke/flow.mysql.count.json

Run flow in container (use host.docker.internal for local DB access):

docker run --rm \
  -v "$(pwd)/example/batch-minimal/flows:/app/flows:ro" \
  -e MYSQL_HOST=host.docker.internal \
  -e MYSQL_PORT=3306 \
  -e MYSQL_USER=root \
  -e MYSQL_PASSWORD=123456 \
  -e MYSQL_DB=mysql \
  mrkit-go-batch:local \
  -config /app/flows/smoke/flow.mysql.count.json

Performance note: use go run for development checks, and prebuilt binaries (go build then run) for production/performance benchmarking.

Documentation Map

Contributions

Pull requests are always welcome.

Created and improved by Yi-fei Gao. All code is licensed under the Apache License 2.0.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MasterIP string = ":10000"

Functions

func ParseArg

func ParseArg() ([]string, string, int, int, bool)

func StartMaster

func StartMaster(input []string, plugin string, nReducer int, nWorker int, inRAM bool)

func StartMasterWithAddr added in v1.0.4

func StartMasterWithAddr(input []string, plugin string, nReducer int, nWorker int, inRAM bool, masterAddr string) error

func StartSingleMachineJob

func StartSingleMachineJob(input []string, plugin string, nReducer int, nWorker int, inRAM bool)

func StartSingleMachineJobWithAddr added in v1.0.4

func StartSingleMachineJobWithAddr(input []string, plugin string, nReducer int, nWorker int, inRAM bool, masterAddr string) error

func StartWorker

func StartWorker(input []string, plugin string, nReducer int, nWorker int, storeInRAM bool)

func StartWorkerWithAddr added in v1.0.4

func StartWorkerWithAddr(input []string, plugin string, nReducer int, nWorker int, storeInRAM bool, masterAddr string) error

Types

This section is empty.

Directories

Path Synopsis
cmd
batch command
legacy/main command
legacy/master command
legacy/worker command

Jump to

Keyboard shortcuts

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