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 |
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.
|
Build a new object
|
|
Add a log to the cache and updates the max and min indexes
|
|
Remove all the logs and free the resources by delegating to the
|
|
Delete the log with the given key
|
|
Flush the buffer on disk delegating to the
|
|
return the size of the file on disk
|
|
Return the key of the first log in this record
|
|
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.
|
|
Return the key of the last log in this record
|
|
Return the log with the given key
|
|
|
|
|
|
|
|
|
|
The keys in the map
|
|
Replace the log with the given key
|
|
|
|
|
|
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 |