本文整理汇总了Java中org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl类的典型用法代码示例。如果您正苦于以下问题:Java VersionPBImpl类的具体用法?Java VersionPBImpl怎么用?Java VersionPBImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VersionPBImpl类属于org.apache.hadoop.yarn.server.records.impl.pb包,在下文中一共展示了VersionPBImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的package包/类
@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);
}
}
示例2: loadVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的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;
}
示例3: dbStoreVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的package包/类
private void dbStoreVersion(Version state) throws IOException {
String key = DB_SCHEMA_VERSION_KEY;
byte[] data =
((VersionPBImpl) state).getProto().toByteArray();
try {
db.put(bytes(key), data);
} catch (DBException e) {
throw new IOException(e);
}
}
示例4: dbStoreVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的package包/类
void dbStoreVersion(Version state) throws IOException {
String key = VERSION_NODE;
byte[] data = ((VersionPBImpl) state).getProto().toByteArray();
try {
db.put(bytes(key), data);
} catch (DBException e) {
throw new IOException(e);
}
}
示例5: storeVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的package包/类
@Override
protected synchronized void storeVersion() throws Exception {
String versionNodePath = getNodePath(zkRootNodePath, VERSION_NODE);
byte[] data =
((VersionPBImpl) CURRENT_VERSION_INFO).getProto().toByteArray();
if (existsWithRetries(versionNodePath, false) != null) {
setDataWithRetries(versionNodePath, data, -1);
} else {
createWithRetries(versionNodePath, data, zkAcl, CreateMode.PERSISTENT);
}
}
示例6: loadVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的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;
}
示例7: loadVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的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;
}
示例8: storeVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的package包/类
@Override
protected synchronized void storeVersion() throws Exception {
Path versionNodePath = getNodePath(rootDirPath, VERSION_NODE);
byte[] data =
((VersionPBImpl) CURRENT_VERSION_INFO).getProto().toByteArray();
if (existsWithRetries(versionNodePath)) {
updateFile(versionNodePath, data, false);
} else {
writeFileWithRetries(versionNodePath, data, false);
}
}
示例9: loadVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的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);
}
}
示例10: dbStoreVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的package包/类
private void dbStoreVersion(Version state) throws IOException {
String key = TIMELINE_STORE_VERSION_KEY;
byte[] data =
((VersionPBImpl) state).getProto().toByteArray();
try {
db.put(bytes(key), data);
} catch (DBException e) {
throw new IOException(e);
}
}
示例11: storeVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的package包/类
@VisibleForTesting
void storeVersion(Version state) throws IOException {
byte[] data =
((VersionPBImpl) state).getProto().toByteArray();
try {
db.put(TIMELINE_STATE_STORE_VERSION_KEY, data);
} catch (DBException e) {
throw new IOException(e);
}
}
示例12: loadVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的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;
}
示例13: storeSchemaVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的package包/类
private void storeSchemaVersion(Version version) throws IOException {
String key = STATE_DB_SCHEMA_VERSION_KEY;
byte[] data =
((VersionPBImpl) version).getProto().toByteArray();
try {
stateDb.put(bytes(key), data);
} catch (DBException e) {
throw new IOException(e.getMessage(), e);
}
}
示例14: loadVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的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;
}
示例15: dbStoreVersion
import org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl; //导入依赖的package包/类
void dbStoreVersion(Version state) throws IOException {
String key = DB_SCHEMA_VERSION_KEY;
byte[] data =
((VersionPBImpl) state).getProto().toByteArray();
try {
db.put(bytes(key), data);
} catch (DBException e) {
throw new IOException(e);
}
}