Skip to content

Commit

Permalink
Fixed ExtraIndex cache behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
jellymlg committed Dec 18, 2024
1 parent f32b22e commit c6268d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,12 @@ trait ExtraIndexerBase extends Actor with Stash with ScorexLogging {
// perform segmentation on big addresses and save their internal segment buffer
trees.values.foreach { tree =>
tree.buffer.values.foreach(seg => segments.put(seg.id, seg))
tree.buffer.clear()
tree.splitToSegments.foreach(seg => segments.put(seg.id, seg))
}

// perform segmentation on big tokens and save their internal segment buffer
tokens.values.foreach { token =>
token.buffer.values.foreach(seg => segments.put(seg.id, seg))
token.buffer.clear()
token.splitToSegments.foreach(seg => segments.put(seg.id, seg))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class HistoryStorage(indexStore: LDBKVStore, objectsStore: LDBKVStore, extraStor
ExtraIndexSerializer.parseBytesTry(bytes) match {
case Success(pm) =>
log.trace(s"Cache miss for existing index $id")
if(pm.isInstanceOf[Segment[_]]){
extraCache.put(pm.id, pm) // cache all segment type objects
if(!pm.isInstanceOf[Segment[_]]){
extraCache.put(pm.id, pm) // cache non-segment objects
}
Some(pm)
case Failure(_) =>
Expand Down

0 comments on commit c6268d7

Please sign in to comment.