Interface OffHeapConcurrentMap.EntryListener

  • Enclosing class:
    OffHeapConcurrentMap

    public static interface OffHeapConcurrentMap.EntryListener
    Listener interface that is notified when certain operations occur for various memory addresses. Note that when this listener is used certain operations are not performed and require the listener to do these instead. Please note each method documentation to tell what those are.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void entryCreated​(long newAddress)
      Invoked when an entry is about to be created.
      void entryRemoved​(long removedAddress)
      Invoked when an entry is about to be removed.
      void entryReplaced​(long newAddress, long oldAddress)
      Invoked when an entry is about to be replaced with a new one.
      void entryRetrieved​(long entryAddress)
      Invoked when an entry is successfully retrieved.
    • Method Detail

      • entryCreated

        void entryCreated​(long newAddress)
        Invoked when an entry is about to be created. The new address is fully addressable, The write lock will already be acquired for the given segment the key mapped to.
        Parameters:
        newAddress - the address just created that will be the new entry
      • entryRemoved

        void entryRemoved​(long removedAddress)
        Invoked when an entry is about to be removed. You can read values from this but after this method is completed this memory address may be freed. The write lock will already be acquired for the given segment the key mapped to.

        This method MUST free the removedAddress before returning

        Parameters:
        removedAddress - the address about to be removed
      • entryReplaced

        void entryReplaced​(long newAddress,
                           long oldAddress)
        Invoked when an entry is about to be replaced with a new one. The old and new address are both addressable, however oldAddress may be freed after this method returns. The write lock will already be acquired for the given segment the key mapped to.

        This method MUST free the oldAddress before returning

        Parameters:
        newAddress - the address just created that will be the new entry
        oldAddress - the old address for this entry that will be soon removed
      • entryRetrieved

        void entryRetrieved​(long entryAddress)
        Invoked when an entry is successfully retrieved. The read lock will already be acquired for the given segment the key mapped to.
        Parameters:
        entryAddress - the address of the entry retrieved