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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:12:17+00:00 2026-05-27T13:12:17+00:00

Is it possible to achieve distributed reads from HDSF cluster using an HDFS client

  • 0

Is it possible to achieve distributed reads from HDSF cluster using an HDFS client on one machine?

I have carried out an experiment with a cluster consisting of 3 data nodes (DN1,DN2,DN3). Then I run 10 simultaneous reads from 10 independent files from a client program located on DN1, and it appeared to be only reading data from DN1. Other data nodes (DN2,DN3) were showing zero activity (judging from debug logs).

I have checked that all files’ blocks are replicated across all 3 datanodes, so if I shut down DN1 then data is read from DN2 (DN2 only).

Increasing the amount of data read did not help (tried from 2GB to 30GB).

Since I have a need to read multiple large files and extract only a small amount of data from it (few Kb), I would like to avoid using map/reduce since it requires settings up more services and also requires writing the output of each split task back to HDFS. Rather it would be nice to have the result streamed directly back to my client program from the data nodes.

I am using SequenceFile for reading/writing data, in this fashion (jdk7):

//Run in thread pool on multiple files simultaneously

List<String> result = new ArrayList<>();
LongWritable key = new LongWritable();
Text value = new Text();
try(SequenceFile.Reader reader = new SequenceFile.Reader(conf,
                                     SequenceFile.Reader.file(filePath)){
  reader.next(key);
  if(key.get() == ID_I_AM_LOOKING_FOR){
    reader.getCurrentValue(value);
    result.add(value.toString());
  }
}

return result; //results from multiple workers are merged later

Any help appreciated. Thanks!

  • 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-27T13:12:17+00:00Added an answer on May 27, 2026 at 1:12 pm

    I’m afraid the behavior you see is by-design. From Hadoop document:

    Replica Selection

    To minimize global bandwidth consumption and read latency, HDFS tries
    to satisfy a read request from a replica that is closest to the
    reader. If there exists a replica on the same rack as the reader node,
    then that replica is preferred to satisfy the read request. If angg/
    HDFS cluster spans multiple data centers, then a replica that is
    resident in the local data center is preferred over any remote
    replica.

    It can be further confirmed by corresponding Hadoop source code:

      LocatedBlocks getBlockLocations(...) {
        LocatedBlocks blocks = getBlockLocations(src, offset, length, true, true);
        if (blocks != null) {
          //sort the blocks
          DatanodeDescriptor client = host2DataNodeMap.getDatanodeByHost(
              clientMachine);
          for (LocatedBlock b : blocks.getLocatedBlocks()) {
            clusterMap.pseudoSortByDistance(client, b.getLocations());
    
            // Move decommissioned datanodes to the bottom
            Arrays.sort(b.getLocations(), DFSUtil.DECOM_COMPARATOR);
          }
        }
        return blocks;
      }
    

    I.e., all available replicas are tried one after another if former one fails but the nearest one is always the first.

    On the other hand, if you access HDFS files through HDFS Proxy, it does pick datanodes randomly. But I don’t think that’s what you want.

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

Sidebar

Related Questions

Is it possible to achieve next thing without using views, but just one single
Is it possible to achieve line-height consistency in all browsers? I have attached an
Is it possible to achieve motion detection using php? I'm not a GD/Image library
Is it possible to achieve font effect similar to the one seen in the
Is it possible to achieve the same effect of any hardware independent functionality from
I'm using Symfony 1.4 and wondering whether it's possible to achieve the following: <a
I am curious if it is possible to achieve a simple div swap using
Is it possible to achieve better data transfer rate with multiple parallel TCP connections
Is it really possible to achieve grade A in yslow for all things for
What are the best resources for understanding what's possible (or not possible) to achieve

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.