|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.processmining.framework.log.LogReader
org.processmining.framework.log.rfb.BufferedLogReader
public class BufferedLogReader
This class implements a fast, SAX-based, log reader buffering log data partly on binary files residing in persistent storage. The purpose of using this log reader is to reduce the memory footprint of log data management, speed up general access and in particular sequential read access, and to allow random access to all data, including write access.
Field Summary | |
---|---|
protected LogData |
data
Contains the currently valid processes, process instances, and log summary of the encapsulated log. |
protected LogFile |
file
The log file from which event data is read. |
protected LogFilter |
filter
LogFilter instance applied to this log. |
protected int |
instanceIteratorIndex
The index for the built-in iterator over the contained process instances. |
protected boolean |
isValid
Marker for thread synchronization; only after this attribute has been set to true , the
data stored in this collection can be used. |
protected LogData |
originalData
Contains the processes, process instances, and log summary as contained in the original log this reader is derived from. |
protected BufferedLogReader |
parent
Parent log reader, from whose data and settings the respective instance has been derived. |
protected java.lang.Thread |
processingThread
This thread is created and configured in the respective constructor. |
protected boolean |
processingThreadStarted
Internal marker. |
protected int[] |
processInstancesToKeep
Marks the indices of process instances in the parent's collection which this instance inherits. |
Constructor Summary | |
---|---|
protected |
BufferedLogReader(BufferedLogReader reader,
int[] pitk)
Create a deep clone of the provided buffered log reader, which only has the instances indicated in the provided integer array as indices. |
protected |
BufferedLogReader(BufferedLogReader aReader,
LogFilter aFilter)
Creates a new instance, based on the original log data used by the provided parameter instance, but filtered with the provided log filter. |
protected |
BufferedLogReader(LogFile aFile,
LogFilter aFilter)
Creates a new instance, parses the given log file and builds the log's data structures as random access swap files. |
Method Summary | |
---|---|
void |
cleanup()
Cleans up the log collection, removing all traces from the file system (buffers etc.) |
LogReader |
clone(int[] pitk)
Clones this log reader, including all contained processes and process instances. |
static LogReader |
createInstance(LogFilter aFilter,
LogFile aFile)
Creates a new instance, parses the given log file and builds the log's data structures as random access swap files. |
static LogReader |
createInstance(LogReader reader,
int[] pitk)
Create a deep clone of the provided buffered log reader, which only has the instances indicated in the provided integer array as indices. |
static LogReader |
createInstance(LogReader reader,
LogFilter filter)
Creates a new instance, based on the original log data used by the provided parameter instance, but filtered with the provided log filter. |
protected void |
ensureValidData()
Helper method, which blocks passively until the log data container's data becomes available for reading. |
protected void |
filter()
Applies the contained filter to the log data. |
protected void |
flagDataValid()
Helper method, which flags this reader's data valid and notifies, i.e. |
LogFile |
getFile()
Returns the log file instance that was given in the constructor. |
ProcessInstance |
getInstance(int index)
Retrieves the process instance located at the given index within the encapsulated log file. |
LogData |
getLogData()
Retrieves the set of log data underlying this log reader's current state. |
LogFilter |
getLogFilter()
Returns the filter instance that was given in the constructor. |
LogSummary |
getLogSummary()
Returns a LogSummary object with summarized info about the
workflow log. |
LogData |
getOriginalData()
Retrieves the set of log data contained in the original log, from which this log reader has been derived. |
Process |
getProcess(int index)
Retrieves the process located at the given index within the encapsulated log file. |
int |
hashCode()
Returns the hash code of this log reader. |
boolean |
hasNext()
Iterator interface method. |
java.util.Iterator |
instanceIterator()
Retrieves an iterator over the process instances contained in the encapsulated log file. |
boolean |
isSelection()
Tells whether or not this logReader object represents a selection of a log, instead of a complete log. |
boolean |
isValid()
Inquires, whether the respective instance is valid, i.e. |
ProcessInstance |
next()
Iterator interface method. |
int |
numberOfInstances()
Retrieves the number of process instances contained in this log file. |
int |
numberOfProcesses()
Retrieves the number of processes contained in this log file. |
int[] |
processInstancesToKeep()
Retrieves the indices of process instances which are not excluded from reading. |
java.util.Iterator |
processIterator()
Retrieves an iterator over the processes contained in the encapsulated log file. |
void |
reset()
Iterator interface method. |
java.lang.String |
toString()
Returns a string representation of this log reader. |
Methods inherited from class org.processmining.framework.log.LogReader |
---|
getInstances |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected LogFile file
protected LogFilter filter
protected int[] processInstancesToKeep
null
otherwise.
protected BufferedLogReader parent
null
, if the instance has been
derived directly from an MXML log file.
protected java.lang.Thread processingThread
protected boolean processingThreadStarted
protected LogData data
protected LogData originalData
protected int instanceIteratorIndex
protected boolean isValid
true
, the
data stored in this collection can be used.
Constructor Detail |
---|
protected BufferedLogReader(LogFile aFile, LogFilter aFilter) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
aFile
- LogFile from which to read event data.aFilter
- LogFilter, which is to be applied to
the contained log data.
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
protected BufferedLogReader(BufferedLogReader aReader, LogFilter aFilter) throws java.io.IOException
aReader
- Buffered log reader from which to obtain the
event log data.aFilter
- Log filter to be applied to the obtained event
log data.
java.io.IOException
protected BufferedLogReader(BufferedLogReader reader, int[] pitk) throws java.lang.IndexOutOfBoundsException, java.io.IOException
reader
- Template buffered log reader.pitk
- Process instance indices to keep.
java.lang.IndexOutOfBoundsException
java.io.IOException
Method Detail |
---|
public static LogReader createInstance(LogReader reader, LogFilter filter) throws java.lang.Exception
reader
- Buffered log reader from which to obtain the
event log data.filter
- Log filter to be applied to the obtained event
log data.
java.lang.Exception
public static LogReader createInstance(LogFilter aFilter, LogFile aFile) throws java.lang.Exception
aFile
- LogFile from which to read event data.aFilter
- LogFilter, which is to be applied to
the contained log data.
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
java.lang.Exception
public static LogReader createInstance(LogReader reader, int[] pitk) throws java.lang.Exception
reader
- Template buffered log reader.pitk
- Process instance indices to keep.
java.lang.IndexOutOfBoundsException
java.io.IOException
java.lang.Exception
public boolean isValid()
protected void flagDataValid()
protected void ensureValidData()
public LogData getLogData()
public LogData getOriginalData()
public LogReader clone(int[] pitk)
LogReader
Notice that this method will yield a deep copy of the cloned instance. This implies doubling this instance's memory consumption (either in random access memory or filesystem space consumption, depending on the implementation) and no synchronization of changes between original and clone.
clone
in class LogReader
pitk
- The contained process instances, whose indices are contained
in the given integer array, are excluded and will not be
contained in the returned clone.
public LogFile getFile()
LogReader
getFile
in class LogReader
public ProcessInstance getInstance(int index)
LogReader
getInstance
in class LogReader
index
- index of the requested process instance in the log
public LogFilter getLogFilter()
LogReader
getLogFilter
in class LogReader
public LogSummary getLogSummary()
LogReader
LogSummary
object with summarized info about the
workflow log. Note that, if a filter is used, any information provided in
this object is based on the filtered log, not on the real contents of the
log file.
getLogSummary
in class LogReader
LogSummary
object with summarized info about the
workflow logpublic Process getProcess(int index)
LogReader
getProcess
in class LogReader
index
- index of the requested process in the log
public boolean hasNext()
LogReader
Probes whether the log reader has another process instance available for reading.
hasNext
in class LogReader
public java.util.Iterator instanceIterator()
LogReader
instanceIterator
in class LogReader
public boolean isSelection()
LogReader
isSelection
in class LogReader
public ProcessInstance next()
LogReader
Retrieves the next process instance from the log.
next
in class LogReader
public int numberOfInstances()
LogReader
numberOfInstances
in class LogReader
public int numberOfProcesses()
LogReader
numberOfProcesses
in class LogReader
public int[] processInstancesToKeep()
LogReader
processInstancesToKeep
in class LogReader
public java.util.Iterator processIterator()
LogReader
processIterator
in class LogReader
public void reset()
LogReader
Resets the main iterator to the first process instance.
reset
in class LogReader
public void cleanup() throws java.io.IOException
Warning: After calling this method, the respective log reader instance becomes unusable! All method calls subsequent to this one will return undefined results!
java.io.IOException
protected void filter() throws java.lang.IndexOutOfBoundsException, java.io.IOException
java.lang.IndexOutOfBoundsException
java.io.IOException
public java.lang.String toString()
toString
in class LogReader
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |