class KoutRecords extends SingleWayMultiPathsRecords {

    // Non-zero depth is used for deepFirst traverse mode.
    // In such case, startOneLayer/finishOneLayer should not be called,
    // instead, we should use addFullPath
    private final int depth;

    public KoutRecords(boolean concurrent, Id source, boolean nearest, int depth) {
        super(RecordType.INT, concurrent, source, nearest);

        // add depth(num) records to record each layer
        this.depth = depth;
        for (int i = 0; i < depth; i++) {
            this.records().push(this.newRecord());
        }
        assert (this.records().size() == (depth + 1));

        // init top layer's parentRecord
        this.currentRecord(this.records().peek(), null);
    }

    @Override
    public int size() {
        return this.currentRecord().size();
    }

    @Override
    public List<Id> ids(long limit) {<FILL_FUNCTION_BODY>}

    @Override
    public PathSet paths(long limit) {
        PathSet paths = new PathSet();
        Stack<Record> records = this.records();
        IntIterator iterator = records.peek().keys();
        while ((limit == NO_LIMIT || limit-- > 0L) && iterator.hasNext()) {
            paths.add(this.linkPath(records.size() - 1, iterator.next()));
        }
        return paths;
    }

    public void addFullPath(List<HugeEdge> edges) {
        assert (depth == edges.size());

        int sourceCode = this.code(edges.get(0).id().ownerVertexId());
        int targetCode;
        for (int i = 0; i < edges.size(); i++) {
            HugeEdge edge = edges.get(i);
            Id sourceV = edge.id().ownerVertexId();
            Id targetV = edge.id().otherVertexId();

            assert (this.code(sourceV) == sourceCode);

            this.edgeResults().addEdge(sourceV, targetV, edge);

            targetCode = this.code(targetV);
            Record record = this.records().elementAt(i + 1);
            if (this.sourceCode == targetCode) {
                break;
            }

            this.addPathToRecord(sourceCode, targetCode, record);
            sourceCode = targetCode;
        }
    }
}

        List<Id> ids = CollectionFactory.newList(CollectionType.EC);
        IntIterator iterator = this.records().peek().keys();
        while ((limit == NO_LIMIT || limit-- > 0L) && iterator.hasNext()) {
            ids.add(this.id(iterator.next()));
        }
        return ids;
    
<methods>public void <init>(org.apache.hugegraph.traversal.algorithm.records.record.RecordType, boolean, org.apache.hugegraph.backend.id.Id, boolean) ,public long accessed() ,public void addPath(org.apache.hugegraph.backend.id.Id, org.apache.hugegraph.backend.id.Id) ,public void addPathToRecord(int, int, org.apache.hugegraph.traversal.algorithm.records.record.Record) ,public org.apache.hugegraph.traversal.algorithm.HugeTraverser.EdgeRecord edgeResults() ,public org.apache.hugegraph.traversal.algorithm.HugeTraverser.PathSet findPath(org.apache.hugegraph.backend.id.Id, Function<org.apache.hugegraph.backend.id.Id,java.lang.Boolean>, boolean, boolean) ,public void finishOneLayer() ,public boolean hasNextKey() ,public abstract List<org.apache.hugegraph.backend.id.Id> ids(long) ,public Iterator<org.apache.hugegraph.backend.id.Id> keys() ,public org.apache.hugegraph.backend.id.Id nextKey() ,public abstract org.apache.hugegraph.traversal.algorithm.HugeTraverser.PathSet paths(long) ,public abstract int size() ,public void startOneLayer(boolean) <variables>private final non-sealed org.apache.hugegraph.util.collection.IntSet accessedVertices,private final non-sealed org.apache.hugegraph.traversal.algorithm.HugeTraverser.EdgeRecord edgeResults,private final non-sealed boolean nearest,private org.apache.hugegraph.util.collection.IntIterator parentRecordKeys,private final non-sealed Stack<org.apache.hugegraph.traversal.algorithm.records.record.Record> records,protected final non-sealed int sourceCode