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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:07:26+00:00 2026-05-31T19:07:26+00:00

I want to run a hadoop unit test, using the local filesystem mode… I

  • 0

I want to run a hadoop unit test, using the local filesystem mode… I would ideally like to see several part-m-* files written out to disk (rather than just 1). However, since it just a test, I dont want to process 64M of data (the default size is ~64megs per block, i believe).

In distributed mode we can set this using

dfs.block.size

I am wondering wether there a way that i can get my local file system to write small part-m files out, i.e. so that my unit test will mimic the contents of large scale data with several (albeit very small) files.

  • 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-05-31T19:07:27+00:00Added an answer on May 31, 2026 at 7:07 pm

    Assuming your input format can handle splitable files (see the org.apache.hadoop.mapreduce.lib.input.FileInputFormat.isSplitable(JobContext, Path) method), you can amend the input split size to process a smaller file with multi mappers (i’m going to assume you’re using the new API mapreduce package):

    For example, if you’re using the TextInputFormat (or most input formats that extend FileInputFormat), you can call the static util methods:

    • FileInputFormat.setMaxInputSplitSize(Job, long)
    • FileInputFormat.setMinInputSplitSize(Job, long)

    The long argument is the size of the split in bytes, so just set to you’re desired size

    Under the hood, these methods set the following job configuration properties:

    • mapred.min.split.size
    • mapred.max.split.size

    Final note, some input formats may override the FileInputFormat.getFormatMinSplitSize() method (which defaults to 1 byte for FileInputFormat), so be weay if you set a value and hadoop is appearing to ignore it.

    A final point – have you considered MRUnit http://incubator.apache.org/mrunit/ for actual ‘unit’ testing of your MR code?

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

Sidebar

Related Questions

i want to run some command on several machine using ssh. I know it
We want to run our unit tests on our TFS server. We are running
I want to run some executables outside of hadoop (but on the same cluster)
I'm using TFS2008 - soon to move to TFS2010 I want run code coverage
I have an app(django-compressor) that I only want to run on my local machine
I want to run a web application on php and mysql, using the CakePHP
I'm setting up Hadoop (0.20.2). For starters, I just want it to run on
I want run to call c.drive() : #include <functional> using namespace std; struct Car
I am writing an NUnit test that I want run only in the Release
I want to run my c# application with OS Linux using Mono. I am

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.