Class GridCacheReturn

    • Constructor Detail

      • GridCacheReturn

        public GridCacheReturn()
        Empty constructor.
      • GridCacheReturn

        public GridCacheReturn​(boolean loc)
        Parameters:
        loc - True if created on the node initiated cache operation.
      • GridCacheReturn

        public GridCacheReturn​(boolean loc,
                               boolean success)
        Parameters:
        loc - True if created on the node initiated cache operation.
        success - Success flag.
      • GridCacheReturn

        public GridCacheReturn​(GridCacheContext cctx,
                               boolean loc,
                               boolean keepBinary,
                               @Nullable
                               @Nullable ClassLoader ldr,
                               Object v,
                               boolean success)
        Parameters:
        cctx - Cache context.
        loc - True if created on the node initiated cache operation.
        keepBinary - True is deserialize value from a binary representation, false otherwise.
        ldr - Class loader, used for deserialization from binary representation.
        v - Value.
        success - Success flag.
    • Method Detail

      • value

        @Nullable
        public <V> V value()
        Returns:
        Value.
      • emptyResult

        public boolean emptyResult()
      • invokeResult

        public boolean invokeResult()
        Returns:
        If return is invoke result.
      • invokeResult

        public void invokeResult​(boolean invokeRes)
        Parameters:
        invokeRes - Invoke result flag.
      • value

        public GridCacheReturn value​(GridCacheContext cctx,
                                     CacheObject v,
                                     boolean keepBinary,
                                     @Nullable
                                     @Nullable ClassLoader ldr)
        Parameters:
        cctx - Cache context.
        v - Value.
        keepBinary - Keep binary flag.
        ldr - Class loader, used for deserialization from binary representation.
        Returns:
        This instance for chaining.
      • success

        public boolean success()
        Returns:
        Success flag.
      • set

        public GridCacheReturn set​(GridCacheContext cctx,
                                   @Nullable
                                   @Nullable CacheObject cacheObj,
                                   boolean success,
                                   boolean keepBinary,
                                   @Nullable
                                   @Nullable ClassLoader ldr)
        Parameters:
        cctx - Cache context.
        cacheObj - Value to set.
        success - Success flag to set.
        keepBinary - Keep binary flag.
        ldr - Class loader, used for deserialization from binary representation.
        Returns:
        This instance for chaining.
      • success

        public GridCacheReturn success​(boolean success)
        Parameters:
        success - Success flag.
        Returns:
        This instance for chaining.
      • addEntryProcessResult

        public void addEntryProcessResult​(GridCacheContext cctx,
                                          KeyCacheObject key,
                                          @Nullable
                                          @Nullable Object key0,
                                          @Nullable
                                          @Nullable Object res,
                                          @Nullable
                                          @Nullable Exception err,
                                          boolean keepBinary)
        Parameters:
        cctx - Context.
        key - Key.
        key0 - Key value.
        res - Result.
        err - Error.
        keepBinary - Keep binary.
      • cacheId

        public int cacheId()
        Returns:
        Cache ID.
      • mergeEntryProcessResults

        public void mergeEntryProcessResults​(GridCacheReturn other)
        Parameters:
        other - Other result to merge with.
      • marshalResult

        public void marshalResult​(GridCacheContext ctx)
        Converts entry processor invokation results to cache object instances.
        Parameters:
        ctx - Cache context.
      • onAckReceived

        public void onAckReceived()
        Method called when ack message received.
        Specified by:
        onAckReceived in interface Message
      • directType

        public short directType()
        Gets message type.
        Specified by:
        directType in interface Message
        Returns:
        Message type.
      • writeTo

        public boolean writeTo​(ByteBuffer buf,
                               MessageWriter writer)
        Writes this message to provided byte buffer.
        Specified by:
        writeTo in interface Message
        Parameters:
        buf - Byte buffer.
        writer - Writer.
        Returns:
        Whether message was fully written.
      • readFrom

        public boolean readFrom​(ByteBuffer buf,
                                MessageReader reader)
        Reads this message from provided byte buffer.
        Specified by:
        readFrom in interface Message
        Parameters:
        buf - Byte buffer.
        reader - Reader.
        Returns:
        Whether message was fully read.
      • fieldsCount

        public byte fieldsCount()
        Gets fields count.
        Specified by:
        fieldsCount in interface Message
        Returns:
        Fields count.