in src/main/java/com/amazonaws/services/neptune/propertygraph/ExportStats.java [51:90]
public String formatStats(GraphSchema graphSchema) {
StringBuilder sb = new StringBuilder();
sb.append("Source:").append(System.lineSeparator());
sb.append(" Nodes: ").append(nodeCount).append(System.lineSeparator());
sb.append(" Edges: ").append(edgeCount).append(System.lineSeparator());
sb.append("Export:").append(System.lineSeparator());
sb.append(" Nodes: ").append(nodeStats.values().stream().map(LabelStats::count).reduce(0L, Long::sum)).append(System.lineSeparator());
sb.append(" Edges: ").append(edgeStats.values().stream().map(LabelStats::count).reduce(0L, Long::sum)).append(System.lineSeparator());
sb.append(" Properties: ").append(getNumberOfProperties(graphSchema)).append(System.lineSeparator());
sb.append("Details:").append(System.lineSeparator());
sb.append(" Nodes: ").append(System.lineSeparator());
GraphElementSchemas nodeSchemas = graphSchema.graphElementSchemasFor(GraphElementType.nodes);
for (Map.Entry<Label, LabelStats> entry : nodeStats.entrySet()) {
Label label = entry.getKey();
LabelStats labelStats = entry.getValue();
LabelSchema labelSchema = nodeSchemas.getSchemaFor(label);
sb.append(" ").append(labelStats.toString()).append(System.lineSeparator());
for (PropertySchemaStats stats : labelSchema.propertySchemaStats()) {
sb.append(" |_ ").append(stats.toString()).append(System.lineSeparator());
}
}
sb.append(" Edges: ").append(System.lineSeparator());
GraphElementSchemas edgeSchemas = graphSchema.graphElementSchemasFor(GraphElementType.edges);
for (Map.Entry<Label, LabelStats> entry : edgeStats.entrySet()) {
Label label = entry.getKey();
LabelStats labelStats = entry.getValue();
LabelSchema labelSchema = edgeSchemas.getSchemaFor(label);
sb.append(" ").append(labelStats.toString()).append(System.lineSeparator());
for (PropertySchemaStats stats : labelSchema.propertySchemaStats()) {
sb.append(" |_ ").append(stats.toString()).append(System.lineSeparator());
}
}
return sb.toString();
}