Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7797019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:33:00+00:00 2026-06-01T23:33:00+00:00

Say I’m building a UDF class called StaticLookupUDF that has to load some static

  • 0

Say I’m building a UDF class called StaticLookupUDF that has to load some static data from a local file during construction.

In this case I want to ensure that I’m not replicating work more than I need to be, in that I don’t want to re-load the static data on every call to the evaluate() method.

Clearly each mapper uses it’s own instantiation of the UDF, but does a new instance get generated for each record processed?

For example, a mapper is going to process 3 rows. Does it create a single StaticLookupUDF and call evaluate() 3 times, or does it create a new StaticLookupUDF for each record, and call evaluate only once per instance?

If the second example is true, in what alternate way should I structure this?

Couldn’t find this anywhere in the docs, I’m going to look through the code, but figured I’d ask the smart people here at the same time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:33:02+00:00Added an answer on June 1, 2026 at 11:33 pm

    Still not totally sure about this, but I got around it by having a static lazy value that loaded data as needed.

    This way you have one-instance of the static value per mapper. So if you’re reading in a dataset and you have 6 map tasks you’ll read in the data 6 times. Not ideal, but better than once per record.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a class called Money which has parameters Dollars and Cents I
Say, I want to create a singleton which has some data inside. The data
Say that I have a singleton class (Downloader) responsible for downloading and persisting files.
Say some programmer gives me an executable jar (from Java code) along with the
Say that I have a web user control that has several drop down lists
Say we have the following simple data-frame of date-value pairs, where some dates are
Say I have a class with synchronized methods. It's actually a class that uses
Say that you have a XHTML document in English but it has accented characters
Say I have a class that owns a D3DDevice : class Thing { public:
Say you have an application divided into 3-tiers: GUI, business logic, and data access.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.