Class SessionManagerImpl
- java.lang.Object
-
- org.apache.flink.table.gateway.service.session.SessionManagerImpl
-
- All Implemented Interfaces:
SessionManager
public class SessionManagerImpl extends Object implements SessionManager
The implementation of theSessionManagerthat manage the lifecycle of theSession.
-
-
Constructor Summary
Constructors Constructor Description SessionManagerImpl(DefaultContext defaultContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseSession(org.apache.flink.table.gateway.api.session.SessionHandle sessionHandle)Close the session with the specified identifier and releases the resources used by the session.intcurrentSessionCount()intgetOperationCount(org.apache.flink.table.gateway.api.session.SessionHandle sessionHandle)SessiongetSession(org.apache.flink.table.gateway.api.session.SessionHandle sessionHandle)Get theSessionwith the identifier.booleanisSessionAlive(org.apache.flink.table.gateway.api.session.SessionHandle sessionId)SessionopenSession(org.apache.flink.table.gateway.api.session.SessionEnvironment environment)Register a newSession.voidstart()Start theSessionManagerand do the required initialization.voidstop()Destroy theSessionManagerand releases used resources.
-
-
-
Constructor Detail
-
SessionManagerImpl
public SessionManagerImpl(DefaultContext defaultContext)
-
-
Method Detail
-
start
public void start()
Description copied from interface:SessionManagerStart theSessionManagerand do the required initialization.- Specified by:
startin interfaceSessionManager
-
stop
public void stop()
Description copied from interface:SessionManagerDestroy theSessionManagerand releases used resources.- Specified by:
stopin interfaceSessionManager
-
getSession
public Session getSession(org.apache.flink.table.gateway.api.session.SessionHandle sessionHandle) throws org.apache.flink.table.gateway.api.utils.SqlGatewayException
Description copied from interface:SessionManagerGet theSessionwith the identifier.- Specified by:
getSessionin interfaceSessionManager- Parameters:
sessionHandle- identifier of the session.- Returns:
- registered session.
- Throws:
org.apache.flink.table.gateway.api.utils.SqlGatewayException
-
openSession
public Session openSession(org.apache.flink.table.gateway.api.session.SessionEnvironment environment) throws org.apache.flink.table.gateway.api.utils.SqlGatewayException
Description copied from interface:SessionManagerRegister a newSession.- Specified by:
openSessionin interfaceSessionManager- Parameters:
environment- the initialization environment.- Returns:
- created session.
- Throws:
org.apache.flink.table.gateway.api.utils.SqlGatewayException
-
closeSession
public void closeSession(org.apache.flink.table.gateway.api.session.SessionHandle sessionHandle) throws org.apache.flink.table.gateway.api.utils.SqlGatewayExceptionDescription copied from interface:SessionManagerClose the session with the specified identifier and releases the resources used by the session.- Specified by:
closeSessionin interfaceSessionManager- Parameters:
sessionHandle- the identifier of the session.- Throws:
org.apache.flink.table.gateway.api.utils.SqlGatewayException
-
isSessionAlive
@VisibleForTesting public boolean isSessionAlive(org.apache.flink.table.gateway.api.session.SessionHandle sessionId)
-
currentSessionCount
@VisibleForTesting public int currentSessionCount()
-
getOperationCount
@VisibleForTesting public int getOperationCount(org.apache.flink.table.gateway.api.session.SessionHandle sessionHandle)
-
-