-
Bug
-
Resolution: Unresolved
-
Major
-
14.0.20.Final
-
None
All of the "many" commands in EntryWrappingInterceptor follow the pattern or something very similar like so
currentStage = entryFactory.wrapEntryForWriting(ctx, key, keyPartitioner.getSegment(key), ignoreOwnership || canReadKey(key), command.loadType() != VisitableCommand.LoadType.DONT_LOAD, currentStage);
In this case the segment is calculated in the explicit call to getSegment but it is also done in the canReadKey as it has to determine the segment to know if the current node is an owner or not. We can instead just reuse the computed segment to avoid calculating the segment twice for every key.