incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manuel Innerhofer <man...@trialox.org>
Subject probable issues in JenaGraphAdaptor
Date Mon, 01 Nov 2010 12:41:05 GMT
Hi,

When stress testing the platform we recurrently get the problem that it
looks like user information disappear from the system graph. After
restarting the TDB storage it's back to normal.
I started debugging this issue. The problem seems to be caused by a corrupt
mapping in JenaGraphAdaptor. It uses a BidiMapImpl instance to map Clerezza
BNode to jena nodes and vice versa. Internally the BidiMapImpl uses two
HashMaps, one for each direction. When the above problem occurs, then the
direction Clerezza BNode to jena Node is no longer correct, while the
direction jena Node to Clerezza BNode still is correct. As a consequence you
still can print out the PLATFORM:userName with the following code:

final Iterator<Triple> triples = systemGraph.filter(null, PLATFORM.userName,
null);
Set<PlainLiteral> userNames = new HashSet<PlainLiteral>();
while (triples.hasNext()) {
   Triple triple = triples.next();
   System.out.println("User Name " + ((PlainLiteral)
triple.getObject()).getLexicalForm());
}

But not with this:

Iterator<Triple> agents = systemGraph.filter(null, RDF.type, FOAF.Agent);
while (agents.hasNext()) {
    GraphNode agent = new GraphNode(agents.next().getSubject(),
systemGraph);
    Iterator<Literal> userNames = agent.getLiterals(PLATFORM.userName);
    if (userNames.hasNext()) {
         System.out.println(userNames.next().getLexicalForm());
    }
}

Anyway, I didn't find any bugs in the code that could cause this corrupt
mapping.

But what I noticed is that every BNode used when filtering with
JenaGraphAptapter.performFilter() is added to this map. This regardless of
ifs existence in the graph. Therefore the map size grows steadily. For
example at the time the above problem occurred, the map size was over
120'000. This could maybe explain why the platform becomes slower with time.
Is it possible that the map could become corrupt because of its size? Maybe
some internal rehashing gone wrong?

Regards,
Manuel

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