forked from byzer-org/byzer-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
71c3e1c
commit f89ae82
Showing
34 changed files
with
349 additions
and
299 deletions.
There are no files selected for viewing
Binary file added
BIN
+12 Bytes
...ouse/carbon_jack/.part-00000-ffd01f2b-fa7a-400d-b330-5129d2a69f9c-c000.snappy.parquet.crc
Binary file not shown.
Binary file added
BIN
+16 Bytes
...ouse/carbon_jack/.part-00001-ffd01f2b-fa7a-400d-b330-5129d2a69f9c-c000.snappy.parquet.crc
Binary file not shown.
Empty file.
Binary file added
BIN
+409 Bytes
...warehouse/carbon_jack/part-00000-ffd01f2b-fa7a-400d-b330-5129d2a69f9c-c000.snappy.parquet
Binary file not shown.
Binary file added
BIN
+784 Bytes
...warehouse/carbon_jack/part-00001-ffd01f2b-fa7a-400d-b330-5129d2a69f9c-c000.snappy.parquet
Binary file not shown.
Binary file added
BIN
+12 Bytes
...ouse/carbon_jack/.part-00000-73c4a7f9-9705-46d9-86fd-1ea523a37f92-c000.snappy.parquet.crc
Binary file not shown.
Binary file added
BIN
+16 Bytes
...ouse/carbon_jack/.part-00001-73c4a7f9-9705-46d9-86fd-1ea523a37f92-c000.snappy.parquet.crc
Binary file not shown.
Empty file.
Binary file added
BIN
+409 Bytes
...warehouse/carbon_jack/part-00000-73c4a7f9-9705-46d9-86fd-1ea523a37f92-c000.snappy.parquet
Binary file not shown.
Binary file added
BIN
+784 Bytes
...warehouse/carbon_jack/part-00001-73c4a7f9-9705-46d9-86fd-1ea523a37f92-c000.snappy.parquet
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,12 @@ package streaming.core.datasource.impl | |
import org.apache.spark.sql.mlsql.session.MLSQLException | ||
import org.apache.spark.sql.{DataFrame, DataFrameReader} | ||
import streaming.common.ScalaEnumTool | ||
import streaming.core.StreamingproJobInfo | ||
import streaming.core.datasource._ | ||
import streaming.core.datasource.util.MLSQLJobCollect | ||
import streaming.dsl.ScriptSQLExec | ||
import streaming.dsl.auth.{OperateType, TableType} | ||
import streaming.dsl.load.batch.{LogTail, MLSQLAPIExplain, MLSQLConfExplain} | ||
import tech.mlsql.job.MLSQLJobInfo | ||
|
||
/** | ||
* 2019-01-11 WilliamZhu([email protected]) | ||
|
@@ -39,7 +39,7 @@ class MLSQLSystemTables extends MLSQLSource with MLSQLSourceInfo with MLSQLRegis | |
|
||
} | ||
case Array("jobs") => | ||
spark.createDataset[StreamingproJobInfo](jobCollect.jobs).toDF() | ||
spark.createDataset[MLSQLJobInfo](jobCollect.jobs).toDF() | ||
case Array("jobs", jobGroupId) => | ||
spark.createDataset(Seq(jobCollect.jobDetail(jobGroupId))).toDF() | ||
case Array("progress", jobGroupId) => | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,18 +2,18 @@ package streaming.core.stream | |
|
||
import org.apache.spark.sql.SparkSession | ||
import org.apache.spark.sql.streaming.StreamingQueryListener | ||
import streaming.core.{StreamingproJobInfo, StreamingproJobManager, StreamingproJobType} | ||
import streaming.log.{Logging, WowLog} | ||
import tech.mlsql.job.{JobManager, MLSQLJobInfo, MLSQLJobType} | ||
|
||
import scala.collection.JavaConverters._ | ||
|
||
/** | ||
* 2019-01-21 WilliamZhu([email protected]) | ||
*/ | ||
object MLSQLStreamManager extends Logging with WowLog { | ||
private val store = new java.util.concurrent.ConcurrentHashMap[String, StreamingproJobInfo]() | ||
private val store = new java.util.concurrent.ConcurrentHashMap[String, MLSQLJobInfo]() | ||
|
||
def addStore(job: StreamingproJobInfo) = { | ||
def addStore(job: MLSQLJobInfo) = { | ||
store.put(job.groupId, job) | ||
} | ||
|
||
|
@@ -40,19 +40,19 @@ class MLSQLStreamingQueryListener extends StreamingQueryListener with Logging wi | |
def sync(name: String, id: String) = { | ||
// first we should check by name, since before the stream is really stared, we have record the name in | ||
// StreamingproJobManager | ||
StreamingproJobManager.getJobInfo.filter(f => f._2.jobType == StreamingproJobType.STREAM | ||
JobManager.getJobInfo.filter(f => f._2.jobType == MLSQLJobType.STREAM | ||
&& (f._2.jobName == name)).headOption match { | ||
case Some(job) => | ||
if (job._2.groupId != id) { | ||
logInfo(format( | ||
s""" | ||
|StreamingproJobManager:${job._2.jobName} | ||
|JobManager:${job._2.jobName} | ||
|Spark streams: ${name} | ||
|Action: sync | ||
|Reason:: Job is not synced before. | ||
""".stripMargin)) | ||
//onQueryStarted is stared before we acquire info from StreamingQuery | ||
StreamingproJobManager.addJobManually(job._2.copy(groupId = id)) | ||
JobManager.addJobManually(job._2.copy(groupId = id)) | ||
} | ||
case None => | ||
// we only care when stream is restore from ck without MLSQL instance restart | ||
|
@@ -61,12 +61,12 @@ class MLSQLStreamingQueryListener extends StreamingQueryListener with Logging wi | |
case Some(job) => | ||
logInfo(format( | ||
s""" | ||
|StreamingproJobManager:${job.jobName} | ||
|JobManager:${job.jobName} | ||
|Spark streams: ${name} | ||
|Action: sync | ||
|Reason:: Job is not in StreamingproJobManager but in MLSQLStreamManager. | ||
|Reason:: Job is not in JobManager but in MLSQLStreamManager. | ||
""".stripMargin)) | ||
StreamingproJobManager.addJobManually(job) | ||
JobManager.addJobManually(job) | ||
case None => | ||
// this should not happen,throw exception | ||
throw new RuntimeException(s"MLSQL have unsync stream: ${name}") | ||
|
@@ -85,10 +85,10 @@ class MLSQLStreamingQueryListener extends StreamingQueryListener with Logging wi | |
|
||
override def onQueryTerminated(event: StreamingQueryListener.QueryTerminatedEvent): Unit = { | ||
MLSQLStreamManager.removeStore(event.id.toString) | ||
StreamingproJobManager.getJobInfo.filter(f => f._2.jobType == StreamingproJobType.STREAM | ||
JobManager.getJobInfo.filter(f => f._2.jobType == MLSQLJobType.STREAM | ||
&& f._2.groupId == event.id.toString).headOption match { | ||
case Some(job) => | ||
StreamingproJobManager.removeJobManually(job._1) | ||
JobManager.removeJobManually(job._1) | ||
case None => | ||
} | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,10 @@ package streaming.dsl.mmlib.algs | |
|
||
import org.apache.spark.sql.expressions.UserDefinedFunction | ||
import org.apache.spark.sql.{DataFrame, SparkSession} | ||
import streaming.core.StreamingproJobManager | ||
import streaming.core.datasource.util.MLSQLJobCollect | ||
import streaming.dsl.mmlib.SQLAlg | ||
import streaming.dsl.mmlib.algs.param.{BaseParams, WowParams} | ||
import tech.mlsql.job.JobManager | ||
|
||
/** | ||
* 2019-01-11 WilliamZhu([email protected]) | ||
|
@@ -18,7 +18,7 @@ class SQLMLSQLJobExt(override val uid: String) extends SQLAlg with WowParams { | |
override def train(df: DataFrame, path: String, params: Map[String, String]): DataFrame = { | ||
val spark = df.sparkSession | ||
val groupId = new MLSQLJobCollect(spark, null).getGroupId(path) | ||
StreamingproJobManager.killJob(groupId) | ||
JobManager.killJob(spark, groupId) | ||
import df.sparkSession.implicits._ | ||
Seq.empty[(String, String)].toDF("param", "description") | ||
|
||
|
Oops, something went wrong.