title: Hazelcast Distributed Executor Service KeyOwner
body: <p>I have problem understanding the concept of Hazelcast Distributed Execution. It is said to be able to perform the execution on the owner instance of a specific key.<br/>
  From Documentation:</p>
  
  <pre><code>   &lt;T&gt; Future&lt;T&gt; submitToKeyOwner(Callable&lt;T&gt; task, Object key)
     Submits task to owner of the specified key and returns a Future representing that task.
         Parameters:
              task - task
              key - key
         Returns:
              a Future representing pending completion of the task
  </code></pre>
  
  <p>I believe that I'm not alone to have a cluster built with multiple maps which might actually use the same key for different purposes, holding different objects (e.g. something along the following setup):</p>
  
  <pre><code>IMap&lt;String, ObjectTypeA&gt; firstMap = HazelcastInstance.getMap("firstMap");
  IMap&lt;String, ObjectTypeA_AppendixClass&gt; secondMap = HazelcastInstance.getMap("secondMap");
  </code></pre>
  
  <p>To me it seems quite confusing what documentation says about the owner of a key. My real frustration is that I don't know WHICH - in which map - key does it refer to?<br/>
  The documentation also gives a "demo" of this approach:</p>
  
  <pre><code>import com.hazelcast.core.Member;
  import com.hazelcast.core.Hazelcast;
  import com.hazelcast.core.IExecutorService;
  import java.util.concurrent.Callable;
  import java.util.concurrent.Future;   
  import java.util.Set;
  import com.hazelcast.config.Config;
  
  public void echoOnTheMemberOwningTheKey(String input, Object key) throws Exception {
     Callable&lt;String&gt; task = new Echo(input);
     HazelcastInstance hz = Hazelcast.newHazelcastInstance();
     IExecutorService executorService = hz.getExecutorService("default");
     Future&lt;String&gt; future = executorService.submitToKeyOwner(task, key);
     String echoResult = future.get();
  }
  </code></pre>
  
  <p>Here's a link to the documentation site: <a href="http://www.hazelcast.com/docs/3.0/manual/multi_html/ch08.html" rel="nofollow">Hazelcast MultiHTML Documentation 3.0 - Distributed Execution</a><br/>
  Did any of you guys figure out in the past what key does it want?</p>