-
Notifications
You must be signed in to change notification settings - Fork 167
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
Use LDBVersionedStore for wallet also #1011
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
def get(key: K): Option[V] = { | ||
lock.readLock().lock() | ||
val res = Option(db.get(key)) | ||
lock.readLock().unlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be protected with try {..} finally { ... } section?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
||
|
||
/** | ||
* Iterate through the database to read elements according to a filter function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Iterate through the database to read elements according to a filter function | |
* Iterate through the database to read elements according to a filter function. | |
* The method first load filtered data in memory and then returns an iterator over them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
} | ||
|
||
/** | ||
* Read all the database elements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Read all the database elements | |
* Read all the database elements. | |
* The elements are first loaded in memory and then returned as the iterator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
* | ||
* Finds all keys from given iterable. | ||
* Result is returned in an iterable of key-value pairs. | ||
* If key is not found, null value is included in result pair. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* If key is not found, null value is included in result pair. | |
* If key is not found, None value is included in result pair. |
/** | ||
* Registry of opened LevelDB instances. | ||
* LevelDB prohibit access to the same storage file from more than one DB instance. | ||
* And ergo application (mostly tests) quite frequently doesn't not explicitly close |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* And ergo application (mostly tests) quite frequently doesn't not explicitly close | |
* And ergo application (mostly tests) quite frequently doesn't close explicitly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
explicitly close is a perfect word order
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get the meaning of the sentence in this case.
lock.writeLock().lock() | ||
try { | ||
add(path, factory.open(path, options)) | ||
} catch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix formatting and identation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
.../src/test/scala/scorex/crypto/authds/avltree/batch/VersionedLDBAVLStorageSpecification.scala
Show resolved
Hide resolved
avldb/src/test/scala/scorex/crypto/authds/avltree/batch/benchmark/IODBBenchmark.scala
Show resolved
Hide resolved
@aslesarenko thanks for the comments, I've addressed all of them! |
This PR builds on top #969 . In addition the PR #969 , this one is using LDBVersionedStore for wallet registry as well. Old class VersionedLDBKVStore currently is used in benchmarks only , and to be removed.
Some ByteArrayWrapper usages eliminated as well, and IODB with ByteArrayWrapper are to be removed in next versions as well.