use of org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl in project hadoop by apache.
the class FileSystemRMStateStore method loadVersion.
@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;
}
use of org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl in project hadoop by apache.
the class RollingLevelDBTimelineStore method loadVersion.
Version loadVersion() throws IOException {
byte[] data = starttimedb.get(bytes(TIMELINE_STORE_VERSION_KEY));
// if version is not stored previously, treat it as 1.0.
if (data == null || data.length == 0) {
return Version.newInstance(1, 0);
}
Version version = new VersionPBImpl(VersionProto.parseFrom(data));
return version;
}
use of org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl in project hadoop by apache.
the class LeveldbTimelineStore method loadVersion.
Version loadVersion() throws IOException {
try {
byte[] data = db.get(bytes(TIMELINE_STORE_VERSION_KEY));
// if version is not stored previously, treat it as CURRENT_VERSION_INFO.
if (data == null || data.length == 0) {
return getCurrentVersion();
}
Version version = new VersionPBImpl(VersionProto.parseFrom(data));
return version;
} catch (DBException e) {
throw new IOException(e);
}
}
use of org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl in project hadoop by apache.
the class LeveldbTimelineStateStore method loadVersion.
@VisibleForTesting
Version loadVersion() throws IOException {
try {
byte[] data = db.get(TIMELINE_STATE_STORE_VERSION_KEY);
// if version is not stored previously, treat it as CURRENT_VERSION_INFO.
if (data == null || data.length == 0) {
return getCurrentVersion();
}
Version version = new VersionPBImpl(YarnServerCommonProtos.VersionProto.parseFrom(data));
return version;
} catch (DBException e) {
throw new IOException(e);
}
}
use of org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl in project hadoop by apache.
the class NMLeveldbStateStoreService method loadVersion.
Version loadVersion() throws IOException {
byte[] data = db.get(bytes(DB_SCHEMA_VERSION_KEY));
// if version is not stored previously, treat it as CURRENT_VERSION_INFO.
if (data == null || data.length == 0) {
return getCurrentVersion();
}
Version version = new VersionPBImpl(VersionProto.parseFrom(data));
return version;
}
Aggregations