@ -614,103 +614,103 @@
/ * *
/ * *
* mysql query type
* mysql query type
* /
* /
srcQueryType : '1' ,
srcQueryType : '1' ,
/ * *
/ * *
* source data source
* source data source
* /
* /
srcDatasource : '' ,
srcDatasource : '' ,
/ * *
/ * *
* target data source
* target data source
* /
* /
targetDatasource : '' ,
targetDatasource : '' ,
/ * *
/ * *
* concurrency
* concurrency
* /
* /
concurrency : 1 ,
concurrency : 1 ,
/ * *
/ * *
* default job type
* default job type
* /
* /
jobType : 'TEMPLATE' ,
jobType : 'TEMPLATE' ,
/ * *
/ * *
* direct model type
* direct model type
* /
* /
modelType : 'import' ,
modelType : 'import' ,
modelTypeList : [ { code : 'import' } , { code : 'export' } ] ,
modelTypeList : [ { code : 'import' } , { code : 'export' } ] ,
sourceTypeList : [
sourceTypeList : [
{
{
code : "MYSQL"
code : 'MYSQL'
} ,
}
] ,
] ,
targetTypeList : [
targetTypeList : [
{
{
code : "HIVE"
code : 'HIVE'
} ,
} ,
{
{
code : "HDFS"
code : 'HDFS'
}
}
] ,
] ,
sourceType : "MYSQL" ,
sourceType : 'MYSQL' ,
targetType : "HDFS" ,
targetType : 'HDFS' ,
sourceMysqlParams : {
sourceMysqlParams : {
srcType : "MYSQL" ,
srcType : 'MYSQL' ,
srcDatasource : "" ,
srcDatasource : '' ,
srcTable : "" ,
srcTable : '' ,
srcQueryType : "1" ,
srcQueryType : '1' ,
srcQuerySql : '' ,
srcQuerySql : '' ,
srcColumnType : "0" ,
srcColumnType : '0' ,
srcColumns : "" ,
srcColumns : '' ,
srcConditionList : [ ] ,
srcConditionList : [ ] ,
mapColumnHive : [ ] ,
mapColumnHive : [ ] ,
mapColumnJava : [ ]
mapColumnJava : [ ]
} ,
} ,
sourceHdfsParams : {
sourceHdfsParams : {
exportDir : ""
exportDir : ''
} ,
} ,
sourceHiveParams : {
sourceHiveParams : {
hiveDatabase : "" ,
hiveDatabase : '' ,
hiveTable : "" ,
hiveTable : '' ,
hivePartitionKey : "" ,
hivePartitionKey : '' ,
hivePartitionValue : ""
hivePartitionValue : ''
} ,
} ,
targetHdfsParams : {
targetHdfsParams : {
targetPath : "" ,
targetPath : '' ,
deleteTargetDir : true ,
deleteTargetDir : true ,
fileType : "--as-avrodatafile" ,
fileType : '--as-avrodatafile' ,
compressionCodec : "snappy" ,
compressionCodec : 'snappy' ,
fieldsTerminated : "" ,
fieldsTerminated : '' ,
linesTerminated : "" ,
linesTerminated : ''
} ,
} ,
targetMysqlParams : {
targetMysqlParams : {
targetType : "MYSQL" ,
targetType : 'MYSQL' ,
targetDatasource : "" ,
targetDatasource : '' ,
targetTable : "" ,
targetTable : '' ,
targetColumns : "" ,
targetColumns : '' ,
fieldsTerminated : "" ,
fieldsTerminated : '' ,
linesTerminated : "" ,
linesTerminated : '' ,
preQuery : "" ,
preQuery : '' ,
isUpdate : false ,
isUpdate : false ,
targetUpdateKey : "" ,
targetUpdateKey : '' ,
targetUpdateMode : "allowinsert"
targetUpdateMode : 'allowinsert'
} ,
} ,
targetHiveParams : {
targetHiveParams : {
hiveDatabase : "" ,
hiveDatabase : '' ,
hiveTable : "" ,
hiveTable : '' ,
createHiveTable : false ,
createHiveTable : false ,
dropDelimiter : false ,
dropDelimiter : false ,
hiveOverWrite : true ,
hiveOverWrite : true ,
replaceDelimiter : "" ,
replaceDelimiter : '' ,
hivePartitionKey : "" ,
hivePartitionKey : '' ,
hivePartitionValue : ""
hivePartitionValue : ''
} ,
} ,
item : '' ,
item : '' ,
scriptBoxDialog : false
scriptBoxDialog : false
@ -721,108 +721,108 @@
backfillItem : Object
backfillItem : Object
} ,
} ,
methods : {
methods : {
setEditorVal ( ) {
setEditorVal ( ) {
this . item = editor . getValue ( )
this . item = editor . getValue ( )
this . scriptBoxDialog = true
this . scriptBoxDialog = true
} ,
} ,
getSriptBoxValue ( val ) {
getSriptBoxValue ( val ) {
editor . setValue ( val )
editor . setValue ( val )
} ,
} ,
_handleQueryType ( o ) {
_handleQueryType ( o ) {
this . sourceMysqlParams . srcQueryType = this . srcQueryType
this . sourceMysqlParams . srcQueryType = this . srcQueryType
this . _getTargetTypeList ( this . sourceType )
this . _getTargetTypeList ( this . sourceType )
this . targetType = this . targetTypeList [ 0 ] . code
this . targetType = this . targetTypeList [ 0 ] . code
} ,
} ,
_handleModelTypeChange ( a ) {
_handleModelTypeChange ( a ) {
this . _getSourceTypeList ( a )
this . _getSourceTypeList ( a )
this . sourceType = this . sourceTypeList [ 0 ] . code
this . sourceType = this . sourceTypeList [ 0 ] . code
this . _handleSourceTypeChange ( { label : this . sourceType , value : this . sourceType } )
this . _handleSourceTypeChange ( { label : this . sourceType , value : this . sourceType } )
} ,
} ,
_handleSourceTypeChange ( a ) {
_handleSourceTypeChange ( a ) {
this . _getTargetTypeList ( a . label )
this . _getTargetTypeList ( a . label )
this . targetType = this . targetTypeList [ 0 ] . code
this . targetType = this . targetTypeList [ 0 ] . code
} ,
} ,
_getSourceTypeList ( data ) {
_getSourceTypeList ( data ) {
switch ( data ) {
switch ( data ) {
case 'import' :
case 'import' :
this . sourceTypeList = [
this . sourceTypeList = [
{
{
code : "MYSQL"
code : 'MYSQL'
} ,
}
]
]
break ;
break
case 'export' :
case 'export' :
this . sourceTypeList = [
this . sourceTypeList = [
{
{
code : "HDFS"
code : 'HDFS'
} ,
} ,
{
{
code : "HIVE"
code : 'HIVE'
}
}
]
]
break ;
break
default :
default :
this . sourceTypeList = [
this . sourceTypeList = [
{
{
code : "MYSQL"
code : 'MYSQL'
} ,
} ,
{
{
code : "HIVE"
code : 'HIVE'
} ,
} ,
{
{
code : "HDFS"
code : 'HDFS'
}
}
]
]
break ;
break
}
}
} ,
} ,
_getTargetTypeList ( data ) {
_getTargetTypeList ( data ) {
switch ( data ) {
switch ( data ) {
case 'MYSQL' :
case 'MYSQL' :
if ( this . srcQueryType === "1" ) {
if ( this . srcQueryType === '1' ) {
this . targetTypeList = [
this . targetTypeList = [
{
{
code : "HDFS"
code : 'HDFS'
} ]
} ]
} else {
} else {
this . targetTypeList = [
this . targetTypeList = [
{
{
code : "HIVE"
code : 'HIVE'
} ,
} ,
{
{
code : "HDFS"
code : 'HDFS'
}
}
]
]
}
}
break ;
break
case 'HDFS' :
case 'HDFS' :
this . targetTypeList = [
this . targetTypeList = [
{
{
code : "MYSQL"
code : 'MYSQL'
}
}
]
]
break ;
break
case 'HIVE' :
case 'HIVE' :
this . targetTypeList = [
this . targetTypeList = [
{
{
code : "MYSQL"
code : 'MYSQL'
}
}
]
]
break ;
break
default :
default :
this . targetTypeList = [
this . targetTypeList = [
{
{
code : "HIVE"
code : 'HIVE'
} ,
} ,
{
{
code : "HDFS"
code : 'HDFS'
}
}
]
]
break ;
break
}
}
} ,
} ,
@ -853,26 +853,26 @@
/ * *
/ * *
* stringify the source params
* stringify the source params
* /
* /
_handleSourceParams ( ) {
_handleSourceParams ( ) {
var params = null
var params = null
switch ( this . sourceType ) {
switch ( this . sourceType ) {
case "MYSQL" :
case 'MYSQL' :
this . sourceMysqlParams . srcQuerySql = this . sourceMysqlParams . srcQueryType === "1" && editor ?
this . sourceMysqlParams . srcQuerySql = this . sourceMysqlParams . srcQueryType === '1' && editor
editor . getValue ( ) : this . sourceMysqlParams . srcQuerySql
? editor . getValue ( ) : this . sourceMysqlParams . srcQuerySql
params = JSON . stringify ( this . sourceMysqlParams )
params = JSON . stringify ( this . sourceMysqlParams )
break ;
break
case "ORACLE" :
case 'ORACLE' :
params = JSON . stringify ( this . sourceOracleParams )
params = JSON . stringify ( this . sourceOracleParams )
break ;
break
case "HDFS" :
case 'HDFS' :
params = JSON . stringify ( this . sourceHdfsParams )
params = JSON . stringify ( this . sourceHdfsParams )
break ;
break
case "HIVE" :
case 'HIVE' :
params = JSON . stringify ( this . sourceHiveParams )
params = JSON . stringify ( this . sourceHiveParams )
break ;
break
default :
default :
params = "" ;
params = ''
break ;
break
}
}
return params
return params
} ,
} ,
@ -880,21 +880,21 @@
/ * *
/ * *
* stringify the target params
* stringify the target params
* /
* /
_handleTargetParams ( ) {
_handleTargetParams ( ) {
var params = null
var params = null
switch ( this . targetType ) {
switch ( this . targetType ) {
case "HIVE" :
case 'HIVE' :
params = JSON . stringify ( this . targetHiveParams )
params = JSON . stringify ( this . targetHiveParams )
break ;
break
case "HDFS" :
case 'HDFS' :
params = JSON . stringify ( this . targetHdfsParams )
params = JSON . stringify ( this . targetHdfsParams )
break ;
break
case "MYSQL" :
case 'MYSQL' :
params = JSON . stringify ( this . targetMysqlParams )
params = JSON . stringify ( this . targetMysqlParams )
break ;
break
default :
default :
params = "" ;
params = ''
break ;
break
}
}
return params
return params
@ -903,47 +903,46 @@
/ * *
/ * *
* get source params by source type
* get source params by source type
* /
* /
_getSourceParams ( data ) {
_getSourceParams ( data ) {
switch ( this . sourceType ) {
switch ( this . sourceType ) {
case "MYSQL" :
case 'MYSQL' :
this . sourceMysqlParams = JSON . parse ( data )
this . sourceMysqlParams = JSON . parse ( data )
this . srcDatasource = this . sourceMysqlParams . srcDatasource
this . srcDatasource = this . sourceMysqlParams . srcDatasource
break ;
break
case "ORACLE" :
case 'ORACLE' :
this . sourceOracleParams = JSON . parse ( data )
this . sourceOracleParams = JSON . parse ( data )
break ;
break
case "HDFS" :
case 'HDFS' :
this . sourceHdfsParams = JSON . parse ( data )
this . sourceHdfsParams = JSON . parse ( data )
break ;
break
case "HIVE" :
case 'HIVE' :
this . sourceHiveParams = JSON . parse ( data )
this . sourceHiveParams = JSON . parse ( data )
break ;
break
default :
default :
break ;
break
}
}
} ,
} ,
/ * *
/ * *
* get target params by target type
* get target params by target type
* /
* /
_getTargetParams ( data ) {
_getTargetParams ( data ) {
switch ( this . targetType ) {
switch ( this . targetType ) {
case "HIVE" :
case 'HIVE' :
this . targetHiveParams = JSON . parse ( data )
this . targetHiveParams = JSON . parse ( data )
break ;
break
case "HDFS" :
case 'HDFS' :
this . targetHdfsParams = JSON . parse ( data )
this . targetHdfsParams = JSON . parse ( data )
break ;
break
case "MYSQL" :
case 'MYSQL' :
this . targetMysqlParams = JSON . parse ( data )
this . targetMysqlParams = JSON . parse ( data )
this . targetDatasource = this . targetMysqlParams . targetDatasource
this . targetDatasource = this . targetMysqlParams . targetDatasource
break ;
break
default :
default :
break ;
break
}
}
} ,
} ,
/ * *
/ * *
* verification
* verification
* /
* /
@ -957,7 +956,7 @@
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Custom Shell(required)' ) } ` )
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Custom Shell(required)' ) } ` )
return false
return false
}
}
sqoopParams [ 'customShell' ] = shellEditor . getValue ( )
sqoopParams . customShell = shellEditor . getValue ( )
} else {
} else {
if ( ! this . jobName ) {
if ( ! this . jobName ) {
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Job Name(required)' ) } ` )
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Job Name(required)' ) } ` )
@ -965,7 +964,7 @@
}
}
switch ( this . sourceType ) {
switch ( this . sourceType ) {
case "MYSQL" :
case 'MYSQL' :
if ( ! this . $refs . refSourceDs . _verifDatasource ( ) ) {
if ( ! this . $refs . refSourceDs . _verifDatasource ( ) ) {
return false
return false
}
}
@ -974,84 +973,84 @@
this . $message . warning ( ` ${ i18n . $t ( 'Please enter a SQL Statement(required)' ) } ` )
this . $message . warning ( ` ${ i18n . $t ( 'Please enter a SQL Statement(required)' ) } ` )
return false
return false
}
}
this . sourceMysqlParams . srcTable = ""
this . sourceMysqlParams . srcTable = ''
this . sourceMysqlParams . srcColumnType = "0"
this . sourceMysqlParams . srcColumnType = '0'
this . sourceMysqlParams . srcColumns = ""
this . sourceMysqlParams . srcColumns = ''
} else {
} else {
if ( this . sourceMysqlParams . srcTable === "" ) {
if ( this . sourceMysqlParams . srcTable === '' ) {
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Mysql Table(required)' ) } ` )
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Mysql Table(required)' ) } ` )
return false
return false
}
}
this . sourceMysqlParams . srcQuerySql = ""
this . sourceMysqlParams . srcQuerySql = ''
if ( this . sourceMysqlParams . srcColumnType === "1" && this . sourceMysqlParams . srcColumns === "" ) {
if ( this . sourceMysqlParams . srcColumnType === '1' && this . sourceMysqlParams . srcColumns === '' ) {
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Columns (Comma separated)' ) } ` )
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Columns (Comma separated)' ) } ` )
return false
return false
}
}
if ( this . sourceMysqlParams . srcColumnType === "0" ) {
if ( this . sourceMysqlParams . srcColumnType === '0' ) {
this . sourceMysqlParams . srcColumns = ""
this . sourceMysqlParams . srcColumns = ''
}
}
}
}
break ;
break
case "HDFS" :
case 'HDFS' :
if ( this . sourceHdfsParams . exportDir === "" ) {
if ( this . sourceHdfsParams . exportDir === '' ) {
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Export Dir(required)' ) } ` )
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Export Dir(required)' ) } ` )
return false
return false
}
}
break ;
break
case "HIVE" :
case 'HIVE' :
if ( this . sourceHiveParams . hiveDatabase === "" ) {
if ( this . sourceHiveParams . hiveDatabase === '' ) {
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Hive Database(required)' ) } ` )
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Hive Database(required)' ) } ` )
return false
return false
}
}
if ( this . sourceHiveParams . hiveTable === "" ) {
if ( this . sourceHiveParams . hiveTable === '' ) {
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Hive Table(required)' ) } ` )
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Hive Table(required)' ) } ` )
return false
return false
}
}
break ;
break
default :
default :
break ;
break
}
}
switch ( this . targetType ) {
switch ( this . targetType ) {
case "HIVE" :
case 'HIVE' :
if ( this . targetHiveParams . hiveDatabase === "" ) {
if ( this . targetHiveParams . hiveDatabase === '' ) {
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Hive Database(required)' ) } ` )
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Hive Database(required)' ) } ` )
return false
return false
}
}
if ( this . targetHiveParams . hiveTable === "" ) {
if ( this . targetHiveParams . hiveTable === '' ) {
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Hive Table(required)' ) } ` )
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Hive Table(required)' ) } ` )
return false
return false
}
}
break ;
break
case "HDFS" :
case 'HDFS' :
if ( this . targetHdfsParams . targetPath === "" ) {
if ( this . targetHdfsParams . targetPath === '' ) {
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Target Dir(required)' ) } ` )
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Target Dir(required)' ) } ` )
return false
return false
}
}
break ;
break
case "MYSQL" :
case 'MYSQL' :
if ( ! this . $refs . refTargetDs . _verifDatasource ( ) ) {
if ( ! this . $refs . refTargetDs . _verifDatasource ( ) ) {
return false
return false
}
}
if ( this . targetMysqlParams . targetTable === "" ) {
if ( this . targetMysqlParams . targetTable === '' ) {
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Mysql Table(required)' ) } ` )
this . $message . warning ( ` ${ i18n . $t ( 'Please enter Mysql Table(required)' ) } ` )
return false
return false
}
}
break ;
break
default :
default :
break ;
break
}
}
sqoopParams [ 'jobName' ] = this . jobName
sqoopParams . jobName = this . jobName
sqoopParams [ 'hadoopCustomParams' ] = this . hadoopCustomParams
sqoopParams . hadoopCustomParams = this . hadoopCustomParams
sqoopParams [ 'sqoopAdvancedParams' ] = this . sqoopAdvancedParams
sqoopParams . sqoopAdvancedParams = this . sqoopAdvancedParams
sqoopParams [ 'concurrency' ] = this . concurrency
sqoopParams . concurrency = this . concurrency
sqoopParams [ 'modelType' ] = this . modelType
sqoopParams . modelType = this . modelType
sqoopParams [ 'sourceType' ] = this . sourceType
sqoopParams . sourceType = this . sourceType
sqoopParams [ 'targetType' ] = this . targetType
sqoopParams . targetType = this . targetType
sqoopParams [ 'targetParams' ] = this . _handleTargetParams ( )
sqoopParams . targetParams = this . _handleTargetParams ( )
sqoopParams [ 'sourceParams' ] = this . _handleSourceParams ( )
sqoopParams . sourceParams = this . _handleSourceParams ( )
}
}
/ / s t o r a g e
/ / s t o r a g e
@ -1142,14 +1141,14 @@
_cacheParams ( ) {
_cacheParams ( ) {
this . $emit ( 'on-cache-params' , {
this . $emit ( 'on-cache-params' , {
concurrency : this . concurrency ,
concurrency : this . concurrency ,
modelType : this . modelType ,
modelType : this . modelType ,
sourceType : this . sourceType ,
sourceType : this . sourceType ,
targetType : this . targetType ,
targetType : this . targetType ,
sourceParams : this . _handleSourceParams ( ) ,
sourceParams : this . _handleSourceParams ( ) ,
targetParams : this . _handleTargetParams ( ) ,
targetParams : this . _handleTargetParams ( ) ,
localParams : this . localParams
localParams : this . localParams
} ) ;
} )
} ,
} ,
_destroyEditor ( ) {
_destroyEditor ( ) {
@ -1171,7 +1170,7 @@
watch : {
watch : {
/ / L i s t e n i n g t o s q l T y p e
/ / L i s t e n i n g t o s q l T y p e
sqlType ( val ) {
sqlType ( val ) {
if ( val == 0 ) {
if ( val == 0 ) {
this . showType = [ ]
this . showType = [ ]
}
}
if ( val != 0 ) {
if ( val != 0 ) {
@ -1186,7 +1185,7 @@
this . connParams = ''
this . connParams = ''
}
}
} ,
} ,
/ / W a t c h t h e c a c h e P a r a m s
/ / W a t c h t h e c a c h e P a r a m s
cacheParams ( val ) {
cacheParams ( val ) {
this . _cacheParams ( )
this . _cacheParams ( )
}
}
@ -1248,21 +1247,21 @@
computed : {
computed : {
cacheParams ( ) {
cacheParams ( ) {
return {
return {
concurrency : this . concurrency ,
concurrency : this . concurrency ,
modelType : this . modelType ,
modelType : this . modelType ,
sourceType : this . sourceType ,
sourceType : this . sourceType ,
targetType : this . targetType ,
targetType : this . targetType ,
localParams : this . localParams ,
localParams : this . localParams ,
sourceMysqlParams : this . sourceMysqlParams ,
sourceMysqlParams : this . sourceMysqlParams ,
sourceHdfsParams : this . sourceHdfsParams ,
sourceHdfsParams : this . sourceHdfsParams ,
sourceHiveParams : this . sourceHiveParams ,
sourceHiveParams : this . sourceHiveParams ,
targetHdfsParams : this . targetHdfsParams ,
targetHdfsParams : this . targetHdfsParams ,
targetMysqlParams : this . targetMysqlParams ,
targetMysqlParams : this . targetMysqlParams ,
targetHiveParams : this . targetHiveParams
targetHiveParams : this . targetHiveParams
}
}
}
}
} ,
} ,
components : { mListBox , mDatasource , mLocalParams , mScriptBox }
components : { mListBox , mDatasource , mLocalParams , mScriptBox }
}
}
< / script >
< / script >
< style lang = "scss" rel = "stylesheet/scss" >
< style lang = "scss" rel = "stylesheet/scss" >
@ -1276,4 +1275,3 @@
top : - 16 px ;
top : - 16 px ;
}
}
< / style >
< / style >