Skip to content

feat: implement DocumentUploadQueue class - #33

Merged
y-lakhdar merged 28 commits into
mainfrom
LENS-856
Jun 1, 2023
Merged

feat: implement DocumentUploadQueue class#33
y-lakhdar merged 28 commits into
mainfrom
LENS-856

Conversation

@y-lakhdar

@y-lakhdar y-lakhdar commented May 30, 2023

Copy link
Copy Markdown
Contributor

Implementation of the DocumentUploadQueue class that will craft and upload document batches to a source.

Proposed changes

The batching logic works as follow:

Whenever a document gets added to a DocumentUploadQueue instance, the doc gets accumulated into a buffer until one of the 2 conditions is met:

  1. The user runs the flush() method.
  2. The user continues to add documents to the queue until it exceeds the maximum queue size limit of 5MB.

As soon as one condition is met, the accumulated documents in the queue are batched and uploaded to the source with the appropriate push strategy.

The queue maximum size limit is set to 5MB (even if the catalog payload limit is 256MB) : https://coveord.atlassian.net/browse/LENS-856 for explanation.

Testing

Created the DocumentUploadQueueTest class to test the addition of bulky documents (2MB documents) to simulate the upload of large data set.
Adding several of these document should trigger automated batching and should be completely transparent to the user.

y-lakhdar and others added 21 commits May 19, 2023 11:22
Update src/main/java/com/coveo/pushapiclient/ApiUrl.java

Co-authored-by: Benjamin Taillon <54454747+btaillon@users.noreply.github.com>

add new getter to source classes

feat: create `PushSource` and `catalogSource` classes (#30)

https://coveord.atlassian.net/browse/LENS-839

update StreamService

add platformClient tests

add PowerMockito dependencies

remove unused import

remove unecessary method

downgrade build to Java 11

revert codeql deletion

lint

lint
Co-authored-by: Benjamin Taillon <54454747+btaillon@users.noreply.github.com>
Co-authored-by: jpmarceau <39384459+jpmarceau@users.noreply.github.com>
Co-authored-by: jpmarceau <39384459+jpmarceau@users.noreply.github.com>
@y-lakhdar
y-lakhdar requested review from a team, btaillon-coveo, hdhayneCoveo, louis-bompart and olamothe and removed request for a team May 30, 2023 17:52
Comment thread src/main/java/com/coveo/pushapiclient/DocumentUploadQueue.java

@louis-bompart louis-bompart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, wonder about the choice of Collection, would be nice to justify it (given our lack of expertise in Java)

Comment thread src/main/java/com/coveo/pushapiclient/DocumentUploadQueue.java
Comment thread src/main/java/com/coveo/pushapiclient/DocumentUploadQueue.java
Base automatically changed from LEN-838 to main May 31, 2023 18:01
@github-actions

github-actions Bot commented May 31, 2023

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Manifest Files

@y-lakhdar
y-lakhdar enabled auto-merge (squash) May 31, 2023 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants