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
database: Replace with new version. #492
Conversation
19a1be7
to
68f00ff
Compare
68f00ff
to
5ff9542
Compare
5ff9542
to
bc9139a
Compare
Rebased. |
bc9139a
to
311a7d6
Compare
311a7d6
to
1e78bde
Compare
Rebased. |
1e78bde
to
7583acf
Compare
Rebased to latest master (on top of blockchain_database2 branch). Comments from the review on Reviewable.io |
7583acf
to
aff5c6f
Compare
aff5c6f
to
ce77394
Compare
ce77394
to
9781452
Compare
Rebased to latest master (on top of blockchain_database2 branch). Comments from the review on Reviewable.io |
9781452
to
775e3c7
Compare
775e3c7
to
eccb337
Compare
Rebased to latest master (on top of blockchain_database2 branch). |
eccb337
to
21e06d4
Compare
Rebased to latest master (on top of blockchain_database2 branch). |
8ec23a4
to
fed022f
Compare
a59c3f2
to
7b6bb74
Compare
7b6bb74
to
5f7d5ee
Compare
Reviewed 9 of 97 files at r1, 5 of 134 files at r2, 6 of 12 files at r3, 3 of 7 files at r4, 119 of 125 files at r5. database/interface.go, line 22 [r5] (raw file): database/interface.go, line 177 [r5] (raw file): Comments from the review on Reviewable.io |
b03c5d7
to
9bc9ad2
Compare
Review status: 5 of 110 files reviewed at latest revision, 3 unresolved discussions. database/interface.go, line 104 [r7] (raw file): Comments from the review on Reviewable.io |
9bc9ad2
to
22b4927
Compare
22b4927
to
b51d891
Compare
Rebased to the latest master. Reviewed 1 of 134 files at r2, 38 of 125 files at r5, 8 of 143 files at r6, 106 of 125 files at r7, 29 of 29 files at r8. database/interface.go, line 22 [r5] (raw file): However, since the interface is intended to be generic enough to support any database backend, the assumptions do not hold. That said, I don't want to make the change in this pull request because it is only intended to delete the old database and move the new database2 package (which is already in master) in its place. I think opening up a separate issue and creating a separate PR after the chain PR #491 and this one are in to expose errors is a fine idea. database/interface.go, line 177 [r5] (raw file): value := bucket.Get(key)
if value == nil {
fmt.Println("key does not exist")
} else if len(value) == 0 {
fmt.Println("key exists but has no value")
} I should also note that another nice property is taking the len of nil or an empty slice both result in 0, so in many cases where you don't care if it exists and simply that it's not empty, the following works: value := bucket.Get(key)
if len(value) == 0 {
fmt.Println("key either does not exist or exists but has no value")
} database/interface.go, line 104 [r7] (raw file): Comments from the review on Reviewable.io |
b51d891
to
6bed4a1
Compare
Review status: 108 of 110 files reviewed at latest revision, 1 unresolved discussion. database/interface.go, line 177 [r5] (raw file): On a separate but slightly related note, I have attempted to implement Comments from the review on Reviewable.io |
Reviewed 1 of 125 files at r5, 1 of 125 files at r7, 1 of 29 files at r8, 2 of 2 files at r9. database/interface.go, line 177 [r5] (raw file): As far as the buckets, you'll probably have to implement them similar to how I did it in ffldb. In particular it keeps a unique bucket counter that gives every new bucket (nested or not) a unique value. Then, it maintains a bucket index that consists of keys which are a prefix followed by the bucket's parent id followed by its name and the value is the bucket's unique id. With that, all keys are stored prefixed with the unique bucket id. In that way, you can easily create a cursor over all items in a bucket by doing a prefix scan for the unique bucket id. As far as checking for nested buckets, that too is easily done by a prefix scan for the bucket index prefix + parent bucket id. Comments from the review on Reviewable.io |
6bed4a1
to
53c6969
Compare
Rebased to latest master (on top of blockchain_database2_index branch). Reviewed 3 of 136 files at r1, 1 of 134 files at r2, 2 of 12 files at r3, 38 of 125 files at r5, 38 of 125 files at r7, 7 of 137 files at r10, 130 of 130 files at r11. Comments from the review on Reviewable.io |
53c6969
to
3ed5dcd
Compare
Reviewed 1 of 134 files at r2, 38 of 125 files at r5, 38 of 125 files at r7, 38 of 130 files at r11, 130 of 130 files at r13. Comments from the review on Reviewable.io |
d229057
to
5ef5852
Compare
Rebased to the latest master (on top of blockchain_database2_index branch). Reviewed 1 of 134 files at r2, 38 of 125 files at r5, 38 of 125 files at r7, 38 of 130 files at r11, 38 of 130 files at r13, 2 of 132 files at r14, 130 of 130 files at r15. Comments from Reviewable |
5ef5852
to
9c46e14
Compare
Rebased to the latest master (on top of blockchain_database2_index branch). Reviewed 1 of 134 files at r2, 38 of 125 files at r5, 38 of 125 files at r7, 38 of 130 files at r11, 38 of 130 files at r13, 38 of 130 files at r15, 1 of 131 files at r16, 130 of 130 files at r17. Comments from Reviewable |
56a71df
to
25ec0ee
Compare
Rebased to the latest master (on top of blockchain_database2_index branch). Reviewed 1 of 134 files at r2, 38 of 125 files at r5, 38 of 125 files at r7, 38 of 130 files at r11, 38 of 130 files at r13, 38 of 130 files at r15, 38 of 130 files at r17, 1 of 131 files at r18, 130 of 130 files at r19. Comments from Reviewable |
This commit removes the old database package, moves the new package into its place, and updates all imports accordingly.
25ec0ee
to
b580cdb
Compare
OK |
ok |
Requires #380, #491, and #650.
This pull request removes the old database package, moves the new package into its place, and updates all imports accordingly.