Interface CdcConsumer

    • Method Detail

      • start

        void start​(MetricRegistry mreg)
        Starts the consumer.
        Parameters:
        mreg - Metric registry for consumer specific metrics.
      • onEvents

        boolean onEvents​(Iterator<CdcEvent> events)
        Handles entry changes events. If this method return true then current offset will be stored and ongoing notifications after CDC application fail/restart will be started from it.
        Parameters:
        events - Entry change events.
        Returns:
        True if current offset should be saved on the disk to continue from it in case any failures or restart.
      • onMappings

        void onMappings​(Iterator<TypeMapping> mappings)
        Handles new mappings from type name to id. State of the types processing will be stored after method invocation and ongoing notifications after CDC application fail/restart will be continued for newly created/updates mappings.
        Parameters:
        mappings - Binary mapping iterator.
        See Also:
        IgniteBinary, IgniteBinary.typeId(String), BinaryIdMapper
      • onCacheDestroy

        void onCacheDestroy​(Iterator<Integer> caches)
        Handles cache destroy events. State of cache processing will be stored after method invocation and ongoing notifications after CDC application fail/restart will be continued for newly changed caches.
        Parameters:
        caches - Destroyed caches.
        See Also:
        Ignite.destroyCache(String), CdcCacheEvent, CacheView.cacheId()
      • alive

        default boolean alive()
        Checks that consumer still alive. This method helps to determine CdcConsumer errors in case CdcEvent is rare or source cluster is down.
        Returns:
        True in case consumer alive, false otherwise.