Skip to content

Commit 085ffc5

Browse files
author
wangjunbo
committed
fix code
1 parent d58e8ec commit 085ffc5

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

kyuubi-server/src/main/scala/org/apache/kyuubi/client/KyuubiSyncThriftClient.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import org.apache.kyuubi.util.{ThreadUtils, ThriftUtils}
4242
import org.apache.kyuubi.util.ThreadUtils.scheduleTolerableRunnableWithFixedDelay
4343

4444
class KyuubiSyncThriftClient private (
45-
hostPort: (String, Int),
45+
val hostPort: (String, Int),
4646
protocol: TProtocol,
4747
engineAliveProbeProtocol: Option[TProtocol],
4848
engineAliveProbeInterval: Long,
@@ -53,7 +53,7 @@ class KyuubiSyncThriftClient private (
5353
@volatile private var _engineId: Option[String] = _
5454
@volatile private var _engineUrl: Option[String] = _
5555
@volatile private var _engineName: Option[String] = _
56-
private[kyuubi] def engineHostPort: (String, Int) = hostPort
56+
def engineHostPort: (String, Int) = hostPort
5757

5858
private[kyuubi] def engineConnectionClosed: Boolean = !protocol.getTransport.isOpen
5959

kyuubi-server/src/main/scala/org/apache/kyuubi/engine/EngineRef.scala

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,11 @@ private[kyuubi] class EngineRef(
337337
}
338338
}
339339

340-
def getServiceNodes(
340+
def getServiceNode(
341341
discoveryClient: DiscoveryClient,
342342
hostPort: (String, Int)): Option[ServiceNodeInfo] = {
343-
tryWithLock(discoveryClient) {
344-
val serviceNodes = discoveryClient.getServiceNodesInfo(engineSpace)
345-
serviceNodes.filter { sn => (sn.host, sn.port) == hostPort }.headOption
346-
}
343+
val serviceNodes = discoveryClient.getServiceNodesInfo(engineSpace)
344+
serviceNodes.filter { sn => (sn.host, sn.port) == hostPort }.headOption
347345
}
348346

349347
def close(): Unit = {

kyuubi-server/src/main/scala/org/apache/kyuubi/session/KyuubiSessionImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class KyuubiSessionImpl(
122122

123123
def getEngineNode: Option[ServiceNodeInfo] = {
124124
withDiscoveryClient(sessionConf) { discoveryClient =>
125-
engine.getServiceNodes(discoveryClient, _client.engineHostPort)
125+
engine.getServiceNode(discoveryClient, _client.engineHostPort)
126126
}
127127
}
128128

0 commit comments

Comments
 (0)