It will be instantiated multiple times; once for each map or reduce
(depending on which it is in). Pig itself also constructs your UDF
during planning on the machine you launch your job on.
Alan.
On Mar 17, 2011, at 11:12 AM, souri datta wrote:
Hi,
If in a UDF , say in the constructor of the class, i initialize
a list
(say ArrayList<String> namesList) of objects(say names). And in the
exec()
method , I do some processing. When I am using this udf in a 20 node
hadoop
cluster, will this list 'nameList' be instantiated multiple times or
will
their be a single instance of namesList and all the mapper/reducers
will use
this single one?
Thanks,
Souri