KEYIN怎么知道的是偏移量offset?
来源:4-5 词频统计之自定义Mapper实现
邪小见
2023-12-28
还是Long,怎么知道的这么具体?
写回答
1回答
-
邪小见
提问者
2023-12-30
Mapper.java
InputFormat.javaMaps are the individual tasks which transform input records into a intermediate records.
Validate the input-specification of the job.
Split-up the input file(s) into logical InputSplits, each of which is then assigned to an individual Mapper.
Provide the RecordReader implementation to be used to glean input records from the logical InputSplit for processing by the Mapper.
然后从getSplits的实现来看,因为是分布式的块存储,要读取多个块的内容,计算方法是通过size,offset来计算的
所以KEYIN一般是便宜量,KEYVALUE一般是一条record,也就是一行。所以推测如果需要的input file里,是复杂数据的话,没有写在一行的话可能不行?
022024-01-19
相似问题