<div dir="ltr"><div>Sorry, I didn&#39;t read your code so I just assumed you&#39;re writing your own RebalancePolicy.<br><br></div>I think you need to implement your own RebalancePolicy, because ClusterTopologyManagerImpl by itself doesn&#39;t remember that a rebalance was triggerred. So if you call startRebalance, but there is already a rebalance in progress, it is just ignored. When the in-progress rebalance finishes, it calls RebalancePolicy.updateCacheStatus, and it&#39;s the RebalancePolicy implementation&#39;s job to start a new rebalance if needed.<br>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 12, 2013 at 5:28 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"><u></u>

  
    
  
  <div text="#000000" bgcolor="#ffffff">
    Hi Dan,<div class="im"><br>
    <br>
    On 2/12/13 3:12 PM, Dan Berindei wrote:
    <blockquote type="cite">
      <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>
    </blockquote></div>
    I didn&#39;t understand the previous sentence... Do I need to invoke
    anything in the RebalancePolicy? <br>
    <br>
    So far, I&#39;m invoking directly in the ClusterTopologyManager:
<a href="https://github.com/pruivo/infinispan/blob/cloudtm_v2/core/src/main/java/org/infinispan/dataplacement/DataPlacementManager.java#L246" target="_blank">https://github.com/pruivo/infinispan/blob/cloudtm_v2/core/src/main/java/org/infinispan/dataplacement/DataPlacementManager.java#L246</a><br>


    <br>
    Thanks!<br>
    <br>
    Cheers,<br>
    Pedro<div><div class="h5"><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
        </div>
        <div><br>
        </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" target="_blank">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:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);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" target="_blank">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>
      <pre><fieldset></fieldset>
_______________________________________________
infinispan-dev mailing list
<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></pre>
    </blockquote>
  </div></div></div>

<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>