Advertisement
Guest User

Accumulo range test

a guest
May 1st, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement