Slave goes through 'switchToSlave' process on every 'masterIsElected' event
CappedOperation does not trigger on first time event

Previously, a CappedOperation was triggered the first event regardless of
which triggered were specified. This was unexpected and counter intuitive,
especially for cases (where it is most used) where a CappedOperation was
added as a time-based logger and a log statement was expected to be
printed after the specified threshold, it would log immediately as well.
Removes console output from GraphDatabaseServiceTest
Fixes XaLogicalLog shutdown issue

XaLogicalLog.close() was flushing the store files after
 marking the active log file as applied. This could
 lead to recovery not happening if shutdown
 failed within a narrow window between log
 shutdown and store flush. This is now fixed.
The LogBackedXaDatasource defined a stop() method that
 managed log lifecycle without having to. This is now
 removed and log lifecycle control is delegated to
 subclasses through XaContainer.
Merge pull request #3229 from digitalstain/1.9-fix-llog-shutdown

[1.9] fix logical log shutdown
Merge pull request #3227 from tinwelint/1.9-capped-ops-no-first

[1.9] CappedOperation does not trigger on first time event
Fixes BackupServiceIT to properly close log channel after latest changes
Fix an ABA bug in the page cache

We were reusing the MuninnPage objects in the MuninnPageCache.freelist.
This could lead to cycles in the freelist through an ABA-bug.

The test that exposed that bug is ignored for now, because it is exposing
another bug that I thought was just a different manifestation of the ABA-bug.
Fixes an issue which made it impossible to resume a migration

i.e. when the migration had been completed, and the migration aborted...
when it would be picked up again the next time to do the moving of files
from migration directory to store directory there would be an assumption
that the "migrate" method would have been run before it. This led to an
NPE for an uninitialized field.
Merge remote-tracking branch 'origin/1.9-maint' into 2.0-maint

Conflicts:
	community/kernel/src/main/java/org/neo4j/kernel/impl/nioneo/xa/NeoStoreXaDataSource.java
	community/kernel/src/test/java/org/neo4j/graphdb/GraphDatabaseServiceTest.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/nioneo/store/TestXa.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/xaframework/XaLogicalLogTest.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/util/CappedOperationTest.java
	community/lucene-index/src/main/java/org/neo4j/index/impl/lucene/LuceneDataSource.java
	enterprise/backup/src/test/java/org/neo4j/backup/BackupServiceIT.java
Merge remote-tracking branch 'origin/2.0-maint' into 2.1-maint

Conflicts:
	community/kernel/src/main/java/org/neo4j/kernel/impl/nioneo/xa/NeoStoreXaDataSource.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/transaction/xaframework/XaLogicalLog.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/nioneo/store/TestXa.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/xaframework/XaLogicalLogTest.java
	community/lucene-index/src/main/java/org/neo4j/index/impl/lucene/LuceneDataSource.java
	enterprise/backup/src/test/java/org/neo4j/backup/BackupServiceIT.java
Merge remote-tracking branch 'origin/2.1-maint'

Conflicts:
	community/kernel/src/main/java/org/neo4j/kernel/impl/nioneo/store/StoreFileChannel.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/nioneo/xa/NeoStoreXaDataSource.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/transaction/xaframework/LogBackedXaDataSource.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/transaction/xaframework/XaContainer.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/transaction/xaframework/XaLogicalLog.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/nioneo/store/TestXa.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/DummyXaDataSource.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/TestXaFramework.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/transaction/xaframework/XaLogicalLogTest.java
Updates changelogs for 1.9.9 with last batch of changes
Re-enable the CommitPusher. More thought need to go into whether it's good or bad
Rewrite of perty to avoid stack build-up and erasure issues

Changes perty such that instead of building Docs for pretty printing
directly, we now build a flat heap representation (DocRecipes).
DocRecipes are abstract, i.e. contain unrendered values.
This is exactly how stack build-up is avoided: Each doc generator
just renders a tiny part of the document, keeping sub-components
abstract in the generated flat representation. An outer
loop continously processes the flat representation and tries
to render any abstract component it finds. Finally,
if all abstract components have been rendered, the flat
representation is turned into a Doc for actual pretty printing,
as before. This is done via simple, heap-based interpreter.

To keep things nice, each generator builds it's slice of
the flat representation using a tiny stack-based DSL.
However this should not be a stack build-up problem as
the nesting level for each individual generator (say
pretty printing of a FunctionInvocation) is just
a few levels deep.

This is the first version of perty with a working
astStructureDocGen (the ability to show both ast
and scala-like representation of ast nodes side by side).

Finally, this also uses scala reflection instead
of using pattern matching to help with some type
erasure problems we say with the old perty.

It is not yet clear wether the overhead is worth the
benefit, we'll have to try it for a while to know.
If it gets in the way, it should be straightforward
to remove using scala reflect.

This version of perty does not yet cover the whole ast
but it is now a in good shape to get started on that.

For reference, here's a condensed list of original
commits. History was squashed since almost all individual
commits where not in a green state.

o Adding scala-reflect dependency
o Add reflective perty (& bling) packages
o Refactor Extractors to be more practical
o Replace use of fix points with a flat reprensentation:
  Add DocSteps, recipes, expand, and eval
o Rebuild pprintToString
o Move Doc helpers to Pretty DSL and fix scalaDocGen
o Fix Pretty DSL so that we can work with different types without calling pretty
o Make scalaDocGenWorkAgain
o Re-enable scalaDocGen using fancy type magic tricks
o Re-enable ast and plan doc gens
o Re-enable AstStructureDocGen
o More ast support for perty
o Update LICENSE files for scala reflect
Fixes tests that left threads behind after run

introduced a simple tracking method that can be used for labelling
threads, only active if assertions are enabled.
Merge pull request #3252 from tinwelint/2.1-resume-migration-fix

[2.1] Fixes an issue which made it impossible to resume a migration
Merge pull request #3258 from boggle/perty-squashed

[2.2] Rewrite of perty to avoid stack build-up and erasure issues
Merge pull request #3217 from lutovich/1.9-slave-epoch-mismatch

[1.9] Slave goes through 'switchToSlave' process on every 'masterIsElected' event
Merge branch '1.9-maint' into 2.0-maint

Conflicts:
	enterprise/backup/CHANGES.txt
	enterprise/ha/src/test/java/org/neo4j/ha/TestSlaveOnlyCluster.java