public interface ReplicationStream extends Closeable
PostgresqlReplicationConnection
until this stream is closed
. This stream can be consumed by
applying a mapping function
using map(Function)
.Modifier and Type | Method and Description |
---|---|
Mono<Void> |
close()
Stop replication changes from server and free resources.
|
LogSequenceNumber |
getLastAppliedLSN()
Returns the last applied lsn send in update message to backed.
|
LogSequenceNumber |
getLastFlushedLSN()
Returns the last flushed lsn send in update message to backend.
|
LogSequenceNumber |
getLastReceiveLSN()
Returns the last received LSN position.
|
boolean |
isClosed() |
<T> Flux<T> |
map(Function<io.netty.buffer.ByteBuf,? extends T> mappingFunction)
Returns a mapping of the replication stream which is an unbounded stream.
|
void |
setAppliedLSN(LogSequenceNumber applied)
Parameter used only physical replication and define which lsn already was apply on standby.
|
void |
setFlushedLSN(LogSequenceNumber flushed)
Sets the flushed LSN.
|
Mono<Void> close()
boolean isClosed()
true
if replication stream was already closed, otherwise return false
<T> Flux<T> map(Function<io.netty.buffer.ByteBuf,? extends T> mappingFunction)
The data buffer
is released after applying the mapping function
.
Unsubscribing from the stream will cancel consumption leaving protocol frames on the transport buffer. Close the
ReplicationStream
object to terminate the
T
- the type of the mapped valuemappingFunction
- the Function
that maps a ByteBuf
to a value.data buffers
that are the results of the replication streamIllegalArgumentException
- if mappingFunction
is null
LogSequenceNumber getLastReceiveLSN()
map(Function)
.LogSequenceNumber getLastFlushedLSN()
LogSequenceNumber getLastAppliedLSN()
void setFlushedLSN(LogSequenceNumber flushed)
flushed
- not null location of the last WAL flushed to disk in the standby.void setAppliedLSN(LogSequenceNumber applied)
applied
- not null location of the last WAL applied in the standby.Copyright © 2020. All rights reserved.