Interface BinariesFactory


  • public interface BinariesFactory
    Factory for binaries classes creation.
    • Method Detail

      • reader

        BinaryReaderEx reader​(BinaryContext ctx,
                              BinaryInputStream in,
                              ClassLoader ldr,
                              @Nullable
                              @Nullable org.apache.ignite.internal.binary.BinaryReaderHandles hnds,
                              boolean forUnmarshal)
        Creates reader instance.
        Parameters:
        ctx - Context.
        in - Input stream.
        ldr - Class loader.
        hnds - Context.
        forUnmarshal - True if reader is needed to unmarshal object.
      • reader

        BinaryReaderEx reader​(BinaryContext ctx,
                              BinaryInputStream in,
                              ClassLoader ldr,
                              @Nullable
                              @Nullable org.apache.ignite.internal.binary.BinaryReaderHandles hnds,
                              boolean skipHdrCheck,
                              boolean forUnmarshal)
        Constructor.
        Parameters:
        ctx - Context.
        in - Input stream.
        ldr - Class loader.
        hnds - Context.
        skipHdrCheck - Whether to skip header check.
        forUnmarshal - True if reader is needed to unmarshal object.
      • writer

        BinaryWriterEx writer​(BinaryContext ctx,
                              boolean failIfUnregistered,
                              int typeId)
        Parameters:
        ctx - Context.
        failIfUnregistered - Flag to fail while writing object of unregistered type.
        typeId - Type id.
        Returns:
        Writer instance.
      • writer

        BinaryWriterEx writer​(BinaryContext ctx,
                              BinaryOutputStream out,
                              org.apache.ignite.internal.binary.BinaryWriterSchemaHolder schema)
        Parameters:
        ctx - Context.
        out - Output stream.
        schema - Schema holder
        Returns:
        Writer instance.
      • create

        org.apache.ignite.internal.binary.BinaryFieldDescriptor create​(Field field,
                                                                       int id)
        Create accessor for the field.
        Parameters:
        field - Field.
        id - Field ID.
        Returns:
        Accessor.
      • binaryEnum

        BinaryObjectEx binaryEnum​(BinaryContext ctx,
                                  int typeId,
                                  @Nullable
                                  @Nullable String clsName,
                                  int ord)
        Creates binary enum.
        Parameters:
        typeId - Type ID.
        clsName - Class name.
        ord - Ordinal.
        ctx - Context.
      • binaryEnum

        BinaryObjectEx binaryEnum​(BinaryContext ctx,
                                  byte[] arr)
        Creates binary enum.
        Parameters:
        ctx - Context.
        arr - Array.
      • binaryOffheapObject

        BinaryObjectEx binaryOffheapObject​(BinaryContext ctx,
                                           long ptr,
                                           int start,
                                           int size)
        Parameters:
        ctx - Context.
        ptr - Memory address.
        start - Object start.
        size - Memory size.
        Returns:
        Binary object based on offheap memory.
      • binaryEnumClass

        Class<?> binaryEnumClass()
        Returns:
        Binary enum class.
      • binaryObjectImplClass

        Class<?> binaryObjectImplClass()
        Returns:
        Binary object impl class.
      • predefinedTypes

        Map<Class<?>,​Integer> predefinedTypes()
        Returns:
        Map of predefined types.
      • compareForDml

        int compareForDml​(Object first,
                          Object second)
        Compare two objects for DML operation.
        Parameters:
        first - First.
        second - Second.
        Returns:
        Comparison result which is aligned with the Comparator.compare(Object, Object) contract.
      • arrayIdentityResolver

        org.apache.ignite.internal.binary.BinaryIdentityResolver arrayIdentityResolver()