Class CacheVersionIO

    • Constructor Detail

      • CacheVersionIO

        public CacheVersionIO()
    • Method Detail

      • size

        public static int size​(GridCacheVersion ver,
                               boolean allowNull)
        Parameters:
        ver - Version.
        allowNull - Is null version allowed.
        Returns:
        Serialized size in bytes.
      • write

        public static void write​(ByteBuffer buf,
                                 GridCacheVersion ver,
                                 boolean allowNull)
        Parameters:
        buf - Byte buffer.
        ver - Version to write.
        allowNull - Is null version allowed.
      • write

        public static void write​(long addr,
                                 GridCacheVersion ver,
                                 boolean allowNull)
        Parameters:
        addr - Write address.
        ver - Version to write.
        allowNull - Is null version allowed.
      • readSize

        public static int readSize​(ByteBuffer buf,
                                   boolean allowNull)
                            throws IgniteCheckedException
        Gets needed buffer size to read the whole version instance. Does not change buffer position.
        Parameters:
        buf - Buffer.
        allowNull - Is null version allowed.
        Returns:
        Size of serialized version.
        Throws:
        IgniteCheckedException - If failed.
      • readSize

        public static int readSize​(long pageAddr,
                                   boolean allowNull)
                            throws IgniteCheckedException
        Gets needed buffer size to read the whole version instance. Does not change buffer position.
        Parameters:
        pageAddr - Page address.
        allowNull - Is null version allowed.
        Returns:
        Size of serialized version.
        Throws:
        IgniteCheckedException - If failed.
      • read

        public static GridCacheVersion read​(ByteBuffer buf,
                                            boolean allowNull)
                                     throws IgniteCheckedException
        Reads GridCacheVersion instance from the given buffer. Moves buffer's position by the number of used bytes.
        Parameters:
        buf - Byte buffer.
        allowNull - Is null version allowed.
        Returns:
        Version.
        Throws:
        IgniteCheckedException - If failed.
      • read

        public static GridCacheVersion read​(long pageAddr,
                                            boolean allowNull)
                                     throws IgniteCheckedException
        Reads GridCacheVersion instance from the given address.
        Parameters:
        pageAddr - Page address.
        allowNull - Is null version allowed.
        Returns:
        Version.
        Throws:
        IgniteCheckedException - If failed.