private void sendAll(List<OTSLine> lines) throws InterruptedException {
    Thread.sleep(Common.getDelaySendMillinSeconds(retryTimes, conf.getSleepInMilliSecond()));
    try {
      BatchWriteRowRequest batchWriteRowRequest = createRequset(lines);
      BatchWriteRowResult result =
          RetryHelper.executeWithRetry(
              new BatchWriteRowCallable(ots, batchWriteRowRequest),
              conf.getRetry(),
              conf.getSleepInMilliSecond());

      LOG.debug("Requst ID : {}", result.getRequestID());
      List<LineAndError> errors = getLineAndError(result, lines);
      if (!errors.isEmpty()) {
        if (retryTimes < conf.getRetry()) {
          retryTimes++;
          LOG.debug("Retry times : {}", retryTimes);
          List<OTSLine> newLines = new ArrayList<OTSLine>();
          for (LineAndError re : errors) {
            if (RetryHelper.canRetry(re.getError().getCode())) {
              RetryHelper.logManager.addException(re.getError(), result.getRequestID());
              newLines.add(re.getLine());
            } else {
              LOG.error("Can not retry, record row to collector. {}", re.getError().getMessage());
              collector.collectDirtyRecord(re.getLine().getRecord(), re.getError().getMessage());
            }
          }
          if (!newLines.isEmpty()) {
            sendAll(newLines);
          }
        } else {
          LOG.error("Retry times more than limition. RetryTime : {}", retryTimes);
          Common.collectDirtyRecord(collector, errors);
        }
      }
    } catch (Exception e) {
      LOG.debug("Send data fail.", e);
      if (isExceptionForSendOneByOne(e)) {
        if (lines.size() == 1) {
          LOG.error("Can not retry for Exception : {}", e.getMessage());
          Common.collectDirtyRecord(collector, lines, e.getMessage());
        } else {
          // 进入单行发送的分支
          sendAllOneByOne(lines);
        }
      } else {
        LOG.error("Can not send lines to OTS. {}", e.getMessage());
        Common.collectDirtyRecord(collector, lines, e.getMessage());
      }
    }
  }