Skip to content

[SPARK-58662][SS] Remove redundant toString in RocksDBStateStoreProvider state transition messages - #57869

Open
uros-b wants to merge 1 commit into
apache:masterfrom
uros-b:cleanup-rocksdb-tostring
Open

[SPARK-58662][SS] Remove redundant toString in RocksDBStateStoreProvider state transition messages#57869
uros-b wants to merge 1 commit into
apache:masterfrom
uros-b:cleanup-rocksdb-tostring

Conversation

@uros-b

@uros-b uros-b commented Aug 8, 2026

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

Removes the redundant .toString from four error-message interpolations in RocksDBStateStoreProvider.validateAndTransitionState:

case UPDATE => s"Cannot update after ${oldState}"

Why are the changes needed?

String interpolation already stringifies embedded values via String.valueOf, so the explicit call adds nothing. The METRICS branch in the same match already reads s"Cannot get metrics in ${oldState} state", so dropping the calls makes all five branches read the same way.

oldState is a case object of the provider's STATE trait with a compiler-generated toString and no custom override, and state is initialized to UPDATING and only ever assigned other case objects, so the rendered text is unchanged.

Does this PR introduce any user-facing change?

No. The error message text is identical.

How was this patch tested?

Existing tests cover this path. No test asserts these four message strings; the messages asserted in RocksDBStateStoreSuite and RocksDBStateStoreLockHardeningSuite come from validateState and from the unchanged METRICS branch, and the error condition and its errorMsg parameter are untouched.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Opus 4.8)

@uros-b uros-b left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@HeartSaVioR Please review.

@uros-b
uros-b requested a review from HeartSaVioR August 8, 2026 11:12

@dongjoon-hyun dongjoon-hyun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1, LGTM

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants