-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add length method to RandomAccessInput #12594
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Add a CHANGES entry?
Thanks @jpountz! What it is not clear to me is if adding a method to this interface is considered a breaking change and it can only be introduced in a major release, or if it can be backported to the 9.x line. Any suggestions? |
I think it's fine to add simple methods to interfaces like this in point releases. Extending RandomAccessInput would be a pretty expert use of lucene. One suggestion: given that |
Because IndexInput already defines a method called |
Ah right, no your way makes more sense then. |
Add RandomAccessInput#length method to the RandomAccessInput interface. In addition it deprecates ByteBuffersDataInput#size in favour of this new method.
Implementation is straight forward as we always have the length of the data when constructing a RandomAccessInput. The only odd thing is that
ByteBuffersDataInput
already has a method calledsize()
so I deprecated it in favour of this new one.closes #12592