class RangeStreamScanner extends ScannerSession implements Callable<RangeStreamScanner> {

    @Override
    public boolean hasNext() {
        /*
         * Let's take a moment to look through all states S
         */
        try {
            if (null != stats)
                stats.getTimer(TIMERS.HASNEXT).resume();
            
            while (null == currentEntry && (!finished || !resultQueue.isEmpty() || flushNeeded())) {
                
                try {
                    /*
                     * Poll for one second. We're in a do/while loop that will break iff we are no longer running or there is a current entry available.
                     */
                    currentEntry = resultQueue.poll(getPollTime(), TimeUnit.MILLISECONDS);
                    
                } catch (InterruptedException e) {
                    log.error(e);
                    throw new RuntimeException(e);
                }
                // if we pulled no data and we are not running, and there is no data in the queue
                // we can flush if needed and retry
                if (currentEntry == null && (!finished && resultQueue.isEmpty())) {
                    submitTask();
                } else if (flushNeeded()) {
                    flush();
                }
            }
        } finally {
            if (null != stats) {
                try {
                    stats.getTimer(TIMERS.HASNEXT).suspend();
                } catch (Exception e) {
                    log.error(e);
                }
            }
            if (uncaughtExceptionHandler.getThrowable() != null) {
                log.error("Exception discovered on hasNext call", uncaughtExceptionHandler.getThrowable());
                Throwables.propagate(uncaughtExceptionHandler.getThrowable());
            }
        }
        return (null != currentEntry);
    }

    public  RangeStreamScanner(String tableName, Set<Authorizations> auths, ResourceQueue delegator, int maxResults, Query settings);
    public  RangeStreamScanner(String tableName, Set<Authorizations> auths, ResourceQueue delegator, int maxResults, Query settings, SessionOptions options,
                    Collection<Range> ranges);
    public  RangeStreamScanner(ScannerSession other);

}