Forum Stats

  • 3,853,853 Users
  • 2,264,287 Discussions
  • 7,905,483 Comments

Discussions

LimitFilter assumption if number returned < bufferSize

bish
bish Member Posts: 30
edited Nov 24, 2017 9:07AM in Coherence Support

Hi,

I have the following c# extend code that pages a result set. Is it safe to assume that if GetValues returns less values than the LimitFilter bufferCount, then

all data has been returned (subsequent nextPage and GetValues is not required to be called again)?

In the system, the first GetValues call returns 20 values in roughly one second.

Since 20 < 1000, we are assuming that there is nothing left to return, but this makes me slightly uneasy.

If Icomment out the code and no longer break out of the while loop at this point and call NextPage and then GetValues, The GetValues call takes roughly ten seconds

and returns no data.

So is this workaround safe ? Any advice on why this last call might be taking such time would also  be appreciated.

var bufferCount = 1000;

var pagedFilter = new LimitFilter(allFilter, bufferCount);

var values = cache.GetValues(pagedFilter).ToList();

while (values.Count > 0)

{

     // is this safe?

     if (values.Count < bufferCount)

          break;

     pagedFilter.NextPage();

     values = cache.GetValues(pagedFilter).ToList();

}

thx

bish

Answers

This discussion has been closed.