Top Fields Constructors Methods
org.postgresql.replication.fluent

public Class ReplicationStreamBuilder

extends Object
implements ChainedStreamBuilder
Class Inheritance
All Implemented Interfaces
org.postgresql.replication.fluent.ChainedStreamBuilder
Imports
org.postgresql.core.BaseConnection, .ReplicationProtocol, org.postgresql.replication.PGReplicationStream, org.postgresql.replication.fluent.logical.ChainedLogicalStreamBuilder, .LogicalReplicationOptions, .LogicalStreamBuilder, .StartLogicalReplicationCallback, org.postgresql.replication.fluent.physical.ChainedPhysicalStreamBuilder, .PhysicalReplicationOptions, .PhysicalStreamBuilder, .StartPhysicalReplicationCallback, java.sql.SQLException

Field Summary

Modifier and TypeField and Description
private final BaseConnection

Constructor Summary

AccessConstructor and Description
public
ReplicationStreamBuilder(final BaseConnection
not null connection with that will be associate replication
connection
)

Method Summary

Modifier and TypeMethod and Description
public ChainedLogicalStreamBuilder
logical()

Implements org.postgresql.replication.fluent.ChainedStreamBuilder.logical.

Create logical replication stream that decode raw wal logs by output plugin to logical form.

public ChainedPhysicalStreamBuilder
physical()

Implements org.postgresql.replication.fluent.ChainedStreamBuilder.physical.

Create physical replication stream for process wal logs in binary form.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

baseConnectionback to summary
private final BaseConnection baseConnection

Constructor Detail

ReplicationStreamBuilderback to summary
public ReplicationStreamBuilder(final BaseConnection connection)
Parameters
connection:BaseConnection

not null connection with that will be associate replication

Method Detail

logicalback to summary
public ChainedLogicalStreamBuilder logical()

Implements org.postgresql.replication.fluent.ChainedStreamBuilder.logical.

Doc from org.postgresql.replication.fluent.ChainedStreamBuilder.logical.

Create logical replication stream that decode raw wal logs by output plugin to logical form. Default about logical decoding you can see by following link Logical Decoding Concepts .

Example usage:

  PGReplicationStream stream =
       pgConnection
           .getReplicationAPI()
           .replicationStream()
           .logical()
           .withSlotName("test_decoding")
           .withSlotOption("include-xids", false)
           .withSlotOption("skip-empty-xacts", true)
           .start();

   while (true) {
     ByteBuffer buffer = stream.read();
     //process logical changes
   }

  
Returns:ChainedLogicalStreamBuilder

not null fluent api

Annotations
@Override
physicalback to summary
public ChainedPhysicalStreamBuilder physical()

Implements org.postgresql.replication.fluent.ChainedStreamBuilder.physical.

Doc from org.postgresql.replication.fluent.ChainedStreamBuilder.physical.

Create physical replication stream for process wal logs in binary form.

Example usage:

  LogSequenceNumber lsn = getCurrentLSN();

   PGReplicationStream stream =
       pgConnection
           .getReplicationAPI()
           .replicationStream()
           .physical()
           .withStartPosition(lsn)
           .start();

   while (true) {
     ByteBuffer buffer = stream.read();
     //process binary WAL logs
   }

  
Returns:ChainedPhysicalStreamBuilder

not null fluent api

Annotations
@Override