Search in sources :

Example 6 with VersionPBImpl

use of org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl in project hadoop by apache.

the class HistoryServerLeveldbStateStoreService method loadVersion.

Version loadVersion() throws IOException {
    byte[] data = db.get(bytes(DB_SCHEMA_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;
}
Also used : VersionPBImpl(org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl) Version(org.apache.hadoop.yarn.server.records.Version)

Example 7 with VersionPBImpl

use of org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl in project hadoop by apache.

the class ShuffleHandler method loadVersion.

@VisibleForTesting
Version loadVersion() throws IOException {
    byte[] data = stateDb.get(bytes(STATE_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;
}
Also used : VersionPBImpl(org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl) Version(org.apache.hadoop.yarn.server.records.Version) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 8 with VersionPBImpl

use of org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl in project tez by apache.

the class ShuffleHandler method loadVersion.

@VisibleForTesting
Version loadVersion() throws IOException {
    byte[] data = stateDb.get(bytes(STATE_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;
}
Also used : VersionPBImpl(org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl) Version(org.apache.hadoop.yarn.server.records.Version) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Aggregations

Version (org.apache.hadoop.yarn.server.records.Version)8 VersionPBImpl (org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl)8 VisibleForTesting (com.google.common.annotations.VisibleForTesting)3 IOException (java.io.IOException)2 FileStatus (org.apache.hadoop.fs.FileStatus)1 Path (org.apache.hadoop.fs.Path)1 DBException (org.iq80.leveldb.DBException)1