[ https://issues.apache.org/jira/browse/IGNITE-12225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Antonov updated IGNITE-12225: ------------------------------------ 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: # Create enum {{ClusterState}} with values {{ACTIVE}}, {{INACTIVE}}, {{READ-ONLY}}. # Add methods to {{IgniteCluster}}: #* {{ClusterState state()}} returns current cluster state #* {{void state(ClusterState newState)}} changes cluster state to {{newState}} state # Mark as deprecated the following methods in {{IgniteCluster}}: {{boolean active()}}, {{void active(boolean active)}}, # Add new command to control.sh: {{control.sh --set-state (ACTIVE|INACTIVE|READ-ONLY)}} [--yes] # Add warn message that command is depricated in control.sh. Commands: --activate, --deactivate, # Remove commands from control.sh: --read-only-on, --read-only-off (no one release wasn't published with this functional) # Add new methods to {{IgniteConfiguration}}: #* {{ClusterState getClusterStateOnStart()}} #* {{IgniteConfiguration setClusterStateOnStart(ClusterState state)}} # Deprecate methods in {{IgniteConfiguration}}: #* {{boolean isActiveOnStart()}} #* {{IgniteConfiguration setActiveOnStart(boolean activeOnStart)}} was: 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: # Create enum {{ClusterState}} with values {{ACTIVE}}, {{INACTIVE}}, {{READ-ONLY}}. # Add methods to {{IgniteCluster}}: #* {{ClusterState state()}} returns current cluster state #* {{void state(ClusterState newState)}} changes cluster state to {{newState}} state # Mark as deprecated the following methods in {{IgniteCluster}}: {{boolean active()}}, {{void active(boolean active)}}, # Add new command to control.sh: {{control.sh --set-state (ACTIVE|INACTIVE|READ-ONLY)}} [--yes] # Add warn message that command is depricated in control.sh. Commands: --activate, --deactivate, # Remove commands from control.sh: --read-only-on, --read-only-off (no one release wasn't published with this functional) > Add enum for cluster state > -------------------------- > > Key: IGNITE-12225 > URL: https://issues.apache.org/jira/browse/IGNITE-12225 > Project: Ignite > Issue Type: Improvement > Reporter: Sergey Antonov > Assignee: Sergey Antonov > Priority: Major > Fix For: 2.8 > > > 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: > # Create enum {{ClusterState}} with values {{ACTIVE}}, {{INACTIVE}}, > {{READ-ONLY}}. > # Add methods to {{IgniteCluster}}: > #* {{ClusterState state()}} returns current cluster state > #* {{void state(ClusterState newState)}} changes cluster state to > {{newState}} state > # Mark as deprecated the following methods in {{IgniteCluster}}: {{boolean > active()}}, {{void active(boolean active)}}, > # Add new command to control.sh: {{control.sh --set-state > (ACTIVE|INACTIVE|READ-ONLY)}} [--yes] > # Add warn message that command is depricated in control.sh. Commands: > --activate, --deactivate, > # Remove commands from control.sh: --read-only-on, --read-only-off (no one > release wasn't published with this functional) > # Add new methods to {{IgniteConfiguration}}: > #* {{ClusterState getClusterStateOnStart()}} > #* {{IgniteConfiguration setClusterStateOnStart(ClusterState state)}} > # Deprecate methods in {{IgniteConfiguration}}: > #* {{boolean isActiveOnStart()}} > #* {{IgniteConfiguration setActiveOnStart(boolean activeOnStart)}} -- This message was sent by Atlassian Jira (v8.3.4#803005)