Skip to main content

· 11 min read
therainisme

目的

本文将会仿照 Docker Container 现有的基本功能,用 Go 简单地实现自己的 Mini Container。后续章节逐步使用 Linux 的 Namespace 和 CGroups 对 Container 与宿主机进行隔离。Namespace 决定了 Container 能看见什么?CGroups 决定了 Container 能使用什么?

// docker         run image <cmd> <params>
// go run main.go run <cmd> <params>

· 35 min read
therainisme

Abstract  MapReduce is a programming model and an associated implementation for processing and generating large data sets. Users specify a map function that processes a key/value pair to generate a set of intermediate key/value pairs, and a reduce function that merges all intermediate values associated with the same intermediate key. Many real world tasks are expressible in this model, as shown in the paper......

MapReduce: Simplified Data Processing on Large Cluster 的部分翻译

· 2 min read
therainisme

全称字符串前缀哈希法,把字符串变成一个 p 进制数字(哈希值),实现不同的字符串映射到不同的数字。 对形如 X1X2...XnX_{1}X_{2} ... X_{n} 的字符串,采用字符的 ASCII 码乘上 PP 的次方来计算哈希值。

· 7 min read
therainisme

goroutine 和操作系统的线程实际上只是一个量的区别,但量变会引起质变的道理同样适用于 goroutine 和 thread。

· 11 min read
therainisme

本文将使用 httpGetBody 作为需要缓存的函数。它会进行 HTTP GET 请求,并获取 HTTP 响应 Body。这个函数的调用开销较大,现在想对每一个进行的 HTTP GET 请求的结果保存下来。