Package com.semedy.reasoner.core
Class JsonTransactionLogHandler
java.lang.Object
com.semedy.reasoner.core.JsonTransactionLogHandler
Creates and replays json log files.
Log file is created in log dir.
The current log file has the name XJsonLogFile.jlog
Log file is created in log dir.
The current log file has the name XJsonLogFile.jlog
- Author:
- angele
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()close log filevoidswitch to next log filevoidflush()flush log filevoidwrite the current action with the given json string into a log file.voidModify edb according to log file
Path can be a single file or a directoryvoidsetMaxLength(int maxlength) set the max length of the log files (used for tests only)longreturn number of added tripleslongreturn number of deleted triples
-
Constructor Details
-
JsonTransactionLogHandler
- Throws:
IOException
-
-
Method Details
-
createNextLogFile
switch to next log file- Throws:
IOException
-
setMaxLength
public void setMaxLength(int maxlength) set the max length of the log files (used for tests only) -
logData
public void logData(String action, String id, String jsontxt) throws IOException, SemReasonerException write the current action with the given json string into a log file.- Parameters:
action-id-jsontxt-- Throws:
IOExceptionSemReasonerException
-
close
public void close()close log file -
flush
public void flush()flush log file -
sizeDeleted
public long sizeDeleted()return number of deleted triples- Returns:
-
sizeAdded
public long sizeAdded()return number of added triples- Returns:
-
playIn
public void playIn(String path, Core core) throws EDBException, IOException, SemReasonerException, InterruptedException, SymboltableException Modify edb according to log file
Path can be a single file or a directory- Parameters:
path- , of the log file or log directorycore- , the core to be used to add and delete jsons- Throws:
InterruptedExceptionSemReasonerExceptionIOExceptionEDBExceptionSymboltableException
-