slava-vishnyakov/map-reduce
Composer 安装命令:
composer require slava-vishnyakov/map-reduce
包简介
MapReduce implementation
README 文档
README
To install:
composer require slava-vishnyakov/map-reduce
use \SlavaVishnyakov\MapReduce\MapReduceMemory; $m = new MapReduceMemory(); // or MapReduceProcess $m->send('a', 1); $m->send('b', 1); $m->send('a', 2); foreach($m->iter() as $key => $groups) { // yields $key = 'a', $groups = [1,2] $key = 'b', $groups = [1]
Also can be done via next() calls:
$m = new MapReduceMemory(); // or MapReduceProcess $m->send('a', 1); $m->send('b', 1); $m->send('a', 2); $m->send('a', new stdClass); $m->next() ==> ['a', [1, 2, new stdClass]] $m->next() ==> ['b', [1]] $m->next() ==> null
There are two implementations MapReduceMemory and MapReduceProcess.
The first does all sorting in memory, the second is for memory-hungry workloads, uses /usr/bin/sort to
process basically unlimited amount of data.
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-04-17