### Question:
GraphGenerator implements Serializable { public synchronized Metrics generateTo(final DB graph, final long totalVertices, final int writeConcurrency, final int graphPartitionCount) throws DBException { Preconditions.checkNotNull(graph); Preconditions.checkArgument(totalVertices > 0); Preconditions.checkArgument(writeConcurrency > 0); Preconditions.checkArgument(graphPartitionCount > 0); ParallelWriteDBWrapper pdb = new ParallelWriteDBWrapper(graph, writeConcurrency); pdb.init(); pdb.startup(); vertexPartition = model.getVertexPartitioner().getPartitionSizes(totalVertices); long vertexPartitionSize = Math.floorDiv(totalVertices, graphPartitionCount) + 1; long totalEdges = countTotalEdges(); long edgePartitionSize = Math.floorDiv(totalEdges, graphPartitionCount) + 1; long time = timeTask(() -> { for (long i = 0; i < graphPartitionCount; i++) { long start = i * vertexPartitionSize; long stop = Math.min(i * vertexPartitionSize + vertexPartitionSize, totalVertices); createVertices(start, stop, pdb); } for (long i = 0; i < graphPartitionCount; i++) { long start = i * edgePartitionSize; long stop = Math.min(i * edgePartitionSize + edgePartitionSize, totalEdges); createEdges(start, stop, pdb, new Random(randomSeed + i)); } commit(pdb); }); logger.info("generated graph of " + totalVertices + " vertices in " + time + "ms"); pdb.shutdown(); pdb.cleanup(); return pdb.getMetrics(); } GraphGenerator(final GraphModel model); GraphModel getModel(); Map<QualifiedName, Long> getVertexPartition(); void setRandomSeed(final long randomSeed); synchronized Metrics generateTo(final DB graph, final long totalVertices, final int writeConcurrency,
                                           final int graphPartitionCount); synchronized Metrics generateTo(SparkConf sparkConf,
                                           final DB graph, final long totalVertices,
                                           final int writeConcurrency, final int graphPartitionCount);  }### Answer:
@Ignore @Test public void verifyStatsManuallyInR() throws Exception { int totalVertices = 10000; Graph graph = SchemaUtils.createTinkerGraph(); GremlinDB gremlinDB = new GremlinDB(); gremlinDB.setGraph(graph); GraphGenerator gen = newGraphGenerator(); gen.generateTo(gremlinDB, totalVertices, 4, 2); writeVerticesTo(graph, new File("/tmp/vertices.csv")); writeEdgesTo(graph, new File("/tmp/edges.csv")); }