@Override
public Object call()
{
start() ;
DatasetGraphTxn dsg = null ;
try
{
int id = gen.incrementAndGet() ;
for (int i = 0; i < repeats; i++)
{
dsg = sConn.begin(ReadWrite.READ) ;
log.debug("reader start " + id + "/" + i) ;
// Original T_TransSystem code
// int x1 = count("SELECT * { ?s ?p ?o }", dsg) ;
// pause(maxpause) ;
// int x2 = count("SELECT * { ?s ?p ?o }", dsg) ;
// if (x1 != x2) log.warn(format("READER: %s Change seen: %d/%d : id=%d: i=%d",
// dsg.getTransaction().getLabel(), x1, x2, id, i)) ;
// Add in an abort.
long start = System.currentTimeMillis();
int x1 = count("SELECT * { ?s ?p ?o }", dsg) ;
pause(maxpause) ;
String qs1 = StrUtils.strjoinNL("PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>",
"SELECT * { {FILTER(afn:wait(10))} UNION {?s ?p ?o }}") ;
String qs2 = StrUtils.strjoinNL("DESCRIBE ?s { ?s ?p ?o }") ;
try {
//countWithAbort(qs1, dsg, 5) ;
describeWithAbort(qs2, dsg, -1) ;
} catch (QueryCancelledException e)
{
txn("X", dsg);
}
log.debug("reader finish " + id + "/" + i) ;
dsg.end() ;
txn("R", dsg) ;
dsg = null ;
}
return null ;
} catch (RuntimeException ex)
{
System.out.flush() ;
System.err.println() ;
ex.printStackTrace(System.err) ;
if ( dsg != null )
{
dsg.abort() ;
dsg.end() ;
txn("E", dsg) ;
dsg = null ;
}
System.exit(2) ;
return null ;