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

[REST] Return more fields within session/batch data #6359

Closed
wants to merge 4 commits into from

Conversation

turboFei
Copy link
Member

@turboFei turboFei commented May 5, 2024

🔍 Description

Issue References 🔗

This pull request fixes #

Describe Your Solution 🔧

Return sessionName and totalOperations within SessionData.
Return appStartTime with list batches.

Types of changes 🔖

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Test Plan 🧪

Behavior Without This Pull Request ⚰️

Behavior With This Pull Request 🎉

Related Unit Tests


Checklist 📝

Be nice. Be informative.

@turboFei turboFei requested a review from pan3793 May 5, 2024 01:31
@turboFei turboFei added this to the v1.10.0 milestone May 5, 2024
@turboFei turboFei changed the title [REST] Return more fields for session data [REST] Return more fields within session data May 5, 2024
@turboFei turboFei changed the title [REST] Return more fields within session data [REST] Return more fields within session/batch data May 8, 2024
@turboFei turboFei requested a review from wForget May 8, 2024 05:16
@@ -432,6 +432,7 @@ class JDBCMetadataStore(conf: KyuubiConf) extends MetadataStore with Logging {
val createTime = resultSet.getLong("create_time")
val engineType = resultSet.getString("engine_type")
val clusterManager = Option(resultSet.getString("cluster_manager"))
val engineOpenTime = resultSet.getLong("engine_open_time")
Copy link
Member Author

Choose a reason for hiding this comment

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

    engine_open_time bigint, -- the engine open time

Copy link
Member

Choose a reason for hiding this comment

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

Where is it assigned a value?

Copy link
Member Author

Choose a reason for hiding this comment

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

let me check

Copy link
Member Author

@turboFei turboFei May 8, 2024

Choose a reason for hiding this comment

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

private def updateBatchMetadata(): Unit = {
val endTime = if (isTerminalState(state)) lastAccessTime else 0L
if (isTerminalState(state) && _applicationInfo.isEmpty) {
_applicationInfo = Some(ApplicationInfo.NOT_FOUND)
}
_applicationInfo.foreach { appInfo =>
val metadataToUpdate = Metadata(
identifier = batchId,
state = state.toString,
engineOpenTime = appStartTime,
engineId = appInfo.id,
engineName = appInfo.name,
engineUrl = appInfo.url.orNull,
engineState = appInfo.state.toString,
engineError = appInfo.error,
endTime = endTime)
session.sessionManager.updateMetadata(metadataToUpdate)

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.44%. Comparing base (dd0aced) to head (5fb3fb8).
Report is 9 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6359      +/-   ##
============================================
- Coverage     58.49%   58.44%   -0.06%     
  Complexity       24       24              
============================================
  Files           653      653              
  Lines         39865    39894      +29     
  Branches       5481     5481              
============================================
- Hits          23319    23316       -3     
- Misses        14055    14082      +27     
- Partials       2491     2496       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@turboFei turboFei closed this in 55f1db3 May 8, 2024
@turboFei turboFei deleted the total_op branch May 8, 2024 16:31
@turboFei
Copy link
Member Author

turboFei commented May 8, 2024

thanks, merged to master

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

Successfully merging this pull request may close these issues.

None yet

3 participants