Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-15300

EntryWrappingInterceptor many commands calculate segment multiple times

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 14.0.27.Final
    • 14.0.20.Final
    • Core
    • 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.

              wburns@redhat.com Will Burns
              wburns@redhat.com Will Burns
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: