On Tue, Mar 6, 2012 at 5:02 PM, Mark Kerzner <[email protected]>wrote:
> Hi, > > I need to initialize the HBase connection, which I normally do in > configure() in the Mapper, and then my mapper uses it. How do I do it in > Pig? > > I am ready to define a UDF that will return a handle, but is it a best > practice? > yes. you can initialize inside the first call to UDF.exec(). The same UDF object is used for the entire mapper. Don't initialize inside the constructor for UDF. AFIK there is no way to tell how many times and when the constructor is called (though it is no more than a handful of times on the front end). Raghu. > Thank you, > Mark >
