Search in sources :

Example 1 with DseKeyspaceMetadata

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

the class DseSchemaParser method parse.

@Override
public SchemaRefresh parse() {
    ImmutableMap.Builder<CqlIdentifier, KeyspaceMetadata> keyspacesBuilder = ImmutableMap.builder();
    for (AdminRow row : rows.keyspaces()) {
        DseKeyspaceMetadata keyspace = parseKeyspace(row);
        keyspacesBuilder.put(keyspace.getName(), keyspace);
    }
    for (AdminRow row : rows.virtualKeyspaces()) {
        DseKeyspaceMetadata keyspace = parseVirtualKeyspace(row);
        keyspacesBuilder.put(keyspace.getName(), keyspace);
    }
    SchemaRefresh refresh = new SchemaRefresh(keyspacesBuilder.build());
    LOG.debug("[{}] Schema parsing took {}", logPrefix, NanoTime.formatTimeSince(startTimeNs));
    return refresh;
}
Also used : DseKeyspaceMetadata(com.datastax.dse.driver.api.core.metadata.schema.DseKeyspaceMetadata) DefaultDseKeyspaceMetadata(com.datastax.dse.driver.internal.core.metadata.schema.DefaultDseKeyspaceMetadata) SchemaRefresh(com.datastax.oss.driver.internal.core.metadata.schema.refresh.SchemaRefresh) CqlIdentifier(com.datastax.oss.driver.api.core.CqlIdentifier) DseKeyspaceMetadata(com.datastax.dse.driver.api.core.metadata.schema.DseKeyspaceMetadata) DefaultDseKeyspaceMetadata(com.datastax.dse.driver.internal.core.metadata.schema.DefaultDseKeyspaceMetadata) KeyspaceMetadata(com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata) AdminRow(com.datastax.oss.driver.internal.core.adminrequest.AdminRow) ImmutableMap(com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap)

Aggregations

DseKeyspaceMetadata (com.datastax.dse.driver.api.core.metadata.schema.DseKeyspaceMetadata)1 DefaultDseKeyspaceMetadata (com.datastax.dse.driver.internal.core.metadata.schema.DefaultDseKeyspaceMetadata)1 CqlIdentifier (com.datastax.oss.driver.api.core.CqlIdentifier)1 KeyspaceMetadata (com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata)1 AdminRow (com.datastax.oss.driver.internal.core.adminrequest.AdminRow)1 SchemaRefresh (com.datastax.oss.driver.internal.core.metadata.schema.refresh.SchemaRefresh)1 ImmutableMap (com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap)1