com.caucho.server.distcache
Class MnodeEntry

java.lang.Object
  extended by com.caucho.server.distcache.MnodeValue
      extended by com.caucho.server.distcache.MnodeEntry
All Implemented Interfaces:
java.io.Serializable

public final class MnodeEntry
extends MnodeValue

An entry in the cache map

See Also:
Serialized Form

Field Summary
static long ANY_KEY
           
static MnodeEntry NULL
           
static long NULL_KEY
           
 
Constructor Summary
MnodeEntry(long valueHash, long valueLength, long version, long flags, long accessedExpireTimeout, long modifiedExpireTimeout, long leaseExpireTimeout, long valueDataId, java.lang.Object value, long lastAccessTime, long lastModifiedTime, boolean isServerVersionValid, boolean isImplicitNull)
           
MnodeEntry(MnodeEntry oldMnodeValue, long valueDataId, long accessTimeout, long lastAccessTime)
           
MnodeEntry(MnodeValue mnodeValue, long valueDataId, java.lang.Object value, long lastAccessTime, long lastModifiedTime, boolean isServerVersionValid, boolean isImplicitNull, int leaseOwner)
           
 
Method Summary
 void clearLease()
          Sets the owner
 void clearLease(int oldLeaseOwner)
          Sets the owner
 int compareTo(MnodeEntry mnode)
          Compares values
static MnodeEntry createInitialNull(CacheConfig config)
           
 long getAccessExpireTimeoutWindow()
          Returns the idle window to avoid too many updates
 java.sql.Blob getBlob()
           
 long getExpirationTime()
          Returns the expiration time
 int getHits()
           
 long getLastAccessedTime()
          Returns the last access time.
 long getLastModifiedTime()
          Returns the last update time.
 long getLastRemoteAccessTime()
          Returns the last remote access time.
 int getLeaseOwner()
          Returns the lease owner
 MnodeUpdate getRemoteUpdate()
          Creates an update with local data removed for remote update.
 java.lang.Object getValue()
          Returns the deserialized value for the entry.
 long getValueDataId()
           
 boolean isExpired(long now)
          Returns true is the entry has expired for being idle or having expired.
 boolean isIdleExpired(long now)
          Returns true is the entry has remained idle too long.
 boolean isImplicitNull()
          If the null value is due to a missing item in the database.
 boolean isLeaseExpired(long now)
           
 boolean isLocalExpired(int serverIndex, long now, CacheConfig config)
          Returns true if the local (unchecked) expire time.
 boolean isLocalExpired(int serverIndex, long now, long localExpireTimeout)
           
 boolean isServerVersionValid()
          Returns true if the server version (startup count) matches the database.
 boolean isUnloadedValue()
           
 boolean isValid()
           
 boolean isValueExpired(long now)
          Returns true if the value of the entry has expired.
 boolean isValueNull()
          Returns true if the value is null
 void setBlob(java.sql.Blob blob)
           
 void setLastAccessTime(long accessTime)
          Sets the last access time.
 void setLastRemoteAccessTime(long accessTime)
          Sets the last remote access time.
 void setLeaseOwner(int leaseOwner, long now)
          Sets the owner
 void setObjectValue(java.lang.Object value)
          Sets the deserialized value for the entry.
 java.lang.String toString()
           
 MnodeEntry updateModifiedTime(long now)
           
 
Methods inherited from class com.caucho.server.distcache.MnodeValue
getAccessedExpireTimeout, getFlags, getLeaseExpireTimeout, getModifiedExpireTimeout, getUserFlags, getValueHash, getValueLength, getVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL

public static final MnodeEntry NULL

NULL_KEY

public static final long NULL_KEY
See Also:
Constant Field Values

ANY_KEY

public static final long ANY_KEY
Constructor Detail

MnodeEntry

public MnodeEntry(long valueHash,
                  long valueLength,
                  long version,
                  long flags,
                  long accessedExpireTimeout,
                  long modifiedExpireTimeout,
                  long leaseExpireTimeout,
                  long valueDataId,
                  java.lang.Object value,
                  long lastAccessTime,
                  long lastModifiedTime,
                  boolean isServerVersionValid,
                  boolean isImplicitNull)

MnodeEntry

public MnodeEntry(MnodeValue mnodeValue,
                  long valueDataId,
                  java.lang.Object value,
                  long lastAccessTime,
                  long lastModifiedTime,
                  boolean isServerVersionValid,
                  boolean isImplicitNull,
                  int leaseOwner)

MnodeEntry

public MnodeEntry(MnodeEntry oldMnodeValue,
                  long valueDataId,
                  long accessTimeout,
                  long lastAccessTime)
Method Detail

createInitialNull

public static MnodeEntry createInitialNull(CacheConfig config)

updateModifiedTime

public MnodeEntry updateModifiedTime(long now)

getValueDataId

public long getValueDataId()

getLastAccessedTime

public long getLastAccessedTime()
Returns the last access time.


setLastAccessTime

public void setLastAccessTime(long accessTime)
Sets the last access time.


getLastRemoteAccessTime

public long getLastRemoteAccessTime()
Returns the last remote access time.


setLastRemoteAccessTime

public void setLastRemoteAccessTime(long accessTime)
Sets the last remote access time.


getLastModifiedTime

public long getLastModifiedTime()
Returns the last update time.


getExpirationTime

public final long getExpirationTime()
Returns the expiration time


isLocalExpired

public final boolean isLocalExpired(int serverIndex,
                                    long now,
                                    CacheConfig config)
Returns true if the local (unchecked) expire time.


isLocalExpired

public final boolean isLocalExpired(int serverIndex,
                                    long now,
                                    long localExpireTimeout)

isLeaseExpired

public final boolean isLeaseExpired(long now)

isExpired

public final boolean isExpired(long now)
Returns true is the entry has expired for being idle or having expired.


isValueExpired

public final boolean isValueExpired(long now)
Returns true if the value of the entry has expired.


isIdleExpired

public final boolean isIdleExpired(long now)
Returns true is the entry has remained idle too long.


getLeaseOwner

public final int getLeaseOwner()
Returns the lease owner


setLeaseOwner

public final void setLeaseOwner(int leaseOwner,
                                long now)
Sets the owner


clearLease

public final void clearLease()
Sets the owner


clearLease

public final void clearLease(int oldLeaseOwner)
Sets the owner


getAccessExpireTimeoutWindow

public long getAccessExpireTimeoutWindow()
Returns the idle window to avoid too many updates


setObjectValue

public final void setObjectValue(java.lang.Object value)
Sets the deserialized value for the entry.


isValueNull

public boolean isValueNull()
Returns true if the value is null


getValue

public final java.lang.Object getValue()
Returns the deserialized value for the entry.


getBlob

public java.sql.Blob getBlob()

setBlob

public void setBlob(java.sql.Blob blob)

getRemoteUpdate

public MnodeUpdate getRemoteUpdate()
Creates an update with local data removed for remote update.


isServerVersionValid

public boolean isServerVersionValid()
Returns true if the server version (startup count) matches the database.


isImplicitNull

public boolean isImplicitNull()
If the null value is due to a missing item in the database.


isUnloadedValue

public boolean isUnloadedValue()

compareTo

public int compareTo(MnodeEntry mnode)
Compares values


isValid

public boolean isValid()

getHits

public int getHits()

toString

public java.lang.String toString()
Overrides:
toString in class MnodeValue