-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
[FLINK-34558][state] Support tracking state size #25837
base: master
Are you sure you want to change the base?
Conversation
4f6599b
to
4f547b9
Compare
4f547b9
to
c83f5a5
Compare
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.
Thanks for the PR! In general I have a question: why serializing the key/value by sampling, instead of read the serialization result/length of current put/add, especially for RocksDB? WDYT @masteryhx
|
||
@Documentation.Section(Documentation.Sections.STATE_SIZE_TRACKING) | ||
public static final ConfigOption<Boolean> SIZE_TRACK_ENABLED = | ||
ConfigOptions.key("state.backend.size-track.keyed-state-enabled") |
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.
Please use state.size-track
as prefix.
@@ -36,16 +38,52 @@ | |||
* @param <S> Type of the internal kv state | |||
* @param <LSM> Type of the latency tracking state metrics |
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.
Please change the description accordingly.
throws Exception { | ||
if (latencyTrackingStateConfig.isEnabled()) { | ||
if (latencyTrackingStateConfig.isEnabled() || sizeTrackingStateConfig.isEnabled()) { |
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.
It seems the LatencyTrackingStateFactory
is still used, why this is not renamed?
@Zakelly In my opinion, serializing the key/value by sampling has the following reasons:
|
What is the purpose of the change
Support tracking state key size and value size and reporting related metrics by metrics reporter.
Brief change log
Add key /value size statistics when accessing state. Add configurations to control whether this feature is enabled (disabled by default) and configure the sampling rate.
Verifying this change
This change added tests and can be verified as follows:
MetricsTrackingValueStateTest
MetricsTrackingMapStateTest
MetricsTrackingListStateTest
MetricsTrackingReducingStateTest
MetricsTrackingAggregatingStateTest
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation