Class AbstractStreamBuilder<T extends ChainedCommonStreamBuilder<T>>
- java.lang.Object
-
- org.postgresql.replication.fluent.AbstractStreamBuilder<T>
-
- All Implemented Interfaces:
ChainedCommonStreamBuilder<T>
- Direct Known Subclasses:
LogicalStreamBuilder,PhysicalStreamBuilder
public abstract class AbstractStreamBuilder<T extends ChainedCommonStreamBuilder<T>> extends java.lang.Object implements ChainedCommonStreamBuilder<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanautomaticFlushprotected java.lang.StringslotNameprotected LogSequenceNumberstartPositionprotected intstatusIntervalMs
-
Constructor Summary
Constructors Constructor Description AbstractStreamBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Tself()TwithAutomaticFlush(boolean automaticFlush)Specify if backend should flush data after receive notification from client.TwithSlotName(java.lang.String slotName)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.TwithStartPosition(LogSequenceNumber lsn)Specify start position from which backend will start stream changes.TwithStatusInterval(int time, java.util.concurrent.TimeUnit format)Specifies the number of time between status packets sent back to the server.
-
-
-
Field Detail
-
statusIntervalMs
protected int statusIntervalMs
-
startPosition
protected LogSequenceNumber startPosition
-
slotName
protected java.lang.String slotName
-
automaticFlush
protected boolean automaticFlush
-
-
Method Detail
-
self
protected abstract T self()
-
withStatusInterval
public T withStatusInterval(int time, java.util.concurrent.TimeUnit format)
Description copied from interface:ChainedCommonStreamBuilderSpecifies the number of time 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:
withStatusIntervalin interfaceChainedCommonStreamBuilder<T extends ChainedCommonStreamBuilder<T>>- Parameters:
time- positive timeformat- format for specified time- Returns:
- not null fluent
-
withStartPosition
public T withStartPosition(LogSequenceNumber lsn)
Description copied from interface:ChainedCommonStreamBuilderSpecify start position from which backend will start stream changes. If parameter will not specify, streaming starts from restart_lsn. For more details see pg_replication_slots description.- Specified by:
withStartPositionin interfaceChainedCommonStreamBuilder<T extends ChainedCommonStreamBuilder<T>>- Parameters:
lsn- not null position from which need start replicate changes- Returns:
- not null fluent
-
withSlotName
public T withSlotName(java.lang.String slotName)
Description copied from interface:ChainedCommonStreamBuilderReplication 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:
withSlotNamein interfaceChainedCommonStreamBuilder<T extends ChainedCommonStreamBuilder<T>>- Parameters:
slotName- not null replication slot already exists on server.- Returns:
- this instance as a fluent interface
-
withAutomaticFlush
public T withAutomaticFlush(boolean automaticFlush)
Description copied from interface:ChainedCommonStreamBuilderSpecify if backend should flush data after receive notification from client.- Specified by:
withAutomaticFlushin interfaceChainedCommonStreamBuilder<T extends ChainedCommonStreamBuilder<T>>- Parameters:
automaticFlush- true if advance FlushLSN to ServerLSN data after receive notification- Returns:
- not null fluent
-
-