hadoop读取文件java.io.EOFException解决

2019-3-13 流沙 大数据

调试了一上午, 蛋疼, 写代码不认真 ,记录下


	public void readFields(DataInput in) throws IOException {
		// TODO Auto-generated method stub
		//this.page = in.readUTF();
		//this.count = in.readInt();
		this.page= in.readUTF();
		this.count = in.readInt();
	}
	

	public void write(DataOutput out) throws IOException {
		// TODO Auto-generated method stub
		//out.writeUTF(this.page);
		//out.write(this.count);
		
		out.writeUTF(this.page);
		out.writeInt(this.count);
	}


数据序列化, 一定要格式相同,  检查了半天, 

发表评论:

Powered by 流沙团