dlmarion commented on code in PR #2620:
URL: https://github.com/apache/accumulo/pull/2620#discussion_r853302227


##########
server/manager/src/main/java/org/apache/accumulo/manager/Manager.java:
##########
@@ -1014,30 +1014,32 @@ public void run() {
     // ACCUMULO-4424 Put up the Thrift servers before getting the lock as a 
sign of process health
     // when a hot-standby
     //
+    // Start the Manager's Fate Service
+    fateServiceHandler = new FateServiceHandler(this);
+    managerClientHandler = new ManagerClientServiceHandler(this);
     // Start the Manager's Client service
-    clientHandler = new ManagerClientServiceHandler(this);
     // Ensure that calls before the manager gets the lock fail
-    Iface haProxy = HighlyAvailableServiceWrapper.service(clientHandler, this);
-    Iface rpcProxy = TraceUtil.wrapService(haProxy);
-    final Processor<Iface> processor;
-    if (context.getThriftServerType() == ThriftServerType.SASL) {
-      Iface tcredsProxy = TCredentialsUpdatingWrapper.service(rpcProxy, 
clientHandler.getClass(),
-          getConfiguration());
-      processor = new Processor<>(tcredsProxy);
-    } else {
-      processor = new Processor<>(rpcProxy);
-    }
+    ManagerClientService.Iface haProxy =
+        HighlyAvailableServiceWrapper.service(managerClientHandler, this);
+
     ServerAddress sa;
     try {
-      sa = TServerUtils.startServer(context, getHostname(), 
Property.MANAGER_CLIENTPORT, processor,
-          "Manager", "Manager Client Service Handler", null, 
Property.MANAGER_MINTHREADS,
-          Property.MANAGER_MINTHREADS_TIMEOUT, Property.MANAGER_THREADCHECK,
-          Property.GENERAL_MAX_MESSAGE_SIZE);
-    } catch (UnknownHostException e) {
-      throw new IllegalStateException("Unable to start server on host " + 
getHostname(), e);
+      TProcessor processor = 
ThriftProcessorTypes.getManagerTProcessor(fateServiceHandler, haProxy,
+          getContext(), getConfiguration());
+
+      try {
+        sa = TServerUtils.startServer(context, getHostname(), 
Property.MANAGER_CLIENTPORT,
+            processor, "Manager", "Manager Client Service Handler", null,
+            Property.MANAGER_MINTHREADS, Property.MANAGER_MINTHREADS_TIMEOUT,
+            Property.MANAGER_THREADCHECK, Property.GENERAL_MAX_MESSAGE_SIZE);
+      } catch (UnknownHostException e) {
+        throw new IllegalStateException("Unable to start server on host " + 
getHostname(), e);
+      }
+      clientService = sa.server;
+      log.info("Started Manager client service at {}", sa.address);
+    } catch (Exception e2) {
+      throw new RuntimeException("Error creating thrift server processor", e2);

Review Comment:
   I was able to remove the Exception declaration from 
`ThriftProcessorTypes.ProcessorType.getProcessor()` and instead throw an 
`IllegalArgumentException`. This allowed me to remove this completely in 
2bac8d5f30828ada41d60168272b0c6b46802dc5



##########
server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java:
##########
@@ -600,30 +604,33 @@ private void 
returnManagerConnection(ManagerClientService.Client client) {
 
   private HostAndPort startTabletClientService() throws UnknownHostException {
     // start listening for client connection last
-    clientHandler = getThriftClientHandler();
-    Iface rpcProxy = TraceUtil.wrapService(clientHandler);
-    final Processor<Iface> processor;
-    if (getContext().getThriftServerType() == ThriftServerType.SASL) {
-      Iface tcredProxy = TCredentialsUpdatingWrapper.service(rpcProxy, 
ThriftClientHandler.class,
-          getConfiguration());
-      processor = new Processor<>(tcredProxy);
-    } else {
-      processor = new Processor<>(rpcProxy);
+    TransactionWatcher watcher = new TransactionWatcher(context);
+    clientHandler = newClientHandler(watcher);
+    thriftClientHandler = newTabletClientHandler(watcher);
+
+    try {
+      TProcessor processor = 
ThriftProcessorTypes.getTabletServerTProcessor(clientHandler,
+          thriftClientHandler, getContext(), getConfiguration());
+      HostAndPort address = startServer(getConfiguration(), 
clientAddress.getHost(), processor);
+      log.info("address = {}", address);
+      return address;
+    } catch (Exception e) {
+      throw new RuntimeException("Error creating thrift server processor", e);

Review Comment:
   I was able to remove the Exception declaration from 
`ThriftProcessorTypes.ProcessorType.getProcessor()` and instead throw an 
`IllegalArgumentException`. This allowed me to remove this completely in 
2bac8d5f30828ada41d60168272b0c6b46802dc5



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to