Skip to content

Conversation

@y-lakhdar
Copy link
Contributor

@y-lakhdar y-lakhdar commented Jan 29, 2026

Summary

Adds configurable batch size support to all push services and implements per-batch file container rotation for UpdateStreamService following Coveo's catalog stream API best practices.

Key Changes

Configurable Batch Size

All services now support custom batch sizes (max: 256MB):

  • PushService(source, options, maxQueueSize)
  • StreamService(source, options, userAgents, maxQueueSize)
  • UpdateStreamService(source, options, userAgents, maxQueueSize)

File Container Rotation (UpdateStreamService)

Each batch now gets its own file container:

  1. Create new file container
  2. Upload batch content
  3. Push container immediately

This follows the catalog stream API best practices.

Testing

  • Added StreamDocumentUploadQueueBatchingTest (new)
  • Added FileContainerRotationIntegrationTest (new)

Part 3 of 3 - Split from PR #186

Dependencies: Should merge after #187 and #188

- Add configurable batch size to PushService, StreamService, UpdateStreamService
- Implement per-batch file container rotation for UpdateStreamService
- Each batch creates own file container and pushes immediately (catalog API best practice)
- Fix: PushService now respects system property (was hardcoded to DEFAULT_QUEUE_SIZE)
- Fix: flushAndPush() guards against null updateStreamService with uploader fallback
- Add CONFIGURATION.md and UPGRADE_NOTES.md documentation
- Update README.md with configuration section
- Add comprehensive tests for batching and rotation behavior

Breaking changes:
- Default batch size increased from 5MB to 256MB
- UpdateStreamService pushes each batch immediately instead of accumulating

Fixes reviewer feedback:
- PushService now uses getConfiguredBatchSize() instead of DEFAULT_QUEUE_SIZE
- StreamDocumentUploadQueue.flushAndPush() now handles null updateStreamService
@y-lakhdar y-lakhdar force-pushed the feat/configurable-batch-size-services branch from a1e5980 to 23deee5 Compare January 29, 2026 16:18
@y-lakhdar y-lakhdar closed this Jan 29, 2026
@y-lakhdar y-lakhdar reopened this Jan 29, 2026
@y-lakhdar y-lakhdar changed the base branch from main to feat/configurable-batch-size-infrastructure January 29, 2026 16:24
- Remove UPGRADE_NOTES.md (no breaking changes to document)
- Add samples/ConfigureBatchSize.java showing 3 ways to configure batch size
- Restore original UpdateStreamDocuments.java (remove verbose comments)
- Update CONFIGURATION.md
@y-lakhdar y-lakhdar marked this pull request as ready for review January 29, 2026 18:40
@y-lakhdar y-lakhdar requested a review from a team as a code owner January 29, 2026 18:40
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.

3 participants