fenfire-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fenfire-dev] RDF traversal utility methods


From: Tuomas Lukka
Subject: Re: [Fenfire-dev] RDF traversal utility methods
Date: Sat, 16 Aug 2003 13:27:34 +0300
User-agent: Mutt/1.5.4i

On Sat, Aug 16, 2003 at 01:07:55PM +0300, Tuukka Hastrup wrote:
> On Sat, 16 Aug 2003, Tuomas Lukka wrote:
> > > There is one test failure, as I don't know how to get all nodes of the 
> > > graph - findN_XAA_Iter returns only subjects, not objects. If all nodes 
> > > are subjects, the tests pass.
> > 
> > Tuukka: we can certainly add findN_AAX_Iter if you like
> 
> I think I'd like. But for sure I was wondering if there has been a reason 
> to omit it. 

The less there are, the less indices there need to be.

> How do we proceed with adding this?

Look at org.fenfire.swamp.makeSwamp.py.

> Could you also tell how we handle deletions in graph w.r.t. iterators that 
> are in use? From irc log I read that one isn't supposed to do deletions 
> while there are iterators. 

See. e.g. 1.4 javadoc for HashMap for the reason:

 The iterators returned by this class's iterator and listIterator
 methods are fail-fast: if list is structurally modified at any time
 after the iterator is created, in any way except through the iterator's
 own remove or add methods, the iterator will throw a
 ConcurrentModificationException.

There is no reasonable way to have efficient and good iterator
semantics with simultaneous editing of the structure.

> OTOH java.util.Iterator Javadoc says:
> "Iterators allow the caller to remove elements from the underlying 
> collection during the iteration with well-defined semantics."

That's different. We could, in theory, do this, but Swamp does not yet
allow this.

We'll do this in swamp once we do a better implementation than HashGraph -
hashgraph is a first version, and is rather inefficient.

> As HashGraph uses HashMap-provided iterators, I suppose they permit 
> calling their remove() method. But as there are three HashMaps whose 
> entries must be updated during removal, I don't think calling remove() 
> would be wise.

Exactly.

        Tuomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]