Skip to content

Commit

Permalink
feat: reorder the list of tasks (#1256)
Browse files Browse the repository at this point in the history
* Reorder the list of tasks

* Create base zk node when taskmanager starts
  • Loading branch information
tobegit3hub authored Feb 21, 2022
1 parent e9fb106 commit 65fc830
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ class SparkPlanner(session: SparkSession, config: OpenmldbBatchConfig, sparkAppN
planCtx.setModuleBuffer(irBuffer)

val root = engine.getPlan
logger.info("Get HybridSE physical plan: ")

if (config.printPhysicalPlan) {
logger.info("Get HybridSE physical plan: ")
root.Print()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ protected void connectZooKeeper() throws IOException {
*/
protected void initZnode() {
try {
ZooKeeperUtil.createAndFailSilent(this, TaskManagerConfig.ZK_ROOT_PATH);
ZooKeeperUtil.createAndFailSilent(this, baseZnode);
} catch (Exception e) {
LOG.fatal("Error to create znode " + baseZnode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ object JobInfoManager {
def getAllJobs(): List[JobInfo] = {
val sql = s"SELECT * FROM $JOB_INFO_TABLE_NAME"
val rs = sqlExecutor.executeSQL(INTERNAL_DB_NAME, sql)
resultSetToJobs(rs)
// TODO: Reorder in output, use orderby desc if SQL supported
resultSetToJobs(rs).sortWith(_.getId > _.getId)
}

def getUnfinishedJobs(): List[JobInfo] = {
Expand All @@ -88,7 +89,7 @@ object JobInfoManager {
}
}

jobs.toList
jobs.toList.sortWith(_.getId > _.getId)
}

def stopJob(jobId: Int): JobInfo = {
Expand Down

0 comments on commit 65fc830

Please sign in to comment.