Code review comment for lp:~pbeaman/akiban-persistit/fix-accumulator-javadoc

Revision history for this message
Peter Beaman (pbeaman) wrote :

Per discussion with Mike and Nathan, the Accumulator API has now changed. Therefore in addition to Javadoc changes, this branch contains quite a few code changes and also a new version number.

Specifically, each kind of accumulator now has a custom method for updating it. A SUM, MIN, MAX and SEQ accumulators are modified by their add(long), minimum(long), maximum(long) and allocate() methods, respectively. Only the allocate() method returns a value. The original update method (minus the Transaction argument) is still present to support the AccumulatorAdpater, but is deprecated. Since the application needs to have specify the final class rather than the base class, the final classes are now public, and there are new type-specific helper methods in Tree to get them. So instead of

  Tree#getAccumulator(Accumulator.Type.SUM, int)

you use

  Tree#getSumAccumulator(int)

The original method remains, but is deprecated.

A minor unrelated change is to make the constructor of SessionId public. This is also an API fix, and I wanted to get it in before forgetting about it.

« Back to merge proposal