use of org.teiid.adminapi.impl.VDBMetaData in project teiid by teiid.
the class EventDistributorImpl method setTableStats.
@Override
public void setTableStats(String vdbName, String vdbVersion, String schemaName, String tableName, TableStats stats) {
VDBMetaData vdb = getVdbRepository().getLiveVDB(vdbName, vdbVersion);
Table t = getTable(vdbName, vdbVersion, schemaName, tableName);
if (t == null) {
return;
}
DdlPlan.setTableStats(vdb, t, stats);
}
use of org.teiid.adminapi.impl.VDBMetaData in project teiid by teiid.
the class EventDistributorImpl method setProperty.
@Override
public void setProperty(String vdbName, String vdbVersion, String uuid, String name, String value) {
VDBMetaData vdb = getVdbRepository().getLiveVDB(vdbName, vdbVersion);
if (vdb == null) {
return;
}
TransformationMetadata tm = vdb.getAttachment(TransformationMetadata.class);
if (tm == null) {
return;
}
AbstractMetadataRecord record = DataTierManagerImpl.getByUuid(tm.getMetadataStore(), uuid);
if (record != null) {
DdlPlan.setProperty(vdb, record, name, value);
}
}
use of org.teiid.adminapi.impl.VDBMetaData in project teiid by teiid.
the class EventDistributorImpl method setColumnStats.
@Override
public void setColumnStats(String vdbName, String vdbVersion, String schemaName, String tableName, String columnName, ColumnStats stats) {
VDBMetaData vdb = getVdbRepository().getLiveVDB(vdbName, vdbVersion);
Table t = getTable(vdbName, vdbVersion, schemaName, tableName);
if (t == null) {
return;
}
Column c = t.getColumnByName(columnName);
if (c != null) {
DdlPlan.setColumnStats(vdb, c, stats);
}
}
use of org.teiid.adminapi.impl.VDBMetaData in project teiid by teiid.
the class DeploymentBasedDatabaseStore method getVDBMetadata.
public VDBMetaData getVDBMetadata(String contents) {
StringReader reader = new StringReader(contents);
try {
startEditing(false);
this.setMode(Mode.DATABASE_STRUCTURE);
QueryParser.getQueryParser().parseDDL(this, new BufferedReader(reader));
} finally {
reader.close();
stopEditing();
}
Database database = getDatabases().get(0);
VDBMetaData vdb = DatabaseUtil.convert(database);
for (ModelMetaData model : vdb.getModelMetaDatas().values()) {
// $NON-NLS-1$
model.addSourceMetadata("DDL", null);
}
for (VDBImportMetadata vid : this.importedVDBs) {
vdb.getVDBImports().add(vid);
}
vdb.addProperty(VDBMetaData.TEIID_DDL, contents);
return vdb;
}
use of org.teiid.adminapi.impl.VDBMetaData in project teiid by teiid.
the class TestCompositeVDB method testRoleInherit.
@Test
public void testRoleInherit() throws Exception {
VDBRepository repo = new VDBRepository();
repo.setSystemStore(RealMetadataFactory.example1Cached().getMetadataStore());
repo.setSystemFunctionManager(RealMetadataFactory.SFM);
MetadataStore metadataStore = new MetadataStore();
RealMetadataFactory.createPhysicalModel("x", metadataStore);
VDBMetaData vdb = createVDBMetadata(metadataStore, "bqt");
DataPolicyMetadata dpm = new DataPolicyMetadata();
dpm.setName("x");
dpm.setGrantAll(true);
vdb.addDataPolicy(dpm);
ConnectorManagerRepository cmr = new ConnectorManagerRepository();
cmr.addConnectorManager("x", new ConnectorManager("y", "z"));
repo.addVDB(vdb, metadataStore, null, null, cmr);
metadataStore = new MetadataStore();
RealMetadataFactory.createPhysicalModel("y", metadataStore);
vdb = createVDBMetadata(metadataStore, "ex");
VDBImportMetadata vdbImport = new VDBImportMetadata();
vdbImport.setName("bqt");
vdbImport.setVersion("1");
vdbImport.setImportDataPolicies(true);
vdb.getVDBImports().add(vdbImport);
repo.addVDB(vdb, metadataStore, null, null, new ConnectorManagerRepository());
vdb = repo.getLiveVDB("ex");
assertEquals(1, vdb.getDataPolicyMap().get("x").getSchemas().size());
}
Aggregations