客户端使用websockets连接到nodejs托管的多维数据集计算器。
当限制设置为超过900时,服务器会出现以下错误:
// Copyright Joyent, Inc. and other Node contributors.
^
RangeError: Maximum call stack size exceeded
代码直接从网站入门指南中复制,即
客户var socket = new WebSocket("ws://nodeserver/1.0/event/get");
socket.onopen = startReceiving;
function startReceiving() {
var yesterday = new Date();
yesterday.setDate(yesterday.getDate() - 1);
var startDate = yesterday.getTime();
socket.send(JSON.stringify({
"expression": "some_event(param1,param2,param3,param4).eq(param1,'SomeValue')",
"start": startDate,
limit: 20000
}));
socket.send(JSON.stringify({
"expression": "someother_event(param1,param2,param3,param4).eq(param1,'SomeOtherValue')",
"start": startDate,
limit: 20000
}));
}
socket.onmessage = function (message) {
var event = JSON.parse(message.data);
// Do something with event
};
服务器var cube = require("cube");
var appConfig = require('./server.config.js');
var evaluatorOptions = appConfig.evaluatorOptions;
var registerServer = function(options, cubeSubject) {
var server = cube.server(options);
server.register = function(db, endpoints) {
cubeSubject.register(db, endpoints);
};
server.start();
};
registerServer(evaluatorOptions, cube.evaluator);
谁能建议我在这里做错了什么? 获取最新版本的多维数据集库解决了上述问题。
在我的例子中,递归是由rollopJoin引起的,它在自己的rollup 数组中被引用。
myCombinedRollup: {
type: `rollupJoin`,
rollups: [ OtherCube.someRollup, CUBE.myCombinedRollup ],
//...
}
一旦我将其更改为引用另一个rollup,我得到了一个不同的错误:)
myCombinedRollup: {
type: `rollupJoin`,
rollups: [ OtherCube.someRollup, CUBE.differentRollup ],
//...
}