use of com.datastax.driver.core.KeyspaceMetadata in project metacat by Netflix.
the class CassandraConnectorDatabaseService method get.
/**
* {@inheritDoc}
*/
@Override
public DatabaseInfo get(@Nonnull @NonNull final ConnectorContext context, @Nonnull @NonNull final QualifiedName name) {
final String keyspace = name.getDatabaseName();
log.debug("Attempting to get keyspace metadata for keyspace {} for request", keyspace, context);
try {
final KeyspaceMetadata keyspaceMetadata = this.getCluster().getMetadata().getKeyspace(keyspace);
if (keyspaceMetadata == null) {
throw new DatabaseNotFoundException(name);
}
log.debug("Successfully found the keyspace metadata for {} for request", name, context);
return DatabaseInfo.builder().name(name).build();
} catch (final DriverException de) {
log.error(de.getMessage(), de);
throw this.getExceptionMapper().toConnectorException(de, name);
}
}
Aggregations