File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -614,10 +614,12 @@ long getLastIndexInClosedSegments() {
614614
615615 TermIndex getLastTermIndex () {
616616 try (AutoCloseableLock readLock = closedSegments .readLock ()) {
617- return (openSegment != null && openSegment .getLastTermIndex () != null ) ?
618- openSegment .getLastTermIndex () :
619- (closedSegments .isEmpty () ? null :
620- closedSegments .get (closedSegments .size () - 1 ).getLastTermIndex ());
617+ TermIndex lastOpenIndex =
618+ (openSegment != null ) ? openSegment .getLastTermIndex () : null ;
619+ return lastOpenIndex != null
620+ ? lastOpenIndex
621+ : (closedSegments .isEmpty () ? null :
622+ closedSegments .get (closedSegments .size () - 1 ).getLastTermIndex ());
621623 }
622624 }
623625
You can’t perform that action at this time.
0 commit comments