docs: protected HashtableEntry mapPut(Object key,
                                      Object value,
                                      int length,
                                      long expirationTime,
                                      long validatorExpirationTime,
                                      byte[] serializedKey,
                                      byte[] serializedCacheValue,
                                      int valueHashcode,
                                      boolean isAliasId) // LI4337-17
      throws IOException,
                      EOFException,
                      FileManagerException,
                      ClassNotFoundException,
                      HashtableOnDiskException {
          if (filemgr == null) {
              throw new HashtableOnDiskException("No Filemanager");
          }
  
          write_requests++;
  
          if (key == null)
              return null;
  
          //
          // Lets rehash if needed.  If the put is a simple replace this rehash
          // is technicaly not required, but detecting that case and handling
          // it specially not only complicates the code but requires an extra
          // fetch or two from disk which seems silly.  So we just rehash
          // immediately (we probably would be rehashing soon anyway, if we
          // are that close to the threshold).
          //
          if (auto_rehash) {
              if (header.num_objects() + 1 > threshold) {
                  if (header.rehashInProgress == 0) {
                      rehash(); // time to grow the table
                  }
              }
          }
  
          HashtableEntry e = findEntry(key, RETRIEVE_KEY, !CHECK_EXPIRED);
  
          if (e == null) { // cannot find the item
              int tableid = header.getTableidForNewEntry();
              HashtableEntry newEntry = htoddc.getFromHashtableEntryPool();
              newEntry.copy(key, value, header.tablesize(tableid), tableid, length, 0, expirationTime, validatorExpirationTime,
                            serializedKey, serializedCacheValue, valueHashcode, isAliasId); // LI4337-17
  
              writeEntry(newEntry); // write entry, update old entry
                                    // to chain in e, update hashtable
              header.incrementObjectCount(); // if necessary
              filemgr.flush();
              htoddc.returnToHashtableEntryPool(newEntry);
          } else {
              if (value == null) { // value is null when putting cache id for the dependency. return because the cache id already exists
                  return null;
              }
              // Create HashtableEntry of old entry with key, size and expiration. These attributes will be used later in HTODDynacache 
              // to remove an old entry from eviction table.
              HashtableEntry oldEntry = htoddc.getFromHashtableEntryPool();
              oldEntry.key = e.key;
              oldEntry.size = e.size;
              oldEntry.expiration = e.expiration;
  
              //Object old_value = e.getValue();            // save for Map interface return
              long old_location = e.location; // save locaction of old space to free
              e.value = value; // update new data
              e.valuelen = length; // optional maxlen for byte[]
              e.expiration = expirationTime; // update expiration time 
              e.serializedKey = serializedKey; // update serialized key
              e.serializedCacheValue = serializedCacheValue; // update serialized cache value
              e.bAliasId = isAliasId; // update alias id indicator
              e.validatorExpiration = validatorExpirationTime; // update validator expiration time
              e.cacheValueHashcode = valueHashcode; // update cache value hashcode 
              if (getHtindex(e.index, e.tableid) == e.location) { // make sure the cached index
                  updateHtindex(e.index, e.next, e.tableid); //    is "deallocated"
              }
              e.location = 0; // force reallocation
              writeEntry(e); // send to disk
              filemgr.deallocate(old_location); // free old space
              filemgr.flush();
              write_replacements++;
              htoddc.returnToHashtableEntryPool(e);
              //return old_value;                  //all done
              return oldEntry; // all done
          }
  
          return null;
      }