本文介绍了是否有可能在mongo中获得地图缩小进度通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在蒙哥,Map Reduce很慢.那是给定的.因此,我想知道是否有可能收到地图缩小进度通知.
Map Reduce is slow in Mongo. That is a given. So, I am wondering if it is possible to receive map reduce progress notifications.
谢谢.
推荐答案
我不知道任何内置功能.但是,您可以在单独的脚本中偶尔运行一次db.currentOp()
,读取map-reduce进度并通知相关方.
I don't know about any built-in features. You could, however, in a separate script run db.currentOp()
every once in a while, read map-reduce progress and notify concerned parties.
这是我所看到的示例:
> db.currentOp()
{
"inprog" : [
{
"opid" : 249198781,
"active" : true,
"lockType" : "read",
"waitingForLock" : false,
"secs_running" : 14,
"op" : "query",
"ns" : "mydb.mycoll",
"query" : {
"mapreduce" : "mycoll",
"map" : function cf__9__f_() {
emit(this.aid, 1);
},
"reduce" : function cf__10__f_(k, vals) {
var result = 0;
vals.forEach(function (v) {result += v;});
return result;
},
"out" : {
"inline" : 1
}
},
"client" : "127.0.0.1:44254",
"desc" : "conn",
"threadId" : "0x7e98f24e4700",
"connectionId" : 1958947,
"msg" : "m/r: (1/3) emit phase 644165/7670157 8%",
"progress" : {
"done" : 644165,
"total" : 7670157
},
"numYields" : 644
}
]
}
这篇关于是否有可能在mongo中获得地图缩小进度通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!