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 |
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 |
Build a new object
LogCacheException |
void com.cosylab.logging.client.cache.MultiFileTableRecord.addLog | ( | ILogEntry | log, | |
int | key | |||
) | throws LogCacheException |
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().
Referenced by com.cosylab.logging.client.cache.LogMultiFileCache.add().
void com.cosylab.logging.client.cache.MultiFileTableRecord.clear | ( | ) | throws LogCacheException |
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().
Referenced by com.cosylab.logging.client.cache.LogMultiFileCache.deleteLog().
void com.cosylab.logging.client.cache.MultiFileTableRecord.deleteLog | ( | Integer | key | ) | throws LogCacheException |
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().
Referenced by com.cosylab.logging.client.cache.LogMultiFileCache.deleteLog().
void com.cosylab.logging.client.cache.MultiFileTableRecord.flushBuffer | ( | ) | throws LogCacheException |
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().
Referenced by com.cosylab.logging.client.cache.LogMultiFileCache.add().
long com.cosylab.logging.client.cache.MultiFileTableRecord.getFileSize | ( | ) | throws IOException |
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().
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 | ( | ) |
Return the key of the first log in this record
References com.cosylab.logging.client.cache.LogBufferedFileCache.getFirstLog(), and com.cosylab.logging.client.cache.MultiFileTableRecord.isEmpty().
Referenced by com.cosylab.logging.client.cache.LogMultiFileCache.getFirstLog().
int com.cosylab.logging.client.cache.MultiFileTableRecord.getFirstLogs | ( | int | n, | |
Collection< Integer > | keys | |||
) |
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().
Integer com.cosylab.logging.client.cache.MultiFileTableRecord.getLastLog | ( | ) |
Return the key of the last log in this record
References com.cosylab.logging.client.cache.LogBufferedFileCache.getLastLog(), and com.cosylab.logging.client.cache.MultiFileTableRecord.isEmpty().
Referenced by com.cosylab.logging.client.cache.LogMultiFileCache.getLastLog().
ILogEntry com.cosylab.logging.client.cache.MultiFileTableRecord.getLog | ( | Integer | key | ) | throws LogCacheException |
Return the log with the given key
key | The not null key of identifying the log |
References com.cosylab.logging.client.cache.LogBufferedFileCache.getLog().
Referenced by com.cosylab.logging.client.cache.LogMultiFileCache.getLog().
int com.cosylab.logging.client.cache.MultiFileTableRecord.getMaxLogIdx | ( | ) |
int com.cosylab.logging.client.cache.MultiFileTableRecord.getMinLogIdx | ( | ) |
int com.cosylab.logging.client.cache.MultiFileTableRecord.getNumOfLogs | ( | ) |
References com.cosylab.logging.client.cache.LogBufferedFileCache.getSize().
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 | ( | ) |
true
if the record contains no log References com.cosylab.logging.client.cache.LogBufferedFileCache.getSize().
Referenced by com.cosylab.logging.client.cache.MultiFileTableRecord.getFirstLog(), and com.cosylab.logging.client.cache.MultiFileTableRecord.getLastLog().
Set<Integer> com.cosylab.logging.client.cache.MultiFileTableRecord.keySet | ( | ) |
The keys in the map
References com.cosylab.logging.client.cache.LogBufferedFileCache.keySet().
void com.cosylab.logging.client.cache.MultiFileTableRecord.replaceLog | ( | Integer | key, | |
ILogEntry | log | |||
) | throws LogCacheException |
Replace the log with the given key
key | The key of the log to replace | |
log | The new log |
References com.cosylab.logging.client.cache.LogBufferedFileCache.replaceLog().
Referenced by com.cosylab.logging.client.cache.LogMultiFileCache.replaceLog().