This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Accumulo range test

By: a guest on May 1st, 2013  |  syntax: Java  |  size: 0.69 KB  |  views: 6  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public class RangeTest {
  2.         public static class Itr extends WrappingIterator {
  3.                 boolean queried = false;
  4.                 public Key getTopKey() {
  5.                         return new Key("C");
  6.                 }
  7.                 public Value getTopValue() {
  8.                         return new Value(new byte[0]);
  9.                 }
  10.                 public Itr deepCopy(IteratrEnvironment env) {
  11.                         Itr i = new Itr();
  12.                         i.setSource(this.getSource().deepCopy(env));
  13.                         return i;
  14.                 }
  15.         }
  16.  
  17.         public static void main(String[] args) throws Exception {
  18.                 Connector c; // do the instaniation stuff for these guys
  19.                 BatchScanner bs;
  20.                 bs.addScanIterator(new IteratorSetting(50, Itr.class));
  21.                 bs.setRanges(Collections.singleton(new Range("A", "B"));
  22.                 for(Entry e : bs) System.out.println(e.getKey());
  23.         }
  24. }
clone this paste RAW Paste Data