Package com.alibaba.wasp

Examples of com.alibaba.wasp.MetaException


  private HTableInterface getHTable() throws MetaException {
    try {
      return hbaseActionManager.getTable(metaTable);
    } catch (StorageTableNotFoundException e) {
      throw new MetaException(e);
    }
  }
View Full Code Here


      return;
    }
    try {
      htable.close();
    } catch (IOException e) {
      throw new MetaException(e);
    }
  }
View Full Code Here

      throws MetaException {
    try {
      return hbaseActionManager.getStorageTableDesc(storageTable);
    } catch (IOException e) {
      LOG.error("getStorageTableDesc ", e);
      throw new MetaException(e);
    }
  }
View Full Code Here

  public HTableDescriptor[] listStorageTables() throws MetaException {
    try {
      return hbaseActionManager.listStorageTables();
    } catch (IOException e) {
      LOG.error("listStorageTables ", e);
      throw new MetaException(e);
    }
  }
View Full Code Here

  public void createStorageTable(HTableDescriptor desc) throws MetaException {
    try {
      hbaseActionManager.createStorageTable(desc);
    } catch (IOException e) {
      LOG.error("listStorageTables ", e);
      throw new MetaException(e);
    }
  }
View Full Code Here

      throws MetaException {
    try {
      return hbaseActionManager.storageTableExists(deleteStorageTable);
    } catch (IOException e) {
      LOG.error("storageTableExists ", e);
      throw new MetaException(e);
    }
  }
View Full Code Here

    Put put = new Put(rowKey);
    put.add(FConstants.CATALOG_FAMILY, FConstants.TABLEINFO, tbl.toByte());
    boolean a = checkAndPut(FConstants.CATALOG_FAMILY, FConstants.TABLEINFO,
        null, put);
    if (!a) {
      throw new MetaException(tbl.getTableName() + " is already exists.");
    }
  }
View Full Code Here

  @Override
  public void dropTable(String tableName) throws MetaException {
    byte[] rowKey = Bytes.toBytes(FConstants.TABLEROW_PREFIX_STR + tableName);
    Get get = new Get(rowKey);
    if (!exists(get)) {
      throw new MetaException(tableName + " is not exists.");
    }
    Delete delete = new Delete(rowKey);
    delete(delete);
  }
View Full Code Here

  public void alterTable(String tableName, FTable newFTable)
      throws MetaException {
    byte[] rowKey = Bytes.toBytes(FConstants.TABLEROW_PREFIX_STR + tableName);
    Get get = new Get(rowKey);
    if (!exists(get)) {
      throw new MetaException(tableName + " is not exists.");
    }
    if (tableName.equals(newFTable.getTableName())) {
      Put put = new Put(rowKey);
      put.add(FConstants.CATALOG_FAMILY, FConstants.TABLEINFO,
          newFTable.toByte());
      put(put);
    } else {
      // rename (1) tableName exists (2)newFTable.getTableName() is not exists
      rowKey = Bytes.toBytes(FConstants.TABLEROW_PREFIX_STR
          + newFTable.getTableName());
      get = new Get(rowKey);
      if (exists(get)) {
        throw new MetaException(tableName + " is already exists.");
      }
      // put into a new row
      Put put = new Put(rowKey);
      put.add(FConstants.CATALOG_FAMILY, FConstants.TABLEINFO,
          newFTable.toByte());
View Full Code Here

        LinkedHashMap<String, Index> indexs = parseIndex(r);
        ftable.setIndex(indexs);
        tables.add(ftable);
      }
    } catch (IOException e) {
      throw new MetaException(e);
    } finally {
      closeHTable(htable);
    }
    return tables;
  }
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.MetaException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.