2626import org .apache .accumulo .core .clientImpl .ClientContext ;
2727import org .apache .accumulo .core .lock .ServiceLockData ;
2828import org .apache .accumulo .core .lock .ServiceLockPaths ;
29+ import org .apache .accumulo .core .rpc .RpcService ;
2930import org .apache .accumulo .core .rpc .ThriftUtil ;
3031import org .apache .thrift .TServiceClient ;
3132import org .apache .thrift .transport .TTransportException ;
3536
3637public interface ManagerClient <C extends TServiceClient > {
3738
38- public static String getPrimaryManagerLocation (ClientContext context ) {
39+ static String getPrimaryManagerLocation (ClientContext context ) {
3940 String managerLocation = null ;
4041 ServiceLockPaths .ServiceLockPath m = context .getServerPaths ().getManager (true );
4142 if (m != null ) {
4243 Optional <ServiceLockData > sld = context .getZooCache ().getLockData (m );
4344 if (sld .isPresent ()) {
44- managerLocation = sld .orElseThrow ().getAddressString (ServiceLockData . ThriftService .MANAGER );
45+ managerLocation = sld .orElseThrow ().getAddressString (RpcService .MANAGER );
4546 }
4647 }
4748 return managerLocation ;
@@ -67,15 +68,15 @@ default C getManagerConnection(Logger log, ThriftClientTypes<C> type, ClientCont
6768 }
6869 HostAndPort manager = HostAndPort .fromString (managerLocation );
6970 try {
70- // Manager requests can take a long time: don't ever time out
71+ // Manager requests can take a long time so never time out
7172 return ThriftUtil .getClientNoTimeout (type , manager , context );
7273 } catch (TTransportException tte ) {
7374 Throwable cause = tte .getCause ();
74- if (cause != null && cause instanceof UnknownHostException ) {
75+ if (cause instanceof UnknownHostException ) {
7576 // do not expect to recover from this
7677 throw new IllegalStateException (tte );
7778 }
78- log .debug ("Failed to connect to manager=" + manager + " , will retry... " , tte );
79+ log .debug ("Failed to connect to manager= {} , will retry... " , manager , tte );
7980 return null ;
8081 }
8182 }
0 commit comments