@Override
            public long run() {
                if (Thread.interrupted()) {
                    return -1;
                }
                long uploadPeriod = isIngestState() ? setting.uploadPeriodMS : 0;
                long maxRow = isIngestState() ? setting.maxRowInRealtime : 0;
                Long nextPeriod = Try.on(
                        () -> rtsGroup.handle(
                                uploadPeriod,
                                maxRow,
                                uploader,
                                rtResources),
                        1, logger,
                        String.format("Handle rts group failed. [table: %s, rtsg: %s]", tableName, rtsGroup.name()));

                if (state == State.RECOVER && !containsRecoverRTSG()) {
                    logger.info("Recover realtime table completed. [table: {}]", tableName);
                    state = State.RUN;
                }

                return nextPeriod == null ? handleRetryPeriod : nextPeriod;
            }
Close this realtime table. Job is done.
This method only called before process exit.
indexr-segment/src/main/java/io/indexr/segment/rt/RealtimeTable.java