Source:
public long append(Object object, Function<TokenResponse, Boolean> acquisitionCallback, Function<TokenResponse, Boolean> deacquisitionCallback) { final LogData ld = new LogData(DataType.DATA, object, runtime.getParameters().getCodecType()); try (ILogData.SerializationHandle sh = ld.getSerializedForm(false)) { int payloadSize = ld.checkMaxWriteSize(runtime.getParameters().getMaxWriteSize()); TokenResponse tokenResponse = runtime.getSequencerView().next(id); for (int x = 0; x < runtime.getParameters().getWriteRetry(); x++) { if (acquisitionCallback != null) { if (!acquisitionCallback.apply(tokenResponse)) { log.warn("Acquisition rejected token={}", tokenResponse); return -1L; } } try { runtime.getAddressSpaceView().write(tokenResponse, ld); return tokenResponse.getToken().getSequence(); } catch (OverwriteException oe) { log.warn("Overwrite occurred at {}", tokenResponse); if (deacquisitionCallback != null) { if (!deacquisitionCallback.apply(tokenResponse)) { log.debug("Deacquisition requested abort"); return -1L; } } tokenResponse = runtime.getSequencerView().next(id); } catch (StaleTokenException te) { log.warn("Token grew stale occurred at {}", tokenResponse); if (deacquisitionCallback != null && !deacquisitionCallback.apply(tokenResponse)) { log.debug("Deacquisition requested abort"); return -1L; } tokenResponse = runtime.getSequencerView().next(id); } } log.error("append[{}]: failed after retries, stream: {}, write size bytes", tokenResponse.getSequence(), runtime.getParameters().getWriteRetry(), this.id, payloadSize); } throw new AppendException(); }

Target:
public long append(Object object, Function<TokenResponse, Boolean> acquisitionCallback, Function<TokenResponse, Boolean> deacquisitionCallback) { final LogData ld = new LogData(DataType.DATA, object, runtime.getParameters().getCodecType()); try (ILogData.SerializationHandle sh = ld.getSerializedForm(false)) { int payloadSize = ld.checkMaxWriteSize(runtime.getParameters().getMaxWriteSize()); TokenResponse tokenResponse = runtime.getSequencerView().next(id); for (int retry = 0; retry < runtime.getParameters().getWriteRetry(); retry++) { if (acquisitionCallback != null) { if (!acquisitionCallback.apply(tokenResponse)) { log.warn("Acquisition rejected token={}", tokenResponse); return Address.NON_ADDRESS; } } try { runtime.getAddressSpaceView().write(tokenResponse, ld); return tokenResponse.getToken().getSequence(); } catch (OverwriteException oe) { log.warn("Overwrite occurred at {}", tokenResponse); if (deacquisitionCallback != null) { if (!deacquisitionCallback.apply(tokenResponse)) { log.debug("Deacquisition requested abort"); return Address.NON_ADDRESS; } } tokenResponse = runtime.getSequencerView().next(id); } catch (StaleTokenException te) { log.warn("Token grew stale occurred at {}", tokenResponse); if (deacquisitionCallback != null && !deacquisitionCallback.apply(tokenResponse)) { log.debug("Deacquisition requested abort"); return Address.NON_ADDRESS; } tokenResponse = runtime.getSequencerView().next(id); } } log.error("append[{}]: failed after retries, stream: {}, write size bytes", tokenResponse.getSequence(), runtime.getParameters().getWriteRetry(), this.id, payloadSize); } throw new AppendException(); }