On Wed, May 13, 2009 at 02:17:48PM +0100, Matthew Toseland wrote:
> > > We don't store in the cache if we have stored in the store.
> > 
> > Are you sure?!
> 
> Hmmm, in fact we do store in both. Do you have any opinion on this?

Spontaneous opinion is it may be suboptimal with unnecessary overwrites of
data in cache but not in store. But if the data is not stored, then its
a good idea to cache. Cannot recall what simulations showed at the moment.

> > > > +
> > > > +       /**
> > > > +        * Calculates the log distance to the neighbors of this node 
> > > > from 
> newpos. 
> > > If
> > > > +        * a neighbor has position newpos, then it is given my current 
> position.
> > > > +        */
> > > > +       private double logdist(CircleKey newpos) {
> > > > +               double val = 0.0f;
> > > > +               for (Iterator<DarknetNode> it = neighbors.iterator() ; 
> it.hasNext() ;) {
> > > > +                       DarknetNode dn = it.next();
> > > > +                       val += Math.log(dn.pos == newpos ? 
> > > > pos.dist(newpos) : 
> > > > +                               dn.pos.dist(newpos));
> > > 
> > > Doh! We just ignore it if we are neighbours in LocationManager.java! 
> Granted 
> > > this is a pretty small effect, but it needs to be fixed...
> > 
> > ??? 
> 
> In LocationManager, when we are deciding whether to do a swap, if the 
> location 
> of a neighbour of the swap target is equal to our location (or theirs, 
> depending on the bit of the calculation), and would thus introduce a zero, we 
> don't include it in the calculation:

Sounds good.

> > > > +               }
> > > > +               return val;
> > > > +       } 
> > > > +
> > > > +
> > > ...
> > > > Added: trunk/apps/simsalabim/DarknetRoute.java
> > > > ===================================================================
> > > > --- trunk/apps/simsalabim/DarknetRoute.java                             
> > > > (rev 
> 0)
> > > > +++ trunk/apps/simsalabim/DarknetRoute.java     2009-02-11 13:53:49 UTC 
> > > > (rev 
> > > 25585)
> > > ...
> > > > +
> > > > +       public Data findData(CircleKey k) {
> > > > +               for (Iterator<DarknetNode> it = route.iterator() ; 
> > > > it.hasNext() ;) {
> > > > +                       Data d  = it.next().findData(k);
> > > > +                       if (d != null)
> > > > +                               return d;
> > > > +               }
> > > > +               return null;
> > > > +       }
> > > 
> > > You don't check on each hop as you reach it? Is this some idea about 
> visiting 
> > > all the nodes on the route even if we find the data early on, so we can 
> store 
> > > it everywhere for better data robustness? (And considerably worse 
> performance 
> > > on popular data!)
> > 
> > Its just a matter of implemetation. The routes terminate for different 
> reasons.
> > When a route has terminated, the implementation checks if the data was 
> found. It
> > corresponds to the node checking the message directly in the real node.
> 
> But you only cache it on nodes before the one where the data was found?

No? On all the nodes in the return path (from where data was found to the
requestor).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20090518/1b3d9520/attachment.pgp>

Reply via email to