BOOKKEEPER-797: IllegalArgumentException when calling CodahaleOpStatsLogger#toOpStatsData()

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/bookkeeper/trunk@1640597 13f79535-47bb-0310-9956-ffa450edef68
BOOKKEEPER-815: Ledger fence state is lost when the ledger file is evicted (Charles Xie via ivank)

Change-Id: I7de7a893043f1304b75d7545899ec5b022148e6b
BOOKKEEPER-800: Expose whether a ledger is closed or not (ivank)
BOOKKEEPER-799: Distribution schedule coverage sets don't take gaps in response lists into account when writequorum > ackquorum (ivank)
BOOKKEEPER-805: NullPointException in bookie server when using twitter-ostrich-provider (Youngjoon Kim via sijie)
BOOKKEEPER-809: Wrong metric on LedgerDeleteOp and LedgerOpenOp (Charles Xie via sijie)
BOOKKEEPER-805: NullPointException in bookie server when using twitter-ostrich-provider (Youngjoon Kim via sijie) (missing CHANGES.txt)
BOOKKEEPER-809: Wrong metric on LedgerDeleteOp and LedgerOpenOp (Charles Xie via sijie) (missing CHANGES.txt)
BOOKKEEPER-820: print out fi.isFenced() in BookieShell (zhaijia via sijie)
BOOKKEEPER-804: Client program is not terminated when using openLedgerNoRecovery (ivank via sijie)
BOOKKEEPER-813: BookieShell doesn't find index directory (Charles Xie via sijie)
BOOKKEEPER-810: Allow to configure TCP connect timeout (Charles Xie via sijie)
BOOKKEEPER-811: Recovery tool doesn't remove cookie after recovering one bookie (Charles Xie via sijie)
BOOKKEEPER-795: Race condition causes writes to hang if ledger is fenced (sijie via ivank)
Made ledger metadata immutable

Ensembles are now ImmutableMap<Long, ImmutableList<BookieSocketAddress>>.
The LedgerManager manager interface has changed to avoid implicitly
updating the version of a LedgerMetadata object. Recovery, Closing and
handling bookie failures have now changed, as there are no longer merge
operations. If a write to zookeeper fails, then
recovery/closing/failureHandling are retried with the new metadata,
provided that assumptions are not broken.

The interesting changes are in LedgerHandle and LedgerMetadata.

There are a lot of changes from ArrayList -> ImmutableList,List
Also a lot of changes from currentEnsemble -> getCurrentEnsemble.

One test had to change. With the old code, if someone fenced a ledger,
closing would fail. This isn't always the case now. If there's lac of
the writing ledger matches the lastEntryId of the new metadata, then
close can succeed. ConditionalSetTest has changed to reflect this.

Change-Id: I01c8c9a532f0c8802120acf93b8aeba20e2a3748