Hello,
  I think that speed of rebalancing can be increased by parallel handling
of supply messages.
  Main Idea is to use per-partition topics.

  At the start of DemandPool we can create topics for every partition and
handle each partition's supply messages at separated listener. In this case
only one thread will request lock for partition it have to relocate.

  Also we can do the same at SupplyPool, and make supply messages in
parallel way.

  Amount of simultaneous messages should be limited to prevent overloading.
Current idea is to request N partitions at start and request one next
partition when one of prevous relocated.

  Per-partition listeners can be created this way:
for (int p = 0; p <= maxP; p++) {
    cctx.io().addOrderedHandler(topic(p), new CI2<UUID,
GridDhtPartitionSupplyMessage>() {
        @Override public void apply(UUID nodeId,
GridDhtPartitionSupplyMessage msg) {
            handleSupplyMessage(new SupplyMessage(nodeId, msg));
        }
    });
}

Thoughts?

Reply via email to