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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
close log filevoid
switch to next log filevoid
flush()
flush log filevoid
write the current action with the given json string into a log file.void
Modify edb according to log file
Path can be a single file or a directoryvoid
setMaxLength
(int maxlength) set the max length of the log files (used for tests only)long
return number of added tripleslong
return 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:
IOException
SemReasonerException
-
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:
InterruptedException
SemReasonerException
IOException
EDBException
SymboltableException
-