大数据全系列 教程
1869个小节阅读:467.9k
目录
408考研
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
7.7.4 cleanup方法实现
AnalyserLogDataMapper类的cleanup方法实现。
xxxxxxxxxx
//定义日志的对象
public static final Logger LOGGER = Logger.getLogger(AnalyserLogDataMapper.class);
//定义几个变量,分别表示进入的数据条数、过滤掉的条数、存入hbase表的数据条数
private int inputRecords,filterRecords,outputRecords;
//当Map任务执行完毕后调用一次该方法
@Override
protected void cleanup(Mapper<LongWritable, Text, NullWritable, Put>.Context context) throws IOException, InterruptedException {
super.cleanup(context);
LOGGER.info("输入数据条数:"+this.inputRecords+",输出的数据条数:"+this.outputRecords+
",过滤掉的数据条数:"+this.filterRecords);
}