public synchronized boolean updateExpirationInHeader ( Object key , long expirationTime , long validatorExpirationTime ) throws IOException , EOFException , FileManagerException , ClassNotFoundException , HashtableOnDiskException { if ( filemgr == null ) { throw new HashtableOnDiskException ( "No Filemanager" ) ; } if ( key == null ) return false ; // no null keys allowed HashtableEntry entry = findEntry ( key , RETRIEVE_KEY , ! CHECK_EXPIRED ) ; if ( entry == null ) return false ; // not found // // Seek to point to validator expiration time field in the header filemgr . seek ( entry . location + DWORDSIZE + // room for next SWORDSIZE ) ; // room for hash filemgr . writeLong ( validatorExpirationTime ) ; // update VET /* * comment out the code below because the expiration time does not change * filemgr.writeInt(0); * filemgr.writeInt(entry.cacheValueHashcode); // update cache value hashcode * filemgr.writeLong(entry.first_created); // update first created (not neccessary but move to pointer * filemgr.writeLong(expirationTime); // update RET */ htoddc . returnToHashtableEntryPool ( entry ) ; return true ; }
This method is used to update expiration times in disk entry header