-
Notifications
You must be signed in to change notification settings - Fork 105
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
[close #446] Fix Optional fields type #445
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
/run-all-tests |
@zhongqishang thanks for your contribution, please create an issue that you wish to fix and follow the PR title format |
could you also add some tests? |
@zz-jason I have created an issue and added the tests. |
/run-all-tests |
Signed-off-by: Qishang Zhong <zhongqishang@gmail.com>
getIntOption(TIKV_RAWKV_BATCH_READ_SLOWLOG_IN_MS); | ||
private Optional<Integer> rawKVBatchWriteSlowLogInMS = | ||
getIntOption(TIKV_RAWKV_BATCH_WRITE_SLOWLOG_IN_MS); | ||
private Integer rawKVReadSlowLogInMS = getIntOption(TIKV_RAWKV_READ_SLOWLOG_IN_MS).orElse(null); |
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'm a little confused. why not set the variable type of rawKVReadSlowLogInMS
to int
and get the value via getInt()
just like what we did for rawKVCleanTimeoutInMS
?
@marsishandsome do you have any idea?
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 think rawKVReadSlowLogInMS
not set default value in org.tikv.common.TiConfiguration#loadFromDefaultProperties
, and rawKVReadSlowLogInMS must be have a default value due to org.tikv.common.log.SlowLogImpl#log
.
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.
rawKVReadSlowLogInMS
is calculated as follows:
- if
TIKV_RAWKV_READ_SLOWLOG_IN_MS
is set, then use it, in such caserawKVReadSlowLogInMS
!= null - else use
getTimeout() * 2
, in such caserawKVReadSlowLogInMS
== null
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.
OK.
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
/merge |
/run-all-tests |
1 similar comment
/run-all-tests |
@zhongqishang merge failed. |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-3.1 in PR #449 |
Signed-off-by: Qishang Zhong zhongqishang@gmail.com
What problem does this PR solve?
When I use the client in Flink , I get an error
What is changed and how it works?
Optional in the getter method
Check List for Tests
This PR has been tested by the at least one of the following methods:
Side effects
Related changes
https://stackoverflow.com/questions/24547673/why-java-util-optional-is-not-serializable-how-to-serialize-the-object-with-suc