-
Notifications
You must be signed in to change notification settings - Fork 849
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
Example Code for Virtual Threads, Pipelinining, and AI Vector Search #372
Example Code for Virtual Threads, Pipelinining, and AI Vector Search #372
Conversation
Signed-off-by: Michael McMahon <michael.a.mcmahon@oracle.com>
Signed-off-by: Michael McMahon <michael.a.mcmahon@oracle.com>
Signed-off-by: Michael McMahon <michael.a.mcmahon@oracle.com>
Fixes #371 |
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.
Assume no tab but 2 spaces indentation (per level).
java/jdbcdriver-virtual-threads/src/main/java/com/oracle/dev/jdbc/PipelineVectorDemo.java
Outdated
Show resolved
Hide resolved
java/jdbcdriver-virtual-threads/src/main/java/com/oracle/dev/jdbc/PipelineVectorDemo.java
Outdated
Show resolved
Hide resolved
java/jdbcdriver-virtual-threads/src/main/java/com/oracle/dev/jdbc/PipelineVectorDemo.java
Outdated
Show resolved
Hide resolved
|
||
/** | ||
* Updates the example table with embeddings for it's text data. This method | ||
* uses the structured concurrency API (preview feature in JDK 22). Calls to |
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.
It's preview feature of JDK21, isn't?
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.
We need JDK22 for the "Gatherers".
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.
Corrected in latest push. Elaborated that structured concurrency has been in preview since 21, and continues to be in the upcoming 23 release.
Also, Gatherers are previewed in 22 and 23. I wanted to keep the focus on structured concurrency though. We could implement this demo without gatherers if we wanted to.
Signed-off-by: Michael McMahon <michael.a.mcmahon@oracle.com>
This branch adds a demo program which makes use of the following:
The demo program will load a database table with text from a book full of facts about wild animals (the book is public domain). It will then query the text from the table, request embeddings for the text from OCI's Generative AI service, and store the embeddings back in the table as
VECTOR
data. Finally, it will perform a similarity search for some search terms using theVECTOR_DISTANCE
function.All steps of the program are executed using pipelined database calls on virtual threads. The virtual threads are managed using structured concurrency APIs which are being previewed in JDK 22.
Instructions for running the demo have been added to the README.