You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Adrien Grand <jp...@gmail.com> on 2012/06/08 12:20:32 UTC

Confusing method names to get the size of objects

Hi,

Lucene and Solr have a few classes that expose the size of their
instances, but with different method names. There are at least
ramBytesUsed (packed ints), sizeInBytes (FST, RamDirectory) and
memSize (Solr DocSets) that provide an estimation of the memory used
in bytes. The confusing thing is that sizeInBytes is sometimes also
used for on-disk sizes (SegmentInfo for example). I think it would
improve readability to stick to only two method names, one for the
in-memory size and one for the on-disk size. Or maybe these methods
have different meanings that I am missing? What do you think?

-- 
Adrien

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Confusing method names to get the size of objects

Posted by Adrien Grand <jp...@gmail.com>.
On Fri, Jun 8, 2012 at 2:12 PM, Michael McCandless
<lu...@mikemccandless.com> wrote:
> +1 to standardize on two names.  It is confusing now!

Thanks Mike for your feedback, I created LUCENE-4121 [1] to address this issue.

 [1] https://issues.apache.org/jira/browse/LUCENE-4121

-- 
Adrien

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Re: Confusing method names to get the size of objects

Posted by Michael McCandless <lu...@mikemccandless.com>.
+1 to standardize on two names.  It is confusing now!

Mike McCandless

http://blog.mikemccandless.com

On Fri, Jun 8, 2012 at 6:20 AM, Adrien Grand <jp...@gmail.com> wrote:
> Hi,
>
> Lucene and Solr have a few classes that expose the size of their
> instances, but with different method names. There are at least
> ramBytesUsed (packed ints), sizeInBytes (FST, RamDirectory) and
> memSize (Solr DocSets) that provide an estimation of the memory used
> in bytes. The confusing thing is that sizeInBytes is sometimes also
> used for on-disk sizes (SegmentInfo for example). I think it would
> improve readability to stick to only two method names, one for the
> in-memory size and one for the on-disk size. Or maybe these methods
> have different meanings that I am missing? What do you think?
>
> --
> Adrien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org