fix: Updated code to use 'putAll' method in assessment & activity aggregate APIs#647
Open
aimansharief wants to merge 6 commits intoSunbird-Lern:developfrom
Open
fix: Updated code to use 'putAll' method in assessment & activity aggregate APIs#647aimansharief wants to merge 6 commits intoSunbird-Lern:developfrom
aimansharief wants to merge 6 commits intoSunbird-Lern:developfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces Cassandra update variants that use putAll for map columns (to merge keys rather than replacing the full map), and wires those new operations into the activity/assessment aggregators so map updates preserve existing entries.
Changes:
- Added
CassandraUtil.createUpdateQueryWithPutAllto generate UPDATE statements that useputAllfor map-typed values. - Extended
CassandraOperation+CassandraOperationImplwithupdateRecordWithPutAllandbatchUpdateWithPutAll. - Switched assessment/activity aggregation flows to use the new
putAll-based update paths.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| core/sunbird-cassandra-utils/src/main/java/org/sunbird/common/CassandraUtil.java | Adds an UPDATE builder that uses putAll for map values to support merge semantics. |
| core/sunbird-cassandra-utils/src/main/java/org/sunbird/cassandraimpl/CassandraOperationImpl.java | Implements new update/batch-update entry points that delegate to the new QueryBuilder logic. |
| core/sunbird-cassandra-utils/src/main/java/org/sunbird/cassandra/CassandraOperation.java | Exposes new *WithPutAll APIs to callers. |
| assessment-aggregator/src/main/scala/org/sunbird/assessment/service/CassandraService.scala | Uses updateRecordWithPutAll when updating user activity aggregates. |
| assessment-aggregator/src/main/scala/org/sunbird/assessment/actor/AssessmentAggregatorActor.scala | Refactors actor wiring/dispatch and uses concrete service instantiation (not injectable). |
| assessment-aggregator/src/test/scala/org/sunbird/assessment/actor/AssessmentAggregatorActorSpec.scala | Updates actor construction (currently mismatched with existing mock-based test expectations). |
| activity-aggregator/src/main/scala/org/sunbird/activity/actor/ActivityAggregatorActor.scala | Switches activity aggregate batch updates to batchUpdateWithPutAll. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...sment-aggregator/src/main/scala/org/sunbird/assessment/actor/AssessmentAggregatorActor.scala
Outdated
Show resolved
Hide resolved
...t-aggregator/src/test/scala/org/sunbird/assessment/actor/AssessmentAggregatorActorSpec.scala
Outdated
Show resolved
Hide resolved
core/sunbird-cassandra-utils/src/main/java/org/sunbird/cassandra/CassandraOperation.java
Show resolved
Hide resolved
.../sunbird-cassandra-utils/src/main/java/org/sunbird/cassandraimpl/CassandraOperationImpl.java
Show resolved
Hide resolved
.../sunbird-cassandra-utils/src/main/java/org/sunbird/cassandraimpl/CassandraOperationImpl.java
Show resolved
Hide resolved
.../sunbird-cassandra-utils/src/main/java/org/sunbird/cassandraimpl/CassandraOperationImpl.java
Show resolved
Hide resolved
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.


Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Type of change
Please choose appropriate options.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes in the below checkboxes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: