Oracle Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.1.2)

E26041-01

OldCache::Entry Class Reference

#include <coherence/net/cache/OldCache.hpp>

List of all members.


Detailed Description

Entry for the local cache extends SafeHashMap::Entry adding entry statistics used for the various eviction policies.

Public Types

typedef spec::Handle Handle
 Entry Handle definition.
typedef spec::View View
 Entry View definition.
typedef spec::Holder Holder
 Entry Holder definition.

Public Member Functions

virtual bool isExpired () const
 Determine if the cache entry has expired.
virtual int32_t getPriority () const
 Calculate a cache priority.
virtual void onAdd ()
 
virtual Object::Holder setValue (Object::Holder ohValue)
 
virtual void toStream (std::ostream &out) const
 
virtual int64_t getCreatedMillis () const
 Determine when the cache entry was created.
virtual int64_t getExpiryMillis () const
 Determine when the cache entry will expire, if ever.
virtual int64_t getLastTouchMillis () const
 Determine when the cache entry was last touched.
virtual int32_t getTouchCount () const
 Determine the number of times that the cache entry has been touched.
virtual size32_t getUnits () const
 Determine the number of cache units used by this Entry.
virtual void setExpiryMillis (int64_t lMillis)
 Specify when the cache entry will expire, or disable expiry.
virtual void setUnits (int32_t cUnits)
 Specify the number of cache units used by this Entry.

Protected Member Functions

 Entry (Object::View vKey, Object::Holder ohValue, size32_t nHash, OldCache::Handle hCache)
 Create a new OldCache::Entry.
 Entry (const Entry &that)
 Copy constructor.
 Entry (Entry::View vThat)
 Copy an Entry.
virtual void discard ()
 Called to inform the Entry that it is no longer used.
virtual bool isDiscarded ()
 Determine if this entry has already been discarded from the cache.
virtual void scheduleExpiry ()
 Reschedule the cache entry expiration.
virtual void touch ()
 Called each time the entry is accessed or modified.
virtual void resetTouchCount ()
 Reset the number of times that the cache entry has been touched.
virtual size32_t calculateUnits (Object::Holder ohValue)
 Calculate a cache cost for the specified object.

Protected Attributes

Volatile< int64_t > m_dtCreated
 The time at which this entry was created.
Volatile< int64_t > m_dtLastUse
 The time at which this Entry was last accessed.
Volatile< int64_t > m_dtExpiry
 The time at which this Entry will (or did) expire.
int32_t m_cUses
 The number of times that this Entry has been accessed.
size32_t m_cUnits
 The number of units for the Entry.
FinalHandle< OldCachef_hCache
 Reference back to the original cache.

Constructor & Destructor Documentation

Entry ( Object::View  vKey,
Object::Holder  ohValue,
size32_t  nHash,
OldCache::Handle  hCache 
) [protected]

Create a new OldCache::Entry.

Parameters:
vKey the associated key
ohValue the associated value
nHash the associated hash code
hCache reference to the cache containing this entry

Entry ( Entry::View  vThat  )  [protected]

Copy an Entry.

Parameters:
vThat the entry to copy


Member Function Documentation

virtual bool isExpired (  )  const [virtual]

Determine if the cache entry has expired.

Returns:
true if the cache entry was subject to automatic expiry and the current time is greater than the entry's expiry time

virtual int32_t getPriority (  )  const [virtual]

Calculate a cache priority.

Returns:
a value between 0 and 10, 0 being the highest priority

virtual bool isDiscarded (  )  [protected, virtual]

Determine if this entry has already been discarded from the cache.

Returns:
true if this entry has been discarded

virtual void resetTouchCount (  )  [protected, virtual]

Reset the number of times that the cache entry has been touched.

The touch count does not get reset to zero, but rather to a fraction of its former self; this prevents long lived items from gaining an unassailable advantage in the eviction process.

Since:
Coherence 3.5

virtual size32_t calculateUnits ( Object::Holder  ohValue  )  [protected, virtual]

Calculate a cache cost for the specified object.

The default implementation uses the unit calculator type of the containing cache.

Parameters:
ohValue the cache value to evaluate for unit cost
Returns:
an integer value 0 or greater, with a larger value signifying a higher cost

virtual int64_t getCreatedMillis (  )  const [virtual]

Determine when the cache entry was created.

Returns:
the date/time value, in millis, when the entry was created

virtual int64_t getExpiryMillis (  )  const [virtual]

Determine when the cache entry will expire, if ever.

Returns:
the date/time value, in millis, when the entry will (or did) expire; zero indicates no expiry

virtual int64_t getLastTouchMillis (  )  const [virtual]

Determine when the cache entry was last touched.

Returns:
the date/time value, in millis, when the entry was most recently touched

virtual int32_t getTouchCount (  )  const [virtual]

Determine the number of times that the cache entry has been touched.

Returns:
the number of times that the cache entry has been touched

virtual size32_t getUnits (  )  const [virtual]

Determine the number of cache units used by this Entry.

Returns:
an integer value 0 or greater, with a larger value signifying a higher cost; -1 implies that the Entry has been discarded

virtual void setExpiryMillis ( int64_t  lMillis  )  [virtual]

Specify when the cache entry will expire, or disable expiry.

Note that if the cache is configured for automatic expiry, each subsequent update to this cache entry will reschedule the expiry time.

Parameters:
lMillis pass the date/time value, in millis, for when the entry will expire, or pass zero to disable automatic expiry

virtual void setUnits ( int32_t  cUnits  )  [virtual]

Specify the number of cache units used by this Entry.

Parameters:
cUnits an integer value 0 or greater, with a larger value


The documentation for this class was generated from the following file:
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.