private void loaderSegments() throws IOException {
            final List<Segment> accum = new ArrayList<>();
            String fileSuffix = DataStoreUtils.DATA_FILE_SUFFIX;
            final File[] ls = topicDir.listFiles();
            if (ls != null) {
                for (final File file : ls) {
                    if (file == null) {
                        continue;
                    }
                    if (file.isFile() && file.toString().endsWith(fileSuffix)) {
                        if (!file.canRead()) {
                            throw new IOException(new StringBuilder(512)
                                    .append("Could not read DATA file ").append(file).toString());
                        }
                        final String filename = file.getName();
                        final long start =
                                Long.parseLong(filename.substring(0, filename.length() - fileSuffix.length()));
                        accum.add(new FileSegment(start, file, false, SegmentType.DATA));
                    }
                }
            }
            if (accum.size() > 0) {
                // compare segment's start value, and sort order
                Collections.sort(accum, new Comparator<Segment>() {

                    @Override
                    public int compare(final Segment o1, final Segment o2) {
                        if (o1.getStart() == o2.getStart()) {
                            return 0;
                        } else if (o1.getStart() > o2.getStart()) {
                            return 1;
                        } else {
                            return -1;
                        }
                    }
                });
                validateSegments("DATA", accum);
            }
            segments = new FileSegmentList(accum.toArray(new Segment[accum.size()]));
            logger.info(new StringBuilder(512)
                    .append("[Data Repair] Loaded DATA ")
                    .append(accum.size()).append(" segments from ")
                    .append(topicDir.getAbsolutePath()).toString());
        }
Repair topic storage files, rebuild index files by existing data files
@param args   Startup parameter array, including the following parts:
              The 1st parameter is the path of topic storage files;
              The 2nd parameter is the topic name(s) that needs to be repaired,
                  if not specified, all topics in the storage path will be repaired.
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/tools/StoreRepairAdmin.java