use of com.datastax.dse.driver.internal.core.metadata.schema.DefaultDseEdgeMetadata in project java-driver by datastax.
the class DseTableParser method buildEdge.
private DseEdgeMetadata buildEdge(CqlIdentifier tableId, Multimap<CqlIdentifier, AdminRow> keyspaceEdges, Multimap<CqlIdentifier, AdminRow> keyspaceVertices) {
if (keyspaceEdges == null) {
return null;
}
Collection<AdminRow> tableEdges = keyspaceEdges.get(tableId);
if (tableEdges == null || tableEdges.isEmpty()) {
return null;
}
AdminRow row = tableEdges.iterator().next();
CqlIdentifier fromTable = CqlIdentifier.fromInternal(row.getString("from_table"));
CqlIdentifier toTable = CqlIdentifier.fromInternal(row.getString("to_table"));
return new DefaultDseEdgeMetadata(getLabel(row), fromTable, findVertexLabel(fromTable, keyspaceVertices, "incoming"), CqlIdentifiers.wrapInternal(row.getListOfString("from_partition_key_columns")), CqlIdentifiers.wrapInternal(row.getListOfString("from_clustering_columns")), toTable, findVertexLabel(toTable, keyspaceVertices, "outgoing"), CqlIdentifiers.wrapInternal(row.getListOfString("to_partition_key_columns")), CqlIdentifiers.wrapInternal(row.getListOfString("to_clustering_columns")));
}
Aggregations