| | |
| | | /** |
| | | * The associated ServerWriter that sends messages to the remote server. |
| | | */ |
| | | protected ServerWriter writer; |
| | | private ServerWriter writer; |
| | | |
| | | /** |
| | | * The associated ServerReader that receives messages from the remote server. |
| | | */ |
| | | protected ServerReader reader; |
| | | private ServerReader reader; |
| | | |
| | | // window |
| | | private int rcvWindow; |
| | |
| | | /** |
| | | * Semaphore that the writer uses to control the flow to the remote server. |
| | | */ |
| | | protected Semaphore sendWindow; |
| | | private Semaphore sendWindow; |
| | | /** |
| | | * The initial size of the sending window. |
| | | */ |
| | | protected int sendWindowSize; |
| | | private int sendWindowSize; |
| | | /** |
| | | * remote generation id. |
| | | */ |
| | |
| | | * The time in milliseconds between heartbeats from the replication |
| | | * server. Zero means heartbeats are off. |
| | | */ |
| | | protected long heartbeatInterval = 0; |
| | | protected long heartbeatInterval; |
| | | |
| | | /** |
| | | * The thread that will send heartbeats. |
| | |
| | | /** |
| | | * Set when ServerWriter is stopping. |
| | | */ |
| | | protected volatile boolean shutdownWriter = false; |
| | | private volatile boolean shutdownWriter; |
| | | |
| | | /** |
| | | * Weight of this remote server. |
| | |
| | | } |
| | | |
| | | // Window stats |
| | | attributes.add(Attributes.create("max-send-window", String |
| | | .valueOf(sendWindowSize))); |
| | | attributes.add(Attributes.create("current-send-window", String |
| | | .valueOf(sendWindow.availablePermits()))); |
| | | attributes.add(Attributes.create("max-rcv-window", String |
| | | .valueOf(maxRcvWindow))); |
| | | attributes.add(Attributes.create("current-rcv-window", String |
| | | .valueOf(rcvWindow))); |
| | | attributes.add(Attributes.create("max-send-window", String.valueOf(sendWindowSize))); |
| | | attributes.add(Attributes.create("current-send-window", String.valueOf(sendWindow.availablePermits()))); |
| | | attributes.add(Attributes.create("max-rcv-window", String.valueOf(maxRcvWindow))); |
| | | attributes.add(Attributes.create("current-rcv-window", String.valueOf(rcvWindow))); |
| | | |
| | | // Encryption |
| | | attributes.add(Attributes.create("ssl-encryption", String |
| | | .valueOf(session.isEncrypted()))); |
| | | attributes.add(Attributes.create("ssl-encryption", String.valueOf(session.isEncrypted()))); |
| | | |
| | | // Data generation |
| | | attributes.add(Attributes.create("generation-id", String |
| | | .valueOf(generationId))); |
| | | attributes.add(Attributes.create("generation-id", String.valueOf(generationId))); |
| | | |
| | | return attributes; |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * Requests to shutdown the writer. |
| | | */ |
| | | protected void shutdownWriter() |
| | | { |
| | | shutdownWriter = true; |
| | | } |
| | | |
| | | /** |
| | | * Shutdown This ServerHandler. |
| | | */ |
| | | @Override |
| | | public void shutdown() |
| | | { |
| | | shutdownWriter(); |
| | | shutdownWriter = true; |
| | | setConsumerActive(false); |
| | | super.shutdown(); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * Log the messages involved in the Topology/StartSession handshake. |
| | | * @param inStartECLSessionMsg The message received first. |
| | | */ |
| | | protected void logStartECLSessionHandshake( |
| | | StartECLSessionMsg inStartECLSessionMsg) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo("In " + this.replicationServer.getMonitorInstanceName() |
| | | + ", " + getClass().getSimpleName() + " " + this + " :" |
| | | + "\nSH SESSION HANDSHAKE RECEIVED:\n" + inStartECLSessionMsg); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Process a Ack message received. |
| | | * @param ack the message received. |
| | | */ |