Package org.apache.hadoop.hbase.filter

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


      final byte [] arbitraryStopRow = Bytes.toBytes("c");
      byte [] actualStopRow = null;
      byte [][] columns = {COLFAMILY_NAME1};
      scanner = region.getScanner(columns,
          arbitraryStartRow, HConstants.LATEST_TIMESTAMP,
          new WhileMatchRowFilter(new StopRowFilter(arbitraryStopRow)));
      HStoreKey key = new HStoreKey();
      TreeMap<byte [], Cell> value =
        new TreeMap<byte [], Cell>(Bytes.BYTES_COMPARATOR);
      while (scanner.next(key, value)) {
        if (actualStartRow == null) {
View Full Code Here


   */
  public Scanner getScanner(final byte [][] columns,
    final byte [] startRow, final byte [] stopRow, final long timestamp)
  throws IOException {
    return getScanner(columns, startRow, timestamp,
      new WhileMatchRowFilter(new StopRowFilter(stopRow)));
 
View Full Code Here

    public void init() throws IOException {
      if ((endRow != null) && (endRow.length > 0)) {
        if (trrRowFilter != null) {
          final Set<RowFilterInterface> rowFiltersSet =
            new HashSet<RowFilterInterface>();
          rowFiltersSet.add(new StopRowFilter(endRow));
          rowFiltersSet.add(trrRowFilter);
          this.scanner = this.htable.getScanner(trrInputColumns, startRow,
            new RowFilterSet(RowFilterSet.Operator.MUST_PASS_ALL,
              rowFiltersSet));
        } else {
View Full Code Here

  private byte[] getEndRow(RowFilterInterface filter) {
    if (filter instanceof WhileMatchRowFilter) {
      WhileMatchRowFilter wmrFilter = (WhileMatchRowFilter) filter;
      if (wmrFilter.getInternalFilter() instanceof StopRowFilter) {
        StopRowFilter stopFilter = (StopRowFilter) wmrFilter
            .getInternalFilter();
        return stopFilter.getStopRowKey();
      }
    } else if (filter instanceof RowFilterSet) {
      RowFilterSet rowFilterSet = (RowFilterSet) filter;
      if (rowFilterSet.getOperator()
          .equals(RowFilterSet.Operator.MUST_PASS_ALL)) {
View Full Code Here

   */
  public Scanner getScanner(final byte [][] columns,
    final byte [] startRow, final byte [] stopRow, final long timestamp)
  throws IOException {
    return getScanner(columns, startRow, timestamp,
      new WhileMatchRowFilter(new StopRowFilter(stopRow)));
  }
View Full Code Here

   */
  public Scanner getScanner(final byte [][] columns,
    final byte [] startRow, final byte [] stopRow, final long timestamp)
  throws IOException {
    return getScanner(columns, startRow, timestamp,
      new WhileMatchRowFilter(new StopRowFilter(stopRow)));
  }
View Full Code Here

          inc.put(id, families[0], "bbb".getBytes());
          inc.commit(id);
        }
      }
      RowFilterInterface f =
        new WhileMatchRowFilter(new StopRowFilter(new Text("aad")));
      scanner = table.obtainScanner(families, HConstants.EMPTY_START_ROW,
        HConstants.LATEST_TIMESTAMP, f);
      int count = 0;
      for (Map.Entry<HStoreKey, SortedMap<Text, byte []>> e: scanner) {
        count++;
View Full Code Here

    // Get the filter.  The RegExpRowFilter used should filter out vowels and
    // the WhileMatchRowFilter(StopRowFilter) should filter out all rows
    // greater than or equal to 'r'.
    Set<RowFilterInterface> filterSet = new HashSet<RowFilterInterface>();
    filterSet.add(new RegExpRowFilter("[^aeiou]"));
    filterSet.add(new WhileMatchRowFilter(new StopRowFilter(new Text("r"))));
    RowFilterInterface filter =
      new RowFilterSet(RowFilterSet.Operator.MUST_PASS_ALL, filterSet);
   
    // Create the scanner from the filter.
    HScannerInterface scanner = table.obtainScanner(colKeys, new Text(new
View Full Code Here

      final Text arbitraryStopRow = new Text("c");
      Text actualStopRow = null;
      Text [] columns = new Text [] {new Text(COLFAMILY_NAME1)};
      scanner = region.getScanner(columns,
          arbitraryStartRow, HConstants.LATEST_TIMESTAMP,
          new WhileMatchRowFilter(new StopRowFilter(arbitraryStopRow)));
      HStoreKey key = new HStoreKey();
      TreeMap<Text, byte[]> value = new TreeMap<Text, byte []>();
      while (scanner.next(key, value)) {
        if (actualStartRow == null) {
          actualStartRow = new Text(key.getRow());
View Full Code Here

    assertTrue(((byte [])obj)[0] == A);
    // Do 'known' Writable type.
    obj = doType(conf, new Text(""), Text.class);
    assertTrue(obj instanceof Text);
    // Try type that should get transferred old fashion way.
    obj = doType(conf, new StopRowFilter(new Text("")),
        RowFilterInterface.class);
    assertTrue(obj instanceof StopRowFilter);
  }
View Full Code Here

TOP

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

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.