common

package
v0.0.0-...-d12220c Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolID    = "/ipfs/mapreduce"
	MaxRetries    = 3
	MaxGoRoutines = 250

	// Master
	NoOfProviders              = 5
	MasterMapOutputFuncName    = "ProcessMapOutput"
	MasterReduceOutputFuncName = "ProcessReduceOutput"
	MasterServiceName          = "Master"

	// Mapper
	MapFuncName    = "Map"
	MapServiceName = "MapService"

	// Reducer
	ReduceFuncName    = "Reduce"
	ReduceServiceName = "ReduceService"
)

Variables

This section is empty.

Functions

func AddFile

func AddFile(ctx context.Context, node *core.IpfsNode, filePath string) (cid.Cid, error)

func GetFile

func GetFile(ctx context.Context, node *core.IpfsNode, fileCid string) (files.Node, error)

func GetInTmpFile

func GetInTmpFile(ctx context.Context, node *core.IpfsNode, fileCid string) (*os.File, error)

func GetPeerFromId

func GetPeerFromId(peerId string) (peerstore.AddrInfo, error)

func GetPlugin

func GetPlugin(ctx context.Context, node *core.IpfsNode, fileCid string) (*plugin.Plugin, error)

func Ihash

func Ihash(key string) int

func WriteToTmp

func WriteToTmp(ctx context.Context, rootNode files.Node) (*os.File, error)

Types

type Empty

type Empty struct {
}

type KeyValue

type KeyValue struct {
	Key   string
	Value string
}

type MapInput

type MapInput struct {
	FuncFileCid  string
	NoOfReducers int
	DataFileCid  string
	MasterPeerId string
}

type MapOutput

type MapOutput struct {
	DataFileCid string
	KvFileCids  []string
}

type ReduceInput

type ReduceInput struct {
	FuncFileCid  string
	KvFileCids   []string
	MasterPeerId string
	ReducerNo    int
}

type ReduceOutput

type ReduceOutput struct {
	ReducerNo     int
	OutputFileCid string
}

Jump to

Keyboard shortcuts

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