Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jz-dmp-cmdexectool
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚本章
jz-dmp-cmdexectool
Commits
a9d4fcb9
Commit
a9d4fcb9
authored
Feb 26, 2021
by
DESKTOP-5KITOLR\Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
e36dc75c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
0 deletions
+63
-0
DatasouceTypeConstant.java
...mp/cmdexectool/common/constant/DatasouceTypeConstant.java
+27
-0
SyncParameters.java
...mdexectool/scheduler/common/task/sync/SyncParameters.java
+36
-0
No files found.
src/main/java/com/jz/dmp/cmdexectool/common/constant/DatasouceTypeConstant.java
0 → 100644
View file @
a9d4fcb9
package
com
.
jz
.
dmp
.
cmdexectool
.
common
.
constant
;
/**
* @ClassName: DatasouceTypeConstant
* @Description: TODO(通用常亮)
* @author Bellamy
* @date 2021年2月26日
*
*/
public
class
DatasouceTypeConstant
{
public
static
final
int
MySQL
=
1
;
public
static
final
int
SQLServer
=
2
;
public
static
final
int
PostgreSQL
=
3
;
public
static
final
int
Oracle
=
4
;
public
static
final
int
DM
=
5
;
public
static
final
int
DB2
=
6
;
public
static
final
int
Hive
=
7
;
public
static
final
int
Impala
=
8
;
public
static
final
int
Kudu
=
9
;
public
static
final
int
HDFS
=
10
;
public
static
final
int
FTP
=
11
;
public
static
final
int
Elasticsearch
=
12
;
}
src/main/java/com/jz/dmp/cmdexectool/scheduler/common/task/sync/SyncParameters.java
View file @
a9d4fcb9
package
com
.
jz
.
dmp
.
cmdexectool
.
scheduler
.
common
.
task
.
sync
;
package
com
.
jz
.
dmp
.
cmdexectool
.
scheduler
.
common
.
task
.
sync
;
import
com.alibaba.fastjson.JSONObject
;
import
com.jz.dmp.cmdexectool.common.constant.CommConstant
;
import
com.jz.dmp.cmdexectool.common.constant.DatasouceTypeConstant
;
import
com.jz.dmp.cmdexectool.common.utils.FreeMarkerUtils
;
import
com.jz.dmp.cmdexectool.controller.bean.DmpProjectConfigInfoDto
;
import
com.jz.dmp.cmdexectool.controller.bean.DmpProjectConfigInfoDto
;
import
com.jz.dmp.cmdexectool.entity.DmpSyncingDatasource
;
import
com.jz.dmp.cmdexectool.mapper.DmpSyncingDatasourceDao
;
import
com.jz.dmp.cmdexectool.mapper.DmpSyncingDatasourceDao
;
import
com.jz.dmp.cmdexectool.scheduler.common.process.ResourceInfo
;
import
com.jz.dmp.cmdexectool.scheduler.common.process.ResourceInfo
;
import
com.jz.dmp.cmdexectool.scheduler.common.task.AbstractParameters
;
import
com.jz.dmp.cmdexectool.scheduler.common.task.AbstractParameters
;
import
org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
;
import
org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @ClassName: SyncParameters
* @ClassName: SyncParameters
...
@@ -55,7 +62,36 @@ public class SyncParameters extends AbstractParameters {
...
@@ -55,7 +62,36 @@ public class SyncParameters extends AbstractParameters {
private
List
<
ResourceInfo
>
resourceList
;
private
List
<
ResourceInfo
>
resourceList
;
public
SyncParameters
(
String
script
,
DmpProjectConfigInfoDto
projectConfigInfoDto
,
DmpSyncingDatasourceDao
dmpSyncingDatasourceDao
,
FreeMarkerConfigurer
freeMarkerConfig
)
{
public
SyncParameters
(
String
script
,
DmpProjectConfigInfoDto
projectConfigInfoDto
,
DmpSyncingDatasourceDao
dmpSyncingDatasourceDao
,
FreeMarkerConfigurer
freeMarkerConfig
)
{
source
=
""
;
env
=
""
;
sink
=
""
;
transform
=
""
;
this
.
script
=
script
;
JSONObject
scriptObj
=
JSONObject
.
parseObject
(
script
);
Map
<
String
,
Object
>
scriptJson
=
(
Map
<
String
,
Object
>)
scriptObj
.
get
(
"params"
);
Map
<
String
,
Object
>
scripts
=
(
Map
<
String
,
Object
>)
scriptJson
.
get
(
"scripts"
);
Map
<
String
,
Object
>
source
=
(
Map
<
String
,
Object
>)
scripts
.
get
(
"reader"
);
//evn
Map
<
String
,
String
>
envModel
=
new
HashMap
<
String
,
String
>();
envModel
.
put
(
"sparkappname"
,
"Waterdrop"
);
env
=
FreeMarkerUtils
.
freemakerJson
(
CommConstant
.
WATERDROP_FTL_ENV
,
envModel
,
freeMarkerConfig
);
//Jdbc(MySQL、Oracle、SqlServer、PostgreSQL、Informix、DB2)
//source
Integer
sourceId
=
Integer
.
valueOf
((
String
)
source
.
get
(
"sourceDbId"
));
DmpSyncingDatasource
dmpSyncingDatasource
=
dmpSyncingDatasourceDao
.
queryById
(
sourceId
);
Integer
datasouceType
=
dmpSyncingDatasource
.
getDatasourceType
();
switch
(
datasouceType
)
{
case
DatasouceTypeConstant
.
MySQL
:
break
;
case
DatasouceTypeConstant
.
SQLServer
:
default
:
break
;
}
}
}
@Override
@Override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment