Merge pull request #1904 from jakub-/pretty-graph-cookbook-labels

Update the pretty graph cookbook to use labels
Merge pull request #1905 from systay/kernel-provided

Make kernel dependencies provided for the Cypher 2.0 compiler
Removed use of deprecated Traversal.description method.
Splits relationship chains by type and direction

Changes how relationships for a node are stored on disk. Node and
relationship records are virtually untouched, and a new type of records
(and store) sits in between a node and its relationships acting as a
node-centric index for type and direction of the relationships.

Previously the logical layout has been that a node has one long chain of
relationships connected to it, where relationships of all types and
directions were mixed in the same chain. Loading relationships of a
particular type and direction could not be made efficiently since the
whole chain had to be loaded. Simplified like this:

   NODE->REL1->REL2->REL3...

This commit introduces RelationshipGroup(Store/Record) which sits in
between node and its relationships like so:

   NODE->GROUP_A->GROUP_B->GROUP_C->...
        /  \        |        |
      OUT  IN      OUT      IN
      /    |        |        |
    REL1  REL2    REL3     REL7
     |     |                 |
     v     v                 v
    REL4  REL6             REL8
     |     |                 |
     v     v                 v
    ...   ...               ...

which removes to need to load irrelevant relationships when knowing their
type and or direction. Furthermore, backpointers on all relationship
records that are first in any chain are used to store the number of
relationships in that chain, allowing for O(1) counting of relationships,
even based on type and direction.

Nodes with few relationships will bypass the relationship group index
and instead switch on a certain number of relationships. This to remove the
overhead of the relationship group records for a small number of
relationships. The dense node threshold is configurable and defaults to 50.

This commit also bumps the store format to 0.A.2 and requires a store
migration, which will happen automatically if configuration settings to
allow it are in place.

The concsistency checker lacks some checks around relationship group
records, so at this point it's not fully covering those areas.
An instance will now create a cluster only after contacting all instances

Before it was so that an instance would create a cluster if, during discovery,
 it would contact at least half of the instances configured as initial_hosts
 and it was the one with the numerically smallest instance id among them.
 This lead to problems where instances would go ahead and create different
 clusters because of startup order. In particular, an instance could
 respond to two other instances with numerically lower instance ids
 but those two would not manage to contact each other. That would
 lead them to each forming a cluster on its own and the remaining
 instance joining one of them, in random.
 This commit changes so that an instance no longer waits for
 quorum number of instances but all of them, as configured in
 initial_hosts. This ensures that the instance forming the cluster
 will have seen all that is possible to see and all other instances
 will join that cluster.
Adds description string to cluster test DSL verification method

ClusterMockTest.verifyConfiguration() can be called anywhere during
 a cluster test and is also called automatically at certain
 operations. This can lead to confusion in case of failures, as
 it's not obvious which call of the ones made during a test failed.
 Adding a description helps tell them apart.
Removed use of deprecated Traversal.description method in examples.
Moves getRelationships into the kernel API.

 o Still delegates to old implementation, but this is now done through the correct call paths.
 o Locking has been moved to the Kernel locking layer.
 o Obviates the need for the lock that could be passed to getNodeForProxy, which has been removed.
 o Deleted relationships are now filtered out in StateHandlingStatementOperations.
 o Use primitive iterator on the low levels for rels
 o Swaps lower level implementation to use ints instead of RelationshipType.

 Remaining:
 o getDegree still uses the old code paths, and should be swapped over in a follow-up commit.

Conflicts:
	community/kernel/src/main/java/org/neo4j/helpers/collection/IteratorUtil.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/api/ConstraintEnforcingEntityOperations.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/api/DefaultLegacyKernelOperations.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/api/StateHandlingStatementOperations.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/api/operations/EntityReadOperations.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/api/store/StoreReadLayer.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/core/NodeImpl.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/core/RelationshipIterator.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/api/integrationtest/RelationshipIT.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/core/RelationshipIteratorIssuesTest.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/core/TestRelationshipGrabSize.java

Kernel TX prepare and commit now get called outside synchronized blocks.
Replace infix, postfix and prefix function expressions with unique AST objects
Adds multi-hosting service to Neo4j Server.

 o Adds a configuration database to the Server, containing
   meta data about hosted databases.
 o Adds database registry, managing live hosted databases.
 o Adds runtime reconfiguration of databases - dropping, creating,
   changing config and mode.
 o Contains several provisions ensuring full backwards compatibility
   with previous 'db' database and it's associated configuration.
   If a legacy config file exists, it overrides hosted config.
 o This commit *only* contains these new services, they are not
   plugged in. This is meant to incorporate this piece-meal by
   first moving the new code in, and plugging it in in a follow-up
   commit.

Conflicts:
	enterprise/com/src/test/java/org/neo4j/com/ServerTest.java
Redid some of the ignored UniqueIndexAccessorCompatibility tests in terms of UniqueConstraintCompatibility.

The populating IndexUpdater test, however, is not equivalent to the test it replaces, because our
pessimistic concurrency control seems to make some of those particular scenarios in the old tests,
impossible to hit through the public API.

The work of rewriting the tests is not yet done. This is just a step of the way.
Wait for 3 to become master
Move getDegree and getRelationshipTypes into the kernel.

 o Moves getDegree and getRelationshipTypes into the kernel implementation.
 o Introduces VersionedHashMap, a hashmap lacking certain multi-threading checks.
Updated to correct version
Implementing split function

test refactoring
Implement replacements for all the ignored index compatibility tests
Merge pull request #1926 from davidegrohmann/2.0-splitfunction

Implementing split function
Merge pull request #1918 from jakewins/2.1-kerneldense

getRelationships, getDegree and getRelationshipTypes to kernel implemenation.
Merge pull request #1927 from cleishm/infix-ast-objects

Replace infix, postfix and prefix function expressions with unique AST objects
Added support for the LOAD CSV clause