static long getEntrySize(LogEntryProto entry) { final int serialized = ServerProtoUtils.removeStateMachineData(entry).getSerializedSize(); return serialized + CodedOutputStream.computeUInt32SizeNoTag(serialized) + 4; }
WriteLog(LogEntryProto entry) { this.entry = ServerProtoUtils.removeStateMachineData(entry); if (this.entry == entry || stateMachine == null) { this.stateMachineFuture = null; } else { try { // this.entry != entry iff the entry has state machine data this.stateMachineFuture = stateMachine.writeStateMachineData(entry); } catch (Throwable e) { LOG.error(name + ": writeStateMachineData failed for index " + entry.getIndex() + ", entry=" + ServerProtoUtils.toLogEntryString(entry), e); throw e; } } this.combined = stateMachineFuture == null? super.getFuture() : super.getFuture().thenCombine(stateMachineFuture, (index, stateMachineResult) -> index); }
if (stateMachineCachingEnabled) { cache.appendEntry(ServerProtoUtils.removeStateMachineData(entry)); } else { cache.appendEntry(entry);