Class SessionManagerImpl
java.lang.Object
org.apache.flink.table.gateway.service.session.SessionManagerImpl
- All Implemented Interfaces:
SessionManager
The implementation of the
SessionManager that manage the lifecycle of the
Session.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseSession(org.apache.flink.table.gateway.api.session.SessionHandle sessionHandle) Close the session with the specified identifier and releases the resources used by the session.intintgetOperationCount(org.apache.flink.table.gateway.api.session.SessionHandle sessionHandle) getSession(org.apache.flink.table.gateway.api.session.SessionHandle sessionHandle) Get theSessionwith the identifier.booleanisSessionAlive(org.apache.flink.table.gateway.api.session.SessionHandle sessionId) openSession(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 Details
-
SessionManagerImpl
-
-
Method Details
-
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.SqlGatewayException Description 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)
-