Go to next start position.

@return true, if successful
@throws IOException Signals that an I/O exception has occurred.
430414
private boolean goToNextStartPosition() throws IOException {
    int basicStartPositionMin;
    int basicStartPositionMax;
    int basicEndPosition;
    int basicEndPositionMin;
    int basicEndPositionMax;
    if (docId == -1 || docId == NO_MORE_DOCS) {
      throw new IOException("no document");
    } else {
      if (lastCollectedStartPosition < NO_MORE_POSITIONS
          && (collectedPositions.isEmpty()
              || (collectedPositions.firstKey() >= (lastCollectedStartPosition
                  - query.maximumLeft)))) {
        // collect new positions
        while ((lastCollectedStartPosition = subSpans
            .nextStartPosition()) != NO_MORE_POSITIONS) {
          basicEndPosition = subSpans.endPosition();
          basicStartPositionMin = Math.max(minPosition,
              lastCollectedStartPosition - query.maximumLeft);
          basicStartPositionMax = lastCollectedStartPosition
              - query.minimumLeft;
          basicEndPositionMin = basicEndPosition + query.minimumRight;
          basicEndPositionMax = Math.min(maxPosition + 1,
              basicEndPosition + query.maximumRight);
          for (int cLeft = basicStartPositionMin; cLeft <= basicStartPositionMax; cLeft++) {
            for (int cRight = basicEndPositionMin; cRight <= basicEndPositionMax; cRight++) {
              if (!collectedPositions.containsKey(cLeft)) {
                collectedPositions.put(cLeft, new ArrayList<Integer>());
              }
              collectedPositions.get(cLeft).add(cRight);
            }
          }
          if (!collectedPositions.isEmpty() && (collectedPositions
              .firstKey() < (lastCollectedStartPosition - query.maximumLeft))) {
            break;
          }
        }
      }
      if (collectedPositions.isEmpty()) {
        return false;
      } else {
        startPosition = collectedPositions.firstKey();
        endPosition = collectedPositions.get(startPosition).remove(0);
        if (collectedPositions.get(startPosition).isEmpty()) {
          collectedPositions.remove(startPosition);
        }
        return true;
      }
    }
  }
347766
private void setCatchingUp() throws IOException {
    try {
      if (inputEditStream != null && inputEditStream.isInProgress()) {
        catchingUp = (inputEditStream.length() - inputEditStream.getPosition() > catchUpLag);
      } else {
        catchingUp = true;
      }
    } catch (Exception e) {
      catchingUp = true;
    }
  }
199516
public final int next() throws IOException {
        if (m_nextException!=null) {
            throw m_nextException;
        }
        try {
            return doNext();
        }
        catch (IOException e) {
            m_nextException=e;
            resetState();
            throw e;
        }
    }
507983
public int run() throws IOException {
    List<WorkerLostStorageInfo> workerLostStorageList = mBlockMasterClient.getWorkerLostStorage();
    if (workerLostStorageList.size() == 0) {
      mPrintStream.println("All worker storage paths are in working state.");
      return 0;
    }
    for (WorkerLostStorageInfo info : workerLostStorageList) {
      Map<String, StorageList> lostStorageMap = info.getLostStorageMap();
      if (lostStorageMap.size() != 0) {
        mPrintStream.printf("The following storage paths are lost in worker %s: %n",
            info.getAddress().getHost());
        for (Map.Entry<String, StorageList> tierStorage : lostStorageMap.entrySet()) {
          for (String storage : tierStorage.getValue().getStorageList()) {
            mPrintStream.printf("%s (%s)%n", storage, tierStorage.getKey());
          }
        }
      }
    }
    return 0;
  }
302896
@Override
  public int advance(int target) throws IOException {
    reset();
    if (docId == NO_MORE_DOCS) {
      return docId;
    } else if (target <= docId) {
      // should not happen
      docId = NO_MORE_DOCS;
      return docId;
    } else {
      docId = subSpans.advance(target);
      if (docId == NO_MORE_DOCS) {
        return docId;
      } else {
        IndexDoc doc = mtasCodecInfo.getDoc(field, docId);
        if (doc != null) {
          minPosition = doc.minPosition;
          maxPosition = doc.maxPosition;
        } else {
          minPosition = NO_MORE_POSITIONS;
          maxPosition = NO_MORE_POSITIONS;
        }
        if (goToNextStartPosition()) {
          return docId;
        } else {
          return nextDoc();
        }
      }
    }
  }
4547
protected synchronized void navigateToIndex(int reqIndex)
			throws IOException {
		// determine if navigation is necessary
		if (reqIndex != index) {
			// ensure that the requested index is valid
			if (reqIndex < 0 || reqIndex >= size) {
				throw new IndexOutOfBoundsException();
			}
			// navigate to requested index in file
			if (reqIndex > index) {
				// forward navigation
				skipForward(reqIndex - index);
			} else {
				// backward navigation
				int backSkips = index - reqIndex;
				if (backSkips < (index / 2)) {
					// check if current index is beyond valid list
					if (index == size) {
						// reset current position to last element in
						// set and adjust index and skip counter.
						index = (size - 1);
						position = lastInsertPosition;
						backSkips = index - reqIndex;
					}
					// move in backward direction
					skipBackward(backSkips);
				} else {
					// it is faster to reset position to the beginning
					// of the file and move forward from there to the
					// requested index
					resetPosition();
					skipForward(reqIndex);
				}
			}
		}
		if (reqIndex != index) {
			throw new IOException("Navigation fault! (required: " + reqIndex
					+ ", yielded: " + index + ")");
		}
	}
282443
public boolean execute() throws IOException {
    if (stopOnError) {
      for (int i = 0; i < actions.length; i++) {
        if (!actions[i].execute()) {
          return false;
        }
      }

      return true;
    } else {
      boolean status = true;
      IOException exception = null;

      for (int i = 0; i < actions.length; i++) {
        try {
          status &= actions[i].execute();
        } catch (IOException ex) {
          status = false;

          if (exception == null) {
            exception = ex;
          }
        }
      }

      if (exception != null) {
        throw exception;
      }

      return status;
    }
  }
773340
@Override
	public boolean next() {
		while (true) {
			if (rp.next())
				return true;
			if (current == endBlkNum)
				return false;
			moveToBlock(current + 1);
		}
	}
1048718
public final void seek(long pPosition) throws IOException {
        checkOpen();

        // TODO: This is correct according to javax.imageio (IndexOutOfBoundsException),
        // but it's inconsistent with reset that throws IOException...
        if (pPosition < flushedPosition) {
            throw new IndexOutOfBoundsException("position < flushedPosition!");
        }

        seekImpl(pPosition);
        position = pPosition;
    }
443642
public boolean next() {
    if (sketchAccessor_ == null) { // initial setup
      sketchAccessor_ = DoublesSketchAccessor.wrap(sketch_);
    } else { // advance index within the current level
      i_++;
    }
    if (i_ < sketchAccessor_.numItems()) {
      return true;
    }
    // go to the next non-empty level
    do {
      level_++;
      if (level_ > 0) {
        bits_ >>>= 1;
      }
      if (bits_ == 0L) {
        return false; // run out of levels
      }
      weight_ *= 2;
    } while ((bits_ & 1L) == 0L);
    i_ = 0;
    sketchAccessor_.setLevel(level_);
    return true;
  }
1164892
public boolean nextBatch() throws IOException {
    for (WritableColumnVector vector : columnVectors) {
      vector.reset();
    }
    columnarBatch.setNumRows(0);
    if (rowsReturned >= totalRowCount) return false;
    checkEndOfRowGroup();

    int num = (int) Math.min((long) capacity, totalCountLoadedSoFar - rowsReturned);
    for (int i = 0; i < columnReaders.length; ++i) {
      if (columnReaders[i] == null) continue;
      columnReaders[i].readBatch(num, columnVectors[i]);
    }
    rowsReturned += num;
    columnarBatch.setNumRows(num);
    numBatched = num;
    batchIdx = 0;
    return true;
  }
230534
public final boolean start() {

        if (running || booting || stopping || terminated) {
            // do nothing if this instance is not stopped
            return false;
        } else {
            // mark this instance started
            booting = true;
            running = true;

            onStarted();

            return true;
        }
    }
379530
public Execed start() throws IOException
	{
		Process p = getProcessBuilder().start();

		return new Execed(cmd, p, builder.redirectErrorStream());
	}
635771
private boolean doStart()
  {
    if (! _lifecycle.isActive()) {
      return false;
    }
    
    if (! isEnable()) {
      return false;
    }
    
    int startingCount = _startingCount.get();

    int threadCount = _threadCount.get() + startingCount;

    if (_threadMax < threadCount) {
      onThreadMax();
      
      return false;
    }
    else if (! isIdleTooLow(startingCount)) {
      return false;
    }
    
    _idleCount.incrementAndGet();

    startConnection();
      
    return true;
  }
1271491
public Object next()
    {
        _current1.reset();
        if (_last1.key() == null)
            findFirst(_dstack);
        else
        {
            findNext(_dstack);
            if (_current1.key() == null)
                _eof = true;
        }

        if (_current1.key() != null)
            _last1.setLocation(_current1);

        return _current1.key();
    }
638270
public boolean nextInput() throws IOException
    {
        if (!options.contains(READ) && !inflater.finished())
        {
            throw new IllegalStateException("should be called after read returns -1");
        }
        if (!compBuf.hasRemaining())
        {
            compBuf.clear();
            int rc = channel.read(compBuf);
            if (rc == -1)
            {
                return false;
            }
            compBuf.flip();
        }
        readHeader();
        inflater.reset();
        crc32.reset();
        return true;
    }
859523
@Override
	public ISynchronizationPoint<Exception> start() {
		SynchronizationPoint<Exception> sp = new SynchronizationPoint<>();
		io.canStartReading().listenAsync(new Task.Cpu.FromRunnable(() -> {
			try {
				Starter start = new Starter(io, defaultEncoding, charactersBuffersSize, maxBuffers);
				stream = start.start();
				next().listenInline(sp);
			} catch (Exception e) {
				sp.error(e);
			}
		}, "Start parsing XML", io.getPriority()), true);
		return sp;
	}