You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2020/03/11 09:50:21 UTC

[GitHub] [incubator-dolphinscheduler] simon824 commented on issue #2102: [Feature]add custom configuration Feature for datax

simon824 commented on issue #2102: [Feature]add custom configuration Feature for datax
URL: https://github.com/apache/incubator-dolphinscheduler/issues/2102#issuecomment-597538608
 
 
   I will describe my ideas for implementing this feature.
   As shown below, I want to add a tab page , one page is the current content , and the other page is a text box for custom json configuration. At the same time, a check of the json format is required. 
   
   
   我来详细说明下我的想法,以方便和前端的同学协作完成功能的开发。
   
   ![image](https://user-images.githubusercontent.com/18065113/76399668-f8a6c500-63b9-11ea-9e73-2f95048500e9.png)
   
   如图,我想在红框的位置增加一个 tab 页,一页是当前的内容不变,另一页是文本框,用于用户自定义写json配置,同时需要对json格式做一个校验。两种方式二选一。
   
   ## 入参定义
   
   - 请求参数processDefinitionJson的tasks列表里的params字段的内容增加customConfig,值为0和1(数值类型),当customConfig等于0,为非自定义配置,其他参数没有变化,如下:
   
   ```
   {"tasks":[{"params":
       {"customConfig":0,
        "targetTable":"test",
        "postStatements":[
            "delete from test"
        ],
        "jobSpeedByte":0,
        "jobSpeedRecord":1000,
        "dtType":"MYSQL",
        "datasource":1,
        "dsType":"MYSQL",
        "datatarget":2,
        "sql":"select 1 as test from dual",
        "preStatements":[
            "delete from test"
        ]
      }
   },{...}]}
   
   ```
   
   - 当customConfig为1,为自定义json配置,只需传json字段(字符串类型)其他参数省略,如下:
   
   ```
   {"tasks":[{"params":{
       {
       "customConfig":1,
       "json":"{"job":{"setting":{"speed":{"byte":1048576},"errorLimit":{"record":0,"percentage":0.02}},"content":[{"reader":{"name":"rdbmsreader","parameter":{"username":"xxx","password":"xxx","column":["id","name"],"splitPk":"pk","connection":[{"querySql":["SELECT * from dual"],"jdbcUrl":["jdbc:dm://ip:port/database"]}],"fetchSize":1024,"where":"1 = 1"}},"writer":{"name":"streamwriter","parameter":{"print":true}}}]}}"
   }
   }}]
   },{...}}
   ```
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services