Skip to content
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

expose write buffer manager memory usage methods through Java Api #8194

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

benoitmeriaux
Copy link
Contributor

No description provided.

@benoitmeriaux benoitmeriaux force-pushed the expose-write-buffer-manager-memory-usages-jni branch from 54d4b12 to 2b23ee2 Compare April 15, 2021 20:40
Copy link
Collaborator

@adamretter adamretter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general this looks fine. I am not certain about the call to make_shared though. Also this needs tests please?

JNIEnv* /*env*/, jclass /*jclazz*/, jlong jbuffer_size) {
auto* write_buffer_manager =
new std::shared_ptr<ROCKSDB_NAMESPACE::WriteBufferManager>(
std::make_shared<ROCKSDB_NAMESPACE::WriteBufferManager>(jbuffer_size,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that this make_shared is supported in C++14?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'm not an expert of C++, and had some troubles to setup the toolchain on my machine, I'll fix this

@benoitmeriaux
Copy link
Contributor Author

I could use some help to solve failing tests, I'm not familiar with JNI/Cpp binding:

1) newWriteBufferManagerWithoutCache(org.rocksdb.WriteBufferManagerTest)
java.lang.UnsatisfiedLinkError: org.rocksdb.WriteBufferManager.getBufferSize(J)J
	at org.rocksdb.WriteBufferManager.getBufferSize(Native Method)
	at org.rocksdb.WriteBufferManager.getBufferSize(WriteBufferManager.java:53)
	at org.rocksdb.WriteBufferManagerTest.newWriteBufferManagerWithoutCache(WriteBufferManagerTest.java:33)
2) newWriteBufferManagerWithCache(org.rocksdb.WriteBufferManagerTest)
java.lang.UnsatisfiedLinkError: org.rocksdb.WriteBufferManager.getBufferSize(J)J
	at org.rocksdb.WriteBufferManager.getBufferSize(Native Method)
	at org.rocksdb.WriteBufferManager.getBufferSize(WriteBufferManager.java:53)
	at org.rocksdb.WriteBufferManagerTest.newWriteBufferManagerWithCache(WriteBufferManagerTest.java:23)

https://app.circleci.com/pipelines/github/facebook/rocksdb/6688/workflows/61e63400-0303-4cf9-ac53-0c1c57d3d75b/jobs/122698/parallel-runs/0/steps/0-108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants