BOOKKEEPER-137 Do not create Ledger index files until absolutely necessary.
Review Request #3661 - Created Jan. 27, 2012 and updated
This is an optimization to speed up the case where we have many ledgers and are writing to them at random (a benchmark case we currently have). Currently, we create the ledger index file and write the first 1k of it to disk immediately. With a lot of ledgers being randomly written to, this means a lot of random writes on the ledger disk. This fix postpones the creation of the index file and writing of the first 1k until the first flush of the ledger. This patch includes BOOKKEEPER-136, as they both deal in the same area, and I found it difficult to separate them. BOOKKEEPER-135 is not required for this patch, and will need modifications after this goes in.