Search in sources :

Example 6 with KyloCatalogException

use of com.thinkbiganalytics.kylo.catalog.api.KyloCatalogException in project kylo by Teradata.

the class AbstractKyloCatalogClient method read.

@Nonnull
@Override
public KyloCatalogReader<T> read(@Nonnull final String id) {
    final DataSetTemplate dataSet = (dataSets != null) ? dataSets.get(id) : null;
    if (dataSet != null) {
        final DefaultKyloCatalogReader<T> reader = new DefaultKyloCatalogReader<>(this, hadoopConfiguration, resourceLoader);
        reader.dataSet(dataSet);
        return reader;
    } else {
        throw new KyloCatalogException("Data set does not exist: " + id);
    }
}
Also used : KyloCatalogException(com.thinkbiganalytics.kylo.catalog.api.KyloCatalogException) DataSetTemplate(com.thinkbiganalytics.kylo.catalog.rest.model.DataSetTemplate) Nonnull(javax.annotation.Nonnull)

Aggregations

KyloCatalogException (com.thinkbiganalytics.kylo.catalog.api.KyloCatalogException)6 Nonnull (javax.annotation.Nonnull)6 VisibleForTesting (com.google.common.annotations.VisibleForTesting)2 DataSetTemplate (com.thinkbiganalytics.kylo.catalog.rest.model.DataSetTemplate)2 JdbcHighWaterMark (com.thinkbiganalytics.kylo.catalog.spark.sources.jdbc.JdbcHighWaterMark)2 JdbcHighWaterMarkAccumulableParam (com.thinkbiganalytics.kylo.catalog.spark.sources.jdbc.JdbcHighWaterMarkAccumulableParam)1 JdbcHighWaterMarkVisitor (com.thinkbiganalytics.kylo.catalog.spark.sources.jdbc.JdbcHighWaterMarkVisitor)1 DataSetProvider (com.thinkbiganalytics.kylo.catalog.spi.DataSetProvider)1 ArrayList (java.util.ArrayList)1 Configuration (org.apache.hadoop.conf.Configuration)1 FileStatus (org.apache.hadoop.fs.FileStatus)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 Path (org.apache.hadoop.fs.Path)1 Job (org.apache.hadoop.mapreduce.Job)1 DataType (org.apache.spark.sql.types.DataType)1