@Override
public Object call()
{
DatasetGraph dsg = null ;
Lock lock = null ;
try {
dsg = tts.getDatasetGraph() ;
lock = dsg.getLock() ;
int id = gen.incrementAndGet() ;
for ( int i = 0 ; i < repeats ; i++ )
{
try {
lock.enterCriticalSection(Lock.WRITE) ;
log.debug("writer start "+id+"/"+i) ;
int x1 = count("SELECT * { ?s ?p ?o }", dsg) ;
int z = change(dsg, id, i) ;
pause(maxpause) ;
int x2 = count("SELECT * { ?s ?p ?o }", dsg) ;
if ( x1+z != x2 )
{
log.warn(format("WRITER: %s Change seen: %d + %d != %d : id=%d: i=%d", "write-" + i, x1, z, x2, id, i)) ;
return null ;
}
log.debug("writer finish "+id+"/"+i) ;
} catch (RuntimeException ex)
{
log.debug("writer error "+id+"/"+i) ;
System.err.println(ex.getMessage()) ;
ex.printStackTrace() ;
} finally {
lock.leaveCriticalSection() ;
}
}
return null ;
}
catch (RuntimeException ex)