hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ajay Srivastava <Ajay.Srivast...@guavus.com>
Subject Re: Passing a value from main() to map()
Date Thu, 26 Apr 2012 09:28:17 GMT
Hi,
It seems that you are trying to code a hadoop job which takes input from stdin ?
As far as I know it is not possible as hadoop job works on input coming in batches not on
real time streams.
Please wait for others response as well as I am a beginner and may be missing something here.


Ajay Srivastava   

On 26-Apr-2012, at 2:27 PM, 王瑞军 wrote:

> hello everyone:
>        i have a problem.we knew map() has it's own parameter such
> as map(Object key, Text value, Context context).
> the following is my structure.
> 
> public class aaa{
>     public static class bbb {
>               public void map() {
>                         i want use the variable number here;
>                         for example;
>                         if(number==0) {print xxxxxx}
>                    }
>            }
>    public static void main() {
>          we receive a number from the keyboard,for example;
>          Scanner input = new Scanner(System.in);
>              number = input.nextInt();
>    }
> }
> 
> so how can i do?grateful!

Mime
View raw message