Search in sources :

Example 1 with DatasourceCriteria

use of com.thinkbiganalytics.metadata.rest.model.data.DatasourceCriteria in project kylo by Teradata.

the class MetadataClientProvider method getDatasourceByName.

/* (non-Javadoc)
     * @see com.thinkbiganalytics.controller.metadata.MetadataProvider#getDatasourceByName(java.lang.String)
     */
@Override
public Datasource getDatasourceByName(String dsName) {
    DatasourceCriteria criteria = this.client.datasourceCriteria().name(dsName);
    List<Datasource> list = this.client.getDatasources(criteria);
    if (list.isEmpty()) {
        return null;
    } else {
        return list.get(0);
    }
}
Also used : DirectoryDatasource(com.thinkbiganalytics.metadata.rest.model.data.DirectoryDatasource) Datasource(com.thinkbiganalytics.metadata.rest.model.data.Datasource) HiveTableDatasource(com.thinkbiganalytics.metadata.rest.model.data.HiveTableDatasource) DatasourceCriteria(com.thinkbiganalytics.metadata.rest.model.data.DatasourceCriteria)

Aggregations

Datasource (com.thinkbiganalytics.metadata.rest.model.data.Datasource)1 DatasourceCriteria (com.thinkbiganalytics.metadata.rest.model.data.DatasourceCriteria)1 DirectoryDatasource (com.thinkbiganalytics.metadata.rest.model.data.DirectoryDatasource)1 HiveTableDatasource (com.thinkbiganalytics.metadata.rest.model.data.HiveTableDatasource)1