hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Groschupf ...@media-style.com>
Subject Re: how blocks are compared
Date Mon, 27 Mar 2006 12:19:59 GMT
Hi Andrzej,
I see!
Thanks for the hint.
Stefan

Am 27.03.2006 um 12:24 schrieb Andrzej Bialecki:

> Stefan Groschupf wrote:
>> Hi,
>> I do not clearly understand how the dfs compare blocks.
>
>> I currently just miss some glue how result of a compare of two  
>> random numbers can be used to decide if a block can be removed or  
>> not.
>>
>> Any hints what I'm missing?
>
> Block reports are sorted according to the same compateTo (in  
> TreeSet.toArray()). It's true that IDs are random, but if both  
> oldReport and newReport lists are sorted, like this:
>
> OLD      NEW
> 1         2
> 2         3
> 3         4
> 5         5
>
> Then the sequence of compares and pointer advances looks like this
>
> old[oldPos=0].compareTo(new[newPos=0]) == -1; remove(old[0]); oldPos 
> ++;
> old[oldPos=1].compareTo(new[newPos=0]) == 0; /* nothing */; oldPos+ 
> +; newPos++;
> old[oldPos=2].compareTo(new[newPos=1]) == 0; /* nothing */; oldPos+ 
> +; newPos++;
> old[oldPos=3].compareTo(new[newPos=2]) == 1; add(new[2]); newPos++;
> old[oldPos=3].compareTo(new[newPos=3]) == 0; /* nothing */; oldPos+ 
> +; newPos++;
>
> -- 
> Best regards,
> Andrzej Bialecki     <><
> ___. ___ ___ ___ _ _   __________________________________
> [__ || __|__/|__||\/|  Information Retrieval, Semantic Web
> ___|||__||  \|  ||  |  Embedded Unix, System Integration
> http://www.sigram.com  Contact: info at sigram dot com
>
>
>

---------------------------------------------------------------
company:        http://www.media-style.com
forum:        http://www.text-mining.org
blog:            http://www.find23.net



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