2 Replies Latest reply: Feb 13, 2014 3:29 AM by 1028528 RSS

    aggregate() called twice on each node

    1028528

      Guys,

       

      I am seeing aggregate() method is called twice on every node for the same invocation, I can’t understand why? First aggregate() is called without passing any entries at all and second time its called it with entries matching the filter. Why is it called twice on every single node?

       

      I was under the impression aggregate() will be called once per node with any data matching the filter and aggregateAll() will be called once on the proxy/client invoking the aggregator.

       

      Any insight in to this will be helpful.

       

      Thanks

      K

        • 1. Re: aggregate() called twice on each node
          alexey.ragozin

          Filter based requests (including filter based aggregation) are processed in batches using single thread. Batch could be any number of partition (from1 to all owned partitions).

          Deserialized cache entry are kept in memory until batch is finished (i.e. filter may require deserialization and aggregator later may require deserialization too).

           

          If whole cache is to be processed in one batch, it would cause to much memory pressure, so Coherence is splitting processing into several batches.

           

          First batch is usually one partition, it is used to estimate real memory pressure per partition for request and choose optimal number for further batches (often you will see exactly two batches - single partition, then rest of partitions).

           

          Each batch is separate aggregate() call (or processAll() in case of entry processor).

          • 2. Re: aggregate() called twice on each node
            1028528

            Hi Alexey,

             

            Ahh.. That explains why am seeing aggregate() being called twice on each node.

             

            Thanks

            K