Codota Logo
PGReplicationConnection
Code IndexAdd Codota to your IDE (free)

How to use
PGReplicationConnection
in
org.postgresql.replication

Best Java code snippets using org.postgresql.replication.PGReplicationConnection (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: debezium/debezium

private PGReplicationStream startPgReplicationStream(final LogSequenceNumber lsn, Function<ChainedLogicalStreamBuilder, ChainedLogicalStreamBuilder> configurator) throws SQLException {
  assert lsn != null;
  ChainedLogicalStreamBuilder streamBuilder = pgConnection()
      .getReplicationAPI()
      .replicationStream()
      .logical()
      .withSlotName(slotName)
      .withStartPosition(lsn);
  streamBuilder = configurator.apply(streamBuilder);
  if (statusUpdateIntervalMillis != null && statusUpdateIntervalMillis > 0) {
    streamBuilder.withStatusInterval(statusUpdateIntervalMillis, TimeUnit.MILLISECONDS);
  }
  PGReplicationStream stream = streamBuilder.start();
  // TODO DBZ-508 get rid of this
  // Needed by tests when connections are opened and closed in a fast sequence
  try {
    Thread.sleep(10);
  } catch (Exception e) {
  }
  stream.forceUpdateStatus();
  return stream;
}
origin: debezium/debezium

.createReplicationSlot()
.logical()
.withSlotName(slotName)
origin: hellobike/tunnel

private void createRplStream() throws SQLException {
  this.stream = this.rplConnection.getReplicationAPI()
      .replicationStream()
      .logical()
      .withSlotName(this.jdbcConfig.getSlotName())
      .withSlotOption("include-xids", true)
      .withSlotOption("skip-empty-xacts", true)
      .withStatusInterval(5, TimeUnit.SECONDS)
      .start();
  log.info("GetRplStream success,slot:{}", this.slotName);
}
origin: hellobike/tunnel

private void createRplSlot() throws SQLException {
  try {
    this.rplConnection.getReplicationAPI()
        .createReplicationSlot()
        .logical()
        .withSlotName(this.jdbcConfig.getSlotName())
        .withOutputPlugin("test_decoding")
        .make();
  } catch (SQLException e) {
    String msg = "ERROR: replication slot \"" + this.jdbcConfig.getSlotName() + "\" already exists";
    if (msg.equals(e.getMessage())) {
      return;
    }
    throw e;
  }
  log.info("GetRplSlot success,slot:{}", this.slotName);
}
origin: eventuate-local/eventuate-local

.replicationStream()
.logical()
.withSlotName(replicationSlotName)
origin: io.debezium/debezium-connector-postgres

.createReplicationSlot()
.logical()
.withSlotName(slotName)
origin: io.debezium/debezium-connector-postgres

private PGReplicationStream startPgReplicationStream(final LogSequenceNumber lsn, Function<ChainedLogicalStreamBuilder, ChainedLogicalStreamBuilder> configurator) throws SQLException {
  assert lsn != null;
  ChainedLogicalStreamBuilder streamBuilder = pgConnection()
      .getReplicationAPI()
      .replicationStream()
      .logical()
      .withSlotName(slotName)
      .withStartPosition(lsn);
  streamBuilder = configurator.apply(streamBuilder);
  if (statusUpdateIntervalMillis != null && statusUpdateIntervalMillis > 0) {
    streamBuilder.withStatusInterval(statusUpdateIntervalMillis, TimeUnit.MILLISECONDS);
  }
  PGReplicationStream stream = streamBuilder.start();
  // TODO DBZ-508 get rid of this
  // Needed by tests when connections are opened and closed in a fast sequence
  try {
    Thread.sleep(10);
  } catch (Exception e) {
  }
  stream.forceUpdateStatus();
  return stream;
}
org.postgresql.replicationPGReplicationConnection

Javadoc

Api available only if connection was create with required for replication properties: PGProperty#REPLICATION and PGProperty#ASSUME_MIN_SERVER_VERSION. Without it property building replication stream fail with exception.

Most used methods

  • replicationStream
    After start replication stream this connection not available to use for another queries until replic
  • createReplicationSlot
    Create replication slot, that can be next use in PGReplicationConnection#replicationStream() Replic

Popular in Java

  • Updating database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • Kernel (java.awt.image)
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now