Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.HTable$ClientScanner


    }

    @Override
    public TRegionInfo getRegionInfo(ByteBuffer searchRow) throws IOError {
      try {
        HTable table = getTable(HConstants.META_TABLE_NAME);
        byte[] row = toBytes(searchRow);
        Result startRowResult = table.getRowOrBefore(
          row, HConstants.CATALOG_FAMILY);

        if (startRowResult == null) {
          throw new IOException("Cannot find row in .META., row="
                                + Bytes.toString(searchRow.array()));
View Full Code Here


        this.coalescer.queueIncrement(tincrement);
        return;
      }

      try {
        HTable table = getTable(tincrement.getTable());
        Increment inc = ThriftUtilities.incrementFromThrift(tincrement);
        table.increment(inc);
      } catch (IOException e) {
        LOG.warn(e.getMessage(), e);
        throw new IOError(e.getMessage());
      }
    }
View Full Code Here

  @Override
  public void start(){
    Preconditions.checkArgument(table == null, "Please call stop " +
        "before calling start on an old instance.");
    try {
      table = new HTable(config, tableName);
      //flush is controlled by us. This ensures that HBase changing
      //their criteria for flushing does not change how we flush.
      table.setAutoFlush(false);
    } catch (IOException e) {
      logger.error("Could not load table, " + tableName +
View Full Code Here

    }
  }

  public boolean reOpenAllRegions(List<HRegionInfo> regions) throws IOException {
    boolean done = false;
    HTable table = null;
    TreeMap<ServerName, List<HRegionInfo>> serverToRegions = Maps.newTreeMap();
    NavigableMap<HRegionInfo, ServerName> hriHserverMapping;

    LOG.info("Bucketing regions by region server...");

    try {
      table = new HTable(masterServices.getConfiguration(), tableName);
      hriHserverMapping = table.getRegionLocations();
    } finally {
      if (table != null) {
        table.close();
      }
    }
    List<HRegionInfo> reRegions = new ArrayList<HRegionInfo>();
    for (HRegionInfo hri : regions) {
      ServerName rsLocation = hriHserverMapping.get(hri);
View Full Code Here

    }

    Configuration c = new Configuration(this.conf);
    this.hbaseCluster = new MiniHBaseCluster(c, numMasters, numSlaves);
    // Don't leave here till we've done a successful scan of the .META.
    HTable t = new HTable(c, HConstants.META_TABLE_NAME);
    ResultScanner s = t.getScanner(new Scan());
    while (s.next() != null) {
      continue;
    }
    s.close();
    t.close();

    getHBaseAdmin(); // create immediately the hbaseAdmin
    LOG.info("Minicluster is up");
    return (MiniHBaseCluster)this.hbaseCluster;
  }
View Full Code Here

   * @throws IOException
   */
  public void restartHBaseCluster(int servers) throws IOException, InterruptedException {
    this.hbaseCluster = new MiniHBaseCluster(this.conf, servers);
    // Don't leave here till we've done a successful scan of the .META.
    HTable t = new HTable(new Configuration(this.conf), HConstants.META_TABLE_NAME);
    ResultScanner s = t.getScanner(new Scan());
    while (s.next() != null) {
      // do nothing
    }
    LOG.info("HBase has been restarted");
    s.close();
    t.close();
  }
View Full Code Here

      HColumnDescriptor hcd = new HColumnDescriptor(family)
          .setMaxVersions(numVersions);
      desc.addFamily(hcd);
    }
    getHBaseAdmin().createTable(desc, startKey, endKey, numRegions);
    return new HTable(getConfiguration(), tableName);
  }
View Full Code Here

    HTableDescriptor desc = new HTableDescriptor(tableName);
    for(byte[] family : families) {
      desc.addFamily(new HColumnDescriptor(family));
    }
    getHBaseAdmin().createTable(desc);
    return new HTable(c, tableName);
  }
View Full Code Here

      HColumnDescriptor hcd = new HColumnDescriptor(family)
          .setMaxVersions(numVersions);
      desc.addFamily(hcd);
    }
    getHBaseAdmin().createTable(desc);
    return new HTable(c, tableName);
  }
View Full Code Here

      HColumnDescriptor hcd = new HColumnDescriptor(family)
          .setMaxVersions(numVersions);
      desc.addFamily(hcd);
    }
    getHBaseAdmin().createTable(desc);
    return new HTable(new Configuration(getConfiguration()), tableName);
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.client.HTable$ClientScanner

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.