[Mondrian] Refactor task

Julian Hyde jhyde at pentaho.com
Wed Nov 23 16:18:14 EST 2011

On Wednesday, November 23, 2011 4:00 PM, Julian Hyde wrote:

> [Can you please] move SegmentHeader, SegmentBody, ConstrainedColumn into mondrian.spi.
> Anything that depends on the mondrian.rolap.agg package should stay in that package, not go into the mondrian.spi. In particular, put code that converts Segment + SegmentWithData to and from SegmentHeader SegmentBody (e.g. {@link SegmentHeader#forSegment}) into a utility class. Call it mondrian.rolap.agg.SegmentBuilder.
> Also, this an opportunity to change 'Object[] ConstrainedColumn.getValues()'. It would be useful if it instead returned a 'SortedSet<Comparable<?>>'. We can make make a set immutable, and also save ourselves the effort of sorting values. (E.g. ConstrainedColumn.merge is currently an O(n ^ 2) algorithm. Moving to sorted sets will make this O(n log n). You may ArraySortedSet useful, if you need to wrap an array as a set (provided that the array is already sorted).

On Nov 23, 2011, at 1:04 PM, Luc Boudreau wrote:

> I'll check these items out.
> Another thing I have noted. Some tests fail because of changes to the SQL detection. (The "bomb" thing in TestContext). It seems like the SQL gets executed correctly (I've checked the logs) but it doesn't get detected. If you can think on the top of your head why this might be happening, this would be useful.

The bomb needs to be passed from one thread to another. I fixed a few cases. There may be more.

A useful technique is to put a breakpoint on the 'threw new Bomb()' line and then single-step the debugger to see whether the bomb gets back to the caller.

It's a useful fire-drill, because real SQL exceptions would need to be handled in the same way.

Frankly, now that at least 3 threads are involved in executing an MDX statement, 'Bomb' probably isn't the mechanism I would choose for adding these tests if I was doing it today. But I think we should stay with it. As I said, it's a useful fire-drill for exception handling in general.


More information about the Mondrian mailing list