Exemple #1
0
  private boolean check() throws DataExchangeException, IOException {
    if (!admin.isMasterRunning()) {
      throw new IllegalStateException("HBase master is not running!");
    }
    if (!admin.tableExists(htable.getTableName())) {
      throw new IllegalStateException(
          "HBase table " + Bytes.toString(htable.getTableName()) + " is not existed!");
    }
    if (!admin.isTableAvailable(htable.getTableName())) {
      throw new IllegalStateException(
          "HBase table " + Bytes.toString(htable.getTableName()) + " is not available!");
    }
    if (!admin.isTableEnabled(htable.getTableName())) {
      throw new IllegalStateException(
          "HBase table " + Bytes.toString(htable.getTableName()) + " is disable!");
    }

    return true;
  }