Change using of limit argument in get_sample

Use 'limit' as argument in scan method instead of self written approach.

Change-Id: I2576b3bf3bb210ba0f21391766e62e19c23b21a0
Merge "Change using of limit argument in get_sample"