accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Vines <jvi...@gmail.com>
Subject Re: StatsIterator - what is the significance of 23?
Date Wed, 04 Sep 2013 04:20:27 GMT
For a similar fun read, check out reasoning for the implementation of
String's hashCode()


On Tue, Sep 3, 2013 at 10:17 PM, Mike Drob <mdrob@mdrob.com> wrote:

> At a guess, it looks like a small prime intended to decrease the amount of
> atomic operations.
>
> Completely unrelated, but this made me think of Feynman and the mysterious
> number 137.
>
>
> On Tue, Sep 3, 2013 at 9:29 PM, David Medinets <david.medinets@gmail.com
> >wrote:
>
> > At the risk of having overlooked something obvious, I was curious about
> the
> > occurrence of 23 in the StatsIterator code:
> >
> >   public void next() throws IOException {
> >     super.next();
> >     numRead++;
> >
> >     if (numRead % 23 == 0) {
> >       readCounter.addAndGet(numRead);
> >       numRead = 0;
> >     }
> >   }
> >
> > I'm also wondering about the StatsIterator in general. The member
> variables
> > are all private. They are incremented but never used.
> >
>



-- 
Cheers
~John

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message