Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-12225

Add enum for cluster state

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.9
    • None
    • Introduced a new public API for the cluster state change (activation/deactivation and etc.). Added ability to activate clusters in a read-only mode.
    • Hide
      Changes in a public API:
      # Introduced {{ClusterState}} enum.
      # *{{org.apache.ignite.IgniteCluster}}*:
      ## Introduced new method for the cluster state change: {{void state(ClusterState)}}
      ## Introduced new method for the getting current cluster state: {{ClusterState state()}}
      ## Deprecated methods {{void active(boolean)}} and {{boolean active()}}. Use a new methods described above.
      # *Control utility ({{control.sh}})*:
      ## Introduced new command for the cluster state change: {{control.sh --set-state INACTIVE|ACTIVE|ACTIVE_READ_ONLY [--yes]}}
      ## Deprecated activate/deactivate commands {{control.sh --activate}}, {{control.sh --deactivate}}
      # *REST*:
      ## Introduced new command for changing cluster state:
      ##* Request: {{http://host:port/ignite?cmd=setstate&state=<NEW_STATE>}}
      ##* Response: {{ {"successStatus":0,"error":null,"sessionToken":null,"response":"setstate done"} }}
      ## Introduced new command for getting current cluster state:
      ##* Request: {{http://host:port/ignite?cmd=state}}
      ##* Response: {{ {"successStatus":0,"error":null,"sessionToken":null,"response":"ACTIVE"} }}
      # *{{org.apache.ignite.IgniteConfiguration}}*:
      ## Introduced new property {{clusterStateOnStart}}. This property has the same behaviour as {{activeOnStart}} for in-memory clusters and {{autoActivation}} for the persistent clusters. The default value of a new property is {{DFLT_STATE_ON_START}} ({{ACTIVE}}).
      ## Deprecated {{activeOnStart}} and {{autoActivation}} properties and related with them default values {{DFLT_ACTIVE_ON_START}}, {{DFLT_AUTO_ACTIVATION}}.
      # *IgniteEvents*:
      ## Introduced a new cluster state change event {{ClusterStateChangeEvent}}.
      ## Deprecated {{ClusterActivationEvent}} event.
      Show
      Changes in a public API: # Introduced {{ClusterState}} enum. # *{{org.apache.ignite.IgniteCluster}}*: ## Introduced new method for the cluster state change: {{void state(ClusterState)}} ## Introduced new method for the getting current cluster state: {{ClusterState state()}} ## Deprecated methods {{void active(boolean)}} and {{boolean active()}}. Use a new methods described above. # *Control utility ({{control.sh}})*: ## Introduced new command for the cluster state change: {{control.sh --set-state INACTIVE|ACTIVE|ACTIVE_READ_ONLY [--yes]}} ## Deprecated activate/deactivate commands {{control.sh --activate}}, {{control.sh --deactivate}} # *REST*: ## Introduced new command for changing cluster state: ##* Request: {{ http://host:port/ignite?cmd=setstate&state=<NEW_STATE >}} ##* Response: {{ {"successStatus":0,"error":null,"sessionToken":null,"response":"setstate done"} }} ## Introduced new command for getting current cluster state: ##* Request: {{ http://host:port/ignite?cmd=state }} ##* Response: {{ {"successStatus":0,"error":null,"sessionToken":null,"response":"ACTIVE"} }} # *{{org.apache.ignite.IgniteConfiguration}}*: ## Introduced new property {{clusterStateOnStart}}. This property has the same behaviour as {{activeOnStart}} for in-memory clusters and {{autoActivation}} for the persistent clusters. The default value of a new property is {{DFLT_STATE_ON_START}} ({{ACTIVE}}). ## Deprecated {{activeOnStart}} and {{autoActivation}} properties and related with them default values {{DFLT_ACTIVE_ON_START}}, {{DFLT_AUTO_ACTIVATION}}. # *IgniteEvents*: ## Introduced a new cluster state change event {{ClusterStateChangeEvent}}. ## Deprecated {{ClusterActivationEvent}} event.
    • Docs Required, Release Notes Required

    Description

      We have 3 cluster states at the moment: inactive, active, read-only.

      For getting current cluster state and changing them IgniteCluster has methods:

      • boolean active(), void active(boolean active) - for cluster activation/deactivation
      • boolean readOnly(), void readOnly(boolean readOnly) - for enabling/disabling read-only mode.

      Also we have control.sh commans for changing cluster state:

      • --activate
      • --deactivate
      • --read-only-on
      • --read-only-off

      For me current API looks unuseful. My proposal:

      1. Create enum ClusterState with values ACTIVE, INACTIVE, READ-ONLY.
      2. Add methods to IgniteCluster:
        • ClusterState state() returns current cluster state
        • void state(ClusterState newState) changes cluster state to newState state
      3. Mark as deprecated the following methods in IgniteCluster: boolean active(), void active(boolean active),
      4. Add new command to control.sh: control.sh --set-state (ACTIVE|INACTIVE|READ-ONLY) [--yes]
      5. Add warn message that command is depricated in control.sh. Commands: --activate, --deactivate,
      6. Remove commands from control.sh: --read-only-on, --read-only-off (no one release wasn't published with this functional)
      7. Add new methods to IgniteConfiguration:
        • ClusterState getClusterStateOnStart()
        • IgniteConfiguration setClusterStateOnStart(ClusterState state)
      8. Deprecate methods in IgniteConfiguration:
        • boolean isActiveOnStart()
        • IgniteConfiguration setActiveOnStart(boolean activeOnStart)
      9. Depracate ClusterActivationEvent and introduce new ClusterStateChangeEvent.

      Attachments

        Issue Links

          Activity

            People

              antonovsergey93 Sergey Antonov
              antonovsergey93 Sergey Antonov
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h