Skip to content

Commit a1ff22e

Browse files
committed
Fix missed references and ide warnings
Fix the missed references caused by merging in the main branch. Also fix code to eliminate warnings from the ide for code improvements.
1 parent 5295842 commit a1ff22e

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

core/src/main/java/org/apache/accumulo/core/rpc/clients/ManagerClient.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.apache.accumulo.core.clientImpl.ClientContext;
2727
import org.apache.accumulo.core.lock.ServiceLockData;
2828
import org.apache.accumulo.core.lock.ServiceLockPaths;
29+
import org.apache.accumulo.core.rpc.RpcService;
2930
import org.apache.accumulo.core.rpc.ThriftUtil;
3031
import org.apache.thrift.TServiceClient;
3132
import org.apache.thrift.transport.TTransportException;
@@ -35,13 +36,13 @@
3536

3637
public 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
}

server/base/src/test/java/org/apache/accumulo/server/manager/LiveTServerSetTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232

3333
import org.apache.accumulo.core.data.ResourceGroupId;
3434
import org.apache.accumulo.core.lock.ServiceLockData;
35-
import org.apache.accumulo.core.lock.ServiceLockData.ThriftService;
3635
import org.apache.accumulo.core.lock.ServiceLockPaths;
3736
import org.apache.accumulo.core.lock.ServiceLockPaths.ServiceLockPath;
3837
import org.apache.accumulo.core.metadata.TServerInstance;
38+
import org.apache.accumulo.core.rpc.RpcService;
3939
import org.apache.accumulo.core.zookeeper.ZcStat;
4040
import org.apache.accumulo.core.zookeeper.ZooCache;
4141
import org.apache.accumulo.server.ServerContext;
@@ -121,7 +121,7 @@ public void testSameHostPortInDiffResourceGroups() {
121121

122122
var locks = new HashMap<ServiceLockPath,LockInfo>();
123123
locks.put(path2, new LockInfo(
124-
new ServiceLockData(UUID.randomUUID(), hp1.toString(), ThriftService.TSERV, g1), 123456));
124+
new ServiceLockData(UUID.randomUUID(), hp1.toString(), RpcService.TSERV, g1), 123456));
125125

126126
var deletedSeen = new HashSet<TServerInstance>();
127127
var addedSeen = new HashSet<TServerInstance>();
@@ -140,7 +140,7 @@ public void testSameHostPortInDiffResourceGroups() {
140140
// change which tserver has the lock
141141
locks.clear();
142142
locks.put(path1, new LockInfo(new ServiceLockData(UUID.randomUUID(), hp1.toString(),
143-
ThriftService.TSERV, ResourceGroupId.DEFAULT), 654321));
143+
RpcService.TSERV, ResourceGroupId.DEFAULT), 654321));
144144

145145
addedSeen.clear();
146146
tservers.scanServers();

0 commit comments

Comments
 (0)