既存の ActivePivot キューブに新しいメジャーを追加しようとしています。Sanbox プロジェクトにメジャーを追加し始めました。うまくいきました。新しいメジャーを見ることができ、すべての要素の合計を取得しました。次の行を追加しました。
EquityDerivativesCube.xml:
<measure name="test" aggregationFunctions="SUM"/>
SandboxFields.xml:
<field name="test" type="double" defaultValue="0" />
PNLCalculator#PNLCalculatorResult.java
private Double test;
public Double getTest() {
return test;
}
public void setTest(Double test) {
this.test = test;
}
PNLCalculator.enrichTrade()
...
result.setTest(2.);
...
Real-World-Application では、このアプローチはうまく機能しません。次の行を追加しました。
に
RealWorldApplicationCube.xml
<measure name="Test" aggregationFunctions="SUM" folder="Dev\Test" />
の中へ
RealWorldApplicationSchema.xml
<field name="Test" type="double" defaultValue="0" />
データは CSV ファイルから読み込まれます。アプリケーションが処理できる各ファイルのすべてのフィールドを定義する CSV ファイルがあります。
...;Test=N/A;
他のすべての測定値を処理する計算機もあります。私はそれを次のように拡張しました:
public void computeTest(IRelationalEntry entry) {
double price = org.apache.commons.collections.MapUtils.getDouble(entry, "price", 0.);
double test = price * 2;
entry.put("Test", test);
}
アプリケーションを実行すると、いくつかの例外が発生し、新しいメジャーが表示されません。例外は次のとおりです。
com.quartetfs.fwk.transaction.TransactionException: [Transaction manager: ActivePivot] Prepare commit operation failed because an exception has been raised. You must now rollback the transaction. at com.quartetfs.fwk.transaction.impl.ATransactionManager.prepareCommit(ATransactionManager.java:130) at com.quartetfs.fwk.transaction.impl.ATransactionManager.commit(ATransactionManager.java:142) at com.quartetfs.tech.store.impl.ARelationalTransactionManager.commit(ARelationalTransactionManager.java:139) at com.quartetfs.tech.store.impl.ARelationalTransactionManager.commit(ARelationalTransactionManager.java:51) at com.real.world.application.impl.ATransactionExceptionAwareHandler.doSubmit(ATransactionExceptionAwareHandler.java:97) at com.real.world.application.impl.ATransactionExceptionAwareHandler.submit(ATransactionExceptionAwareHandler.java:51) at com.quartetfs.tech.store.impl.TransactionHandlerListener.receive(TransactionHandlerListener.java:61) at com.quartetfs.tech.store.csv.impl.FilteredSource.receive(FilteredSource.java:56) at com.quartetfs.fwk.messaging.impl.ParserContext.publishChunk(ParserContext.java:457) at com.quartetfs.fwk.messaging.impl.ParserContext.awaitTermination(ParserContext.java:382) at com.quartetfs.fwk.messaging.impl.CSVSource.process(CSVSource.java:308) at com.quartetfs.fwk.messaging.impl.CSVSource.onFileAction(CSVSource.java:282) at com.quartetfs.fwk.messaging.impl.AFileWatcher.filesAction(AFileWatcher.java:277) at com.quartetfs.fwk.messaging.impl.AFileWatcher.doInterval(AFileWatcher.java:267) at com.quartetfs.fwk.messaging.impl.AFileWatcher.startScheduling(AFileWatcher.java:125) at com.quartetfs.fwk.messaging.impl.AFileWatcher.start(AFileWatcher.java:107) at com.quartetfs.fwk.messaging.impl.CSVSource.start(CSVSource.java:182) at com.quartetfs.tech.store.csv.impl.ExtendedCSVDataModelFactory$1.run(ExtendedCSVDataModelFactory.java:217) at java.lang.Thread.run(Thread.java:662) Caused by: com.quartetfs.fwk.transaction.TransactionException: [Transaction manager: RealWorldApplicationSchema] Prepare commit operation failed because an exception has been raised. You must now rollback the transaction. at com.quartetfs.fwk.transaction.impl.ATransactionManager.prepareCommit(ATransactionManager.java:130) at com.quartetfs.tech.store.impl.ARelationalTransactionManager.doPrepareCommit(ARelationalTransactionManager.java:113) at com.quartetfs.fwk.transaction.impl.ATransactionManager.prepareCommit(ATransactionManager.java:128) ... 18 more Caused by: com.quartetfs.fwk.transaction.TransactionException: One of the schema transaction contribution tasks failed. at com.quartetfs.biz.pivot.transaction.impl.ActivePivotSchemaTransaction.prepareCommit(ActivePivotSchemaTransaction.java:239) at com.quartetfs.biz.pivot.impl.ActivePivotSchemaTransactionManager.doPrepareCommit(ActivePivotSchemaTransactionManager.java:194) at com.quartetfs.fwk.transaction.impl.ATransactionManager.prepareCommit(ATransactionManager.java:128) ... 20 more Caused by: java.lang.RuntimeException: com.quartetfs.biz.pivot.ClassificationException: The calculator has thrown an exception during the evaluation of the object: RelationalEntry [type=ActivePivot, key=Key [ ... ,Test=null, ...]] at jsr166y.ForkJoinTask.completeExceptionally(ForkJoinTask.java:1116) at jsr166y.cancellable.impl.CancellableCountedCompleter.onCompletion(CancellableCountedCompleter.java:132) at jsr166y.CountedCompleter.tryComplete(CountedCompleter.java:391) at com.quartetfs.biz.pivot.transaction.impl.ActivePivotSchemaTransaction$ContributeAction.afterCompute(ActivePivotSchemaTransaction.java:492) at jsr166y.cancellable.impl.CancellableCountedCompleter.compute(CancellableCountedCompleter.java:96) at jsr166y.CountedCompleter.exec(CountedCompleter.java:437) at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:265) at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:976) at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1480) at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:105) Caused by: com.quartetfs.biz.pivot.ClassificationException: The calculator has thrown an exception during the evaluation of the object: RelationalEntry [type=ActivePivot, key=Key [ ... ,Test=null, ...]] at com.quartetfs.biz.pivot.classification.impl.Classifier.classifyAll(Classifier.java:114) at com.quartetfs.biz.pivot.transaction.impl.ActivePivotSchemaTransaction$ContributeAction.compute(ActivePivotSchemaTransaction.java:446) at com.quartetfs.biz.pivot.transaction.impl.ActivePivotSchemaTransaction$ContributeAction.computeSafely(ActivePivotSchemaTransaction.java:487) at jsr166y.cancellable.impl.CancellableCountedCompleter.compute(CancellableCountedCompleter.java:91) ... 5 more Caused by: com.quartetfs.biz.pivot.ClassificationException: Classification failure for level "Test": the mandatory property "Test" is not found. Contribution key: "Key [ ... ,Test=null, ...]]. at com.quartetfs.biz.pivot.classification.impl.ResultClassificationProcedure.execute(ResultClassificationProcedure.java:192) at com.quartetfs.biz.pivot.classification.impl.ClassificationTree$ClassificationNode.execute(ClassificationTree.java:215) at com.quartetfs.biz.pivot.classification.impl.ClassificationTree$ClassificationNode.execute(ClassificationTree.java:235) at com.quartetfs.biz.pivot.classification.impl.ClassificationTree.execute(ClassificationTree.java:57) at com.quartetfs.biz.pivot.classification.impl.Classifier.classify(Classifier.java:161) at com.quartetfs.biz.pivot.classification.impl.Classifier.classifyAll(Classifier.java:110) ... 8 more
06.02.2013 16:09:24 com.real.world.application.impl.ATransactionExceptionAwareHandler doSubmit
私は何が欠けていますか?キューブに新しいメジャーを追加するにはどうすればよいですか? 電卓のエラーの原因は何ですか?
コードのデバッグ中に、計算機メソッド (computeTest()) にアクセスし、値を RelationalEntry に設定しています。
乾杯