code: private void setupIngestStreamWithRetries(long txid) throws IOException {
      for (int i = 0; i < inputStreamRetries; i++) {
        try {
          setupCurrentEditStream(txid);
          return;
        } catch (IOException e) {
          if (i == inputStreamRetries - 1) {
            throw new IOException("Cannot obtain stream for txid: " + txid, e);
          }
          LOG.info("Error :", e);
        }
        sleep(1000);
        LOG.info("Retrying to get edit input stream for txid: " + txid
            + ", tried: " + (i + 1) + " times");
      }
    }
docs: Setup the input stream to be consumed by the reader, with retries on
  failures.