jkzlzhoujie 6 anni fa
parent
commit
102bfc49ec

+ 3 - 6
src/main/java/com/yihu/ehr/listener/HbaseLogListener.java

@ -21,8 +21,7 @@ public class HbaseLogListener implements EventListener {
    Logger log = LoggerFactory.getLogger(HbaseLogListener.class);
    private static String action_put = "Put";//添加和修改单个字段值
    private static String action_del = "DeleteColumn";//删除单个字段值
    private static String action_delAll = "DeleteFamily";//删除整行
    private static String action_delFamily = "DeleteFamily";//删除整行
    @Override
    public void processEvents(List<SepEvent> sepEvents) {
@ -43,8 +42,8 @@ public class HbaseLogListener implements EventListener {
                    action = action_put;
                }else if(cell.toString().contains(action_del)){
                    action = action_del;
                }else if(cell.toString().contains(action_delAll)){
                    action = action_delAll;
                }else if(cell.toString().contains(action_delFamily)){
                    action = action_delFamily;
                }
                dataMap.put("action", action);
                dataMap.put(cloumn, value);
@ -53,8 +52,6 @@ public class HbaseLogListener implements EventListener {
            Gson gson = new Gson();
            String jsonData = gson.toJson(dataMap);
            producer.sendMessage(jsonData);
            //测试 删除格式 字段为空 的数据
        }
        log.info("sep Events end");
    }