You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (Created) (JIRA)" <ji...@apache.org> on 2011/10/10 14:19:29 UTC

[jira] [Created] (LUCENE-3502) Packed ints: move .getArray into Reader API

Packed ints: move .getArray into Reader API
-------------------------------------------

                 Key: LUCENE-3502
                 URL: https://issues.apache.org/jira/browse/LUCENE-3502
             Project: Lucene - Java
          Issue Type: Improvement
            Reporter: Michael McCandless
            Assignee: Michael McCandless
             Fix For: 3.5, 4.0


This is a simple code cleanup... it's messy that a consumer of
PackedInts.Reader must check whether the impl is Direct8/16/32/64 in
order to get an array; it's better to move up the .getArray into the
Reader interface and then make the DirectN impls package private.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Commented] (LUCENE-3502) Packed ints: move .getArray into Reader API

Posted by "Michael McCandless (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13124072#comment-13124072 ] 

Michael McCandless commented on LUCENE-3502:
--------------------------------------------

OK I agree, I'll put the .hasArray back.
                
> Packed ints: move .getArray into Reader API
> -------------------------------------------
>
>                 Key: LUCENE-3502
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3502
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>         Attachments: LUCENE-3502.patch
>
>
> This is a simple code cleanup... it's messy that a consumer of
> PackedInts.Reader must check whether the impl is Direct8/16/32/64 in
> order to get an array; it's better to move up the .getArray into the
> Reader interface and then make the DirectN impls package private.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Commented] (LUCENE-3502) Packed ints: move .getArray into Reader API

Posted by "Simon Willnauer (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13124070#comment-13124070 ] 

Simon Willnauer commented on LUCENE-3502:
-----------------------------------------

bq. I like the hasArray for API consistency with ByteBuffer etc too (same with Docvalues).
consistency is good and you might need a hasArray() for future docvalues impls or subclasses that compute it?
                
> Packed ints: move .getArray into Reader API
> -------------------------------------------
>
>                 Key: LUCENE-3502
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3502
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>         Attachments: LUCENE-3502.patch
>
>
> This is a simple code cleanup... it's messy that a consumer of
> PackedInts.Reader must check whether the impl is Direct8/16/32/64 in
> order to get an array; it's better to move up the .getArray into the
> Reader interface and then make the DirectN impls package private.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Resolved] (LUCENE-3502) Packed ints: move .getArray into Reader API

Posted by "Michael McCandless (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless resolved LUCENE-3502.
----------------------------------------

    Resolution: Fixed

Thanks Simon and Robert.
                
> Packed ints: move .getArray into Reader API
> -------------------------------------------
>
>                 Key: LUCENE-3502
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3502
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 4.0
>
>         Attachments: LUCENE-3502.patch, LUCENE-3502.patch
>
>
> This is a simple code cleanup... it's messy that a consumer of
> PackedInts.Reader must check whether the impl is Direct8/16/32/64 in
> order to get an array; it's better to move up the .getArray into the
> Reader interface and then make the DirectN impls package private.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Updated] (LUCENE-3502) Packed ints: move .getArray into Reader API

Posted by "Michael McCandless (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-3502:
---------------------------------------

    Attachment: LUCENE-3502.patch

New patch, using .hasArray/getArray.
                
> Packed ints: move .getArray into Reader API
> -------------------------------------------
>
>                 Key: LUCENE-3502
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3502
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>         Attachments: LUCENE-3502.patch, LUCENE-3502.patch
>
>
> This is a simple code cleanup... it's messy that a consumer of
> PackedInts.Reader must check whether the impl is Direct8/16/32/64 in
> order to get an array; it's better to move up the .getArray into the
> Reader interface and then make the DirectN impls package private.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Commented] (LUCENE-3502) Packed ints: move .getArray into Reader API

Posted by "Simon Willnauer (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13124043#comment-13124043 ] 

Simon Willnauer commented on LUCENE-3502:
-----------------------------------------

mike this looks good. Can we rename getNativeArray to getArray? this seems more consistent to what we have in IDV and what java has in ByteBuffer etc. I also think we should have a boolean hasArray() for consistency, or did I miss it?

simon
                
> Packed ints: move .getArray into Reader API
> -------------------------------------------
>
>                 Key: LUCENE-3502
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3502
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>         Attachments: LUCENE-3502.patch
>
>
> This is a simple code cleanup... it's messy that a consumer of
> PackedInts.Reader must check whether the impl is Direct8/16/32/64 in
> order to get an array; it's better to move up the .getArray into the
> Reader interface and then make the DirectN impls package private.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Commented] (LUCENE-3502) Packed ints: move .getArray into Reader API

Posted by "Simon Willnauer (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13124167#comment-13124167 ] 

Simon Willnauer commented on LUCENE-3502:
-----------------------------------------

looks good mike!
                
> Packed ints: move .getArray into Reader API
> -------------------------------------------
>
>                 Key: LUCENE-3502
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3502
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>         Attachments: LUCENE-3502.patch, LUCENE-3502.patch
>
>
> This is a simple code cleanup... it's messy that a consumer of
> PackedInts.Reader must check whether the impl is Direct8/16/32/64 in
> order to get an array; it's better to move up the .getArray into the
> Reader interface and then make the DirectN impls package private.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Commented] (LUCENE-3502) Packed ints: move .getArray into Reader API

Posted by "Robert Muir (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13124067#comment-13124067 ] 

Robert Muir commented on LUCENE-3502:
-------------------------------------

I like the hasArray for API consistency with ByteBuffer etc too (same with Docvalues).

                
> Packed ints: move .getArray into Reader API
> -------------------------------------------
>
>                 Key: LUCENE-3502
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3502
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>         Attachments: LUCENE-3502.patch
>
>
> This is a simple code cleanup... it's messy that a consumer of
> PackedInts.Reader must check whether the impl is Direct8/16/32/64 in
> order to get an array; it's better to move up the .getArray into the
> Reader interface and then make the DirectN impls package private.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Updated] (LUCENE-3502) Packed ints: move .getArray into Reader API

Posted by "Michael McCandless (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-3502:
---------------------------------------

    Fix Version/s:     (was: 3.5)

Removing 3.5 fix version... I keep forgetting packed ints aren't backported yet.

But for LUCENE-2205 we have to make sure we sync to trunk when we backport it.
                
> Packed ints: move .getArray into Reader API
> -------------------------------------------
>
>                 Key: LUCENE-3502
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3502
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 4.0
>
>         Attachments: LUCENE-3502.patch, LUCENE-3502.patch
>
>
> This is a simple code cleanup... it's messy that a consumer of
> PackedInts.Reader must check whether the impl is Direct8/16/32/64 in
> order to get an array; it's better to move up the .getArray into the
> Reader interface and then make the DirectN impls package private.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Commented] (LUCENE-3502) Packed ints: move .getArray into Reader API

Posted by "Michael McCandless (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-3502?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13124064#comment-13124064 ] 

Michael McCandless commented on LUCENE-3502:
--------------------------------------------

OK I'll rename to getArray.

On the .hasArray -- why do we need that?  Can't we just have .getArray and it returns null if there is none?  (None of these classes have a "costly" .getArray impl).  Likewise for DocValues...
                
> Packed ints: move .getArray into Reader API
> -------------------------------------------
>
>                 Key: LUCENE-3502
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3502
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>         Attachments: LUCENE-3502.patch
>
>
> This is a simple code cleanup... it's messy that a consumer of
> PackedInts.Reader must check whether the impl is Direct8/16/32/64 in
> order to get an array; it's better to move up the .getArray into the
> Reader interface and then make the DirectN impls package private.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] [Updated] (LUCENE-3502) Packed ints: move .getArray into Reader API

Posted by "Michael McCandless (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-3502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-3502:
---------------------------------------

    Attachment: LUCENE-3502.patch
    
> Packed ints: move .getArray into Reader API
> -------------------------------------------
>
>                 Key: LUCENE-3502
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3502
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.5, 4.0
>
>         Attachments: LUCENE-3502.patch
>
>
> This is a simple code cleanup... it's messy that a consumer of
> PackedInts.Reader must check whether the impl is Direct8/16/32/64 in
> order to get an array; it's better to move up the .getArray into the
> Reader interface and then make the DirectN impls package private.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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