Package org.h2.server
Class TcpServerThread
- java.lang.Object
-
- org.h2.server.TcpServerThread
-
- All Implemented Interfaces:
java.lang.Runnable
public class TcpServerThread extends java.lang.Object implements java.lang.RunnableOne server thread is opened per client connection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classTcpServerThread.CachedInputStreamAn input stream with a position.
-
Field Summary
Fields Modifier and Type Field Description private SmallMapcacheprivate intclientVersionprivate Commandcommitprivate longlastRemoteSettingsIdprivate SmallLRUCache<java.lang.Long,TcpServerThread.CachedInputStream>lobsprivate TcpServerserverprivate SessionLocalsessionprivate java.lang.StringsessionIdprivate booleanstopprivate java.lang.Threadthreadprivate intthreadIdprotected Transfertransfer
-
Constructor Summary
Constructors Constructor Description TcpServerThread(java.net.Socket socket, TcpServer server, int id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcancelStatement(java.lang.String targetSessionId, int statementId)Cancel a running statement.(package private) voidclose()Close a connection.private voidcloseSession()private intgetState(int oldModificationId)(package private) java.lang.ThreadgetThread()private voidprocess()voidrun()private voidsendError(java.lang.Throwable t, boolean withStatus)private voidsendRows(ResultInterface result, long count)private voidsetParameters(Command command)(package private) voidsetThread(java.lang.Thread thread)private voidtrace(java.lang.String s)
-
-
-
Field Detail
-
transfer
protected final Transfer transfer
-
server
private final TcpServer server
-
session
private SessionLocal session
-
stop
private boolean stop
-
thread
private java.lang.Thread thread
-
commit
private Command commit
-
cache
private final SmallMap cache
-
lobs
private final SmallLRUCache<java.lang.Long,TcpServerThread.CachedInputStream> lobs
-
threadId
private final int threadId
-
clientVersion
private int clientVersion
-
sessionId
private java.lang.String sessionId
-
lastRemoteSettingsId
private long lastRemoteSettingsId
-
-
Constructor Detail
-
TcpServerThread
TcpServerThread(java.net.Socket socket, TcpServer server, int id)
-
-
Method Detail
-
trace
private void trace(java.lang.String s)
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
closeSession
private void closeSession()
-
close
void close()
Close a connection.
-
sendError
private void sendError(java.lang.Throwable t, boolean withStatus)
-
setParameters
private void setParameters(Command command) throws java.io.IOException
- Throws:
java.io.IOException
-
process
private void process() throws java.io.IOException- Throws:
java.io.IOException
-
getState
private int getState(int oldModificationId)
-
sendRows
private void sendRows(ResultInterface result, long count) throws java.io.IOException
- Throws:
java.io.IOException
-
setThread
void setThread(java.lang.Thread thread)
-
getThread
java.lang.Thread getThread()
-
cancelStatement
void cancelStatement(java.lang.String targetSessionId, int statementId)Cancel a running statement.- Parameters:
targetSessionId- the session idstatementId- the statement to cancel
-
-