[ https://issues.apache.org/jira/browse/RATIS-477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16756760#comment-16756760 ]
Vladimir Rodionov edited comment on RATIS-477 at 1/31/19 1:21 AM: ------------------------------------------------------------------ Keeping index in memory is very bad idea. If you will think about this, Josh. was (Author: vrodionov): Keeping index in memory is very bad idea. > 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)