2 Replies Latest reply on Mar 27, 2013 6:01 AM by paulpa63

    New execution policies for the Distributed  Executor Service

    paulpa63 Newbie

      Hi,

       

      We have undertaken some recent development using the Infinispan distributed execution service for transfering large data objects between sites.  In order to achieve this we have currently had to patch the DistributedTaskExecutionPolicy (and also extend the DefaultExecutorService).  Our version of the DistributedTaskExecutionPolicy enum includes new values SITE and MACHINE and also properties for siteId and machineId.  The idea is that a task can be targetted at a specific site or machine where the siteId and/or machineId specified in the policy is matched to these attributes of a node address (the latter are sourced from the server hints in infinispan.xml).  Would the Infinispan project be interested in incorporating this patch?

       

      Paul

       

        • 1. Re: New execution policies for the Distributed  Executor Service
          Vladimir Blagojevic Master

          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 Newbie

            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;

             

                ...       

            }