Package com.tangosol.net.cache
Class ReadWriteBackingMap.ReadQueue
java.lang.Object
com.tangosol.util.Base
com.tangosol.license.LicensedObject
com.tangosol.license.CoherenceDataGridEdition
com.tangosol.license.CoherenceApplicationEdition
com.tangosol.license.CoherenceCommunityEdition
com.tangosol.net.cache.ReadWriteBackingMap.ReadQueue
- Enclosing class:
- ReadWriteBackingMap
public class ReadWriteBackingMap.ReadQueue
extends com.tangosol.license.CoherenceCommunityEdition
A queue of keys that should be read from the underlying
 CacheStore.
- Author:
- jh 2005.02.08
- 
Nested Class SummaryNested classes/interfaces inherited from class com.tangosol.license.LicensedObjectcom.tangosol.license.LicensedObject.LicenseDataNested classes/interfaces inherited from class com.tangosol.util.BaseBase.LoggingWriter
- 
Field Summary
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanAdd a key to the queue.voidclear()Remove all keys from the queue.protected ListReturn a list of keys in the queue.Return a map of keys in the queue.peek()Wait for a key to be added to the queue and return it without removing it from the queue.peek(long cMillis) Wait for a key (up to the specified wait time) to be added to the queue and return it without removing it from the queue, or null if the specified wait time has passed).booleanRemove a key from the queue if the key is in the queue.protected ReadWriteBackingMap.ReadLatchselect(long cWaitMillis) Select the next key from the refresh-ahead queue that is a candidate for an asynchronous load.intsize()Return the length of the queue.toString()For debugging purposes, present the queue in human-readable format.Methods inherited from class com.tangosol.license.CoherenceCommunityEditionprintLicenseMethods inherited from class com.tangosol.license.LicensedObjectcontainsEdition, ensureEdition, getClassLicenseData, getClassLicenseData, getLicenseData, getLicenseFailure, isExpired, main, printLicense, retain, retain, setLicenseDataMethods 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- 
ReadQueueprotected ReadQueue()Construct a ReadQueue.
 
- 
- 
Method Details- 
addAdd a key to the queue. This method has no effect if the key is already queued.- Parameters:
- oKey- the key object
- Returns:
- true if the key was added to the queue; false otherwise
 
- 
peekWait for a key to be added to the queue and return it without removing it from the queue.- Returns:
- the next item in the queue (it will only return null when the backing map is no longer active)
 
- 
peekWait for a key (up to the specified wait time) to be added to the queue and return it without removing it from the queue, or null if the specified wait time has passed).- Parameters:
- cMillis- the number of ms to wait for a key in the queue; pass -1 to wait indefinitely or 0 for no wait
- Returns:
- the next item in the queue, or null if the wait time has passed or if the backing map is no longer active
 
- 
removeRemove a key from the queue if the key is in the queue.- Parameters:
- oKey- the key object
- Returns:
- true if the key was removed from the queue; false otherwise
 
- 
selectSelect the next key from the refresh-ahead queue that is a candidate for an asynchronous load. A key is a candidate if it can be locked "quickly".This method performs the selection process by iterating through the refresh-ahead queue starting with the first key in the queue. If the queue is empty, this method will block until a key is added to the queue. A key is skipped if it cannot be locked within the specified wait time. If a candidate key is found, a new ReadLatch for the key is placed in the control map and returned; otherwise, null is returned. - Parameters:
- cWaitMillis- the maximum amount of time (in milliseconds) to wait to select a key and acquire a latch on it; pass -1 to wait indefinitely
- Returns:
- a ReadLatch for the selected key or null if a candidate key was not found and latched within the specified time
 
- 
clearpublic void clear()Remove all keys from the queue.
- 
sizepublic int size()Return the length of the queue.- Returns:
- the length of the queue
 
- 
toStringFor debugging purposes, present the queue in human-readable format.- Overrides:
- toStringin class- com.tangosol.license.CoherenceCommunityEdition
- Returns:
- a String representation of this object
 
- 
getKeyListReturn a list of keys in the queue.- Returns:
- a list of keys in the queue
 
- 
getKeyMapReturn a map of keys in the queue.Note: The map returned from this method is not thread-safe; therefore, a lock on this ReadQueue must be obtained before accessing the map - Returns:
- a map of keys in the queue
 
 
-