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


Java DBException.getMessage方法代码示例

本文整理汇总了Java中org.iq80.leveldb.DBException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java DBException.getMessage方法的具体用法?Java DBException.getMessage怎么用?Java DBException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.iq80.leveldb.DBException的用法示例。


在下文中一共展示了DBException.getMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startInternal

import org.iq80.leveldb.DBException; //导入方法依赖的package包/类
@Override
protected void startInternal() throws Exception {
  Path storeRoot = createStorageDir();
  Options options = new Options();
  options.createIfMissing(false);
  options.logger(new LeveldbLogger());
  LOG.info("Using state database at " + storeRoot + " for recovery");
  File dbfile = new File(storeRoot.toString());
  try {
    db = JniDBFactory.factory.open(dbfile, options);
  } catch (NativeDB.DBException e) {
    if (e.isNotFound() || e.getMessage().contains(" does not exist ")) {
      LOG.info("Creating state database at " + dbfile);
      options.createIfMissing(true);
      try {
        db = JniDBFactory.factory.open(dbfile, options);
        // store version
        storeVersion();
      } catch (DBException dbErr) {
        throw new IOException(dbErr.getMessage(), dbErr);
      }
    } else {
      throw e;
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:27,代码来源:LeveldbRMStateStore.java

示例2: initStorage

import org.iq80.leveldb.DBException; //导入方法依赖的package包/类
@Override
protected void initStorage(Configuration conf)
    throws IOException {
  Path storeRoot = createStorageDir(conf);
  Options options = new Options();
  options.createIfMissing(false);
  options.logger(new LeveldbLogger());
  LOG.info("Using state database at " + storeRoot + " for recovery");
  File dbfile = new File(storeRoot.toString());
  try {
    db = JniDBFactory.factory.open(dbfile, options);
  } catch (NativeDB.DBException e) {
    if (e.isNotFound() || e.getMessage().contains(" does not exist ")) {
      LOG.info("Creating state database at " + dbfile);
      isNewlyCreated = true;
      options.createIfMissing(true);
      try {
        db = JniDBFactory.factory.open(dbfile, options);
        // store version
        storeVersion();
      } catch (DBException dbErr) {
        throw new IOException(dbErr.getMessage(), dbErr);
      }
    } else {
      throw e;
    }
  }
  checkVersion();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:30,代码来源:NMLeveldbStateStoreService.java

示例3: storeSchemaVersion

import org.iq80.leveldb.DBException; //导入方法依赖的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

示例4: startStorage

import org.iq80.leveldb.DBException; //导入方法依赖的package包/类
@Override
protected void startStorage() throws IOException {
  Path storeRoot = createStorageDir(getConfig());
  Options options = new Options();
  options.createIfMissing(false);
  options.logger(new LeveldbLogger());
  LOG.info("Using state database at " + storeRoot + " for recovery");
  File dbfile = new File(storeRoot.toString());
  try {
    db = JniDBFactory.factory.open(dbfile, options);
  } catch (NativeDB.DBException e) {
    if (e.isNotFound() || e.getMessage().contains(" does not exist ")) {
      LOG.info("Creating state database at " + dbfile);
      options.createIfMissing(true);
      try {
        db = JniDBFactory.factory.open(dbfile, options);
        // store version
        storeVersion();
      } catch (DBException dbErr) {
        throw new IOException(dbErr.getMessage(), dbErr);
      }
    } else {
      throw e;
    }
  }
  checkVersion();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:28,代码来源:HistoryServerLeveldbStateStoreService.java


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