-
Notifications
You must be signed in to change notification settings - Fork 3.9k
GH-15187: [Java] Made reader initialization lazy and added new getTransferPair() function that takes in a Field type
#34424
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
bb538c6
Made reader initialization lazy and added new getTransferPair() funct…
rtadepalli ca11887
Fix javadoc to add @param annotation for BufferAllocator
rtadepalli 778b26f
Merge remote-tracking branch 'upstream/main' into GH-15187
rtadepalli 76219f5
GH-15187: Make reader instantiation thread safe in BaseValueVector
rtadepalli aa7e1d7
Merge remote-tracking branch 'upstream/main' into GH-15187
rtadepalli 7f73e3c
GH-15187: Change markdown from devils tick to link
rtadepalli fe52705
GH-15187: Change class instantiation
rtadepalli fa74584
GH-15187: add new lambda to return implementation of the reader
rtadepalli 5dcce2e
Merge remote-tracking branch 'upstream/main' into GH-15187
rtadepalli 24deeeb
GH-15187: Fix comments
rtadepalli 94fe92d
GH-15187: Move supplier and just return new instance of FieldReader t…
rtadepalli 1ec9a35
Merge remote-tracking branch 'upstream/main' into GH-15187
rtadepalli b4a0c9d
GH-15187: remove unneeded Supplier imports
rtadepalli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
This is not thread safe, but I am not sure if adding the Google core libraries dependency to get
Suppliers::memoizeis allowed. I don't know of other ways to make this thread safe without adding anythrowsclause.I tried adding
apache.commons.lang3#LazyInitializerbut that I think requires that I addthrows ConcurrentExceptionto thegetReaderfunction, doesn't seem that great.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.
is it possible to liberate the necessary code from either of these libraries? I'm not sure how much baggage they would drag with them
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.
Thanks for working on this rtadepalli. Instead of the above logic, should we add a new constructor with a new boolean parameter createReader. We create the reader based on the boolean flag. And in the getReader if the reader is null, we throw an exception. Callers who dont need the reader can call the new constructor, and if they try accessing the reader then they get an exception.
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.
@prashanthbdremio I think adding a new constructor would not be backwards compatible, unless we just default the boolean to
truein theBigIntVector(field, allocator);constructor (and constructors in other classes). If we do this, I guess we're not really changing much, since the reader will be eagerly created anyways. If you think that is fine, I can make the change.@lwhite1 I have made some changes to the way the reader is being initialized -- please take another look. Thanks.