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 8590321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:16:06+00:00 2026-06-11T23:16:06+00:00

I have a lot of files stored in the distributed cache, each corresponding to

  • 0

I have a lot of files stored in the distributed cache, each corresponding to a user id. I want to attach a specific file corresponding to a particular user id(which will be the key of the reducer), to a particular reduce task. But I am not able to do so, because, I read the files from distributed cache using the configure method, which comes before the reduce method in the reduce class. So I cannot access the keys of the reduce method in the configure method of the reduce class, and hence can’t read only the file that I want to. Pls help me.

class reduce{

void configure(args)
{

/*I can a particular file from the Path[] here.
I want to select the  file corresponding to the key of the reduce method and pass its
contents to the reduce method. I am not able to do this as I can't access the key of 
the reduce method.*/

}

void reduce(args)
{
}


}
  • 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-11T23:16:07+00:00Added an answer on June 11, 2026 at 11:16 pm

    A solution is to assign the Path arrays from the DistributedCache to class variables during the configure step as described in the DistributedCache javadocs. Of course, replace the map code with your reduce code.

    This is using the old API, which it looked like your code was using.

     public static class MapClass extends MapReduceBase  
     implements Mapper<K, V, K, V> {
    
       private Path[] localArchives;
       private Path[] localFiles;
    
       public void configure(JobConf job) {
         // Get the cached archives/files
         localArchives = DistributedCache.getLocalCacheArchives(job);
         localFiles = DistributedCache.getLocalCacheFiles(job);
       }
    
       public void map(K key, V value, 
                       OutputCollector<K, V> output, Reporter reporter) 
       throws IOException {
         // Use data from the cached archives/files here
         // ...
         // ...
         output.collect(k, v);
       }
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a lot of mp3 files and i stored path of these file
We have a lot of web services (.asmx files, which can be accessed for
I have an catalog with a lot of files. I want to count every
Amazon Integration I have my own CMS which has a file manager. A lot
I have a web application that stores a lot of user generated files. Currently
I have a lot of large csv files with NULL values stored as ,,
I have a piece of program processing a lot of files, where for each
I have lot (1000s) of digital content files (images, videos) that are stored in
I have some image-files stored into one file (some kind of archive). That file
I have a lot of files such as JavaScript, HTML, and even C and

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.