hadoop-common-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raghavendra Prabhu" <rrpra...@gmail.com>
Subject JobClient and LocalJobRunner trivial issues
Date Mon, 03 Apr 2006 13:07:46 GMT

static Random r = new Random(); in JobClient

I dont know where to ask this question, either to nutch or hadoop

But this is a general question. When you run two instances of a application
which uses hadoop, there is a probablity
that random id generated is the same and it may result in a collision

I think it would not matter. But anyway i have just jotted it down in case
it creates a problem in the future

The same is true with LocalJobRunner

  private String newId() {
      return Integer.toString(Math.abs(new Random().nextInt()),36);
Since we are calling newid() each time with newRandon().nextInt, there is
again a probability that this may happend

But we can safely carry on i guess considering that the chances are vey very
slim that this may happen


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message