public void validateSegments(final String segTypeStr, final List<Segment> segments) {
            // valid segments continuous
            for (int i = 0; i < segments.size() - 1; i++) {
                final Segment curr = segments.get(i);
                final Segment next = segments.get(i + 1);
                if (curr.getStart() + curr.getCachedSize() != next.getStart()) {
                    throw new IllegalStateException(new StringBuilder(512)
                            .append("The following ").append(segTypeStr)
                            .append(" segments don't validate: ")
                            .append(curr.getFile().getAbsolutePath()).append(", ")
                            .append(next.getFile().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