* Additionally, the call always refreshes the object's current
* {@link CurrentInProgressMetadata} information.
*/
synchronized private void checkEnv() throws IOException {
if (!initialized) {
FormatInfoWritable writable = localFormatInfoWritable.get();
if (metadataManager.readWritableFromZk(formatInfoPath, writable, null) == null) {
LOG.error("Environment not initialized (format() not called?)");
throw new IOException(
"Environment not initialized (format() not called?");
}
if (writable.getProtoVersion() != PROTO_VERSION) {
throw new IllegalStateException("Wrong protocol version! Expected " +
BKJM_BOOKKEEPER_DIGEST_PW + ", but read " +
writable.getProtoVersion());
}
if (LOG.isDebugEnabled()) {
LOG.debug("Namespace info read: " + writable.toColonSeparatedString());
}
}
currentInProgressMetadata.init();
initialized = true;
}