类 SerializingBufferWriter
- java.lang.Object
-
- com.mysql.cj.protocol.SerializingBufferWriter
-
- 所有已实现的接口:
CompletionHandler<Long,Void>
public class SerializingBufferWriter extends Object implements CompletionHandler<Long,Void>
A layer overAsynchronousSocketChannelthat serializes all incoming write requests. This means we queue any incoming buffer and don't begin writing it until the previous buffer has been written fully. All buffers are transmitted atomically with respect to the caller/callback.
-
-
字段概要
字段 修饰符和类型 字段 说明 protected AsynchronousSocketChannelchannel
-
构造器概要
构造器 构造器 说明 SerializingBufferWriter(AsynchronousSocketChannel channel)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidcompleted(Long bytesWritten, Void v)Completion handler for channel writes.voidfailed(Throwable t, Void v)voidqueueBuffer(ByteBuffer buf, CompletionHandler<Long,Void> callback)Queue a buffer to be written to the channel.voidsetChannel(AsynchronousSocketChannel channel)Allow overwriting the channel once the writer has been established.
-
-
-
字段详细资料
-
channel
protected AsynchronousSocketChannel channel
-
-
构造器详细资料
-
SerializingBufferWriter
public SerializingBufferWriter(AsynchronousSocketChannel channel)
-
-
方法详细资料
-
queueBuffer
public void queueBuffer(ByteBuffer buf, CompletionHandler<Long,Void> callback)
Queue a buffer to be written to the channel. This method uses a mutex on the buffer list to synchronize for the following cases:- The buffer list becomes empty after we check and miss writing to the channel.
- LinkedList is not thread-safe.
- 参数:
buf-ByteBuffercallback-CompletionHandler
-
completed
public void completed(Long bytesWritten, Void v)
Completion handler for channel writes.- 指定者:
completed在接口中CompletionHandler<Long,Void>- 参数:
bytesWritten- number of processed bytesv- Void
-
setChannel
public void setChannel(AsynchronousSocketChannel channel)
Allow overwriting the channel once the writer has been established. Required for SSL/TLS connections when the encryption doesn't start until we send the capability flag to X Plugin.- 参数:
channel-AsynchronousSocketChannel
-
-