Interface MaintenanceRegistry


  • public interface MaintenanceRegistry
    MaintenanceRegistry is a service local to each Ignite node that allows to request performing maintenance actions on that particular node.

    When a node gets into a situation when some specific actions are required it enters the special mode called maintenance mode. In maintenance mode it doesn't join to the rest of the cluster but still allows to connect to it with control.{sh|bat} script or via JXM interface and perform needed actions.

    Implementing new task for maintenance mode requires several pieces of code.

    • Method Detail

      • isMaintenanceMode

        boolean isMaintenanceMode()
        Returns:
        True if any maintenance task was found.
      • registerMaintenanceTask

        @Nullable
        @Nullable MaintenanceTask registerMaintenanceTask​(MaintenanceTask task)
                                                   throws IgniteCheckedException
        Method to register MaintenanceTask locally on the node where method is called.

        For now it is not allowed to register new Maintenance Tasks in Maintenance Mode so this method should be called only when node operates normally. This may change in the future so it will become possible to create other maintenance tasks on node that is already entered Maintenance Mode.

        When task is registered node continues to operate normally and will enter Maintenance Mode only after restart.

        Parameters:
        task - MaintenanceTask object with maintenance information that needs to be stored to maintenance registry.
        Returns:
        Previously registered MaintenanceTask with the same ID or null if no tasks were registered for this ID.
        Throws:
        IgniteCheckedException - If handling or storing maintenance task failed.
      • unregisterMaintenanceTask

        boolean unregisterMaintenanceTask​(String maintenanceTaskName)
        Deletes MaintenanceTask of given ID from maintenance registry.
        Parameters:
        maintenanceTaskName - name of MaintenanceTask to be deleted.
        Returns:
        true if existing task has been deleted.
      • activeMaintenanceTask

        @Nullable
        @Nullable MaintenanceTask activeMaintenanceTask​(String maintenanceTaskName)
        Returns active MaintenanceTask by its name. There are active tasks only when node entered Maintenance Mode. MaintenanceTask becomes active when node enters Maintenance Mode and doesn't resolve the task during maintenance prepare phase.
        Parameters:
        maintenanceTaskName - Maintenance Task name.
        Returns:
        MaintenanceTask object for given name or null if no maintenance task was found.
      • prepareAndExecuteMaintenance

        void prepareAndExecuteMaintenance()
        Examine all components if they need to execute maintenance actions. As user may resolve some maintenance situations by hand when the node was turned off, component may find out that no maintenance is needed anymore. Maintenance tasks for these components are removed and their maintenance actions are not executed.
      • requestedTask

        @Nullable
        @Nullable MaintenanceTask requestedTask​(String maintenanceTaskName)
        Parameters:
        maintenanceTaskName - Task's name.
        Returns:
        Requested maintenance task or null.