FoundationDB/sql-layer — pull request #1058 by nathanlws (2013-11-18 22:40:40+00:00)
Title: Perform online DDL in multiple transactions

At a high level, this is a very small tweak to what already existed. The new `OnlineHelper#runPlan()` method takes a plan, creates a cursor and scans until finished. The method requires care around `periodicCommit()` (i.e. rewinding upon failure back to last successful row) so a callback is provided so it is only written once.

The rewinding makes use of the 4e5c96a, which exposes GroupCursor#rebind(hkey,deep) a little more broadly. I considered moving that to RowCursor, which would remove the delicacy, but was on the fence. I'd be happy to pull that out if it makes broader sense. Note that no new cursors would implement it, similar to most throwing for `jump()`.

Periodically commiting is still off by default for Persistit, though it is arguably as useful for long running DDL (i.e. allowing journal files to be consumed). An new IT is present to ensure everything is hooked up properly.

Trivial demo of 'long' running DDL on FDB side:
```
$ psql -c 'select count(*) from t'
500000
$ time psql -c 'alter table t add column y int'
ALTER TABLE
real	0m8.530s
$ time psql -c 'select count(*) from t'
500000
```