accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Billie J Rinaldi <billie.j.rina...@ugov.gov>
Subject Re: Could combiners be coded using groovy?
Date Tue, 10 Apr 2012 19:57:33 GMT
I'm not familiar with Groovy, but it sounds interesting.  I could recommend some ways to test
your iterator before you push it out to Accumulo.  You can make some fake data for a unit
test by creating a TreeMap<Key,Value> and then using a SortedMapIterator to turn that
into a source for your iterator.  A lot of our unit tests look like the following.

  TreeMap<Key,Value> tm = new TreeMap<Key,Value>();
  // put some data into the tree map
  
  MyIterator iter = new MyIterator();
  
  IteratorSetting is = new IteratorSetting(1, MyIterator.class);
  MyIterator.setSomeOption(is, option);
  
  iter.init(new SortedMapIterator(tm), is.getOptions(), null);
  iter.seek(new Range(), new ArrayList<ByteSequence>(), false);
  
  while (iter.hasTop()) {
    Key k = iter.getTopKey();
    Value v = iter.getTopValue();
    // check that k and v are what you expected
    iter.next();
  }

Another option is to use the ClientSideIteratorScanner to test your iterator in your local
JVM before running it on a tserver.

Billie


On Sunday, April 8, 2012 11:08:05 PM, "David Medinets" <david.medinets@gmail.com> wrote:
> I was working with combiners and seeing the jar file loaded and
> reloaded. And seeing my accumulo crash because I coded the combiner
> incorrectly. I started to wonder how easier it might be to easy a
> dynamically compiled language like Groovy to developer combiners.
> 
> How hard would it be to integrate Groovy? Have any of the core
> accumulo developers used groovy?
> 
> Is there a better language than groovy now? I last worked with groovy
> #$%$ years ago. It worked very well for me.

Mime
View raw message