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

Michael Busch commented on LUCENE-2126:
---------------------------------------

Thanks for the input, Marvin.

I can see the advantages of what you're proposing. With this patch it'd only be 
possible to benefit in all IndexInput/IndexOutput implementations from a new 
encoding/decoding method if you add it to the DataInput/Output class directly, 
which is only possible by changing the classes in Lucene, not from outside.

The problem here, as so often, is backwards-compat. This patch here has no 
problems in that regard, as we just move the methods into new superclasses. If 
we'd want to implement what Lucy is doing, we'd have to deprecate all 
encoding/decoding methods in IndexInput/Output and add them to 
DataInput/Output. Then a DataInput would not be the superclass of IndexInput, 
but rather *have* an IndexInput. All users who call any of the 
encoding/decoding methods directly on IndexInput/Output would have to change 
their code to use the new classes. 

So I can certainly see the benefits, the question now is if they're at the 
moment important enough to justify dealing with the backwards-compat hassle?

> Split up IndexInput and IndexOutput into DataInput and DataOutput
> -----------------------------------------------------------------
>
>                 Key: LUCENE-2126
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2126
>             Project: Lucene - Java
>          Issue Type: Improvement
>    Affects Versions: Flex Branch
>            Reporter: Michael Busch
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: Flex Branch
>
>         Attachments: lucene-2126.patch
>
>
> I'd like to introduce the two new classes DataInput and DataOutput
> that contain all methods from IndexInput and IndexOutput that actually
> decode or encode data, such as readByte()/writeByte(),
> readVInt()/writeVInt().
> Methods like getFilePointer(), seek(), close(), etc., which are not
> related to data encoding, but to files as input/output source stay in
> IndexInput/IndexOutput.
> This patch also changes ByteSliceReader/ByteSliceWriter to extend
> DataInput/DataOutput. Previously ByteSliceReader implemented the
> methods that stay in IndexInput by throwing RuntimeExceptions.
> See also LUCENE-2125.
> All tests pass.

-- 
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

Reply via email to