You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "jackierwzhang (via GitHub)" <gi...@apache.org> on 2025/04/28 23:46:55 UTC
[PR] [SPARK-51940][SS] Add interface for managing streaming checkpoint metadata [spark]
jackierwzhang opened a new pull request, #50746:
URL: https://github.com/apache/spark/pull/50746
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a faster review.
7. If you want to add a new configuration, please read the guideline first for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the guideline first in
'common/utils/src/main/resources/error/README.md'.
-->
### What changes were proposed in this pull request?
Minor refactor to introduce an interface for accessing the metadata (e.g. offset / commit logs) in a streaming checkpoint.
### Why are the changes needed?
To standardize the access pattern.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
This is a pure refactoring, existing tests should suffice.
### Was this patch authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-51940][SS] Add interface for managing streaming checkpoint metadata [spark]
Posted by "HeartSaVioR (via GitHub)" <gi...@apache.org>.
HeartSaVioR commented on code in PR #50746:
URL: https://github.com/apache/spark/pull/50746#discussion_r2069440009
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/StreamExecution.scala:
##########
@@ -222,21 +228,6 @@ abstract class StreamExecution(
}
}
- /**
Review Comment:
Ah OK you moved the explanation to new class. Never mind.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-51940][SS] Add interface for managing streaming checkpoint metadata [spark]
Posted by "jackierwzhang (via GitHub)" <gi...@apache.org>.
jackierwzhang commented on code in PR #50746:
URL: https://github.com/apache/spark/pull/50746#discussion_r2068997998
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/StreamExecution.scala:
##########
@@ -222,21 +228,6 @@ abstract class StreamExecution(
}
}
- /**
Review Comment:
I removed it because they are duplicated with that in the class?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-51940][SS] Add interface for managing streaming checkpoint metadata [spark]
Posted by "HeartSaVioR (via GitHub)" <gi...@apache.org>.
HeartSaVioR closed pull request #50746: [SPARK-51940][SS] Add interface for managing streaming checkpoint metadata
URL: https://github.com/apache/spark/pull/50746
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-51940][SS] Add interface for managing streaming checkpoint metadata [spark]
Posted by "jackierwzhang (via GitHub)" <gi...@apache.org>.
jackierwzhang commented on PR #50746:
URL: https://github.com/apache/spark/pull/50746#issuecomment-2840641389
@HeartSaVioR I actually had to revert some `lazy vals` in `StreamExecution` back to `vals` because [this](https://github.com/apache/spark/pull/50746/files#diff-7e8a99d76adb60a2d85609ab46bb2867cd83de106b3c048d6d955805824c9bb6R173) access to `id` within `streamMetadata` would actually forces initialize the subclass's lazy val but at that time the input parameter `asyncWritesExecutorService` [here](https://github.com/apache/spark/pull/50746/files#diff-a1227731d4b0a7bb5f6f6b3ca3baa67a9c9bdf717a474f22dd73dd8c2cf9d398R93) is still null.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-51940][SS] Add interface for managing streaming checkpoint metadata [spark]
Posted by "jackierwzhang (via GitHub)" <gi...@apache.org>.
jackierwzhang commented on PR #50746:
URL: https://github.com/apache/spark/pull/50746#issuecomment-2837152130
> The code looks OK - meta question: I see you changed val to lazy val in multiple places. Is that intentional, and if it is, mind explaining?
Yes, there are mainly two reason:
1. I don't want the initialization of the class to automatically initialize the logs since they involve FS operations, only direct access should initialize the logs.
2. Overriding a lazy val in StreamExecution is easier to reason that a plain val, which may be null when it's overridden by the subclass and hence throw NPE. For example, [this](https://github.com/apache/spark/pull/50746/files#diff-7e8a99d76adb60a2d85609ab46bb2867cd83de106b3c048d6d955805824c9bb6L175) `id` may throw null because `checkpointMetadata` above it is overridden.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-51940][SS] Add interface for managing streaming checkpoint metadata [spark]
Posted by "HeartSaVioR (via GitHub)" <gi...@apache.org>.
HeartSaVioR commented on PR #50746:
URL: https://github.com/apache/spark/pull/50746#issuecomment-2837222910
https://github.com/jackierwzhang/spark/actions/runs/14720115571/job/41312160109
Test failures seem to be relevant. @jackierwzhang Would you mind taking a look?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-51940][SS] Add interface for managing streaming checkpoint metadata [spark]
Posted by "HeartSaVioR (via GitHub)" <gi...@apache.org>.
HeartSaVioR commented on code in PR #50746:
URL: https://github.com/apache/spark/pull/50746#discussion_r2067883971
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/StreamExecution.scala:
##########
@@ -222,21 +228,6 @@ abstract class StreamExecution(
}
}
- /**
Review Comment:
@jackierwzhang Sorry, shall we retain the code comment as it is when you move this and below?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
Re: [PR] [SPARK-51940][SS] Add interface for managing streaming checkpoint metadata [spark]
Posted by "HeartSaVioR (via GitHub)" <gi...@apache.org>.
HeartSaVioR commented on PR #50746:
URL: https://github.com/apache/spark/pull/50746#issuecomment-2843280952
Thanks! Merging to master.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org