public static RealtimeSegment open(Path path, String table, String name, SegmentSchema schema) throws IOException {
        Preconditions.checkState(path != null && !Strings.isEmpty(name) && schema != null);

        if (!Files.exists(path)) {
            Files.createDirectories(path);
        }
        State state = State.getState(path);
        switch (state) {
            case Begin: {
                RealtimeSegment segment = new RealtimeSegment(path, table, name, schema, state, false);
                segment.commitState(State.Created);
                return segment;
            }
            case Created:
            case RTIFinished:
            case Saved: {
                // A segment recovered from disk will never be ingested again.
                if (state == State.Created) {
                    state = State.RTIFinished;
                }
                RealtimeSegment segment = new RealtimeSegment(path, table, name, schema, state, true);
                segment.commitState(state);
                return segment;
            }
            default:
                return null;
        }
    }
Rows in memory has dump to local disk.
indexr-segment/src/main/java/io/indexr/segment/rt/RealtimeSegment.java