Public Member Functions | |
| CacheEntry (Integer key, long startPos, long endPos) | |
| CacheEntry (String hexadecimal) | |
| String | toHexadecimal () |
Public Attributes | |
| final int | key |
| final long | start |
| final long | end |
Static Public Attributes | |
| static final int | ENTRY_LENGTH = 40 |
An entry of the cache. It contains the name of the file where the entry is stored together with the position of the entry.
Having the name of the file allows to open and close the file when needed. In a previous version there was a RandomAccessFile instead of the name but it ended up with an error because the number of open file was exceeding the maximum allowed.
| com::cosylab::logging::engine::cache::CacheEntry::CacheEntry | ( | Integer | key, | |
| long | startPos, | |||
| long | endPos | |||
| ) | [inline] |
| com::cosylab::logging::engine::cache::CacheEntry::CacheEntry | ( | String | hexadecimal | ) | [inline] |
Constructor.
Build the entry by its hexadecimal representation
| hexadecimal |
| String com::cosylab::logging::engine::cache::CacheEntry::toHexadecimal | ( | ) | [inline] |
Translate the content of the entry in an hexadecimal string composed of the key, the start and end.
The array returned by this method can be written on a file. Its length is constant for each possible entry so the fields are not separated.
References end, key, and start.
Referenced by alma::acs::jlog::test::EngineCacheTest::testCacheEntryTranslation(), and com::cosylab::logging::engine::cache::CacheEntriesQueue::writePageOnFile().
The ending position of the entry in the file
Referenced by CacheEntry(), alma::acs::jlog::test::EngineCacheTest::testCacheEntryTranslation(), alma::acs::jlog::test::TestEngineCacheEntriesQueue::testPushPopQueue(), alma::acs::jlog::test::TestEngineCacheEntriesQueue::testPushPopQueueVector(), alma::acs::jlog::test::TestEngineCacheEntriesQueue::testPushPopQueueVectorFile(), alma::acs::jlog::test::TestEngineCacheEntriesQueue::testRandomOrder(), and toHexadecimal().
final int com::cosylab::logging::engine::cache::CacheEntry::ENTRY_LENGTH = 40 [static] |
The length of the bytes representing each entry.
This number is useful while caching the entries on a file.
40 is 8 for the integer and 2 time 16 for the longs.
The key of the file where the entry is stored
Referenced by CacheEntry(), com::cosylab::logging::engine::cache::EngineCache::pop(), alma::acs::jlog::test::EngineCacheTest::testCacheEntryTranslation(), alma::acs::jlog::test::TestEngineCacheEntriesQueue::testPushPopQueue(), alma::acs::jlog::test::TestEngineCacheEntriesQueue::testPushPopQueueVector(), alma::acs::jlog::test::TestEngineCacheEntriesQueue::testPushPopQueueVectorFile(), alma::acs::jlog::test::TestEngineCacheEntriesQueue::testRandomOrder(), and toHexadecimal().
The starting position of the entry in the file
Referenced by CacheEntry(), alma::acs::jlog::test::EngineCacheTest::testCacheEntryTranslation(), alma::acs::jlog::test::TestEngineCacheEntriesQueue::testPushPopQueue(), alma::acs::jlog::test::TestEngineCacheEntriesQueue::testPushPopQueueVector(), alma::acs::jlog::test::TestEngineCacheEntriesQueue::testPushPopQueueVectorFile(), alma::acs::jlog::test::TestEngineCacheEntriesQueue::testRandomOrder(), and toHexadecimal().
1.6.2