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


##########
core/src/main/java/org/apache/accumulo/core/util/compaction/ExternalCompactionUtil.java:
##########
@@ -112,6 +113,26 @@ public static Optional<HostAndPort> 
findCompactionCoordinator(ClientContext cont
         .map(sld -> sld.getAddress(ThriftService.COORDINATOR));
   }
 
+  /**
+   * @param context client context
+   * @return CompactionCoordinator Thrift client, user has the responsibility 
to call
+   *         {@code ThriftUtil.returnClient(coordinatorClient, context);}
+   */
+  public static CompactionCoordinatorService.Client 
getCoordinatorClient(ClientContext context) {
+    var coordinatorHost = 
ExternalCompactionUtil.findCompactionCoordinator(context);
+    if (coordinatorHost.isEmpty()) {
+      throw new IllegalStateException("Unable to find coordinator. Check that 
it is running.");
+    }
+    HostAndPort address = coordinatorHost.orElseThrow();
+    CompactionCoordinatorService.Client coordinatorClient;
+    try {
+      coordinatorClient = ThriftUtil.getClient(ThriftClientTypes.COORDINATOR, 
address, context);
+    } catch (Exception e) {

Review Comment:
   Fixed in c93fb11



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