-
Notifications
You must be signed in to change notification settings - Fork 921
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
[KYUUBI #5328] Batch supports priority scheduling #5352
Changes from 5 commits
654ad84
4c6b990
8d4b276
f7ca221
fcaf85d
129a467
e1705c3
67eb252
6b8d0f0
c0bbc0d
27fc5e8
21ceccb
7ed2551
1bf81e7
58621b5
687ed1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,9 +167,10 @@ class JDBCMetadataStore(conf: KyuubiConf) extends MetadataStore with Logging { | |
|request_args, | ||
|create_time, | ||
|engine_type, | ||
|cluster_manager | ||
|cluster_manager, | ||
|priority | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not see the metadata table schema change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for review, metadata table schema changed in #5329 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks @zwangsheng |
||
|) | ||
|VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) | ||
|VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) | ||
|""".stripMargin | ||
|
||
JdbcUtils.withConnection { connection => | ||
|
@@ -190,15 +191,16 @@ class JDBCMetadataStore(conf: KyuubiConf) extends MetadataStore with Logging { | |
valueAsString(metadata.requestArgs), | ||
metadata.createTime, | ||
Option(metadata.engineType).map(_.toUpperCase(Locale.ROOT)).orNull, | ||
metadata.clusterManager.orNull) | ||
metadata.clusterManager.orNull, | ||
metadata.priority) | ||
} | ||
} | ||
|
||
override def pickMetadata(kyuubiInstance: String): Option[Metadata] = synchronized { | ||
JdbcUtils.executeQueryWithRowMapper( | ||
s"""SELECT identifier FROM $METADATA_TABLE | ||
|WHERE state=? | ||
|ORDER BY create_time ASC LIMIT 1 | ||
|ORDER BY priority DESC, create_time ASC LIMIT 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as we discussed before, there would cause significant performance issues on MySQL 5.7(which is adopted widely at the current stage), we should provide a switch to allow user disable this feature |
||
|""".stripMargin) { stmt => | ||
stmt.setString(1, OperationState.INITIALIZED.toString) | ||
} { resultSet => | ||
|
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.
There's a magic code here. Default priority is worth to be extracted to explicit static value , and further mentioned in config docs. Or it's confusing for user and developers reviewing the UTs.
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.
let's at least document it should be consistent with the metadata table DDL definition