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

Perform Remote Filtering/Conversion in a single step

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

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 7.2.0.Final
    • 7.1.0.Final
    • Listeners
    • None

      I want to have filter and convert take place in one step ie. do filtering and conversion applied to REMOTE LISTENERS in one step

      a) I define CacheEventConverterFactory which implements CacheEventConverterFactory, Serializable
      b) I register on the server org.infinispan.notifications.cachelistener.filter.CacheEventConverterFactory the cache event converter
      which returns (CacheEventConverter<K, V, C>) new SharesDynamicFilterConverter(params);
      c) I then define CacheEventFilterFactory which implements CacheEventFilterFactory, Serializable {
      and returns(CacheEventFilter<K, V>) new SharesDynamicFilterConverter(params);
      d) The CustomeDynamicFilterConverter extends AbstractCacheEventFilterConverter<String, Share, ShareProgress> implements Serializable {
      and has the implementation of
      public Share filterAndConvert(String key, Share oldValue, Metadata oldMetadata, Share newValue, Metadata newMetadata, EventType eventType) {
      e) finally I define a listener binding it to the filter and converter
      @ClientListener(filterFactoryName = "custom-dynamic-filter",
      converterFactoryName = "custom-dynamic-converter",
      includeCurrentState = true)

      and register it along with params for the filter on the client side
      cache.addClientListener(listener, new Object[]

      {"NYX", 50f}, null);


      The result of this is that certainly both accept and convert methods are run and both call the same filterAndConvert method on SharesDynamicFilterConverter

      However, this is not desirable as I don't want 2 steps which will effectively do the same thing but a single step. TBH I am not happy with the solution but what I did (in absence of better understanding of how to combine the steps -NOTE there is no single Factory for both Converter and Filter and even if it did we would probably have to implement accept & convert inside so the end result would have been the same)

      So what I did was to change the last step
      ie.
      e) finally I define a listener binding ONLY the converter
      @ClientListener(converterFactoryName = "murex-dynamic-converter", includeCurrentState = true)

      and register it along with params ONLY for the converter on the client side
      cache.addClientListener(listener, null, new Object[]{"NYX", 50f}

      );

      This works as it actually does the filter during the convert step BUT is there another way and am I missing something? If not this would be a feature request

            [ISPN-5222] Perform Remote Filtering/Conversion in a single step

            Martin Gencur <mgencur@redhat.com> changed the Status of bug 1211944 from ON_QA to VERIFIED

            RH Bugzilla Integration added a comment - Martin Gencur <mgencur@redhat.com> changed the Status of bug 1211944 from ON_QA to VERIFIED

            Dave Stahl <dstahl@redhat.com> changed the Status of bug 1211944 from MODIFIED to ON_QA

            RH Bugzilla Integration added a comment - Dave Stahl <dstahl@redhat.com> changed the Status of bug 1211944 from MODIFIED to ON_QA

            Dave Stahl <dstahl@redhat.com> changed the Status of bug 1211944 from POST to MODIFIED

            RH Bugzilla Integration added a comment - Dave Stahl <dstahl@redhat.com> changed the Status of bug 1211944 from POST to MODIFIED

            Adrian Nistor <anistor@redhat.com> changed the Status of bug 1211944 from ASSIGNED to POST

            RH Bugzilla Integration added a comment - Adrian Nistor <anistor@redhat.com> changed the Status of bug 1211944 from ASSIGNED to POST

            Integrated. Thanks rh-ee-galder!

            Adrian Nistor (Inactive) added a comment - Integrated. Thanks rh-ee-galder !

            anistor, see PR for details

            Galder Zamarreño added a comment - anistor , see PR for details

            rh-ee-galder I'm curious how are you planning to solve this.

            Adrian Nistor (Inactive) added a comment - rh-ee-galder I'm curious how are you planning to solve this.

              rh-ee-galder Galder Zamarreño
              rhn-gps-stkousso STYLIANOS Kousouris
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: