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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:25:10+00:00 2026-05-26T13:25:10+00:00

Now I am using Hadoop to process the data that will finally be loaded

  • 0

Now I am using Hadoop to process the data that will finally be loaded into the same table. I need to a shared sequential number generator to generate id for each row. Now I am using the following approach to generate the unique number:

1) Create a text file, e.g., test.seq, in HDFS for saving the current sequential number.

2) I use a lock file “.lock” to control concurrency. Suppose we have two tasks to processing the data in parallel. If task1 wants to get the number, it will check if the lock file exists. If yes, it means that task2 is accessing the number from the test.seq, then task1 has to wait. When task2 has acquired the number, it overwrites the old number by increasing 1 when it returns, and deletes the lock file “.lock”. When task1 sees the .lock disappear, task1 will firstly create a “.lock” file, then does the same way to get the sequential number.

However, I am not sure if this approach is practical. Because I keep the .lock and test.seq files in the HDFS, even the content of test.seq was changed by task 1, it might not immediately be aware by the task2. As the other tasks get the information about the data in the HDFS is through by namenode. So, the datanode will first notify the change to the namenode, then the other tasks are notified the changes. Is it correct?

Another idea is to create torjan program running on the Master. so, the task get the sequential number is through RPC the Torjan program. But how to run the Torjan program on the master program?

Could anybody give me some advice? 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-26T13:25:11+00:00Added an answer on May 26, 2026 at 1:25 pm

    The main problem is that you choose hadoop because of the horizontal scalability properties.
    All forms of horizontal scalability suffer greatly when you include something that needs to be coordinated from a central point.

    So you have two options:

    1. You accept the scaling limitations and go for the solutions proposed by others. (like the zookeeper option)
    2. You choose a solution that does not require a form of central coordination. At the expense of some properties of the key.

    I would try to see if the latter would be enough for your purposes.
    One such solution could be that you take the id of the current tracker instance and append a local counter value.
    This way the value is unique and sequentially per tracker and over multiple runs of the same job, but not within the job.

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

Sidebar

Related Questions

I am using hadoop hdfs to store large data. I need to first transfer
I'm now using this code to import csv data into my database.(Thanks to Francis
I have been using Hadoop quite a while now. After some time I realized
I am managing a Hadoop cluster that is shared between a number of users.
I have a mapper that, while processing data, classifies output into 3 different types
I need to write data in to Hadoop (HDFS) from external sources like a
Lots of BAWs (big ass-websites) are using data storage and retrieval techniques that rely
.NET developers out there! Need your opinion here! I am now using Visual Assist
Here's my table right now (using mysql): SQL Table: koko_table name varchar(140) status varchar(140)
I'm looking for a way to make a grid (for now using Table, but

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.