Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/myonim/go-map-reduce

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/myonim/go-map-reduce

  • v0.0.0-20220816071047-eb0b9ed278f0
  • Source
  • Go
  • Socket score

Version published
Created
Source

go-map-reduce

This is to simulate a basic Map Reduce procedure on a distributed system. host1 and host2 are machines with their request latencies log. The final result of the Map Reduce will be a file with count of latencies above one second and below one second.

func main() {
	// do map op for both hosts
	// this simulates a distributed systems
	go doMap(HOSTS[0])
	go doMap(HOSTS[1])
	time.Sleep(time.Second)
	Shuffle(HOSTS)
	reduceInput := getReduceInput()
	Reduce(reduceInput)
}

Map function is called on both hosts. Here, the call is concurrent because in a distributed systems, every machine would call the Map function simultaneously. After doMap the Shuffle function is called to create the intermediate arguments for the reduce function. Finally, the Reduce function is called and generates the required result inside reduce_results/result.txt file.

FAQs

Package last updated on 16 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc