Class MarshallerContextImpl

    • Method Detail

      • onMappingDataReceived

        public void onMappingDataReceived​(IgniteLogger log,
                                          List<Map<Integer,​MappedName>> mappings)
        Parameters:
        log - Ignite logger.
        mappings - All marshaller mappings to write.
      • checkHasClassName

        public void checkHasClassName​(String clsName,
                                      ClassLoader ldr,
                                      String fileName)
        Parameters:
        clsName - Class name.
        ldr - Class loader used to get properties file.
        fileName - File name.
      • registerClassName

        public boolean registerClassName​(byte platformId,
                                         int typeId,
                                         String clsName,
                                         boolean failIfUnregistered)
                                  throws IgniteCheckedException
        Method to register typeId->class name mapping in marshaller context <b>cluster-wide</b>. This method guarantees that mapping is delivered to all nodes in cluster and blocks caller thread until then.
        Specified by:
        registerClassName in interface MarshallerContext
        Parameters:
        platformId - Id of a platform (java, .NET, etc.) to register mapping for.
        typeId - Type ID.
        clsName - Class name.
        failIfUnregistered - If true then throw UnregisteredBinaryTypeException with registration future instead of synchronously awaiting for its completion.
        Returns:
        True if mapping was registered successfully.
        Throws:
        IgniteCheckedException - In case of error.
      • registerClassNameLocally

        public boolean registerClassNameLocally​(byte platformId,
                                                int typeId,
                                                String clsName)
                                         throws IgniteCheckedException
        Method to register typeId->class name mapping in marshaller context <b>on local node only</b>. No guarantees that the mapping is presented on other nodes are provided. This method is safe to use if there is another source of mappings like metadata persisted on disk and this source is known to be solid and free of conflicts beforehand.
        Specified by:
        registerClassNameLocally in interface MarshallerContext
        Parameters:
        platformId - Id of a platform (java, .NET, etc.) to register mapping for.
        typeId - Type id.
        clsName - Class name.
        Returns:
        True if class mapping was registered successfully.
        Throws:
        IgniteCheckedException - In case of error.
      • unregisterClassNameLocally

        public void unregisterClassNameLocally​(int typeId)
        Remove mapping for appropriate type locally.
      • onMappingProposed

        public MappedName onMappingProposed​(MarshallerMappingItem item)
        Parameters:
        item - type mapping to propose
        Returns:
        null if cache doesn't contain any mappings for given (platformId, typeId) pair, previous mapped name otherwise.
      • onMappingAccepted

        public void onMappingAccepted​(MarshallerMappingItem item)
        Parameters:
        item - Item.
      • resolveMissedMapping

        public String resolveMissedMapping​(byte platformId,
                                           int typeId)
        Parameters:
        platformId - Platform id.
        typeId - Type id.
      • isSystemType

        public boolean isSystemType​(String typeName)
        Checks whether the given type is a system one - JDK class or Ignite class.
        Specified by:
        isSystemType in interface MarshallerContext
        Parameters:
        typeName - Type name.
        Returns:
        true if the type is a system one, false otherwise.
      • resolveMappingFileStoreWorkDir

        public static File resolveMappingFileStoreWorkDir​(String igniteWorkDir)
        Parameters:
        igniteWorkDir - Base ignite working directory.
        Returns:
        Resolved directory.
      • mappingFileStoreWorkDir

        public static File mappingFileStoreWorkDir​(String igniteWorkDir)
        Parameters:
        igniteWorkDir - Base ignite working directory.
        Returns:
        Work directory for marshaller mappings.
      • onMarshallerProcessorStop

        public void onMarshallerProcessorStop()
      • initialized

        public boolean initialized()
        Returns:
        True if marshaller context is initialized.
      • setMarshallerMappingFileStoreDir

        public void setMarshallerMappingFileStoreDir​(@Nullable
                                                     @Nullable File marshallerMappingFileStoreDir)
        Sets custom marshaller mapping files directory. Used for standalone WAL iteration
        Parameters:
        marshallerMappingFileStoreDir - directory with type name mappings