Increase MaxPermSize to 512m for running Cypher acceptance tests
Throws NoSuchTransactionException in LogicalTransactionStore#getMetadataFor

instead of returning null. Will make for better error message in the log.
Reinstates the catching up with master before allowing transactions

this is to remove an unexpected pause that the first batch of transactions
would potentially run into as part of the store catching up in the
background. Having it explicit like this is more expected behaviour.
Merge pull request #3261 from tinwelint/2.2-reinstate-catchup

[2.2] Reinstates the catching up with master before allowing transactions
Merge pull request #3260 from tinwelint/2.2-throw-no-such-tx

[2.2] Throws NoSuchTransactionException in LogicalTransactionStore#getMetadataFor
Guards for concurrent shutdown when applying batches on slaves

Committing and applying a batch of transactions in
TransactionCommittingResponseUnpacker would:
- 1. append a batch of transactions
- 2. force
- 3. then finally mark as committed and apply each one

If there would occur a clean shutdown during or after 1 or 2, but before 3
there might be transactions appended to the log, but never applied, not
even the next start of the db, since there would be no recovery performed.
A similar problem could occur for rotation where force (2) would check
rotation which would effectively exhibit very similar problems.

This commit adds synchronized using the same monitor as append and shutdown
for one whole transaction batch to guard for concurrent shutdown. Also
TransactionAppender#force (2) is changed to not check rotation, and
instead the TransactionCommittingResponseUnpacker checking rotation before
committing and applying each batch, i.e. no possibility of rotation
happening in between append and commit-and-apply.
Merge pull request #3265 from tinwelint/2.2-slave-batch-commit-fix

[2.2] Guards for concurrent shutdown when applying batches on slaves
Revert the change which adds count values in the state on read

- it is indeed better to delegate the caching to the page cache used in the CountStore
- having less values in the in-memory state will also make the sorting much faster when we need to merge them
  with the one on disk
Increase key-value record size to 16 + 16 bytes

- change node and relationship key encoding to write a type byte
- extract CountsStoreWriter and added tests
- fix a bug in the binary search when reading entries ordered by key
Stop visiting records when reading an empty one from the page
Add tests for CountsStore
Extract record serialization outside the CountsStore

Now the CountsStore accept generic keys
Change CountsStore.get to accept a register rather than returining a long
Make the counts store generic on values type
CountsStore takes a WriterFactory rather than creating a specific CountsStoreWriter
Repackaging to separate the concepts of KVStore and CountsStore

- revisit KeyValueRecordVisitor to be generic
- the specific CountsStore visitors uses registers rather than passing aroung longs
This chnage will expose a way to ask a lucene index to sample the percentage of different value
present in the index. I.e., it scans a given sample size of the indexed value by skipping at a
given frequency. The return percentage is computed as uniqueSampledValues / sampleSize.
Add a new CountsKey for index entry counts
Collect index counts from the IndexTransactionApplier to be saved by the CountsStoreApplier [broken]