com.amazon.redshift.replication.fluent

## Class ReplicationStreamBuilder

- java.lang.Object
- - com.amazon.redshift.replication.fluent.ReplicationStreamBuilder

All Implemented Interfaces:
  ChainedStreamBuilder

    public class ReplicationStreamBuilder
    extends Object
    implements ChainedStreamBuilder

### Constructor Summary

Constructors
Constructor and Description
`ReplicationStreamBuilder(BaseConnection connection)`

### Method Summary

All Methods Instance Methods Concrete Methods
`ChainedLogicalStreamBuilder` `logical()` Create logical replication stream that decode raw wal logs by output plugin to logical form.
`ChainedPhysicalStreamBuilder` `physical()` Create physical replication stream for process wal logs in binary form.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ReplicationStreamBuilder

    public ReplicationStreamBuilder(BaseConnection connection)

Parameters:
  `connection` - not null connection with that will be associate replication

### Method Detail

#### logical

    public ChainedLogicalStreamBuilder logical()

Description copied from interface: `ChainedStreamBuilder`

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:

        RedshiftReplicationStream 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
        }

Specified by:
  `logical` in interface `ChainedStreamBuilder`
Returns:
  not null fluent api

#### physical

    public ChainedPhysicalStreamBuilder physical()

Description copied from interface: `ChainedStreamBuilder`

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

Example usage:

        LogSequenceNumber lsn = getCurrentLSN();

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

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

Specified by:
  `physical` in interface `ChainedStreamBuilder`
Returns:
  not null fluent api