New spectrum execution monitor for batch importer

for better overview of relative step processing costs in the stage(s)
Add initial support for determining the freshness of a plan

This involves an instrumented GraphStatistics instance that will
record each "statistical queries" and the observed values, the
result of this process called a snapshot.
In addition, we're also introducing a function defined over two
snapshots that determines if they're diverge enough for the
plans having observed one of them to be scheduled for replanning.

Signed-off-by: Pontus Melke <pontus.melke@neotechnology.com>
Merge pull request #3350 from jakub-/plan-freshness

Add initial support for determining the freshness of a plan
Change the read_only flag to ONLY mean that transactions with changes cannot commit. Specifically it now means that the database CAN change if it is a slave in a HA setup.

Format according to new scheme
Merge pull request #3309 from rickardoberg/readonlychange

read_only change
Merge pull request #3353 from tinwelint/2.2-bip-spectrum-exec-mon

New spectrum execution monitor for batch importer
Expose a way to ask a lucene index to sample index selectivity

o Scan a sample of index entries and compute uniqueSampledValues / sampleSize
Add a new CountsKey for index entry counts
Maintain index update counts from index proxies

o OnlineIndexProxy will ensure that the index counts are updated
o Fix bug when generate LazyIndexUpdates to never construct 'overlapping updates'
o Cleanup code in LazyIndexUpdates
o Make sure we update index update counts during population
Add minor version to CountsStore such that we can flush safely on index flip (outside of log rotation)

o Ensure we compare CountsKeys correctly by type
o Fix reading of index keys
o Add flushIndexCounts() to IndexStoreView
Remove index counts when dropping an index
Make index stats part of SchemaRead and add indexNumberOfEntries

Rationale: For planning to be sane, indices shouldn't appear or disappear out of nowhere, hence we need to be tied to the schema read lock
Add IndexStatisticsTest
Pass on transaction id to index updaters
Pull out and refactor IndexCountVisitor from CountingIndexUpdater
Only apply index count updates for unprocessed transactions during recovery

o Rename updateXYZ to incrementXYZ CountsStore related methods
o Push transactionId down to IndexUpdaters (and couple them to process only updates for a single transaction)
Replace use of LongRegister with DoubleLongRegister in counts store
Add new type of IndexKey for storing sampling results
Refactored counts package

o CountsAcceptor is now called CountsAccessor and also has read methods
o CountsState => CountsRecordState
o IndexKey is now split into Index{Size|Sample}Key
o CountsTrackerState now uses explicit calls per key type
Support index samples in counts tracker