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
0567c947
Commit
0567c947
authored
Mar 10, 2021
by
mcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
0adfe38d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
SyncParameters.java
...mdexectool/scheduler/common/task/sync/SyncParameters.java
+8
-9
No files found.
src/main/java/com/jz/dmp/cmdexectool/scheduler/common/task/sync/SyncParameters.java
View file @
0567c947
...
@@ -123,7 +123,7 @@ public class SyncParameters extends AbstractParameters {
...
@@ -123,7 +123,7 @@ public class SyncParameters extends AbstractParameters {
||
sourceTypeId
==
DatasouceTypeConstant
.
Informix
||
sourceTypeId
==
DatasouceTypeConstant
.
Informix
||
sourceTypeId
==
DatasouceTypeConstant
.
DB2
))
{
||
sourceTypeId
==
DatasouceTypeConstant
.
DB2
))
{
//source
//source
getJdbcSource
(
dmpSyncingDatasource
,
registerTableName
,
freeMarkerConfig
);
getJdbcSource
(
dmpSyncingDatasource
,
registerTableName
,
freeMarkerConfig
,
publicKey
);
}
}
//产生 Jdbc(MySQL、Oracle、SqlServer、PostgreSQL、Informix、DB2) sink
//产生 Jdbc(MySQL、Oracle、SqlServer、PostgreSQL、Informix、DB2) sink
if
((
targetTypeId
==
DatasouceTypeConstant
.
MySQL
if
((
targetTypeId
==
DatasouceTypeConstant
.
MySQL
...
@@ -132,7 +132,7 @@ public class SyncParameters extends AbstractParameters {
...
@@ -132,7 +132,7 @@ public class SyncParameters extends AbstractParameters {
||
targetTypeId
==
DatasouceTypeConstant
.
PostgreSQL
||
targetTypeId
==
DatasouceTypeConstant
.
PostgreSQL
||
targetTypeId
==
DatasouceTypeConstant
.
Informix
||
targetTypeId
==
DatasouceTypeConstant
.
Informix
||
targetTypeId
==
DatasouceTypeConstant
.
DB2
))
{
||
targetTypeId
==
DatasouceTypeConstant
.
DB2
))
{
getJdbcSink
(
targetDatasource
,
targetObj
,
freeMarkerConfig
,
publicKey
);
getJdbcSink
(
targetDatasource
,
targetObj
,
freeMarkerConfig
,
publicKey
);
}
}
//transform
//transform
if
(
mappingObj
.
size
()
>
0
&&
null
!=
mappingObj
)
{
if
(
mappingObj
.
size
()
>
0
&&
null
!=
mappingObj
)
{
...
@@ -150,8 +150,6 @@ public class SyncParameters extends AbstractParameters {
...
@@ -150,8 +150,6 @@ public class SyncParameters extends AbstractParameters {
.
append
(
" $t "
);
.
append
(
" $t "
);
sqlModel
.
put
(
"sql"
,
sql
);
sqlModel
.
put
(
"sql"
,
sql
);
sqlModel
.
put
(
"source_table_name"
,
source_table_name
);
sqlModel
.
put
(
"source_table_name"
,
source_table_name
);
//String table_name = registerTableName[0] + "_view";
//sqlModel.put("table_name", table_name);
transform
=
transform
+
FreeMarkerUtils
.
freemakerJson
(
CommConstant
.
WATERDROP_FTL_TRANSFORM_SQL
,
sqlModel
,
freeMarkerConfig
);
transform
=
transform
+
FreeMarkerUtils
.
freemakerJson
(
CommConstant
.
WATERDROP_FTL_TRANSFORM_SQL
,
sqlModel
,
freeMarkerConfig
);
Map
targetModel
=
new
HashMap
();
Map
targetModel
=
new
HashMap
();
...
@@ -161,7 +159,7 @@ public class SyncParameters extends AbstractParameters {
...
@@ -161,7 +159,7 @@ public class SyncParameters extends AbstractParameters {
.
append
(
" from "
)
.
append
(
" from "
)
.
append
(
" $t "
);
.
append
(
" $t "
);
targetModel
.
put
(
"sql"
,
targetSql
);
targetModel
.
put
(
"sql"
,
targetSql
);
targetModel
.
put
(
"source_table_name"
,
targetTabl
e
);
targetModel
.
put
(
"source_table_name"
,
source_table_nam
e
);
transform
=
transform
+
FreeMarkerUtils
.
freemakerJson
(
CommConstant
.
WATERDROP_FTL_TRANSFORM_SQL
,
targetModel
,
freeMarkerConfig
);
transform
=
transform
+
FreeMarkerUtils
.
freemakerJson
(
CommConstant
.
WATERDROP_FTL_TRANSFORM_SQL
,
targetModel
,
freeMarkerConfig
);
}
}
...
@@ -216,7 +214,7 @@ public class SyncParameters extends AbstractParameters {
...
@@ -216,7 +214,7 @@ public class SyncParameters extends AbstractParameters {
waterdropScript
=
FreeMarkerUtils
.
freemakerJson
(
CommConstant
.
WATERDROP_FTL
,
waterdropModel
,
freeMarkerConfig
);
waterdropScript
=
FreeMarkerUtils
.
freemakerJson
(
CommConstant
.
WATERDROP_FTL
,
waterdropModel
,
freeMarkerConfig
);
}
}
public
void
getJdbcSource
(
DmpSyncingDatasource
dmpSyncingDatasource
,
String
[]
registerTableName
,
FreeMarkerConfigurer
freeMarkerConfig
)
{
public
void
getJdbcSource
(
DmpSyncingDatasource
dmpSyncingDatasource
,
String
[]
registerTableName
,
FreeMarkerConfigurer
freeMarkerConfig
,
String
publicKey
)
{
for
(
String
tableName
:
registerTableName
)
{
for
(
String
tableName
:
registerTableName
)
{
Map
jdbcModel
=
new
HashMap
();
Map
jdbcModel
=
new
HashMap
();
jdbcModel
.
put
(
"driver"
,
dmpSyncingDatasource
.
getDriverClassName
());
jdbcModel
.
put
(
"driver"
,
dmpSyncingDatasource
.
getDriverClassName
());
...
@@ -224,7 +222,7 @@ public class SyncParameters extends AbstractParameters {
...
@@ -224,7 +222,7 @@ public class SyncParameters extends AbstractParameters {
jdbcModel
.
put
(
"table"
,
tableName
);
jdbcModel
.
put
(
"table"
,
tableName
);
jdbcModel
.
put
(
"result_table_name"
,
tableName
);
jdbcModel
.
put
(
"result_table_name"
,
tableName
);
jdbcModel
.
put
(
"user"
,
dmpSyncingDatasource
.
getUserName
());
jdbcModel
.
put
(
"user"
,
dmpSyncingDatasource
.
getUserName
());
jdbcModel
.
put
(
"password"
,
dmpSyncingDatasource
.
getPassword
(
));
jdbcModel
.
put
(
"password"
,
EncryptionUtils
.
decode
(
dmpSyncingDatasource
.
getPassword
(),
publicKey
));
jdbcModel
.
put
(
"partitionColumn"
,
""
);
jdbcModel
.
put
(
"partitionColumn"
,
""
);
jdbcModel
.
put
(
"numPartitions"
,
""
);
jdbcModel
.
put
(
"numPartitions"
,
""
);
jdbcModel
.
put
(
"lowerBound"
,
""
);
jdbcModel
.
put
(
"lowerBound"
,
""
);
...
@@ -233,7 +231,7 @@ public class SyncParameters extends AbstractParameters {
...
@@ -233,7 +231,7 @@ public class SyncParameters extends AbstractParameters {
}
}
}
}
public
void
getJdbcSink
(
DmpSyncingDatasource
targetDatasource
,
Map
<
String
,
Object
>
targetObj
,
FreeMarkerConfigurer
freeMarkerConfig
,
String
publicKey
)
{
public
void
getJdbcSink
(
DmpSyncingDatasource
targetDatasource
,
Map
<
String
,
Object
>
targetObj
,
FreeMarkerConfigurer
freeMarkerConfig
,
String
publicKey
)
{
String
postImportStatement
=
String
.
valueOf
(
targetObj
.
get
(
"postImportStatement"
));
//导入后语句
String
postImportStatement
=
String
.
valueOf
(
targetObj
.
get
(
"postImportStatement"
));
//导入后语句
String
preImportStatement
=
String
.
valueOf
(
targetObj
.
get
(
"preImportStatement"
));
//导入前语句
String
preImportStatement
=
String
.
valueOf
(
targetObj
.
get
(
"preImportStatement"
));
//导入前语句
preStatements
=
new
ArrayList
<
String
>();
preStatements
=
new
ArrayList
<
String
>();
...
@@ -265,7 +263,8 @@ public class SyncParameters extends AbstractParameters {
...
@@ -265,7 +263,8 @@ public class SyncParameters extends AbstractParameters {
}
}
jdbcSinkModel
.
put
(
"dbtable"
,
targetObj
.
get
(
"targetTable"
));
//目标表
jdbcSinkModel
.
put
(
"dbtable"
,
targetObj
.
get
(
"targetTable"
));
//目标表
jdbcSinkModel
.
put
(
"user"
,
targetDatasource
.
getUserName
());
jdbcSinkModel
.
put
(
"user"
,
targetDatasource
.
getUserName
());
jdbcSinkModel
.
put
(
"password"
,
targetDatasource
.
getPassword
());
jdbcSinkModel
.
put
(
"password"
,
password
);
jdbcSinkModel
.
put
(
"source_table_name"
,
targetObj
.
get
(
"targetTable"
));
sink
=
FreeMarkerUtils
.
freemakerJson
(
CommConstant
.
WATERDROP_FTL_SINK_JDBC
,
jdbcSinkModel
,
freeMarkerConfig
);
sink
=
FreeMarkerUtils
.
freemakerJson
(
CommConstant
.
WATERDROP_FTL_SINK_JDBC
,
jdbcSinkModel
,
freeMarkerConfig
);
}
}
...
...
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