Disk related functions should be seperated out from ClaimTrie class into its own class #136

Closed
opened 2018-05-09 04:24:09 +02:00 by kaykurokawa · 6 comments
kaykurokawa commented 2018-05-09 04:24:09 +02:00 (Migrated from github.com)

All disk read/write functions done through the CDBWrapper class in ClaimTrie should be separated out onto its own file/class. This should improve readability as it should be much clearer what is being saved and how. We should also write unit tests for the separated out disk read/write class.

All disk read/write functions done through the CDBWrapper class in ClaimTrie should be separated out onto its own file/class. This should improve readability as it should be much clearer what is being saved and how. We should also write unit tests for the separated out disk read/write class.
bvbfan commented 2018-05-16 13:40:36 +02:00 (Migrated from github.com)

I will try to make the task. You mean CDBWrapper (reads from disk) as well as CDBBatch (write to disk) to separated in related class, right?

I will try to make the task. You mean CDBWrapper (reads from disk) as well as CDBBatch (write to disk) to separated in related class, right?
kaykurokawa commented 2018-05-16 18:07:47 +02:00 (Migrated from github.com)

Yes basically anything that has to do with CClaimTrie.db in claimtrie.h/cpp

Yes basically anything that has to do with CClaimTrie.db in claimtrie.h/cpp
bvbfan commented 2018-05-18 09:12:40 +02:00 (Migrated from github.com)

I found that architecture is not good enough to me. Did you accept more agressive refactor? Why, CClaimTrieCache should have all dirty nodes and CClaimTrie should search in, when it's not found, then query CClaimTrieDb (new separed class) so CClaimTrie became a interface between cache and db. This will result in remove of all dirtyQueueXXX and related functions from CClaimTrie. Is this acceptable to you?

I found that architecture is not good enough to me. Did you accept more agressive refactor? Why, CClaimTrieCache should have all *dirty* nodes and CClaimTrie should search in, when it's not found, then query CClaimTrieDb (new separed class) so CClaimTrie became a interface between cache and db. This will result in remove of all dirtyQueueXXX and related functions from CClaimTrie. Is this acceptable to you?
bvbfan commented 2018-05-19 23:01:35 +02:00 (Migrated from github.com)

https://github.com/lbryio/lbrycrd/pull/140
It's simple, i can make more aggressive refactor if still needs

https://github.com/lbryio/lbrycrd/pull/140 It's simple, i can make more *aggressive* refactor if still needs
lyoshenka commented 2018-09-19 19:33:42 +02:00 (Migrated from github.com)

handled by #175

handled by #175
alyssaoc commented 2018-10-04 19:52:59 +02:00 (Migrated from github.com)

closing for #175

closing for #175
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbrycrd#136
No description provided.