How to share global sequential number generator in Hadoop?
问题 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