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

Remove priority queue from RhtPQMap and entire project #84

Merged
merged 3 commits into from
Feb 22, 2023
Merged

Conversation

7hong13
Copy link
Contributor

@7hong13 7hong13 commented Feb 21, 2023

What this PR does / why we need it?

  • Change the RhtPQMap to use less memory by removing the priority queue.
  • RhtPQMap has been renamed to ElementRht.

Any background context you want to provide?

What are the relevant tickets?

yorkie-team/yorkie#462, yorkie-team/yorkie#423

Checklist

  • Added relevant tests or not required
  • Didn't break anything

@7hong13 7hong13 added the enhancement 🌟 New feature or request label Feb 21, 2023
@7hong13 7hong13 self-assigned this Feb 21, 2023
val node = nodeMapByCreatedAt[createdAt]
?: throw NoSuchElementException("The ElementRhtNode by $createdAt doesn't exist.")
node.remove(executedAt)
return node.value
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hackerwins I returned the node.value regardless of whether or not the node.remove() returned true, based on the JS-SDK.

val node = nodeMapByKey[key]
?: throw NoSuchElementException("$key doesn't exist in nodeMapByKey")
node.remove(removedAt)
return node.value
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hackerwins I returned the node.value in the same way as the remove() function above. This approach differs slightly from the JS-SDK, so I will adjust it if it could cause any issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed it to return nullable value ac9080f

@codecov
Copy link

codecov bot commented Feb 21, 2023

Codecov Report

Merging #84 (ac9080f) into main (04225bc) will increase coverage by 0.31%.
The diff coverage is 82.75%.

@@            Coverage Diff             @@
##             main      #84      +/-   ##
==========================================
+ Coverage   81.48%   81.80%   +0.31%     
==========================================
  Files          52       52              
  Lines        2377     2358      -19     
  Branches      336      334       -2     
==========================================
- Hits         1937     1929       -8     
+ Misses        257      250       -7     
+ Partials      183      179       -4     
Impacted Files Coverage Δ
...main/kotlin/dev/yorkie/document/json/JsonObject.kt 89.33% <66.66%> (-2.56%) ⬇️
...main/kotlin/dev/yorkie/document/crdt/ElementRht.kt 80.85% <80.85%> (ø)
...src/main/kotlin/dev/yorkie/api/ElementConverter.kt 77.77% <100.00%> (+0.20%) ⬆️
...ie/src/main/kotlin/dev/yorkie/document/Document.kt 87.50% <100.00%> (ø)
...main/kotlin/dev/yorkie/document/crdt/CrdtObject.kt 90.69% <100.00%> (ø)
.../main/kotlin/dev/yorkie/document/json/JsonArray.kt 60.93% <100.00%> (ø)
...in/kotlin/dev/yorkie/document/crdt/RgaTreeSplit.kt 68.30% <0.00%> (+1.13%) ⬆️
...ie/src/main/kotlin/dev/yorkie/util/SplayTreeSet.kt 81.06% <0.00%> (+2.42%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@7hong13 7hong13 merged commit 9913c25 into main Feb 22, 2023
@7hong13 7hong13 deleted the element_rht branch February 22, 2023 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🌟 New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants