Skip to content
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

Handle multiple assertions by single user on single record correctly #283

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions conf/cassandra3_case_sensitive_schema.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ CREATE TABLE occ.qa (
"userDisplayName" text,
"userEmail" text,
uuid text,
PRIMARY KEY (rowkey, "userId", code)
PRIMARY KEY (rowkey, "userId", code, relatedUuid)
) WITH CLUSTERING ORDER BY ("userId" ASC, code ASC)
AND bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
Expand Down Expand Up @@ -721,4 +721,4 @@ CREATE TABLE occ.loc_new (
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';
AND speculative_retry = '99PERCENTILE';
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ class OccurrenceDAOImpl extends OccurrenceDAO {
if (!record.isEmpty) {

//preserve the raw record
val qaMap = qualityAssertionProperties ++ Map("snapshot" -> Json.toJSON(record.get))
val qaMap = qualityAssertionProperties ++ (if (qualityAssertion.relatedUuid == null || qualityAssertion.relatedUuid.isEmpty()) Map("relatedUuid" -> "") else Map()) ++ Map("snapshot" -> Json.toJSON(record.get))
persistenceManager.put(rowKey, qaEntityName, qaMap, true, false)
val systemAssertions = getSystemAssertions(rowKey)
val userAssertions = getUserAssertions(rowKey)
Expand Down Expand Up @@ -969,7 +969,8 @@ class OccurrenceDAOImpl extends OccurrenceDAO {
Map(
"rowkey" -> toBeDeleted.referenceRowKey,
"userId" -> toBeDeleted.getUserId,
"code" -> toBeDeleted.code.toString
"code" -> toBeDeleted.code.toString,
(if (Config.caseSensitiveCassandra) "relatedUuid" else "relateduuid") -> toBeDeleted.getRelatedUuid
),
qaEntityName
)
Expand Down