public class PostgresOffsetContext extends Object implements OffsetContext
| Modifier and Type | Class and Description |
|---|---|
static class |
PostgresOffsetContext.Loader |
| Modifier and Type | Field and Description |
|---|---|
static String |
LAST_COMMIT_LSN_KEY |
static String |
LAST_COMPLETELY_PROCESSED_LSN_KEY |
private Lsn |
lastCommitLsn |
private Lsn |
lastCompletelyProcessedLsn |
private boolean |
lastSnapshotRecord |
private static org.slf4j.Logger |
LOGGER |
private Map<String,String> |
partition |
private static String |
SERVER_PARTITION_KEY |
private SourceInfo |
sourceInfo |
private org.apache.kafka.connect.data.Schema |
sourceInfoSchema |
private Lsn |
streamingStoppingLsn |
private TransactionContext |
transactionContext |
| Modifier | Constructor and Description |
|---|---|
private |
PostgresOffsetContext(PostgresConnectorConfig connectorConfig,
Lsn lsn,
Lsn lastCompletelyProcessedLsn,
Lsn lastCommitLsn,
Long txId,
Instant time,
boolean snapshot,
boolean lastSnapshotRecord,
TransactionContext transactionContext) |
| Modifier and Type | Method and Description |
|---|---|
OffsetState |
asOffsetState() |
void |
event(DataCollectionId tableId,
Instant instant) |
Map<String,?> |
getOffset() |
Map<String,?> |
getPartition() |
org.apache.kafka.connect.data.Struct |
getSourceInfo() |
org.apache.kafka.connect.data.Schema |
getSourceInfoSchema() |
(package private) Lsn |
getStreamingStoppingLsn()
Returns the LSN that the streaming phase should stream events up to or null if
a stopping point is not set.
|
TransactionContext |
getTransactionContext() |
(package private) boolean |
hasCompletelyProcessedPosition() |
(package private) boolean |
hasLastKnownPosition() |
static PostgresOffsetContext |
initialContext(PostgresConnectorConfig connectorConfig,
PostgresConnection jdbcConnection,
Clock clock) |
static PostgresOffsetContext |
initialContext(PostgresConnectorConfig connectorConfig,
PostgresConnection jdbcConnection,
Clock clock,
Lsn lastCommitLsn,
Lsn lastCompletelyProcessedLsn) |
boolean |
isSnapshotRunning() |
(package private) Lsn |
lastCommitLsn() |
(package private) Lsn |
lastCompletelyProcessedLsn() |
(package private) Lsn |
lsn() |
void |
markLastSnapshotRecord() |
void |
postSnapshotCompletion() |
void |
preSnapshotCompletion() |
void |
preSnapshotStart() |
void |
setStreamingStoppingLsn(Lsn streamingStoppingLsn) |
String |
toString() |
void |
updateCommitPosition(Lsn lsn,
Lsn lastCompletelyProcessedLsn,
Instant commitTime,
Long txId,
TableId tableId,
Long xmin) |
void |
updateSnapshotPosition(Instant timestamp,
TableId tableId) |
void |
updateWalPosition(Lsn lsn,
Lsn lastCompletelyProcessedLsn,
Instant commitTime,
Long txId,
TableId tableId,
Long xmin) |
(package private) Long |
xmin() |
private static final org.slf4j.Logger LOGGER
private static final String SERVER_PARTITION_KEY
public static final String LAST_COMPLETELY_PROCESSED_LSN_KEY
public static final String LAST_COMMIT_LSN_KEY
private final org.apache.kafka.connect.data.Schema sourceInfoSchema
private final SourceInfo sourceInfo
private boolean lastSnapshotRecord
private Lsn lastCompletelyProcessedLsn
private Lsn lastCommitLsn
private Lsn streamingStoppingLsn
private final TransactionContext transactionContext
private PostgresOffsetContext(PostgresConnectorConfig connectorConfig, Lsn lsn, Lsn lastCompletelyProcessedLsn, Lsn lastCommitLsn, Long txId, Instant time, boolean snapshot, boolean lastSnapshotRecord, TransactionContext transactionContext)
public Map<String,?> getPartition()
getPartition in interface OffsetContextpublic Map<String,?> getOffset()
getOffset in interface OffsetContextpublic org.apache.kafka.connect.data.Schema getSourceInfoSchema()
getSourceInfoSchema in interface OffsetContextpublic org.apache.kafka.connect.data.Struct getSourceInfo()
getSourceInfo in interface OffsetContextpublic boolean isSnapshotRunning()
isSnapshotRunning in interface OffsetContextpublic void preSnapshotStart()
preSnapshotStart in interface OffsetContextpublic void preSnapshotCompletion()
preSnapshotCompletion in interface OffsetContextpublic void postSnapshotCompletion()
postSnapshotCompletion in interface OffsetContextpublic void updateWalPosition(Lsn lsn, Lsn lastCompletelyProcessedLsn, Instant commitTime, Long txId, TableId tableId, Long xmin)
public void updateCommitPosition(Lsn lsn, Lsn lastCompletelyProcessedLsn, Instant commitTime, Long txId, TableId tableId, Long xmin)
boolean hasLastKnownPosition()
boolean hasCompletelyProcessedPosition()
Lsn lsn()
Lsn lastCompletelyProcessedLsn()
Lsn lastCommitLsn()
Lsn getStreamingStoppingLsn()
public void setStreamingStoppingLsn(Lsn streamingStoppingLsn)
Long xmin()
public static PostgresOffsetContext initialContext(PostgresConnectorConfig connectorConfig, PostgresConnection jdbcConnection, Clock clock)
public static PostgresOffsetContext initialContext(PostgresConnectorConfig connectorConfig, PostgresConnection jdbcConnection, Clock clock, Lsn lastCommitLsn, Lsn lastCompletelyProcessedLsn)
public OffsetState asOffsetState()
public void markLastSnapshotRecord()
markLastSnapshotRecord in interface OffsetContextpublic void event(DataCollectionId tableId, Instant instant)
event in interface OffsetContextpublic TransactionContext getTransactionContext()
getTransactionContext in interface OffsetContextCopyright © 2021 JBoss by Red Hat. All rights reserved.