/** * Creates a special DurableDataLog wrapping the BookKeeperLog that does only supports reading from the log. It does * not support initialization or otherwise modifications to the log. Accessing this log will not interfere with other * active writes to this log (i.e., it will not fence anyone out or close Ledgers that shouldn't be closed). * * @return A new DurableDataLog instance. * @throws DataLogInitializationException If an exception occurred fetching metadata from ZooKeeper. */ public DurableDataLog asReadOnly() throws DataLogInitializationException { return new ReadOnlyBooKeeperLog(this.log.loadMetadata()); }