You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by ZhiHong Fu <dd...@gmail.com> on 2008/11/26 09:48:58 UTC
output in memory
Hello ,
now , I have a mapreduce job , which i want the job result will not be
stored in a file , I just need it to be showed to users.
So , how can i write a outputFormat for that ?
for example , The job will read a big number of data from the database, and
then I will process the data such as searching, filtering ,sorting and so
on, and then return results to the user, So there is no need to store the
result.
so what should i do? thanks
regards
Re: output in memory
Posted by tim robertson <ti...@gmail.com>.
I would still store the result in file, and then write a user
interface that renders the output file as required...
How would you know the user is still on the other end waiting to view
the result? If you are sure, then perhaps the thing that launches the
job could block until it is finished, and then simply open the file
and log it to the console? In a web app, you could just poll until
the job is finished and then use the file as the model object and just
write a view, assuming you are doing a model view controller type web
app.
If you really want to just System.out it, then:
- implement a RecordWriter that just does a System.out in the write()
- extend OutputFormat and in getRecordWriter() return your RecordWriter.
Cheers,
Tim
On Wed, Nov 26, 2008 at 9:48 AM, ZhiHong Fu <dd...@gmail.com> wrote:
> Hello ,
>
> now , I have a mapreduce job , which i want the job result will not be
> stored in a file , I just need it to be showed to users.
>
> So , how can i write a outputFormat for that ?
>
> for example , The job will read a big number of data from the database, and
> then I will process the data such as searching, filtering ,sorting and so
> on, and then return results to the user, So there is no need to store the
> result.
>
> so what should i do? thanks
>
> regards
>