-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
245 changed files
with
10,692 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...client/src/main/scala/com/webank/wedatasphere/linkis/computation/client/JobListener.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.webank.wedatasphere.linkis.computation.client | ||
|
||
|
||
trait JobListener { | ||
|
||
def onJobSubmitted(job: LinkisJob): Unit | ||
|
||
def onJobRunning(job: LinkisJob): Unit | ||
|
||
def onJobFinished(job: LinkisJob): Unit | ||
|
||
def onJobUnknownError(job: LinkisJob, t: Throwable): Unit | ||
|
||
} |
68 changes: 68 additions & 0 deletions
68
...-client/src/main/scala/com/webank/wedatasphere/linkis/computation/client/JobMetrics.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.webank.wedatasphere.linkis.computation.client | ||
|
||
import java.util | ||
|
||
import com.webank.wedatasphere.linkis.common.utils.{ByteTimeUtils, Logging} | ||
|
||
|
||
trait ClientMetrics { | ||
|
||
def getMetrics: Map[String, Any] | ||
def getMetricString: String | ||
def printIt(): Unit | ||
|
||
} | ||
|
||
abstract class AbstractJobMetrics extends ClientMetrics with Logging { | ||
override def printIt(): Unit = info(getMetricString) | ||
} | ||
|
||
import scala.collection.convert.WrapAsScala._ | ||
class LinkisJobMetrics(taskId: String) extends AbstractJobMetrics { | ||
|
||
private var clientSubmitTime: Long = 0 | ||
private var clientFinishedTime: Long = 0 | ||
private var clientGetJobInfoTime: Long = 0 | ||
private var clientFetchResultSetTime: Long = 0 | ||
private val metricsMap = new util.HashMap[String, Any] | ||
|
||
def setClientSubmitTime(clientSubmitTime: Long): Unit = this.clientSubmitTime = clientSubmitTime | ||
def setClientFinishedTime(clientFinishedTime: Long): Unit = this.clientFinishedTime = clientFinishedTime | ||
def addClientGetJobInfoTime(getJobInfoTime: Long): Unit = this.clientGetJobInfoTime += getJobInfoTime | ||
def addClientFetchResultSetTime(fetchResultSetTime: Long): Unit = this.clientFetchResultSetTime = clientFetchResultSetTime | ||
|
||
def setLong(key: String, value: Long): Unit = metricsMap.put(key, value) | ||
|
||
def addLong(key: String, value: Long): Unit = { | ||
val v = if(metricsMap.containsKey(key)) metricsMap.get(key).asInstanceOf[Long] else 0 | ||
setLong(key, value + v) | ||
} | ||
|
||
override def getMetrics: Map[String, Any] = { | ||
metricsMap.put("clientSubmitTime", clientSubmitTime) | ||
metricsMap.put("clientFinishedTime", clientFinishedTime) | ||
metricsMap.put("clientGetJobInfoTime", clientGetJobInfoTime) | ||
metricsMap.put("clientFetchResultSetTime", clientFetchResultSetTime) | ||
metricsMap.toMap | ||
} | ||
|
||
override def getMetricString: String = s"The metrics of job($taskId), costs ${ByteTimeUtils.msDurationToString(clientFinishedTime - clientSubmitTime)} to execute, costs ${ByteTimeUtils.msDurationToString(clientFetchResultSetTime)} to fetch all resultSets." | ||
|
||
} |
41 changes: 41 additions & 0 deletions
41
...n-client/src/main/scala/com/webank/wedatasphere/linkis/computation/client/LinkisJob.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.webank.wedatasphere.linkis.computation.client | ||
|
||
import com.webank.wedatasphere.linkis.computation.client.operator.Operator | ||
|
||
|
||
trait LinkisJob { | ||
|
||
def getId: String | ||
|
||
def kill(): Unit | ||
|
||
def getOperator(operatorName: String): Operator[_] | ||
|
||
def isCompleted: Boolean | ||
|
||
def isSucceed: Boolean | ||
|
||
def waitForCompleted(): Unit | ||
|
||
def waitFor(mills: Long): Unit | ||
|
||
def getJobMetrics: LinkisJobMetrics | ||
|
||
} |
Oops, something went wrong.