Package org.apache.hadoop.hbase.client.coprocessor

Examples of org.apache.hadoop.hbase.client.coprocessor.AggregationClient.rowCount()


    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    scan.setStartRow(ROWS[2]);
    scan.setStopRow(ROWS[14]);
    final ColumnInterpreter<Long, Long> ci = new LongColumnInterpreter();
    long rowCount = aClient.rowCount(TEST_TABLE, ci, scan);
    assertEquals(12, rowCount);
  }

  /**
   * This will test the row count on the entire table. Startrow and endrow will
View Full Code Here


  public void testRowCountAllTable() throws Throwable {
    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    final ColumnInterpreter<Long, Long> ci = new LongColumnInterpreter();
    long rowCount = aClient.rowCount(TEST_TABLE, ci,
        scan);
    assertEquals(ROWSIZE, rowCount);
  }

  /**
 
View Full Code Here

    scan.setStopRow(ROWS[2]);

    final ColumnInterpreter<Long, Long> ci = new LongColumnInterpreter();
    long rowCount = -1;
    try {
      rowCount = aClient.rowCount(TEST_TABLE, ci, scan);
    } catch (Throwable e) {
      myLog.error("Exception thrown in the invalidRange method"
          + e.getStackTrace());
    }
    assertEquals(-1, rowCount);
View Full Code Here

    scan.setStopRow(ROWS[5]);

    final ColumnInterpreter<Long, Long> ci = new LongColumnInterpreter();
    long rowCount = -1;
    try {
      rowCount = aClient.rowCount(TEST_TABLE, ci, scan);
    } catch (Throwable e) {
      rowCount = 0;
    }
    assertEquals(0, rowCount);
  }
View Full Code Here

    scan.setStartRow(ROWS[5]);
    scan.setStopRow(ROWS[15]);
    final ColumnInterpreter<Long, Long> ci = new LongColumnInterpreter();
    long rowCount = -1;
    try {
      rowCount = aClient.rowCount(TEST_TABLE, ci, scan);
    } catch (Throwable e) {
       rowCount = 0;
    }
    assertEquals(0, rowCount);
  }
View Full Code Here

  public void testRowCountWithNullCQ() throws Throwable {
    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addFamily(TEST_FAMILY);
    final ColumnInterpreter<Long, Long> ci = new LongColumnInterpreter();
    long rowCount = aClient.rowCount(TEST_TABLE, ci,
        scan);
    assertEquals(20, rowCount);
  }

  @Test
View Full Code Here

    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    final ColumnInterpreter<Long, Long> ci = new LongColumnInterpreter();
    Filter f = new PrefixFilter(Bytes.toBytes("foo:bar"));
    scan.setFilter(f);
    long rowCount = aClient.rowCount(TEST_TABLE, ci,
        scan);
    assertEquals(0, rowCount);
  }

  /**
 
View Full Code Here

    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    scan.setStartRow(ROWS[2]);
    scan.setStopRow(ROWS[14]);
    final ColumnInterpreter<Long, Long> ci = new LongColumnInterpreter();
    long rowCount = aClient.rowCount(TEST_TABLE, ci, scan);
    assertEquals(12, rowCount);
  }

  /**
   * This will test the row count on the entire table. Startrow and endrow will
View Full Code Here

  public void testRowCountAllTable() throws Throwable {
    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    final ColumnInterpreter<Long, Long> ci = new LongColumnInterpreter();
    long rowCount = aClient.rowCount(TEST_TABLE, ci,
        scan);
    assertEquals(ROWSIZE, rowCount);
  }

  /**
 
View Full Code Here

    scan.setStopRow(ROWS[2]);

    final ColumnInterpreter<Long, Long> ci = new LongColumnInterpreter();
    long rowCount = -1;
    try {
      rowCount = aClient.rowCount(TEST_TABLE, ci, scan);
    } catch (Throwable e) {
      myLog.error("Exception thrown in the invalidRange method"
          + e.getStackTrace());
    }
    assertEquals(-1, rowCount);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.