Package org.kiji.schema.impl.hbase

Examples of org.kiji.schema.impl.hbase.HBaseDataRequestAdapter


  @Test
  public void testApplyToScan() throws Exception {
    // Initialize a scan object with some requested data.
    final KijiDataRequest priorDataRequest = KijiDataRequest.create("family", "column");
    final Scan actualScan =
        new HBaseDataRequestAdapter(priorDataRequest, mColumnNameTranslator).toScan(mTableLayout);

    // Construct a row filter and apply it to the existing scan.
    final KijiRowFilter rowFilter = new MyKijiRowFilter();
    final KijiRowFilterApplicator applicator =
        KijiRowFilterApplicator.create(rowFilter, mTableLayout, getKiji().getSchemaTable());
    applicator.applyTo(actualScan);

    // After filter application, expect the scan to also have the column requested by the filter.
    final Scan expectedScan =
        new HBaseDataRequestAdapter(
            priorDataRequest.merge(rowFilter.getDataRequest()), mColumnNameTranslator)
            .toScan(mTableLayout);
    expectedScan.setFilter(mHBaseFilter);
    assertEquals(expectedScan.toString(), actualScan.toString());
    assertTrue(new ScanEquals(expectedScan).matches(actualScan));
View Full Code Here


  public void applyTo(Scan scan) throws IOException {
    // The filter might need to request data that isn't already requested by the scan, so add
    // it here if needed.
    try {
      // TODO: SCHEMA-444 Avoid constructing a new KijiColumnNameTranslator below.
      new HBaseDataRequestAdapter(
          mRowFilter.getDataRequest(),
          HBaseColumnNameTranslator.from(mTableLayout))
          .applyToScan(scan, mTableLayout);
    } catch (InvalidLayoutException e) {
      throw new InternalKijiError(e);
View Full Code Here

TOP

Related Classes of org.kiji.schema.impl.hbase.HBaseDataRequestAdapter

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.