Home > front end >  Hazelcast not using it's own partition-operations threads resulting in lack of order
Hazelcast not using it's own partition-operations threads resulting in lack of order

Time:10-06

I would like some support with the management of partition-aware operations. I am not able to see use of partition-operation threads within eclipse debugger (see attached images). Only ForkJoinPool workers are ever used.

This is applicable to the following operations:

  1. map.submitToKey(strategyId, new TriggerUpdateEntryProcessor(update)); This is using a Offloadable implementation (but not readonly) therefore should be processed in blocking mode, but it does not.
  2. executorService.executeOnKeyOwner(triggerUpdateTask, strategyId); It’s also meant to be possible to submit a partition-aware task observation

    idle threads

    CodePudding user response:

    If you implement Offloadable the entry processor will NOT run on the partition thread. From the Javadoc:

    If the EntryProcessor implements the Offloadable interface the processing will be offloaded to the given ExecutorService allowing unblocking the partition-thread, which means that other partition-operations may proceed. The key will be locked for the time-span of the processing in order to not generate a write-conflict. In this case the threading looks as follows:

    partition-thread (fetch & lock)
    execution-thread (process)
    partition-thread (set & unlock, or just unlock if no changes)

    If you want to run the entry processor on the partition thread then just don't implement Offloadable.

  • Related