Package com.tangosol.net.cache
Class SerializationPagedCache.PagedBinaryStore
java.lang.Object
com.tangosol.util.Base
com.tangosol.net.cache.SerializationPagedCache.PagedBinaryStore
- All Implemented Interfaces:
- BinaryStore
- Enclosing class:
- SerializationPagedCache
A virtual BinaryStore implementation that aggregates a sequence (newest
 to oldest) of periodic BinaryStore objects.
- 
Nested Class SummaryNested classes/interfaces inherited from class com.tangosol.util.BaseBase.LoggingWriterNested classes/interfaces inherited from interface com.tangosol.io.BinaryStoreBinaryStore.KeySetAware, BinaryStore.SizeAware
- 
Field Summary
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAdvance the current page, using the passed BinaryStore as the store for the new current page, and returning the oldest active page, if the maximum number of active pages is exceeded by the advancing of the current page.voidclose()Release underlying resources.voidRemove the specified key from the underlying store if present.voideraseAll()Remove all data from the underlying store.Get the array of BinaryStore objects, one for each active page.intDetermine the number of pages that the PagedBinaryStore is currently managing.Obtain the page to which current updates are being performed.intDetermine the number of pages that the PagedBinaryStore has managed in total, including those it is currently managing.intDetermine the maximum number of pages that the cache will manage, beyond which the oldest pages are destroyed.Obtain the oldest active page.getPage(int nPage) Get the BinaryStore for the page specified by the passed page number.protected MapObtain the map that manages the mapping from Binary keys to BinaryStore objects.intDetermine the number of pages that the PagedBinaryStore has managed in total, including those it is currently managing.booleanisPageActive(int nPage) Determine if the specified page number is active.keys()Iterate all keys in the underlying store.Return the value associated with the specified key, or null if the key does not have an associated value in the underlying store.protected voidlogException(Throwable e, String sMethod) Helper to log ignored exceptions.voidStore the specified value under the specific key in the underlying store.protected inttoPageIndex(int nPage) Translate a page number to an index into the PageArray.Methods inherited from class com.tangosol.util.Baseazzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, newHashMap, newHashMap, newHashSet, newHashSet, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
- 
Constructor Details- 
PagedBinaryStorepublic PagedBinaryStore(int cPages) Construct a PagedBinaryStore.- Parameters:
- cPages- the maximum number of pages to have active at a time
 
 
- 
- 
Method Details- 
loadReturn the value associated with the specified key, or null if the key does not have an associated value in the underlying store.- Specified by:
- loadin interface- BinaryStore
- Parameters:
- binKey- key whose associated value is to be returned
- Returns:
- the value associated with the specified key, or null if no value is available for that key
 
- 
storeStore the specified value under the specific key in the underlying store. This method is intended to support both key/value creation and value update for a specific key.- Specified by:
- storein interface- BinaryStore
- Parameters:
- binKey- key to store the value under
- binValue- value to be stored
 
- 
eraseRemove the specified key from the underlying store if present.- Specified by:
- erasein interface- BinaryStore
- Parameters:
- binKey- key whose mapping is to be removed from the map
 
- 
eraseAllpublic void eraseAll()Remove all data from the underlying store.- Specified by:
- eraseAllin interface- BinaryStore
 
- 
keysIterate all keys in the underlying store.- Specified by:
- keysin interface- BinaryStore
- Returns:
- a read-only iterator of the keys in the underlying store
 
- 
closepublic void close()Release underlying resources.
- 
getMaximumPagespublic int getMaximumPages()Determine the maximum number of pages that the cache will manage, beyond which the oldest pages are destroyed.- Returns:
- the maximum number of pages that the cache will manage
 
- 
getActivePageCountpublic int getActivePageCount()Determine the number of pages that the PagedBinaryStore is currently managing. This is the "active" page count.- Returns:
- the number of pages that the PagedBinaryStore is currently managing
 
- 
getTotalPageCountpublic int getTotalPageCount()Determine the number of pages that the PagedBinaryStore has managed in total, including those it is currently managing.- Returns:
- the total number of pages ever managed by the PagedBinaryStore
 
- 
getCurrentPageNumberpublic int getCurrentPageNumber()Determine the number of pages that the PagedBinaryStore has managed in total, including those it is currently managing.- Returns:
- the total number of pages ever managed by the PagedBinaryStore
 
- 
isPageActivepublic boolean isPageActive(int nPage) Determine if the specified page number is active. A page is active if it is either the current page, or a page that has not aged to the point that it has been discarded.- Parameters:
- nPage- the page number to test
- Returns:
- if the specified page is active
 
- 
getActivePageArrayGet the array of BinaryStore objects, one for each active page. The array is indexed by "page indexes" and not page numbers. Page numbers are sequential page ids; they can be translated to page indices by using the toPageIndex method.- Returns:
- the array of active BinaryStore objects
 
- 
getPageGet the BinaryStore for the page specified by the passed page number. The page number is basically the infinitely increasing counter of pages; the first page is 0, the second is 1, and so on.- Parameters:
- nPage- the page number
- Returns:
- the correspodning BinaryStore, or null if the specified page number is not active
 
- 
getCurrentPageObtain the page to which current updates are being performed. This page is referred to as the "current" page.- Returns:
- the BinaryStore that holds the current page's data
 
- 
getOldestActivePageObtain the oldest active page.- Returns:
- the BinaryStore that holds the oldest active page's data
 
- 
toPageIndexprotected int toPageIndex(int nPage) Translate a page number to an index into the PageArray.- Parameters:
- nPage- the page number
- Returns:
- an index into the PageArray, or -1 if the page number is no longer valid
 
- 
getPagedKeyMapObtain the map that manages the mapping from Binary keys to BinaryStore objects. The BinaryStore objects are actually wrappers around the real BinaryStore objects that each manage one "page" of data.- Returns:
- the map of Binary key to BinaryStore
 
- 
advanceCurrentPageprotected SerializationPagedCache.WrapperBinaryStore advanceCurrentPage(SerializationPagedCache.WrapperBinaryStore store) Advance the current page, using the passed BinaryStore as the store for the new current page, and returning the oldest active page, if the maximum number of active pages is exceeded by the advancing of the current page.- Parameters:
- store- the BinaryStore to use for the new current page
- Returns:
- the oldest active page, if keeping it would exceed the maximum number of pages; otherwise null
 
- 
logExceptionHelper to log ignored exceptions.- Parameters:
- e- the throwable object
- sMethod- the calling method name
 
 
-