Package org.apache.accumulo.core.client

Examples of org.apache.accumulo.core.client.Scanner.addScanIterator()


                "(fn [y x]" +
                  "(if (instance? KeyValue y)" +
                      "(string/join \",\" [(kvs x) (kvs y)])" +
                      "(string/join \",\" [(kvs x) y])))");
        is.addOption("columns", "1");
        s.addScanIterator(is);

        List<String> list = new ArrayList<String>();
        for (Map.Entry<Key, Value> e : s) {
            list.add(new String(e.getValue().get()));
        }
View Full Code Here


                "(import '[org.apache.accumulo.core.data Value])" +
                "(fn [x _]" +
                  "(inc x))");
        is.addOption("val", "0");
        is.addOption("columns", "1");
        s.addScanIterator(is);

        List<String> list = new ArrayList<String>();
        for (Map.Entry<Key, Value> e : s) {
            list.add(new String(e.getValue().get()));
        }
View Full Code Here

        s.setRange(new Range("d"));

        IteratorSetting is = new IteratorSetting(10, "combiner", "clojure_accumulo.iterators.ClojureCombiner");
        is.addOption("f", "(fn [_ _] (throw (Exception.)))");
        is.addOption("columns", "1");
        s.addScanIterator(is);

        List<String> list = new ArrayList<String>();
        for (Map.Entry<Key, Value> e : s) {
            list.add(new String(e.getValue().get()));
        }
View Full Code Here

                "(import '[org.apache.accumulo.core.data Value])" +
                "(fn [x _]" +
                  "(inc x))");
        is.addOption("val", "0");
        is.addOption("columns", "1");
        s.addScanIterator(is);

        List<String> list = new ArrayList<String>();
        for (Map.Entry<Key, Value> e : s) {
            list.add(new String(e.getValue().get()));
        }
View Full Code Here

    }

    @Test(expected = IllegalArgumentException.class)
    public void testValidationRequiresPredicate() throws Exception {
        Scanner s = conn.createScanner(TABLE_NAME, new Authorizations());
        s.addScanIterator(new IteratorSetting(10, "filter", "clojure_accumulo.iterators.ClojureFilter"));
        s.iterator();
    }

    @Test
    public void testFilter() throws Exception {
View Full Code Here

        IteratorSetting is = new IteratorSetting(10, "filter", "clojure_accumulo.iterators.ClojureFilter");
        is.addOption("pred",
                "(import '[org.apache.accumulo.core.data Key])" +
                "(fn [[^Key k v]] " +
                  "(= (str (.getRow k)) \"a\"))");
        s.addScanIterator(is);

        for (Map.Entry<Key, Value> e : s) {
            Assert.assertEquals("a", e.getKey().getRow().toString());
        }
    }
View Full Code Here

    }

    @Test(expected = IllegalArgumentException.class)
    public void testValidationRequiresFn() throws Exception {
        Scanner s = conn.createScanner(TABLE_NAME, new Authorizations());
        s.addScanIterator(new IteratorSetting(10, "mapper", "clojure_accumulo.iterators.ClojureMapper"));
        s.iterator();
    }

    @Test
    public void testMapValues() throws Exception {
View Full Code Here

        is.addOption("f",
                "(require '[clojure.string :as string])" +
                "(import '[org.apache.accumulo.core.data Value])" +
                "(fn [[_ ^Value v]] " +
                   "(Value. (.getBytes (string/upper-case (String. (.get v))))))");
        s.addScanIterator(is);

        Set<String> expected = new HashSet<String>();
        expected.add("A-B");
        expected.add("A-C");
        expected.add("D-E");
View Full Code Here

                "(fn [[^Key k v]] " +
                  "[(Key. (string/upper-case (str (.getRow k))) " +
                         "(str (.getColumnFamily k)) " +
                         "(str (.getColumnQualifier k)))" +
                     "v])");
        s.addScanIterator(is);

        Set<String> expected = new HashSet<String>();
        expected.add("A");
        expected.add("D");
View Full Code Here

  @Override
  public long deleteByQuery(Query<K,T> query) throws IOException {
    try {
      Scanner scanner = createScanner(query);
      // add iterator that drops values on the server side
      scanner.addScanIterator(new IteratorSetting(Integer.MAX_VALUE, SortedKeyIterator.class));
      RowIterator iterator = new RowIterator(scanner.iterator());
     
      long count = 0;

      while (iterator.hasNext()) {
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.