public static State getState(Path segmentPath) throws IOException {
            try (Stream<Path> paths = Files.list(segmentPath)) {
                Set<String> stateFiles = paths
                        .map(p -> p.getFileName().toString())
                        .filter(n -> n.startsWith("_ST_") || n.startsWith("_st_"))
                        .collect(Collectors.toSet());
                State stat = Begin;
                for (State st : State.values()) {
                    if (stateFiles.contains(st.fileName) || stateFiles.contains(st.fileName.toLowerCase())) {
                        stat = st;
                    }
                }
                return stat;
            }
        }
Rows in memory has dump to local disk.
indexr-segment/src/main/java/io/indexr/segment/rt/RealtimeSegment.java