Class V3PGReplicationStream

java.lang.Object
org.postgresql.core.v3.replication.V3PGReplicationStream
All Implemented Interfaces:
AutoCloseable, PGReplicationStream

public class V3PGReplicationStream extends Object implements PGReplicationStream
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • POSTGRES_EPOCH_2000_01_01

      public static final long POSTGRES_EPOCH_2000_01_01
      See Also:
    • NANOS_PER_MILLISECOND

      private static final long NANOS_PER_MILLISECOND
      See Also:
    • copyDual

      private final CopyDual copyDual
    • updateInterval

      private final long updateInterval
    • replicationType

      private final ReplicationType replicationType
    • lastStatusUpdate

      private long lastStatusUpdate
    • closeFlag

      private boolean closeFlag
    • lastServerLSN

      private LogSequenceNumber lastServerLSN
    • lastReceiveLSN

      private volatile LogSequenceNumber lastReceiveLSN
      Last receive LSN + payload size.
    • lastAppliedLSN

      private volatile LogSequenceNumber lastAppliedLSN
    • lastFlushedLSN

      private volatile LogSequenceNumber lastFlushedLSN
  • Constructor Details

    • V3PGReplicationStream

      public V3PGReplicationStream(CopyDual copyDual, LogSequenceNumber startLSN, long updateIntervalMs, ReplicationType replicationType)
      Parameters:
      copyDual - bidirectional copy protocol
      startLSN - the position in the WAL that we want to initiate replication from usually the currentLSN returned by calling pg_current_wal_lsn()for v10 above or pg_current_xlog_location() depending on the version of the server
      updateIntervalMs - the number of millisecond between status packets sent back to the server. A value of zero disables the periodic status updates completely, although an update will still be sent when requested by the server, to avoid timeout disconnect.
      replicationType - LOGICAL or PHYSICAL
  • Method Details