Class CacheEvent

    • Constructor Detail

      • CacheEvent

        public CacheEvent​(String cacheName,
                          ClusterNode node,
                          @Nullable
                          @Nullable ClusterNode evtNode,
                          String msg,
                          int type,
                          int part,
                          boolean near,
                          Object key,
                          IgniteUuid xid,
                          String txLbl,
                          Object lockId,
                          Object newVal,
                          boolean hasNewVal,
                          Object oldVal,
                          boolean hasOldVal,
                          UUID subjId,
                          String cloClsName,
                          String taskName)
        Constructs cache event.
        Parameters:
        cacheName - Cache name.
        node - Local node.
        evtNode - Event node ID.
        msg - Event message.
        type - Event type.
        part - Partition for the event (usually the partition the key belongs to).
        near - Flag indicating whether event happened on near or partitioned cache.
        key - Cache key.
        xid - Transaction ID.
        txLbl - Transaction label.
        lockId - Lock ID.
        newVal - New value.
        hasNewVal - Flag indicating whether new value is present in case if we don't have it in deserialized form.
        oldVal - Old value.
        hasOldVal - Flag indicating whether old value is present in case if we don't have it in deserialized form.
        subjId - Subject ID.
        cloClsName - Closure class name.
        taskName - Name of the task if cache event was caused by an operation initiated within task execution.
    • Method Detail

      • cacheName

        public String cacheName()
        Gets cache name.
        Returns:
        Cache name.
      • partition

        public int partition()
        Gets partition for the event which is the partition the key belongs to.
        Returns:
        Partition for the event.
      • isNear

        public boolean isNear()
        Gets flag indicating whether event happened on near or partitioned cache.
        Returns:
        Flag indicating whether event happened on near or partitioned cache.
      • eventNode

        public ClusterNode eventNode()
        Gets node which initiated cache operation or null if that node is not available.
        Returns:
        Node which initiated cache operation or null if that node is not available.
      • key

        public <K> K key()
        Gets cache entry associated with event.
        Type Parameters:
        K - Cache entry type.
        Returns:
        Cache entry associated with event.
      • xid

        public IgniteUuid xid()
        ID of surrounding cache transaction or null if there is no surrounding transaction.
        Returns:
        ID of surrounding cache transaction.
      • txLabel

        public String txLabel()
        Label of surrounding cache transaction or null if there either is no surrounding transaction or label was not set.
        Returns:
        Label of surrounding cache transaction.
      • lockId

        public Object lockId()
        ID of the lock if held or null if no lock held.
        Returns:
        ID of the lock if held.
      • oldValue

        public Object oldValue()
        Gets old value associated with this event.
        Returns:
        Old value associated with event.
      • hasOldValue

        public boolean hasOldValue()
        Gets flag indicating whether cache entry has old value in case if we only have old value in serialized form in which case oldValue() will return null.
        Returns:
        Flag indicating whether there is old value associated with this event.
      • hasNewValue

        public boolean hasNewValue()
        Gets flag indicating whether cache entry has new value in case if we only have new value in serialized form in which case newValue() will return null.
        Returns:
        Flag indicating whether there is new value associated with this event.
      • closureClassName

        public String closureClassName()
        Gets closure class name (applicable only for TRANSFORM operations).
        Returns:
        Closure class name.
      • taskName

        public String taskName()
        Gets task name if cache event was caused by an operation initiated within task execution.
        Returns:
        Task name.
      • shortDisplay

        public String shortDisplay()
        Gets a shortened version of toString() result. Suitable for humans to read.
        Specified by:
        shortDisplay in interface Event
        Overrides:
        shortDisplay in class EventAdapter
        Returns:
        Shortened version of toString() result.