private void doFlushLsn(LogSequenceNumber lsn) throws SQLException { stream.setFlushedLSN(lsn); stream.setAppliedLSN(lsn); stream.forceUpdateStatus(); }
private void doFlushLsn(LogSequenceNumber lsn) throws SQLException { stream.setFlushedLSN(lsn); stream.setAppliedLSN(lsn); stream.forceUpdateStatus(); }
.forEach(eventConsumer); stream.setAppliedLSN(stream.getLastReceiveLSN()); stream.setFlushedLSN(stream.getLastReceiveLSN());
private void receiveStream() throws SQLException { assert !stream.isClosed(); assert !connection.isClosed(); //non blocking receive message ByteBuffer msg = stream.readPending(); if (msg == null) { TimeUtils.sleepInMills(10L); return; } int offset = msg.arrayOffset(); byte[] source = msg.array(); int length = source.length - offset; LogSequenceNumber lsn = stream.getLastReceiveLSN(); InvokeContext ctx = new InvokeContext(); ctx.setMessage(new String(source, offset, length)); ctx.setJdbcUrl(this.jdbcConfig.getUrl()); ctx.setJdbcUser(this.jdbcConfig.getUsername()); ctx.setJdbcPass(this.jdbcConfig.getPassword()); ctx.setSlotName(this.slotName); ctx.setServerId(this.serverId); ctx.setLsn(lsn.asLong()); eventParser.parse(ctx); //feedback stream.setAppliedLSN(lsn); stream.setFlushedLSN(lsn); }