
Public Member Functions | |
| MultiFileTableRecord () throws LogCacheException | |
| int | getNumOfLogs () |
| long | getFileSize () throws IOException |
| void | addLog (ILogEntry log, int key) throws LogCacheException |
| int | getMinLogIdx () |
| int | getMaxLogIdx () |
| ILogEntry | getLog (Integer key) throws LogCacheException |
| void | flushBuffer () throws LogCacheException |
| void | deleteLog (Integer key) throws LogCacheException |
| void | clear () throws LogCacheException |
| boolean | isEmpty () |
| Integer | getFirstLog () |
| Integer | getLastLog () |
| int | getFirstLogs (int n, Collection< Integer > keys) |
| Set< Integer > | keySet () |
| void | replaceLog (Integer key, ILogEntry log) throws LogCacheException |
Private Attributes | |
| LogBufferedFileCache | lbfc |
| int | minLogIdx |
| int | maxLogIdx |
This class defines a data set providing information on a single LogBufferedFileCache object. Each time a new file is created we also create an instance of this class.
LogFileTableRecord objects are organized in a vector to form the log file table used to retrieve the logs according to the user's defined keyword.
| com::cosylab::logging::client::cache::MultiFileTableRecord::MultiFileTableRecord | ( | ) | throws LogCacheException [inline] |
| void com::cosylab::logging::client::cache::MultiFileTableRecord::addLog | ( | ILogEntry | log, | |
| int | key | |||
| ) | throws LogCacheException [inline] |
Add a log to the cache and updates the max and min indexes
| log | The log to add to the cache | |
| key | The key of the new log |
| LogCacheException | If an error happens while adding the log |
References com::cosylab::logging::client::cache::LogBufferedFileCache::add(), lbfc, maxLogIdx, and minLogIdx.
Referenced by com::cosylab::logging::client::cache::LogMultiFileCache::add().
| void com::cosylab::logging::client::cache::MultiFileTableRecord::clear | ( | ) | throws LogCacheException [inline] |
Remove all the logs and free the resources by delegating to the LogBufferedFileCache
| <code>LogCacheException</code> | in case of error clearing the buffer |
References com::cosylab::logging::client::cache::LogBufferedFileCache::clear(), lbfc, maxLogIdx, and minLogIdx.
Referenced by com::cosylab::logging::client::cache::LogMultiFileCache::deleteLog().
| void com::cosylab::logging::client::cache::MultiFileTableRecord::deleteLog | ( | Integer | key | ) | throws LogCacheException [inline] |
Delete the log with the given key
| key | The not null key of identifying the log |
| <code>LogCacheException</code> | in case of error deleting the log |
References com::cosylab::logging::client::cache::LogBufferedFileCache::deleteLog(), lbfc, and minLogIdx.
Referenced by com::cosylab::logging::client::cache::LogMultiFileCache::deleteLog().
| void com::cosylab::logging::client::cache::MultiFileTableRecord::flushBuffer | ( | ) | throws LogCacheException [inline] |
Flush the buffer on disk delegating to the LogBufferedFileCache
| LogCacheException | In case of error flushing on disk |
References com::cosylab::logging::client::cache::LogBufferedFileCache::flushBuffer(), and lbfc.
Referenced by com::cosylab::logging::client::cache::LogMultiFileCache::add().
| long com::cosylab::logging::client::cache::MultiFileTableRecord::getFileSize | ( | ) | throws IOException [inline] |
return the size of the file on disk
| IOException | In case of error getting the size of the file |
References com::cosylab::logging::client::cache::LogBufferedFileCache::getFileSize(), and lbfc.
Referenced by com::cosylab::logging::client::cache::LogMultiFileCache::add(), com::cosylab::logging::client::cache::LogMultiFileCache::getLogFileSize(), and com::cosylab::logging::client::cache::LogMultiFileCache::printFileTableInfo().
| Integer com::cosylab::logging::client::cache::MultiFileTableRecord::getFirstLog | ( | ) | [inline] |
Return the key of the first log in this record
References com::cosylab::logging::client::cache::LogBufferedFileCache::getFirstLog(), isEmpty(), lbfc, and minLogIdx.
Referenced by com::cosylab::logging::client::cache::LogMultiFileCache::getFirstLog().
| int com::cosylab::logging::client::cache::MultiFileTableRecord::getFirstLogs | ( | int | n, | |
| Collection< Integer > | keys | |||
| ) | [inline] |
Append at most n keys from the first valid logs to the collection. First here means first in the FIFO policy.
The number of added keys can be less then n if the cache doesn't contain enough logs.
References com::cosylab::logging::client::cache::LogBufferedFileCache::getFirstLogs(), and lbfc.
| Integer com::cosylab::logging::client::cache::MultiFileTableRecord::getLastLog | ( | ) | [inline] |
Return the key of the last log in this record
References com::cosylab::logging::client::cache::LogBufferedFileCache::getLastLog(), isEmpty(), lbfc, and minLogIdx.
Referenced by com::cosylab::logging::client::cache::LogMultiFileCache::getLastLog().
| ILogEntry com::cosylab::logging::client::cache::MultiFileTableRecord::getLog | ( | Integer | key | ) | throws LogCacheException [inline] |
Return the log with the given key
| key | The not null key of identifying the log |
References com::cosylab::logging::client::cache::LogBufferedFileCache::getLog(), lbfc, maxLogIdx, and minLogIdx.
Referenced by com::cosylab::logging::client::cache::LogMultiFileCache::getLog().
| int com::cosylab::logging::client::cache::MultiFileTableRecord::getMaxLogIdx | ( | ) | [inline] |
References maxLogIdx.
Referenced by com::cosylab::logging::client::cache::LogMultiFileCache::add(), com::cosylab::logging::client::cache::LogMultiFileCache::deleteLog(), and com::cosylab::logging::client::cache::LogMultiFileCache::printFileTableInfo().
| int com::cosylab::logging::client::cache::MultiFileTableRecord::getMinLogIdx | ( | ) | [inline] |
References minLogIdx.
Referenced by com::cosylab::logging::client::cache::LogMultiFileCache::add(), com::cosylab::logging::client::cache::LogMultiFileCache::deleteLog(), and com::cosylab::logging::client::cache::LogMultiFileCache::printFileTableInfo().
| int com::cosylab::logging::client::cache::MultiFileTableRecord::getNumOfLogs | ( | ) | [inline] |
References com::cosylab::logging::client::cache::LogBufferedFileCache::getSize(), and lbfc.
Referenced by com::cosylab::logging::client::cache::LogMultiFileCache::add(), com::cosylab::logging::client::cache::LogMultiFileCache::deleteLog(), and com::cosylab::logging::client::cache::LogMultiFileCache::printFileTableInfo().
| boolean com::cosylab::logging::client::cache::MultiFileTableRecord::isEmpty | ( | ) | [inline] |
true if the record contains no log References com::cosylab::logging::client::cache::LogBufferedFileCache::getSize(), and lbfc.
Referenced by getFirstLog(), and getLastLog().
| Set<Integer> com::cosylab::logging::client::cache::MultiFileTableRecord::keySet | ( | ) | [inline] |
The keys in the map
References com::cosylab::logging::client::cache::LogBufferedFileCache::keySet(), lbfc, and minLogIdx.
| void com::cosylab::logging::client::cache::MultiFileTableRecord::replaceLog | ( | Integer | key, | |
| ILogEntry | log | |||
| ) | throws LogCacheException [inline] |
Replace the log with the given key
| key | The key of the log to replace | |
| log | The new log |
References lbfc, minLogIdx, and com::cosylab::logging::client::cache::LogBufferedFileCache::replaceLog().
Referenced by com::cosylab::logging::client::cache::LogMultiFileCache::replaceLog().
Referenced by addLog(), clear(), deleteLog(), flushBuffer(), getFileSize(), getFirstLog(), getFirstLogs(), getLastLog(), getLog(), getNumOfLogs(), isEmpty(), keySet(), MultiFileTableRecord(), and replaceLog().
Referenced by addLog(), clear(), getLog(), getMaxLogIdx(), and MultiFileTableRecord().
Minimum and maximum log keys stored in the LogBufferedFileCache These two numbers are used to locate a given log by its keyword.
NOTE: These numbers are updated only while adding logs i.e. if a log is deleted it can happen that is not in the record even if its key is in the range [minLogIdx,maxLogIdx]
Referenced by addLog(), clear(), deleteLog(), getFirstLog(), getLastLog(), getLog(), getMinLogIdx(), keySet(), MultiFileTableRecord(), and replaceLog().
1.6.2