Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-8331

CacheEntryExpiredEvent.getValue() is always null when entry expired from cache store

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    • Icon: Enhancement Enhancement
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 9.1.1.Final
    • Expiration
    • None

      AdvancedCacheWriter.PurgeListener callback only sends the key of the expired entry.

      Proposal:
      AdvancedCacheWriter.PurgeListener.entryPurged(MarshalledEntry entry);

      This way, we only incur the cost of unmarshalling value/metadata when requested.

            [ISPN-8331] CacheEntryExpiredEvent.getValue() is always null when entry expired from cache store

            Infinispan issue tracking has been migrated to GitHub issues: https://github.com/infinispan/infinispan/issues
            If you still want this issue to be worked on, create a new issue on GitHub and link this issue.

            Tristan Tarrant added a comment - Infinispan issue tracking has been migrated to GitHub issues: https://github.com/infinispan/infinispan/issues If you still want this issue to be worked on, create a new issue on GitHub and link this issue.

            The API for this is already implemented by wburns@redhat.com with @Experimental org.infinispan.persistence.spi.AdvancedCacheExpirationWriter.ExpirationPurgeListener#marshalledEntryPurged. The problem of course is that none of the stores currently implement this.

            If we do, we may want to provide a way to optionally pull the value such as a `Supplier` to get the value.

            Why would this be necessary? The implenters would return implementation of the org.infinispan.marshall.core.MarshalledEntry which would proxy the getValueBytes() and getValue() method calls.

            Radoslav Husar added a comment - The API for this is already implemented by wburns@redhat.com with @Experimental org.infinispan.persistence.spi.AdvancedCacheExpirationWriter.ExpirationPurgeListener#marshalledEntryPurged . The problem of course is that none of the stores currently implement this. If we do, we may want to provide a way to optionally pull the value such as a `Supplier` to get the value. Why would this be necessary? The implenters would return implementation of the org.infinispan.marshall.core.MarshalledEntry which would proxy the getValueBytes() and getValue() method calls.

            wburns@redhat.com Why not PurgeListener.entryPurged(MarshalledEntry entry)?
            That way both values and meta data are exposed, yet unmarshalled lazily.

            Paul Ferraro added a comment - wburns@redhat.com Why not PurgeListener.entryPurged(MarshalledEntry entry)? That way both values and meta data are exposed, yet unmarshalled lazily.

            Will Burns added a comment -

            Unfortunately this is the way the loader spi was implemented. I would love to change this to support values as well. If we do, we may want to provide a way to optionally pull the value such as a `Supplier` to get the value. I am not sure if we have implementations that it may be very costly to pull the value or not.

            Also cc/ remerson@redhat.com since he has been dealing with loaders recently.

            Will Burns added a comment - Unfortunately this is the way the loader spi was implemented. I would love to change this to support values as well. If we do, we may want to provide a way to optionally pull the value such as a `Supplier` to get the value. I am not sure if we have implementations that it may be very costly to pull the value or not. Also cc/ remerson@redhat.com since he has been dealing with loaders recently.

              Unassigned Unassigned
              pferraro@redhat.com Paul Ferraro
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: