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

Add [set]DailyOffpeakTimeUTC option to Java API #13148

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

Conversation

alanpaxton
Copy link
Contributor

Reflect RocksDB DailyOffpeakTimeUTC option in Java API. As is standard for options, there are a number of different places where this option needs to be added: it is an option, a DB option, and it is mutable (can be changed while running).

The new option is a string value. This requires an extension to the internal MutableDBOptions parse code, which received the entire options string from C++ and parses it on the Java side.

Reflect RocksDB DailyOffpeakTimeUTC  option in Java API.
As is standard for options, there are a number of different places where this option needs to be added.

The new option is a string value. This requires an extension to the internal MutableDBOptions parse code, which received the entire options string from C++ and parses it on the Java side.
@alanpaxton alanpaxton marked this pull request as draft November 19, 2024 15:29
java/rocksjni/options.cc Outdated Show resolved Hide resolved
@@ -759,6 +759,19 @@ public long compactionReadaheadSize() {
return compactionReadaheadSize(nativeHandle_);
}

@Override
public DBOptions setDailyOffpeakTimeUTC(String offpeakTimeUTC) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is good design. Somebody can say that java date/time data structures can be better, but conversion will probably make more problems. 👍

Copy link
Contributor Author

@alanpaxton alanpaxton Nov 20, 2024

Choose a reason for hiding this comment

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

I thought hard about that. If I would use the the java date/time, I need to parse the HH:mm-HH:mm format. Better to just present the same string as RockSDB does.

@rhubner
Copy link
Contributor

rhubner commented Nov 19, 2024

LGTM

@alanpaxton alanpaxton force-pushed the eb/java-offpeak-compaction-options branch from 2bb94d2 to a5cc7ab Compare November 20, 2024 09:05
@alanpaxton alanpaxton marked this pull request as ready for review November 20, 2024 09:26
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.

3 participants