@Override
    public Segment open(IndexMemCache indexMemCache, ExtIndexMemCache extIndexMemCache, PackMemCache packMemCache) throws IOException {
        if (mergeSegment != null) {
            return mergeSegment.open(indexMemCache, extIndexMemCache, packMemCache);
        }
        return new Segment() {
            SegmentFdRowIterator iterator = new SegmentFdRowIterator(
                    new ArrayList<>(segments.values()),
                    indexMemCache,
                    packMemCache);
            SegmentFdRowIterator rt;

            @Override
            public int version() {
                return metadata.version;
            }

            @Override
            public SegmentMode mode() {
                return metadata.mode;
            }

            @Override
            public String name() {
                return metadata.name;
            }

            @Override
            public SegmentSchema schema() {
                return metadata.schema;
            }

            @Override
            public long rowCount() {
                return RTSGroup.this.rowCount();
            }

            @Override
            public RowTraversal rowTraversal() {
                rt = iterator;
                return new RowTraversal() {
                    @Override
                    public Iterator<Row> iterator() {
                        return iterator;
                    }
                };
            }

            @Override
            public void close() throws IOException {
                if (rt != null) {
                    rt.close();
                    rt = null;
                }
            }
        };
    }
This method is only used for testing. Never use it in real production.
indexr-segment/src/main/java/io/indexr/segment/rt/RTSGroup.java