Re: Approach to hold the output of an iterator in memory to do further operations

2015-04-27 Thread Mike Drob
Check out the MinCombiner

https://github.com/apache/accumulo/blob/master/core/src/main/java/org/apache/accumulo/core/iterators/user/MinCombiner.java

On Mon, Apr 27, 2015 at 12:19 PM, vaibhav thapliyal 
vaibhav.thapliyal...@gmail.com wrote:

 Hello everyone.

 I am trying to carry out max and min kind of operations using accumulo.

 But since the Accumulo iterators only operate on the entries that are
 lovally hosted I get the local max and local min of the instead of a global
 max and min.

 To get this global max and min, I have to calculate this client side.  I
 want to ask if there is some way to store this local max and min in memory
 using iterator. So that a global max and min can be calculated server side
 only.

 I tried to this by writing the result in another table and using another
 iterator to return me the global max and min.

 I want to ask if there if a way to store this in memory so as to avoid
 writing it to a table?

 Thanks
 Vaibhav



Re: Approach to hold the output of an iterator in memory to do further operations

2015-04-27 Thread Josh Elser

No, there isn't a way to do this that doesn't involve writing it to disk.

vaibhav thapliyal wrote:

I want to ask if there if a way to store this in memory so as to avoid
writing it to a table?


Is there a reason for wanting to avoid this (small) amount of work 
client-side? My experience has been that this is a very lightweight 
computation to perform on the client.


 To get this global max and min, I have to calculate this client side. 
 I want to ask if there is some way to store this local max and min in 
memory using iterator. So that a global max and min can be calculated 
server side only.