Skip to content

Conversation

@rjrudin
Copy link
Contributor

@rjrudin rjrudin commented Dec 31, 2025

IncrementalWriteFilter is the entry point, with a Builder for customizing its behavior.

Copilot AI review requested due to automatic review settings December 31, 2025 00:09
@github-actions
Copy link

github-actions bot commented Dec 31, 2025

Copyright Validation Results
Total: 7 | Passed: 5 | Failed: 0 | Skipped: 2 | at: 2025-12-31 14:39:44 UTC | commit: ad22dcb

⏭️ Skipped (Excluded) Files

  • marklogic-client-api/build.gradle
  • test-app/src/main/ml-config/databases/content-database.json

✅ Valid Files

  • marklogic-client-api/src/main/java/com/marklogic/client/datamovement/filter/IncrementalWriteEvalFilter.java
  • marklogic-client-api/src/main/java/com/marklogic/client/datamovement/filter/IncrementalWriteFilter.java
  • marklogic-client-api/src/main/java/com/marklogic/client/datamovement/filter/IncrementalWriteOpticFilter.java
  • marklogic-client-api/src/test/java/com/marklogic/client/datamovement/filter/IncrementalWriteFilterTest.java
  • marklogic-client-api/src/test/java/com/marklogic/client/datamovement/filter/IncrementalWriteTest.java

✅ All files have valid copyright headers!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces an incremental write feature that prevents unnecessary document writes by comparing hash values of document content. The implementation uses a field-based hash stored in MarkLogic to determine if a document's content has changed since its last write, skipping writes for unchanged documents.

Key Changes:

  • Added IncrementalWriteFilter with two retrieval strategies: Optic queries and server-side eval
  • Implemented JSON canonicalization to handle key ordering differences
  • Added comprehensive test coverage for the incremental write functionality

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test-app/src/main/ml-config/databases/content-database.json Adds field and range-field-index configurations for incrementalWriteHash field
marklogic-client-api/src/test/java/com/marklogic/client/datamovement/filter/IncrementalWriteTest.java Integration tests for incremental write with Optic and eval filters, JSON canonicalization scenarios
marklogic-client-api/src/test/java/com/marklogic/client/datamovement/filter/IncrementalWriteFilterTest.java Unit tests for metadata handling without database connection
marklogic-client-api/src/main/java/com/marklogic/client/datamovement/filter/IncrementalWriteOpticFilter.java Optic-based implementation for retrieving existing hash values
marklogic-client-api/src/main/java/com/marklogic/client/datamovement/filter/IncrementalWriteFilter.java Core filter logic with Builder pattern for customization
marklogic-client-api/src/main/java/com/marklogic/client/datamovement/filter/IncrementalWriteEvalFilter.java Server-side JavaScript eval implementation for hash retrieval
marklogic-client-api/build.gradle Adds dependencies for JSON canonicalization and hash generation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rjrudin rjrudin force-pushed the feature/26420-eval-query branch from 093f7ea to 2b6294e Compare December 31, 2025 13:15
@Override
public DocumentWriteSet apply(DocumentWriteSetFilter.Context context) {
ArrayNode uris = new ObjectMapper().createArrayNode();
for (DocumentWriteOperation op : context.getDocumentWriteSet()) {
Copy link
Contributor

@BillFarber BillFarber Dec 31, 2025

Choose a reason for hiding this comment

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

nitpick - I would use a different variable name than "op" just to avoid confusion with optic DSL (particularly because of IncrementalWriteOpticFilter below).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had that exact same thought yesterday and I know I changed it to "doc" somewhere else, will definitely change it here. I think Copilot spits out "op" by default.

BillFarber
BillFarber previously approved these changes Dec 31, 2025
IncrementalWriteFilter is the entry point, with a Builder for customizing its behavior.
@rjrudin rjrudin merged commit f6cfa96 into develop Dec 31, 2025
3 checks passed
@rjrudin rjrudin deleted the feature/26420-eval-query branch December 31, 2025 15:03
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