<div dir="ltr"><div>Hi Pedro<br><br></div><div>When I split off the RebalancePolicy I was thinking that when a RebalancePolicy needs to collaborate with a ConsistentHashFactory, they should do so via another cache manager-scoped component. But that doesn&#39;t really work (yet?), because ConsistentHashFactory can&#39;t access any components.<br>

</div><div><br></div><div></div><div>I think it would be better to extend ClusterTopologyManager.triggerRebalance (and ConsistentHashFactory.rebalance) to accept an arbitrary Object parameter. Then RebalancePolicy could use this parameter to pass extra information to the CHF, like your Mappings object, and then when ClusterTopologyManagerImpl asks for a balanced CH, the CHF will include the Mappings in the result CH. What do you think?<br>

<br></div><div>In order to trigger the rebalance you have to call startRebalance, and the new (&quot;balanced&quot;) consistent hash must not be equal to the existing consistent hash. See <a href="https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/topology/ClusterTopologyManagerImpl.java#L389">https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/topology/ClusterTopologyManagerImpl.java#L389</a><br>

<br></div><div>Cheers<br></div><div>Dan<br><br></div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 7, 2013 at 10:05 PM, Pedro Ruivo <span dir="ltr">&lt;<a href="mailto:pruivo@gsd.inesc-id.pt" target="_blank">pruivo@gsd.inesc-id.pt</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I&#39;m working in a way to rebase auto-placer on top of NBST and I have one<br>
question...<br>
If you have already forgot, auto-placer analyzes the workload and tries<br>
to move the most remote accessed keys to the corresponding requester.<br>
<br>
After calculating the new mappings, I want to trigger the NBST with this<br>
mapping. I&#39;m thinking to add a new method in the ClusterTopologyManager,<br>
something like:<br>
<br>
triggerAutoPlacer(String cacheName, Mappings newMappings);<br>
<br>
and this method it will be a duplicate of triggerRebalance but instead<br>
of doing chFactory.rebalance(CH) (in the startRebalance() method) I&#39;m<br>
thinking to do chFactory.autoPlacer(CH, Mappings). The last method will<br>
override the defautl CH location.<br>
<br>
Question: will this solution trigger the NBST or do I have to create the<br>
triggerAutoPlacer() method in another class?<br>
<br>
ps. forget the methods names... I will think in better names later<br>
<br>
Thanks!!<br>
<br>
Cheers,<br>
Pedro<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</blockquote></div><br></div>