neo4j/neo4j — pull request #1952 by digitalstain (2014-02-12 13:42:55+00:00)
Title: Factors out of NeoStoreTransaction the relationship manipulation logic

As part of building rolling upgrades for transitioning to dense node stores,
it is required to have some dense node creation logic be reusable outside
of NeoStoreTransaction. This is also useful for BatchInserter which also
needs to replicate some of that functionality. This commit extracts
the relDelete() and relationshipCreate() methods of NeoStoreTransaction
into their own class so it can be reused from elsewhere.
It also introduces flyweight context for NeoStoreTransaction. The idea
is that most of the state for NeoStoreTransaction consists of objects
that can be reused, including the newly created RelatioshipCreator
and RelationshipDeleter. This allows for pooling objects with a
min/peak/target strategy pool as implemented in FlyweightPool. Doing
so reduces drastically the amount of garbage generated, though measurements
on that have not occured yet.