com.datastax.driver.core.MaterializedViewMetadata Java Examples

The following examples show how to use com.datastax.driver.core.MaterializedViewMetadata. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CassandraSession.java    From presto with Apache License 2.0 5 votes vote down vote up
public List<String> getCaseSensitiveTableNames(String caseInsensitiveSchemaName)
        throws SchemaNotFoundException
{
    KeyspaceMetadata keyspace = getKeyspaceByCaseInsensitiveName(caseInsensitiveSchemaName);
    ImmutableList.Builder<String> builder = ImmutableList.builder();
    for (TableMetadata table : keyspace.getTables()) {
        builder.add(table.getName());
    }
    for (MaterializedViewMetadata materializedView : keyspace.getMaterializedViews()) {
        builder.add(materializedView.getName());
    }
    return builder.build();
}
 
Example #2
Source File: CassandraConnectorDatabaseService.java    From metacat with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public List<QualifiedName> listViewNames(
    @Nonnull @NonNull final ConnectorRequestContext context,
    @Nonnull @NonNull final QualifiedName databaseName
) {
    final String catalogName = databaseName.getCatalogName();
    final String keyspace = databaseName.getDatabaseName();
    log.debug("Attempting to get materialized view names for keyspace {} due to request {}", keyspace, context);
    try {
        final KeyspaceMetadata keyspaceMetadata = this.getCluster().getMetadata().getKeyspace(keyspace);
        if (keyspaceMetadata == null) {
            throw new DatabaseNotFoundException(databaseName);
        }

        final ImmutableList.Builder<QualifiedName> viewsBuilder = ImmutableList.builder();
        for (final MaterializedViewMetadata view : keyspaceMetadata.getMaterializedViews()) {
            viewsBuilder.add(
                QualifiedName.ofView(catalogName, keyspace, view.getBaseTable().getName(), view.getName())
            );
        }

        final List<QualifiedName> views = viewsBuilder.build();
        log.debug("Successfully found {} views for keyspace {} due to request {}", views.size(), keyspace, context);
        return views;
    } catch (final DriverException de) {
        log.error(de.getMessage(), de);
        throw this.getExceptionMapper().toConnectorException(de, databaseName);
    }
}
 
Example #3
Source File: CassandraSchema.java    From calcite with Apache License 2.0 5 votes vote down vote up
@Override protected Map<String, Table> getTableMap() {
  final ImmutableMap.Builder<String, Table> builder = ImmutableMap.builder();
  for (TableMetadata table : getKeyspace().getTables()) {
    String tableName = table.getName();
    builder.put(tableName, new CassandraTable(this, tableName));

    for (MaterializedViewMetadata view : table.getViews()) {
      String viewName = view.getName();
      builder.put(viewName, new CassandraTable(this, viewName, true));
    }
  }
  return builder.build();
}
 
Example #4
Source File: DataAccessImpl.java    From hawkular-metrics with Apache License 2.0 4 votes vote down vote up
@Override public void onMaterializedViewChanged(MaterializedViewMetadata materializedViewMetadata,
MaterializedViewMetadata materializedViewMetadata1) {}
 
Example #5
Source File: GCGraceSecondsManager.java    From hawkular-metrics with Apache License 2.0 2 votes vote down vote up
@Override
public void onMaterializedViewAdded(MaterializedViewMetadata view) {

}
 
Example #6
Source File: GCGraceSecondsManager.java    From hawkular-metrics with Apache License 2.0 2 votes vote down vote up
@Override
public void onMaterializedViewRemoved(MaterializedViewMetadata view) {

}
 
Example #7
Source File: GCGraceSecondsManager.java    From hawkular-metrics with Apache License 2.0 2 votes vote down vote up
@Override
public void onMaterializedViewChanged(MaterializedViewMetadata current, MaterializedViewMetadata previous) {

}
 
Example #8
Source File: DataAccessImpl.java    From hawkular-metrics with Apache License 2.0 votes vote down vote up
@Override public void onMaterializedViewAdded(MaterializedViewMetadata materializedViewMetadata) {} 
Example #9
Source File: DataAccessImpl.java    From hawkular-metrics with Apache License 2.0 votes vote down vote up
@Override public void onMaterializedViewRemoved(MaterializedViewMetadata materializedViewMetadata) {}