wangxingwang il y a 6 ans
Parent
commit
ce872afc16

+ 6 - 2
src/main/java/com/yihu/quota/controller/CubeController.java

@ -153,6 +153,8 @@ public class CubeController  extends BaseController {
    @ApiOperation(value = "保存mapping 数据 ")
    @RequestMapping(value = "/saveElasticSearchMappingData", method = RequestMethod.GET)
    public Envelop saveElasticSearchMappingData(
            @ApiParam(name = "dataSource", value = "数据源 hbase / mysql", required = true, defaultValue = "hbase")
            @RequestParam(value = "dataSource", required = true) String dataSource,
            @ApiParam(name = "table", value = "表 Healtharchive / HealtharchiveSub", required = true)
            @RequestParam(value = "table", required = true) String table,
            @ApiParam(name = "rowkey", value = "行数据唯一键值", required = true)
@ -170,7 +172,7 @@ public class CubeController  extends BaseController {
        try {
            Gson gson = new Gson();
            Map<String, Object> source  = new HashMap<>();
            source.put("dataSource","hbase");
            source.put("dataSource", dataSource);
            source.put("table",table);
            source.put("rowkey",rowkey);
            source.put("profile_id",profileId);
@ -190,6 +192,8 @@ public class CubeController  extends BaseController {
    @ApiOperation(value = "删除mapping 数据 ")
    @RequestMapping(value = "/delElasticSearchMappingData", method = RequestMethod.GET)
    public Envelop delElasticSearchMappingData(
            @ApiParam(name = "dataSource", value = "数据源 hbase / mysql", required = true, defaultValue = "hbase")
            @RequestParam(value = "dataSource", required = true) String dataSource,
            @ApiParam(name = "table", value = "表 Healtharchive / HealtharchiveSub", required = true)
            @RequestParam(value = "table", required = true) String table,
            @ApiParam(name = "rowkey", value = "行数据唯一键值", required = true)
@ -200,7 +204,7 @@ public class CubeController  extends BaseController {
        try {
            Gson gson = new Gson();
            Map<String, Object> source  = new HashMap<>();
            source.put("dataSource","hbase");
            source.put("dataSource", dataSource);
            source.put("table",table);
            source.put("rowkey",rowkey);
            source.put("action","DeleteFamily");

+ 6 - 1
src/main/java/com/yihu/quota/service/cube/ElasticSearchDataProcessService.java

@ -66,7 +66,8 @@ public class ElasticSearchDataProcessService {
                if(dataSource.toLowerCase().equals(dataSource_hbase)){
                     hbaseDataProcess(dataMap);
                }else if(dataSource.toLowerCase().equals(dataSource_mysql)){
                     mysqlDataProcess(dataMap);
//                     mysqlDataProcess(dataMap);
                     hbaseDataProcess(dataMap);
                }
            }
        } catch (Exception e) {
@ -86,6 +87,10 @@ public class ElasticSearchDataProcessService {
        String rowKey = "";
        String profileId = "";
        String action = "";
        String database = "";
        if (dataMap.containsKey("database")) {
            database = dataMap.remove("database").toString();
        }
        if(dataMap.containsKey(table_k)){
            table = dataMap.get(table_k).toString();
        }