本文整理汇总了Java中org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto.parseFrom方法的典型用法代码示例。如果您正苦于以下问题:Java VersionProto.parseFrom方法的具体用法?Java VersionProto.parseFrom怎么用?Java VersionProto.parseFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto
的用法示例。
在下文中一共展示了VersionProto.parseFrom方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadVersion
import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto; //导入方法依赖的package包/类
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;
}
示例2: loadVersion
import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto; //导入方法依赖的package包/类
@Override
protected synchronized Version loadVersion() throws Exception {
String versionNodePath = getNodePath(zkRootNodePath, VERSION_NODE);
if (existsWithRetries(versionNodePath, false) != null) {
byte[] data = getDataWithRetries(versionNodePath, false);
Version version =
new VersionPBImpl(VersionProto.parseFrom(data));
return version;
}
return null;
}
示例3: loadVersion
import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto; //导入方法依赖的package包/类
@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;
}
示例4: loadVersion
import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto; //导入方法依赖的package包/类
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);
}
}
示例5: loadVersion
import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto; //导入方法依赖的package包/类
@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;
}
示例6: loadVersion
import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto; //导入方法依赖的package包/类
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;
}
示例7: loadVersion
import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto; //导入方法依赖的package包/类
@Override
protected synchronized Version loadVersion() throws Exception {
String versionNodePath = getNodePath(zkRootNodePath, VERSION_NODE);
if (exists(versionNodePath)) {
byte[] data = getData(versionNodePath);
return new VersionPBImpl(VersionProto.parseFrom(data));
}
return null;
}
示例8: loadVersion
import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto; //导入方法依赖的package包/类
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;
}
示例9: loadVersion
import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto; //导入方法依赖的package包/类
@Override
protected synchronized Version loadVersion() throws Exception {
String versionNodePath = getNodePath(zkRootNodePath, VERSION_NODE);
if (existsWithRetries(versionNodePath, true) != null) {
byte[] data = getDataWithRetries(versionNodePath, true);
Version version =
new VersionPBImpl(VersionProto.parseFrom(data));
return version;
}
return null;
}
示例10: loadVersion
import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto; //导入方法依赖的package包/类
@Override
protected synchronized Version loadVersion() throws Exception {
Path versionNodePath = getNodePath(rootDirPath, VERSION_NODE);
if (fs.exists(versionNodePath)) {
FileStatus status = fs.getFileStatus(versionNodePath);
byte[] data = readFile(versionNodePath, status.getLen());
Version version =
new VersionPBImpl(VersionProto.parseFrom(data));
return version;
}
return null;
}
示例11: loadVersion
import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto; //导入方法依赖的package包/类
Version loadVersion() throws IOException {
byte[] data = db.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;
}
示例12: loadVersion
import org.apache.hadoop.yarn.proto.YarnServerCommonProtos.VersionProto; //导入方法依赖的package包/类
@VisibleForTesting
Version loadVersion() throws IOException {
byte[] data = stateDb.get(bytes(STATE_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;
}