Class V3ReplicationProtocol
- java.lang.Object
-
- org.postgresql.core.v3.replication.V3ReplicationProtocol
-
- All Implemented Interfaces:
ReplicationProtocol
public class V3ReplicationProtocol extends java.lang.Object implements ReplicationProtocol
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.Logger
LOGGER
private PGStream
pgStream
private QueryExecutor
queryExecutor
-
Constructor Summary
Constructors Constructor Description V3ReplicationProtocol(QueryExecutor queryExecutor, PGStream pgStream)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
configureSocketTimeout(CommonOptions options)
private static java.lang.String
createStartLogicalQuery(LogicalReplicationOptions options)
START_REPLICATION SLOT slot_name LOGICAL XXX/XXX [ ( option_name [option_value] [, ...private static java.lang.String
createStartPhysicalQuery(PhysicalReplicationOptions options)
START_REPLICATION [SLOT slot_name] [PHYSICAL] XXX/XXX.private PGReplicationStream
initializeReplication(java.lang.String query, CommonOptions options, ReplicationType replicationType)
PGReplicationStream
startLogical(LogicalReplicationOptions options)
Starts logical replication.PGReplicationStream
startPhysical(PhysicalReplicationOptions options)
Starts physical replication.
-
-
-
Field Detail
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
queryExecutor
private final QueryExecutor queryExecutor
-
pgStream
private final PGStream pgStream
-
-
Constructor Detail
-
V3ReplicationProtocol
public V3ReplicationProtocol(QueryExecutor queryExecutor, PGStream pgStream)
-
-
Method Detail
-
startLogical
public PGReplicationStream startLogical(LogicalReplicationOptions options) throws java.sql.SQLException
Description copied from interface:ReplicationProtocol
Starts logical replication.- Specified by:
startLogical
in interfaceReplicationProtocol
- Parameters:
options
- not null options for logical replication stream- Returns:
- not null stream instance from which available fetch wal logs that was decode by output plugin
- Throws:
java.sql.SQLException
- on error
-
startPhysical
public PGReplicationStream startPhysical(PhysicalReplicationOptions options) throws java.sql.SQLException
Description copied from interface:ReplicationProtocol
Starts physical replication.- Specified by:
startPhysical
in interfaceReplicationProtocol
- Parameters:
options
- not null options for physical replication stream- Returns:
- not null stream instance from which available fetch wal logs
- Throws:
java.sql.SQLException
- on error
-
initializeReplication
private PGReplicationStream initializeReplication(java.lang.String query, CommonOptions options, ReplicationType replicationType) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
createStartPhysicalQuery
private static java.lang.String createStartPhysicalQuery(PhysicalReplicationOptions options)
START_REPLICATION [SLOT slot_name] [PHYSICAL] XXX/XXX.
-
createStartLogicalQuery
private static java.lang.String createStartLogicalQuery(LogicalReplicationOptions options)
START_REPLICATION SLOT slot_name LOGICAL XXX/XXX [ ( option_name [option_value] [, ... ] ) ]
-
configureSocketTimeout
private void configureSocketTimeout(CommonOptions options) throws PSQLException
- Throws:
PSQLException
-
-