use of org.voltdb.catalog.Database in project voltdb by VoltDB.
the class SwapTablesPlanNode method viewsDependOn.
/**
* @param theTable
* @return
*/
private static boolean viewsDependOn(Table aTable, StringBuilder viewNames) {
String separator = "(";
for (MaterializedViewInfo anyView : aTable.getViews()) {
viewNames.append(separator).append(anyView.getTypeName());
separator = ", ";
}
for (Table anyTable : ((Database) aTable.getParent()).getTables()) {
for (MaterializedViewHandlerInfo anyView : anyTable.getMvhandlerinfo()) {
if (anyView.getSourcetables().getIgnoreCase(aTable.getTypeName()) != null) {
viewNames.append(separator).append(anyView.getDesttable().getTypeName());
separator = ", ";
}
}
}
if (", ".equals(separator)) {
viewNames.append(")");
return true;
}
return false;
}
use of org.voltdb.catalog.Database in project voltdb by VoltDB.
the class TestVoltCompilerAlterDropTable method verifyTableColumnGone.
//Check given col does not exists
private void verifyTableColumnGone(VoltCompiler compiler, String tableName, String colName) {
Database db = compiler.m_catalog.getClusters().get("cluster").getDatabases().get("database");
Table table = db.getTables().get(tableName);
Column col = table.getColumns().get(colName);
assertNull(col);
}
use of org.voltdb.catalog.Database in project voltdb by VoltDB.
the class TestVoltCompilerAlterDropTable method verifyTableExists.
//Check given table exists
private void verifyTableExists(VoltCompiler compiler, String tableName) {
Database db = compiler.m_catalog.getClusters().get("cluster").getDatabases().get("database");
Table table = db.getTables().get(tableName);
assertNotNull(table);
}
use of org.voltdb.catalog.Database in project voltdb by VoltDB.
the class TestVoltCompilerAlterDropTable method verifyTableColumnNullable.
//Check given col nullability if catalog was compiled.
private void verifyTableColumnNullable(VoltCompiler compiler, String tableName, String colName, boolean shouldBeNullable) {
Database db = compiler.m_catalog.getClusters().get("cluster").getDatabases().get("database");
Table table = db.getTables().get(tableName);
Column col = table.getColumns().get(colName);
assertNotNull(col);
assertEquals(shouldBeNullable, col.getNullable());
}
use of org.voltdb.catalog.Database in project voltdb by VoltDB.
the class TestVoltCompilerAlterDropTable method verifyTableGone.
//Check given table is gone
private void verifyTableGone(VoltCompiler compiler, String tableName) {
Database db = compiler.m_catalog.getClusters().get("cluster").getDatabases().get("database");
Table table = db.getTables().get(tableName);
assertNull(table);
}
Aggregations