public override bool Next(InputChunk chunk)
 {
     lock (this)
     {
         if (_id >= _highId)
         {
             return(false);
         }
         long startId = _id;
         _id = min(_highId, startId + _batchSize);
         (( StoreScanChunk )chunk).initialize(startId, _id);
         return(true);
     }
 }
Esempio n. 2
0
 public override bool Next(InputChunk chunk)
 {
     lock (this)
     {
         if (_numberOfBatches > 1)
         {
             _numberOfBatches--;
             long batch = _nextBatch++;
             (( Chunk )chunk).Initialize(_states.apply(batch), batch, _batchSize);
             return(true);
         }
         else if (_numberOfBatches == 1)
         {
             _numberOfBatches--;
             int  rest  = toIntExact(_totalCount % _batchSize);
             int  size  = rest != 0 ? rest : _batchSize;
             long batch = _nextBatch++;
             (( Chunk )chunk).Initialize(_states.apply(batch), batch, size);
             return(true);
         }
         return(false);
     }
 }