private static evaluate_response newEvalStream ( Stream < Collection < CollectHistory . NamedEvaluation > > tsc , int fetch ) { final BufferedIterator < Collection < CollectHistory . NamedEvaluation > > iter = new BufferedIterator ( tsc . iterator ( ) , EVAL_QUEUE_SIZE ) ; final long idx = EVAL_ITERS_ALLOC . getAndIncrement ( ) ; final IteratorAndCookie < Collection < CollectHistory . NamedEvaluation > > iterAndCookie = new IteratorAndCookie <> ( iter ) ; EVAL_ITERS . put ( idx , iterAndCookie ) ; final List < Collection < CollectHistory . NamedEvaluation > > result = fetchFromIter ( iter , fetch , MAX_EVAL_FETCH ) ; EncDec . NewIterResponse < Collection < CollectHistory . NamedEvaluation > > responseObj = new EncDec . NewIterResponse <> ( idx , result , iter . atEnd ( ) , iterAndCookie . getCookie ( ) ) ; LOG . log ( Level . FINE , "responseObj = {0}" , responseObj ) ; return EncDec . encodeEvaluateResponse ( responseObj ) ; }
Create a new evaluation iterator from the given stream .