ignite-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [ignite] sk0x50 commented on a change in pull request #6423: IGNITE-11256 Cluster wide read-only mode.
Date Wed, 29 May 2019 15:23:25 GMT
sk0x50 commented on a change in pull request #6423: IGNITE-11256 Cluster wide read-only mode.
URL: https://github.com/apache/ignite/pull/6423#discussion_r288612094
 
 

 ##########
 File path: modules/core/src/main/java/org/apache/ignite/internal/cluster/IgniteClusterImpl.java
 ##########
 @@ -318,6 +320,41 @@ public IgniteClusterImpl(GridKernalContext ctx) {
         }
     }
 
+    /** {@inheritDoc} */
+    @Override public boolean readOnly() {
+        guard();
+
+        try {
+            return ctx.state().publicApiReadOnlyMode();
+        }
+        finally {
+            unguard();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override public void readOnly(boolean readOnly) throws IgniteException {
+        checkReadOnlyModeSupports();
 
 Review comment:
   my sense of beauty tells me that this code should look like the following:
   ```
   guard();
   
   try {
       verifyReadOnlyModeSupport();
   
       ctx.state().changeGlobalState(readOnly).get();
   }
   ...
   ```
   
   Perhaps, `verifyReadOnlyModeSupport` should be a part of `ctx.state().changeGlobalState(readOnly)`
method, I am not sure here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message