Search in sources :

Example 1 with DseTableMetadata

use of com.datastax.dse.driver.api.core.metadata.schema.DseTableMetadata in project java-driver by datastax.

the class DseSchemaParser method parseTables.

private Map<CqlIdentifier, TableMetadata> parseTables(CqlIdentifier keyspaceId, Map<CqlIdentifier, UserDefinedType> types) {
    ImmutableMap.Builder<CqlIdentifier, TableMetadata> tablesBuilder = ImmutableMap.builder();
    Multimap<CqlIdentifier, AdminRow> vertices = rows.vertices().get(keyspaceId);
    Multimap<CqlIdentifier, AdminRow> edges = rows.edges().get(keyspaceId);
    for (AdminRow tableRow : rows.tables().get(keyspaceId)) {
        DseTableMetadata table = tableParser.parseTable(tableRow, keyspaceId, types, vertices, edges);
        if (table != null) {
            tablesBuilder.put(table.getName(), table);
        }
    }
    return tablesBuilder.build();
}
Also used : TableMetadata(com.datastax.oss.driver.api.core.metadata.schema.TableMetadata) DseTableMetadata(com.datastax.dse.driver.api.core.metadata.schema.DseTableMetadata) DseTableMetadata(com.datastax.dse.driver.api.core.metadata.schema.DseTableMetadata) CqlIdentifier(com.datastax.oss.driver.api.core.CqlIdentifier) AdminRow(com.datastax.oss.driver.internal.core.adminrequest.AdminRow) ImmutableMap(com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap)

Aggregations

DseTableMetadata (com.datastax.dse.driver.api.core.metadata.schema.DseTableMetadata)1 CqlIdentifier (com.datastax.oss.driver.api.core.CqlIdentifier)1 TableMetadata (com.datastax.oss.driver.api.core.metadata.schema.TableMetadata)1 AdminRow (com.datastax.oss.driver.internal.core.adminrequest.AdminRow)1 ImmutableMap (com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap)1