Package org.apache.hadoop.hbase.filter

Examples of org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter


       
        // Confirm that data is no longer there because we dropped the table
        // This needs to be done natively b/c the metadata is gone
        HTableInterface htable = conn5.unwrap(PhoenixConnection.class).getQueryServices().getTable(SchemaUtil.getTableNameAsBytes(ATABLE_SCHEMA_NAME, ATABLE_NAME));
        Scan scan = new Scan();
        scan.setFilter(new FirstKeyOnlyFilter());
        scan.setTimeRange(0, ts+9);
        assertNull(htable.getScanner(scan).next());
        conn5.close();

        // Still should work b/c we're at an earlier timestamp than when table was deleted
View Full Code Here


       * scan, add the FirstKeyOnlyFilter as the LAST filter of a MUST_PASS_ALL
       * FilterList.
       */
      if (rowKeyOnly) {
        hbaseScan.setFilter(
            HBaseUtils.andFilterAtIndex(hbaseScan.getFilter(), HBaseUtils.LAST_FILTER, new FirstKeyOnlyFilter()));
      }
    } else {
      transformed.add(ROW_KEY_PATH);
    }

View Full Code Here

        if (clientTimeStamp == HConstants.LATEST_TIMESTAMP) {
            return null;
        }
   
        Scan scan = newTableRowsScan(key, clientTimeStamp, HConstants.LATEST_TIMESTAMP);
        scan.setFilter(new FirstKeyOnlyFilter());
        scan.setRaw(true);
        RegionScanner scanner = region.getScanner(scan);
        List<Cell> results = Lists.<Cell> newArrayList();
        scanner.next(results);
        // HBase ignores the time range on a raw scan (HBASE-7362)
View Full Code Here

   */
  private synchronized void refreshItemIDs() throws IOException {
    // Get the list of item ids
    HTableInterface table = pool.getTable(tableName);
    Scan scan = new Scan(new byte[]{0x69}, new byte[]{0x70});
    scan.setFilter(new FilterList(FilterList.Operator.MUST_PASS_ALL, new KeyOnlyFilter(), new FirstKeyOnlyFilter()));
    ResultScanner scanner = table.getScanner(scan);
    Collection<Long> ids = Lists.newLinkedList();
    for (Result result : scanner) {
      ids.add(bytesToUserOrItemID(result.getRow()));
    }
View Full Code Here

   */
  private synchronized void refreshUserIDs() throws IOException {
    // Get the list of user ids
    HTableInterface table = pool.getTable(tableName);
    Scan scan = new Scan(new byte[]{0x75}, new byte[]{0x76});
    scan.setFilter(new FilterList(FilterList.Operator.MUST_PASS_ALL, new KeyOnlyFilter(), new FirstKeyOnlyFilter()));
    ResultScanner scanner = table.getScanner(scan);
    Collection<Long> ids = Lists.newLinkedList();
    for (Result result : scanner) {
      ids.add(bytesToUserOrItemID(result.getRow()));
    }
View Full Code Here

            if (familyMap.isEmpty() && context.getWhereCoditionColumns().isEmpty()
                    && table.getColumnFamilies().size() == 1) {
                // Project the one column family. We must project a column family since it's possible
                // that there are other non declared column families that we need to ignore.
                scan.addFamily(table.getColumnFamilies().get(0).getName().getBytes());
                ScanUtil.andFilterAtBeginning(scan, new FirstKeyOnlyFilter());
            } else {
                byte[] ecf = SchemaUtil.getEmptyColumnFamily(table);
                // Project empty key value unless the column family containing it has
                // been projected in its entirety.
                if (!familyMap.containsKey(ecf) || familyMap.get(ecf) != null) {
View Full Code Here

       * scan, add the FirstKeyOnlyFilter as the LAST filter of a MUST_PASS_ALL
       * FilterList.
       */
      if (rowKeyOnly) {
        hbaseScan.setFilter(
            HBaseUtils.andFilterAtIndex(hbaseScan.getFilter(), HBaseUtils.LAST_FILTER, new FirstKeyOnlyFilter()));
      }
    } else {
      transformed.add(ROW_KEY_PATH);
    }

View Full Code Here

     * the range.
     */
    private void deleteRowsInRange(byte[] start, byte[] end) {
        final Scan scan = new Scan(start, end).setFilter(
                new FilterList(
                        new FirstKeyOnlyFilter(),
                        new KeyOnlyFilter()));

        try {
            hTable.coprocessorExec(
                    BulkDeleteProtocol.class, start, end, new Batch.Call<BulkDeleteProtocol, BulkDeleteResponse>() {
View Full Code Here

        if (clientTimeStamp == HConstants.LATEST_TIMESTAMP) {
            return null;
        }
       
        Scan scan = newTableRowsScan(key, clientTimeStamp, HConstants.LATEST_TIMESTAMP);
        scan.setFilter(new FirstKeyOnlyFilter());
        scan.setRaw(true);
        RegionScanner scanner = region.getScanner(scan);
        List<KeyValue> results = Lists.<KeyValue>newArrayList();
        scanner.next(results);
        // HBase ignores the time range on a raw scan (HBASE-7362)
View Full Code Here

       
        // Confirm that data is no longer there because we dropped the table
        // This needs to be done natively b/c the metadata is gone
        HTableInterface htable = conn5.unwrap(PhoenixConnection.class).getQueryServices().getTable(SchemaUtil.getTableNameAsBytes(ATABLE_SCHEMA_NAME, ATABLE_NAME));
        Scan scan = new Scan();
        scan.setFilter(new FirstKeyOnlyFilter());
        scan.setTimeRange(0, ts+9);
        assertNull(htable.getScanner(scan).next());
        conn5.close();

        // Still should work b/c we're at an earlier timestamp than when table was deleted
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter

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.