<p>I have several Map/Reduce style programs, written in Ruby, using STDIN/STDOUT. For example, something like this:</p>
<pre><code>cat input.csv | mapper.rb | sort | reducer.rb > output.csv
</code></pre>
<p>Is Go good for this style of application? Does anyone know where I can find examples? </p>
<hr/>**评论:**<br/><br/>dr_borges: <pre><p>I've been working on a proof of concept project (<a href="https://github.com/drborges/rivers" rel="nofollow">https://github.com/drborges/rivers</a>) for data stream processing built on top of the Go pipeline pattern <a href="https://blog.golang.org/pipelines" rel="nofollow">https://blog.golang.org/pipelines</a> along with some Producer-Consumer concepts that might (perhaps slightly) fit your use case (any feedback is very welcome).</p>
<p>There are other packages that provide very interesting solutions you may wanna check for instance:</p>
<p><a href="https://labix.org/pipe" rel="nofollow">https://labix.org/pipe</a></p>
<p>Also Go stdlib has pretty useful packages that make it easy to build composable programs similar to your use case - <a href="https://golang.org/src/io/pipe.go" rel="nofollow">https://golang.org/src/io/pipe.go</a></p>
<p>Hope that helps.</p></pre>tv64738: <pre><p>That's just <code>os.Stdin</code> and <code>os.Stdout</code> with something like <a href="https://golang.org/pkg/bufio/#example_Scanner_lines">https://golang.org/pkg/bufio/#example_Scanner_lines</a> or <a href="https://golang.org/pkg/encoding/json/#Decoder.Decode">https://golang.org/pkg/encoding/json/#Decoder.Decode</a></p></pre>dgryski: <pre><p>I've implemented a library that can be used for map/reduce style jobs, and also as a hadoop client: <a href="https://github.com/dgryski/dmrgo" rel="nofollow">https://github.com/dgryski/dmrgo</a></p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传