Package org.apache.hadoop.hdfs.server.namenode.bookkeeper.metadata.proto

Examples of org.apache.hadoop.hdfs.server.namenode.bookkeeper.metadata.proto.FormatInfoWritable


   * 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;
  }
View Full Code Here


          // First create the parent path
          zk.create(zkParentPath, new byte[] { '0' },
              Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);

          // Write format/namespace information to ZooKeeper
          FormatInfoWritable writable = localFormatInfoWritable.get();
          writable.set(PROTO_VERSION, si);
          byte[] data = WritableUtil.writableToByteArray(writable);
          zk.create(formatInfoPath, data, Ids.OPEN_ACL_UNSAFE,
              CreateMode.PERSISTENT);
        } catch (KeeperException e) {
          keeperException("Unrecoverable ZooKeeper error initializing " +
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.server.namenode.bookkeeper.metadata.proto.FormatInfoWritable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.