当前位置: 首页>>代码示例>>Java>>正文


Java VersionPBImpl类代码示例

本文整理汇总了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);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:LeveldbTimelineStateStore.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:NMLeveldbStateStoreService.java

示例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);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:NMLeveldbStateStoreService.java

示例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);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:LeveldbRMStateStore.java

示例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);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:ZKRMStateStore.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:ZKRMStateStore.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:13,代码来源:FileSystemRMStateStore.java

示例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);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:FileSystemRMStateStore.java

示例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);    	
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:15,代码来源:LeveldbTimelineStore.java

示例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);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:LeveldbTimelineStore.java

示例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);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:LeveldbTimelineStateStore.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:ShuffleHandler.java

示例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);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:ShuffleHandler.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:HistoryServerLeveldbStateStoreService.java

示例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);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:HistoryServerLeveldbStateStoreService.java


注:本文中的org.apache.hadoop.yarn.server.records.impl.pb.VersionPBImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。