keith-turner commented on a change in pull request #1677:
URL: https://github.com/apache/accumulo/pull/1677#discussion_r469603172



##########
File path: 
server/base/src/main/java/org/apache/accumulo/server/ServerContext.java
##########
@@ -68,13 +68,22 @@
   private CryptoService cryptoService = null;
 
   public ServerContext(SiteConfiguration siteConfig) {
-    this(new ServerInfo(siteConfig));
+    this(new ServerInfo(siteConfig), true);
+  }
+
+  public ServerContext(SiteConfiguration siteConfig, boolean 
enableZookeeperRetries) {
+    this(new ServerInfo(siteConfig), enableZookeeperRetries);
   }
 
   private ServerContext(ServerInfo info) {
+    this(info, true);
+  }
+
+  private ServerContext(ServerInfo info, boolean enableRetries) {
     super(SingletonReservation.noop(), info, info.getSiteConfiguration());
     this.info = info;
-    zooReaderWriter = new ZooReaderWriter(info.getSiteConfiguration());
+    zooReaderWriter = enableRetries ? 
ZooReaderWriter.retriesEnabled(info.getSiteConfiguration())
+        : ZooReaderWriter.retriesDisabled(info.getSiteConfiguration());

Review comment:
       I am not sure this a good idea, but its something I thought of after 
reading this comment.  Could make every ZooReaderWriter method accept a retry 
factory and have overloaded versions that do not take a retry factory and use a 
default.  This  seems tedious though, but its the best I could think of so far 
to associate the retry logic with method calls instead of the object. 




----------------------------------------------------------------
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:
[email protected]


Reply via email to