| 
					
				 | 
			
			
				@ -1,6 +1,6 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				package com.yihu.wlyy.analysis.etl; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.analysis.model.DataModel; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.json.JSONObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.slf4j.Logger; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.slf4j.LoggerFactory; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -10,7 +10,7 @@ import java.util.Map; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * 日志信息分析提取 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * <p> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * Created by lyr-pc on 2017/2/17. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				public class LogDataTransform { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -37,7 +37,7 @@ public class LogDataTransform { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public static LogDataTransform getLogTransform() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(instance == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (instance == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            synchronized (obj) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (instance == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    instance = new LogDataTransform(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -52,12 +52,12 @@ public class LogDataTransform { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param log 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void transform(DataModel log) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void transform(JSONObject log) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ILogTransform transform = transforms.get(log.getLogType()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ILogTransform transform = transforms.get(log.getString("logType")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (transform == null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                logger.error("logType:" + log.getLogType() + " transform can not find"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                logger.error("logType:" + log.getString("logType") + " transform can not find"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                transform.transform(log); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -104,7 +104,7 @@ public class LogDataTransform { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("log transform init success"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.error("log transform init failed"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.error("log transform init failed:" + e.getMessage()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |