Refactor ColumnFamilyDescriptor to be RocksObject#12505
Conversation
9a2c8af to
624b2ae
Compare
adamretter
left a comment
There was a problem hiding this comment.
Some initial feedback...
|
@rhubner Do you also need to update the |
624b2ae to
5cc529a
Compare
5cc529a to
b0e5449
Compare
alanpaxton
left a comment
There was a problem hiding this comment.
I have suggested some minor changes.
I have chimed in on the issue raised by Adam about constructing new Java objects in the portal, I think you are basically correct there, and that option (2) is right. But see the details.
| this.implicitlyCreatedColumnFamilyOptions = implicitlyCreatedColumnFamilyOptions; | ||
| } | ||
|
|
||
| private static long createNativeInstance(final byte[] columnFamilyName, |
There was a problem hiding this comment.
I would prefer to call this "createNativeDescriptor" - I think that makes it clearer.
| */ | ||
| jbyteArray Java_org_rocksdb_ColumnFamilyDescriptor_getName( | ||
| JNIEnv* env, jclass, jlong jcf_descriptor_handle) { | ||
| auto cf_options = |
There was a problem hiding this comment.
Name should be cf_descriptor
| */ | ||
| void Java_org_rocksdb_ColumnFamilyDescriptor_disposeJni( | ||
| JNIEnv*, jclass, jlong jcf_descriptor_handle) { | ||
| auto cf_options = |
| jlong* jco = env->GetLongArrayElements(jcolumn_options, nullptr); | ||
| if (jco == nullptr) { | ||
| // exception thrown: OutOfMemoryError | ||
| const jsize len_cols = env->GetArrayLength(jcf_descriptors); |
There was a problem hiding this comment.
This little code snippet (jcf_descriptors to std::vector) occurs in 3 or 4 places. Could it be a helper function in columnfamilydescriptor.cc ?
|
|
||
| final byte[][] cfNames = new byte[columnFamilyDescriptors.size()][]; | ||
| final long[] cfOptionHandles = new long[columnFamilyDescriptors.size()]; | ||
| final long[] cfDescriptorHandles = new long[columnFamilyDescriptors.size()]; |
There was a problem hiding this comment.
Conversion from List to
final long[] cfDescriptorHandles = new long[columnFamilyDescriptors.size()];
seems to happen in several places. Another candidate for a helper ?
9fb719a to
cda2067
Compare
|
@rhubner I reviewed your latest batch of changes, LGTM now. Line 6846 of portal.h needs the text fixed, it says |
84f8a67 to
a1137f1
Compare
1647f6a to
734f7e2
Compare
50f5d71 to
21b242a
Compare
8b4adb9 to
d6b268d
Compare
do what CI says `make format` should have done, rather than what `make format` does for me…
d6b268d to
4892d76
Compare
Fix memory leak, see #12224 for details