Hi Boxuan,
Please find the code below:
1. Starting the transaction (identifier value is TestBatchLogger)
public JanusGraphTransaction startJanusGraphTransaction(String identifier) {
return janusGraphSchema.getConfiguredGraph().buildTransaction().logIdentifier(identifier).start();
}
2. Multiple add vertex/edge operations on the graph through (e.g.)
GraphTraversal<Vertex, Vertex> traversal = g.addV("idVertex")
.property(id, "uuid");
return traversal.next();
Here g is the gremlin GraphTraversalSource object obtained from JanusGraphFactory.open(<graphConfigPropertiesFile>).traversal()
3. Commit on the transaction object returned by the start transaction method.
So I wanted to replay the logs of this transaction. For this I made a call to the below method
public void startLogProcessor(String identifier) {
LogProcessorFramework logProcessor =
JanusGraphFactory.openTransactionLog(graph);
logProcessor.addLogProcessor(identifier).
setProcessorIdentifier("BatchTxLogger").
setStartTime(Instant.now()).
addProcessor((tx, txId, changeState) -> {
System.out.println("tx--"+tx.toString() + " txId--"+txId.toString()
+" changeState--"+changeState.toString());
for (JanusGraphVertex v : changeState.getVertices(Change.ANY)) {
System.out.println(v.label());
}
}).build();
}
But here I am unable to get the sysout. Tried different combinations of startTime (Instance.EPOCH, Instance.now().minusMillis(500) etc.) but did not get the println output on the console (No exception or error in any case).
I also tried removing the identifier which gave the invalid readmarker error. So after checking the class files I also removed the start time to resolve the error. But still no console output :(
Regards,
Ojas