The patch I uploaded contains a feature for making PE to be exclusive. By setting exclusive number N for a PE, when deploying, N partition will be allocated to this PE. And the other non-exclusive PEs will be deployed to the left partitions as before, keep symmetrical design.
To distinguish the PE partition and the Cluster partition, I use global partition to call the partition id in a cluster. And the mainly change is in App, Stream and Sender.
1. In App, add a schedule method for allocating global partition to PEs
2. In Sender, change the send(String hashkey, Event event) to be send(int partition, Event event). Because now sender cannot decide sending to which global partition only by hashkey, PE type also need be known. I move this part of logic into Stream. Let PE decides which global partition need be sent.
3.In Stream, add a logic for iterating PEs and checking if this event need be sent to local.
There are two test cases for this feature, one for testing the schedule, and another reuses the WordCount test case to check if the logical is right.