I come back to you.
I didn't really solved my issue with range(int, int) and limit().
I'm able to limit the size of the hashmap at the end by the operation:
traversal[filtring step].groupCount().cap().next().take(3)
My concern is to be able to limit the memory usage. I'm worry by the production of the Hashmap. Indeed, I read this like : applied your filter, count group, produce the hashmap and then limit it size. If Gremlin work like this, the output of the next() step will be very huge. So how work Gremlin for this case ?
My second issue is still with the range(int, int)-step. If I want the 1 000 000-th value of the group count, then I don't want produce all the hashmap to keep only one value. Gremlin has no method to do that ? If not, I will search another way but I have no clue how to do it for the moment.
Best regards,
Thomas