Class PhysicalStreamBuilder
- java.lang.Object
-
- org.postgresql.replication.fluent.AbstractStreamBuilder<ChainedPhysicalStreamBuilder>
-
- org.postgresql.replication.fluent.physical.PhysicalStreamBuilder
-
- All Implemented Interfaces:
ChainedCommonStreamBuilder<ChainedPhysicalStreamBuilder>,CommonOptions,ChainedPhysicalStreamBuilder,PhysicalReplicationOptions
public class PhysicalStreamBuilder extends AbstractStreamBuilder<ChainedPhysicalStreamBuilder> implements ChainedPhysicalStreamBuilder, PhysicalReplicationOptions
-
-
Field Summary
-
Fields inherited from class org.postgresql.replication.fluent.AbstractStreamBuilder
automaticFlush, slotName, startPosition, statusIntervalMs
-
-
Constructor Summary
Constructors Constructor Description PhysicalStreamBuilder(StartPhysicalReplicationCallback startCallback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetAutomaticFlush()java.lang.StringgetSlotName()Replication slots provide an automated way to ensure that the master does not remove WAL segments until they have been received by all standbys, and that the master does not remove rows which could cause a recovery conflict even when the standby is disconnected.LogSequenceNumbergetStartLSNPosition()intgetStatusInterval()Specifies the number of millisecond between status packets sent back to the server.protected ChainedPhysicalStreamBuilderself()PGReplicationStreamstart()Open physical replication stream.-
Methods inherited from class org.postgresql.replication.fluent.AbstractStreamBuilder
withAutomaticFlush, withSlotName, withStartPosition, withStatusInterval
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.postgresql.replication.fluent.ChainedCommonStreamBuilder
withAutomaticFlush, withSlotName, withStartPosition, withStatusInterval
-
-
-
-
Constructor Detail
-
PhysicalStreamBuilder
public PhysicalStreamBuilder(StartPhysicalReplicationCallback startCallback)
- Parameters:
startCallback- not null callback that should be executed after build parameters for start replication
-
-
Method Detail
-
self
protected ChainedPhysicalStreamBuilder self()
- Specified by:
selfin classAbstractStreamBuilder<ChainedPhysicalStreamBuilder>
-
start
public PGReplicationStream start() throws java.sql.SQLException
Description copied from interface:ChainedPhysicalStreamBuilderOpen physical replication stream.- Specified by:
startin interfaceChainedPhysicalStreamBuilder- Returns:
- not null PGReplicationStream available for fetch wal logs in binary form
- Throws:
java.sql.SQLException- on error
-
getSlotName
public java.lang.String getSlotName()
Description copied from interface:CommonOptionsReplication slots provide an automated way to ensure that the master does not remove WAL segments until they have been received by all standbys, and that the master does not remove rows which could cause a recovery conflict even when the standby is disconnected.- Specified by:
getSlotNamein interfaceCommonOptions- Returns:
- nullable replication slot name that already exists on server and free.
-
getStartLSNPosition
public LogSequenceNumber getStartLSNPosition()
- Specified by:
getStartLSNPositionin interfaceCommonOptions- Returns:
- the position to start replication. This cannot be null.
-
getStatusInterval
public int getStatusInterval()
Description copied from interface:CommonOptionsSpecifies the number of millisecond between status packets sent back to the server. This allows for easier monitoring of the progress from 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. The default value is 10 seconds.- Specified by:
getStatusIntervalin interfaceCommonOptions- Returns:
- the current status interval
-
getAutomaticFlush
public boolean getAutomaticFlush()
- Specified by:
getAutomaticFlushin interfaceCommonOptions
-
-