public CassandraSchema(String host, String keyspace, SchemaPlus parentSchema, String name) {
super();
this.keyspace = keyspace;
try {
Cluster cluster = Cluster.builder().addContactPoint(host).build();
this.session = cluster.connect(keyspace);
} catch (Exception e) {
throw new RuntimeException(e);
}
this.parentSchema = parentSchema;
this.name = name;
Hook.TRIMMED.add(new Function<RelNode, Void>() {
public Void apply(RelNode node) {
CassandraSchema.this.addMaterializedViews();
return null;
}
});
}
|