[ https://issues.apache.org/jira/browse/RATIS-477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16763999#comment-16763999 ]
Josh Elser commented on RATIS-477: ---------------------------------- Filed RATIS-481 because I was getting stuck trying to work on this. Cleaning up processReadRequest into its own class should help with what I was trying to do here. > Improve LogStateMachine.processReadRequest() > -------------------------------------------- > > Key: RATIS-477 > URL: https://issues.apache.org/jira/browse/RATIS-477 > Project: Ratis > Issue Type: Improvement > Components: LogService > Reporter: Josh Elser > Assignee: Josh Elser > Priority: Major > Fix For: 0.4.0 > > > [~vrodionov] and [~rajeshbabu] were asking about this in RATIS-470. Can we > improve the logic that reads through the "head" of the RaftLog to find the > "LogService offset"? > Vlad suggested: > {quote} > Josh, can we simplify this a little bit? Client gets Raft log ID one every > append, for multi-get calls we can use this LogID (RAFT) as our start log ID > to avoid iterating through all logs, then you can unwind log entries by using > new logic, see above: > int numRecordsInAppend = append.getDataCount(); > There is no need to iterate from the very beginning > {quote} -- This message was sent by Atlassian JIRA (v7.6.3#76005)