HDDS-7158. ldb cli command supports to scan container V3.#3705
HDDS-7158. ldb cli command supports to scan container V3.#3705ChenSammi merged 6 commits intoapache:masterfrom
Conversation
duongkame
left a comment
There was a problem hiding this comment.
Thanks for the patch @ChenSammi. This looks good to me, only left a few nitpick comments.
|
|
||
| @Override | ||
| protected void finalize() throws Throwable { | ||
| ManagedRocksObjectMetrics.INSTANCE.increaseManagedObject(); |
There was a problem hiding this comment.
Let's make it an util in ManagedRocksObjectMetrics.
static void assertClosed(RocksMutableObject rocksObject) {
ManagedRocksObjectMetrics.INSTANCE.increaseManagedObject();
if (rocksObject.isOwningHandle()) {
ManagedRocksObjectMetrics.INSTANCE.increaseLeakObject();
LOG.warn("{} is not closed properly",
rocksObject.getClass().getSimpleName());
}
}
There was a problem hiding this comment.
@DuongNguyen0 , thanks for the code review. RocksMutableObject.isOwningHandle has a protected access privilege, and cannot be directly called in either ManagedRocksObjectMetrics or ManagedRocksObjectUtils(I assume you mean this class). That's why move the check into the final method.
There was a problem hiding this comment.
Sounds good, thanks for the clarification, Sammi.
| if (schemaV3) { | ||
| int index = | ||
| DatanodeSchemaThreeDBDefinition.getContainerKeyPrefixLength(); | ||
| String cid = ((String)key).substring(0, index); |
There was a problem hiding this comment.
| String cid = ((String)key).substring(0, index); | |
| String cid = key.toString().substring(0, index); |
| int index = | ||
| DatanodeSchemaThreeDBDefinition.getContainerKeyPrefixLength(); | ||
| String cid = ((String)key).substring(0, index); | ||
| String blockId = ((String)key).substring(index); |
There was a problem hiding this comment.
| String blockId = ((String)key).substring(index); | |
| String blockId = key.toString().substring(index); |
| import org.rocksdb.Slice; | ||
|
|
||
| /** | ||
| * Managed Options. |
There was a problem hiding this comment.
| * Managed Options. | |
| * Managed Slice. |
guihecheng
left a comment
There was a problem hiding this comment.
LGTM+1
Thanks @ChenSammi !
|
Thanks @DuongNguyen0 and @guihecheng for the code review. |
https://issues.apache.org/jira/browse/HDDS-7158