Hi Sun, Sounds you are dealing with I met before.
The format of my file is something like this, there is only a space between each element source destination degree timestamp. for example: http://www.google.com http://something.net 3 1234555 The source is my key for map and reduce, I just use 'String [] splits = value.toString().split(" ");' to split everything. Maybe you are looking for something more complicated, hope this helps. --- On Mon, 6/1/09, Zhengguo 'Mike' SUN <[email protected]> wrote: > From: Zhengguo 'Mike' SUN <[email protected]> > Subject: what is the efficient way to implement InputFormat > To: [email protected] > Date: Monday, June 1, 2009, 8:52 PM > Hi, All, > > The input of my MapReduce job is two large txt files. And > an InputSplit consists of a portion of the file from both > files. And this Split is content dependent. So I have to > read the input file to generate a split. Now the thing is > that most of the time is spent in generating these splits. > The Map and Reduce phases actually take less time than that. > I was wondering if there is an efficient way to generate > splits from files. My InputFormat class is based on > FileInputFormat. The getSplits function of FileInputFormat > doesn't read input file. But this is impossible for me > because my split depends on the content of the file. > > Any ideas or comments are appreciated. > > >
