lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrien Grand (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-5301) All PackedInts APIs should share a common interface for random-access reads
Date Thu, 24 Oct 2013 14:10:03 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-5301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13804222#comment-13804222
] 

Adrien Grand commented on LUCENE-5301:
--------------------------------------

I wondered about this one. Since the other impls are protected by a hard check (the array
bounds check), I wanted to be consistent and have a hard check for these bounds as well, otherwise
an out-of-bounds long could be casted to a valid integer. But maybe it would be better to
only have an assertion. Will update the patch.

> All PackedInts APIs should share a common interface for random-access reads
> ---------------------------------------------------------------------------
>
>                 Key: LUCENE-5301
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5301
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Minor
>         Attachments: LUCENE-5301.patch
>
>
> It would be convenient if all PackedInts had a super-class with the {{long get(long index)}}
method. Maybe this super-class could even be NumericDocValues so that doc values formats don't
need to wrap eg. BlockPackedReader into this kind of construct:
> {code}
>         final BlockPackedReader reader = new BlockPackedReader(data, entry.packedIntsVersion,
entry.blockSize, entry.count, true);
>         return new LongNumericDocValues() {
>           @Override
>           public long get(long id) {
>             return reader.get(id);
>           }
>         };
> {code}
> Instead, they could just
> {code}
>         return new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize,
entry.count, true);
> {code}



--
This message was sent by Atlassian JIRA
(v6.1#6144)

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


Mime
View raw message