Package com.alibaba.wasp

Examples of com.alibaba.wasp.MetaException


  public void addIndex(String tableName, Index index) throws MetaException {
    byte[] rowKey = Bytes.toBytes(FConstants.TABLEROW_PREFIX_STR + tableName);
    Get get = new Get(rowKey);
    // check if the table exists
    if (!exists(get)) {
      throw new MetaException(tableName + " is not exists.");
    }
    Put put = new Put(rowKey);
    byte[] cq = Bytes.toBytes(FConstants.INDEXQUALIFIER_PREFIX_STR
        + index.getIndexName());
    put.add(FConstants.CATALOG_FAMILY, cq, index.toByte());
View Full Code Here


  public void deleteIndex(String tableName, Index index) throws MetaException {
    byte[] rowKey = Bytes.toBytes(FConstants.TABLEROW_PREFIX_STR + tableName);
    Get get = new Get(rowKey);
    // check if the table exists
    if (!exists(get)) {
      throw new MetaException(tableName + " is not exists.");
    }
    Delete delete = new Delete(rowKey);
    byte[] cq = Bytes.toBytes(FConstants.INDEXQUALIFIER_PREFIX_STR
        + index.getIndexName());
    delete.deleteColumns(FConstants.CATALOG_FAMILY, cq);
View Full Code Here

    byte[] rowKey = Bytes.toBytes(FConstants.TABLEROW_PREFIX_STR + tableName);
    Get get = new Get(rowKey);
    get.addFamily(FConstants.CATALOG_FAMILY);
    // check if the table exists
    if (!exists(get)) {
      throw new MetaException(tableName + " is not exists.");
    }
    Result rs = get(get);
    return parseIndex(rs);
  }
View Full Code Here

      throws MetaException {
    byte[] rowKey = Bytes.toBytes(FConstants.TABLEROW_PREFIX_STR + tableName);
    Get get = new Get(rowKey);
    // check if the table exists
    if (!exists(get)) {
      throw new MetaException(tableName + " is not exists.");
    }
    byte[] cq = Bytes.toBytes(FConstants.INDEXQUALIFIER_PREFIX_STR + indexName);
    get.addColumn(FConstants.CATALOG_FAMILY, cq);
    Result rs = get(get);
    byte[] value = rs.getValue(FConstants.CATALOG_FAMILY, cq);
View Full Code Here

    byte[] value = rs
        .getValue(FConstants.CATALOG_FAMILY, FConstants.EGLOCATION);
    try {
      return ServerName.convert(value);
    } catch (DeserializationException de) {
      throw new MetaException(de);
    }
  }
View Full Code Here

    try {
      return new Pair<EntityGroupInfo, ServerName>(
          EntityGroupInfo.parseFromOrNull(infoValue),
          ServerName.convert(locationValue));
    } catch (DeserializationException de) {
      throw new MetaException(de);
    }
  }
View Full Code Here

      } finally {
        scanner.close();
        metaTable.close();
      }
    } catch (IOException e) {
      throw new MetaException(e);
    }
    return;
  }
View Full Code Here

        EntityGroupLocation egLoc = new EntityGroupLocation(info,
            sn.getHostname(), sn.getPort());
        return egLoc;
      }
    } catch (IOException e) {
      throw new MetaException(e);
    }
  }
View Full Code Here

      if (LOG.isDebugEnabled()) {
        LOG.debug("FMeta Put " + p);
      }
      meta.put(p);
    } catch (IOException e) {
      throw new MetaException(e);
    } finally {
      closeHTable(meta);
    }
  }
View Full Code Here

      if (LOG.isDebugEnabled()) {
        LOG.debug("FMeta checkAndPut " + p);
      }
      return meta.checkAndPut(p.getRow(), family, qualifier, value, p);
    } catch (IOException e) {
      throw new MetaException(e);
    } finally {
      closeHTable(meta);
    }
  }
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.