PGReplicationStream
PGReplicationStream is an API class provided by the GaussDB JDBC driver. It is used to operate logical replication streams.
Inheritance Relationship of PGReplicationStream
PGReplicationStream is a logical replication API. Its implementation class is V3PGReplicationStream, which is in the org.postgresql.core.v3.replication package. The declaration of the class is as follows:
public class V3PGReplicationStream implements PGReplicationStream
Constructor
public V3PGReplicationStream(CopyDual copyDual, LogSequenceNumber startLSN, long updateIntervalMs, ReplicationType replicationType)
Common Methods
Return Value |
Method |
Description |
throws |
---|---|---|---|
void |
close() |
Ends the logical replication and releases resources. |
SQLException |
void |
forceUpdateStatus() |
Forcibly sends the LSN status received, flushed, and applied last time to the backend. |
SQLException |
LogSequenceNumber |
getLastAppliedLSN() |
Obtains the LSN when the primary node replays logs last time. |
- |
LogSequenceNumber |
getLastFlushedLSN() |
Obtains the LSN flushed by the primary node last time, that is, the LSN pushed by the current logic decoding. |
- |
LogSequenceNumber |
getLastReceiveLSN() |
Obtains the LSN received last time. |
- |
boolean |
isClosed() |
Determines whether the replication stream is disabled. |
- |
ByteBuffer |
read() |
Reads the next WAL record from the backend. If the data cannot be read, this method blocks the I/O read. |
SQLException |
ByteBuffer |
readPending() |
Reads the next WAL record from the backend. If the data cannot be read, this method does not block the I/O read. |
SQLException |
void |
setAppliedLSN(LogSequenceNumber applied) |
Sets the applied LSN. |
- |
void |
setFlushedLSN(LogSequenceNumber flushed) |
Sets the flushed LSN, which is sent to the backend at the next update to push the LSN on the server. |
- |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot