【发布时间】:2018-01-24 09:19:18
【问题描述】:
实际上我有一组 json 文件(即总计:1M,大小为 500MB)。每个 json 文件有 18 个 Key。我尝试使用下面的 Javascript 实现信封模式
'use strict';
declareUpdate()
var docs = fn.collection("input");
for(var doc of docs) {
var transformed = {};
transformed.Metadata = { "Last Used" : ""};
transformed.Updated = { "University" : "UCLA"}
transformed.Source = doc; //Sending original data under Source section
xdmp.nodeReplace(doc,transformed)
}
我尝试使用 marklogic 9 的 JAVA API 调用此 JS.sjs。但我遇到以下错误:
Exception in thread "main" com.marklogic.client.FailedRequestException: Local message: failed to apply resource at invoke: Internal Server Error. Server Message: XDMP-EXPNTREECACHEFULL: for(var doc of docs) { -- Expanded tree cache full on host localhost uri file.json-0-968991
at com.marklogic.client.impl.OkHttpServices.checkStatus(OkHttpServices.java:4317)
at com.marklogic.client.impl.OkHttpServices.postIteratedResourceImpl(OkHttpServices.java:3831)
at com.marklogic.client.impl.OkHttpServices.postEvalInvoke(OkHttpServices.java:3768)
at com.marklogic.client.impl.ServerEvaluationCallImpl.eval(ServerEvaluationCallImpl.java:164)
at com.marklogic.client.impl.ServerEvaluationCallImpl.eval(ServerEvaluationCallImpl.java:153)
at com.marklogic.client.impl.ServerEvaluationCallImpl.evalAs(ServerEvaluationCallImpl.java:144)
at bulkimport.Tsm.main(Tsm.java:19)
我查看了 MarkLogic Documentation,他们提到了解决此错误的方法。之后我将expanded tree cache size* 增加到2048,但我仍然面临同样的错误。
如何通过上述代码(即JS.sjs)进行优化以避免此错误?
感谢任何帮助。
【问题讨论】:
标签: javascript marklogic java