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

Refactor 'excludeJobIds' Serialization for Spark Job Compatibility #155

Merged
merged 1 commit into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ object FlintInstance {
"state" -> job.state,
// update last update time
"lastUpdateTime" -> currentTime,
"excludeJobIds" -> job.excludedJobIds,
// Convert a Seq[String] into a comma-separated string, such as "id1,id2".
// This approach is chosen over serializing to an array format (e.g., ["id1", "id2"])
// because it simplifies client-side processing. With a comma-separated string,
// clients can easily ignore this field if it's not in use, avoiding the need
// for array parsing logic. This makes the serialized data more straightforward to handle.
"excludeJobIds" -> job.excludedJobIds.mkString(","),
"jobStartTime" -> job.jobStartTime))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ class FlintInstanceTest extends SparkFunSuite with Matchers {
json should include(""""sessionId":"session-789"""")
json should include(""""state":"RUNNING"""")
json should include(s""""lastUpdateTime":$currentTime""")
json should include(""""excludeJobIds":["job-101","job-202"]""")
json should include(
""""excludeJobIds":"job-101,job-202""""
) // Check for comma-separated string
json should include(""""jobStartTime":1620000001000""")
json should include(""""error":""""")
}
Expand Down
Loading