-
1. Re: New execution policies for the Distributed Executor Service
vblagojevic Mar 23, 2013 11:34 AM (in response to paulpa63)Paul,
Sounds great. There is a bit of legal stuff you would have to go through (https://cla.jboss.org) but submit your code as a pull request and talk to Mircea regarding this contribution.
Regards,
Vladimir
-
2. Re: New execution policies for the Distributed Executor Service
paulpa63 Mar 27, 2013 6:01 AM (in response to vblagojevic)Hi Vladimir,
My work environment has some constraints which make transfer of patches difficult and time-consuming. In this case my patch is very simple and I will transcribe it below for your consideration.
Hope this is of use,
Paul
-------------------
public enum DistributedTaskExecutionPolicy {
ALL, SAME_MACHINE, SAME_RACK, SAME_SITE, SITE, MACHINE;
private String siteId;
private String machineId;
// ... getters and setters
}
-------------------
private List<Address> DefaultExecutorService.filterMembers(...) {
...
case SITE:
filter = new NodeFilter {
private final String siteId = policy.getSiteId();
@Override
public boolean include(TopologyAwareAddress thisAddress, TopologyAwareAddress otherAddress) {
return thisAddress.getSiteId().equals(siteId);
}
};
break;
case MACHINE:
filter = new NodeFilter {
private final String siteId = policy.getSiteId();
private final String machineId = policy.getMachineId();
@Override
public boolean include(TopologyAwareAddress thisAddress, TopologyAwareAddress otherAddress) {
return thisAddress.getSiteId().equals(siteId) && thisAddress.getMachineId().equals(machineId);
}
};
break;
...
}