[ https://issues.apache.org/jira/browse/LUCENE-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12832971#action_12832971 ]
Michael McCandless commented on LUCENE-1990: -------------------------------------------- Great progress Toke! I guess we should do Mutable since you're so far along already :) But, now that we have getMutable, can we make the concrete impls package private? Javadocs for Mutable.set should note that the size is fixed once you allocate it. We have no way to save a Mutable... should we add that? If so, we may want to rename Writer -> WriteOnceWriter. This way consumers can also get a Mutable, do random writes, then save, if the "write once" model isn't a good fit. Maybe we should just merge Mutable & Reader, then? (LongStore? LongArray? PackedLongs?) We should state clearly that these are all unsigned ints storage. Maybe rename PackedDirectInt to PackedDirect32 (and Short to 16, Byte to 8). Because... while it is using a direct int[] under the hood, it's really using all 32 bits for the full positive int range. So PackedDirect32 can be used even for pos ints that would overflow a normal java "int". (Though, for long we obviously can't use that 64th bit for positive ints...). The @see in the new IndexInput.readShort is wrong (referencing writeInt). Can you add @lucene.internal to the javadocs? Seems like once we stomp the bugs, beef up the tests, and merge PRIORITY and BLOCK_PREFERENCE (into maybe STORAGE?) for the public API, we are nearly done? Thanks Toke! > Add unsigned packed int impls in oal.util > ----------------------------------------- > > Key: LUCENE-1990 > URL: https://issues.apache.org/jira/browse/LUCENE-1990 > Project: Lucene - Java > Issue Type: Improvement > Components: Index > Reporter: Michael McCandless > Priority: Minor > Attachments: LUCENE-1990-te20100122.patch, > LUCENE-1990-te20100210.patch, LUCENE-1990-te20100212.patch, > LUCENE-1990.patch, LUCENE-1990_PerformanceMeasurements20100104.zip > > > There are various places in Lucene that could take advantage of an > efficient packed unsigned int/long impl. EG the terms dict index in > the standard codec in LUCENE-1458 could subsantially reduce it's RAM > usage. FieldCache.StringIndex could as well. And I think "load into > RAM" codecs like the one in TestExternalCodecs could use this too. > I'm picturing something very basic like: > {code} > interface PackedUnsignedLongs { > long get(long index); > void set(long index, long value); > } > {code} > Plus maybe an iterator for getting and maybe also for setting. If it > helps, most of the usages of this inside Lucene will be "write once" > so eg the set could make that an assumption/requirement. > And a factory somewhere: > {code} > PackedUnsignedLongs create(int count, long maxValue); > {code} > I think we should simply autogen the code (we can start from the > autogen code in LUCENE-1410), or, if there is an good existing impl > that has a compatible license that'd be great. > I don't have time near-term to do this... so if anyone has the itch, > please jump! -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org