@Override
 protected synchronized Version loadVersion() throws Exception {
   Path versionNodePath = getNodePath(rootDirPath, VERSION_NODE);
   FileStatus status = getFileStatusWithRetries(versionNodePath);
   if (status != null) {
     byte[] data = readFileWithRetries(versionNodePath, status.getLen());
     Version version = new VersionPBImpl(VersionProto.parseFrom(data));
     return version;
   }
   return null;
 }
예제 #2
0
 @Override
 protected Version loadVersion() throws Exception {
   Version version = null;
   try {
     byte[] data = db.get(bytes(VERSION_NODE));
     if (data != null) {
       version = new VersionPBImpl(VersionProto.parseFrom(data));
     }
   } catch (DBException e) {
     throw new IOException(e);
   }
   return version;
 }