Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjunbo committed Jan 18, 2024
1 parent d58e8ec commit 085ffc5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import org.apache.kyuubi.util.{ThreadUtils, ThriftUtils}
import org.apache.kyuubi.util.ThreadUtils.scheduleTolerableRunnableWithFixedDelay

class KyuubiSyncThriftClient private (
hostPort: (String, Int),
val hostPort: (String, Int),
protocol: TProtocol,
engineAliveProbeProtocol: Option[TProtocol],
engineAliveProbeInterval: Long,
Expand All @@ -53,7 +53,7 @@ class KyuubiSyncThriftClient private (
@volatile private var _engineId: Option[String] = _
@volatile private var _engineUrl: Option[String] = _
@volatile private var _engineName: Option[String] = _
private[kyuubi] def engineHostPort: (String, Int) = hostPort
def engineHostPort: (String, Int) = hostPort

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,11 @@ private[kyuubi] class EngineRef(
}
}

def getServiceNodes(
def getServiceNode(
discoveryClient: DiscoveryClient,
hostPort: (String, Int)): Option[ServiceNodeInfo] = {
tryWithLock(discoveryClient) {
val serviceNodes = discoveryClient.getServiceNodesInfo(engineSpace)
serviceNodes.filter { sn => (sn.host, sn.port) == hostPort }.headOption
}
val serviceNodes = discoveryClient.getServiceNodesInfo(engineSpace)
serviceNodes.filter { sn => (sn.host, sn.port) == hostPort }.headOption
}

def close(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class KyuubiSessionImpl(

def getEngineNode: Option[ServiceNodeInfo] = {
withDiscoveryClient(sessionConf) { discoveryClient =>
engine.getServiceNodes(discoveryClient, _client.engineHostPort)
engine.getServiceNode(discoveryClient, _client.engineHostPort)
}
}

Expand Down

0 comments on commit 085ffc5

Please sign in to comment.