Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.HTableInterface


    scan.setCaching(caching);
    if (allFilters != null) {
      scan.setFilter(allFilters);
    }
    scan.addFamily(FConstants.CATALOG_FAMILY);
    HTableInterface metaTable = getHTable();
    try {
      ResultScanner scanner = metaTable.getScanner(scan);
      try {
        Result data;
        while ((data = scanner.next()) != null) {
          if (data.isEmpty()) {
            continue;
          }
          if (Bytes.startsWith(data.getRow(), FConstants.TABLEROW_PREFIX)) {
            continue;
          }
          // Break if visit returns false.
          if (!visitor.visit(data))
            break;
        }
      } finally {
        scanner.close();
        metaTable.close();
      }
    } catch (IOException e) {
      throw new MetaException(e);
    }
    return;
View Full Code Here


    p.add(FConstants.CATALOG_FAMILY, FConstants.EGLOCATION, sn.toByte());
    return p;
  }

  private void put(final Put p) throws MetaException {
    HTableInterface meta = getHTable();
    try {
      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

    }
  }

  private boolean checkAndPut(final byte[] family, final byte[] qualifier,
      final byte[] value, final Put p) throws MetaException {
    HTableInterface meta = getHTable();
    try {
      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

      closeHTable(meta);
    }
  }

  private void put(final List<Put> p) throws MetaException {
    HTableInterface meta = getHTable();
    try {
      meta.put(p);
      if (LOG.isDebugEnabled()) {
        LOG.debug("FMeta Put " + p);
      }
    } catch (IOException e) {
      throw new MetaException(e);
View Full Code Here

      closeHTable(meta);
    }
  }

  private Result get(final Get get) throws MetaException {
    HTableInterface meta = getHTable();
    try {
      if (LOG.isDebugEnabled()) {
        LOG.debug("FMeta Get " + get);
      }
      return meta.get(get);
    } catch (IOException e) {
      throw new MetaException(e);
    } finally {
      closeHTable(meta);
    }
View Full Code Here

      closeHTable(meta);
    }
  }

  private void delete(final Delete delete) throws MetaException {
    HTableInterface meta = getHTable();
    try {
      if (LOG.isDebugEnabled()) {
        LOG.debug("FMeta Delete " + delete);
      }
      meta.delete(delete);
    } catch (IOException e) {
      throw new MetaException(e);
    } finally {
      closeHTable(meta);
    }
View Full Code Here

      closeHTable(meta);
    }
  }

  private void delete(final List<Delete> allDelete) throws MetaException {
    HTableInterface meta = getHTable();
    try {
      meta.delete(allDelete);
      if (LOG.isDebugEnabled()) {
        LOG.debug("FMeta Delete " + allDelete);
      }
    } catch (IOException e) {
      throw new MetaException(e);
View Full Code Here

      closeHTable(meta);
    }
  }

  private boolean exists(final Get get) throws MetaException {
    HTableInterface meta = getHTable();
    try {
      boolean ex = meta.exists(get);
      if (LOG.isDebugEnabled()) {
        LOG.debug("FMeta " + get + " exists " + "=" + ex);
      }
      return ex;
    } catch (IOException e) {
View Full Code Here

   * @throws java.io.IOException
   * @throws StorageTableNotFoundException
   */
  public void put(String tableName, Put put) throws IOException,
      StorageTableNotFoundException {
    HTableInterface tableInterface = getTable(tableName);

    try {
      tableInterface.put(put);
    } finally {
      // return table to hTable pool
      tableInterface.close();
    }
  }
View Full Code Here

   * @throws java.io.IOException
   * @throws StorageTableNotFoundException
   */
  public void delete(String tableName, Delete delete) throws IOException,
      StorageTableNotFoundException {
    HTableInterface tableInterface = getTable(tableName);

    try {
      tableInterface.delete(delete);
    } finally {
      // return table to hTable pool
      tableInterface.close();
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.client.HTableInterface

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.