Search in sources :

Example 21 with DatasetTypeMeta

use of io.cdap.cdap.proto.DatasetTypeMeta in project cdap by caskdata.

the class DescribeDatasetTypeCommand method perform.

@Override
public void perform(Arguments arguments, PrintStream output) throws Exception {
    DatasetTypeId type = cliConfig.getCurrentNamespace().datasetType(arguments.get(ArgumentName.DATASET_TYPE.toString()));
    DatasetTypeMeta datasetTypeMeta = datasetTypeClient.get(type);
    Table table = Table.builder().setHeader("name", "modules").setRows(ImmutableList.of(datasetTypeMeta), new RowMaker<DatasetTypeMeta>() {

        @Override
        public List<?> makeRow(DatasetTypeMeta object) {
            return Lists.newArrayList(object.getName(), Joiner.on(", ").join(object.getModules()));
        }
    }).build();
    cliConfig.getTableRenderer().render(cliConfig, output, table);
}
Also used : DatasetTypeId(io.cdap.cdap.proto.id.DatasetTypeId) Table(io.cdap.cdap.cli.util.table.Table) RowMaker(io.cdap.cdap.cli.util.RowMaker) DatasetTypeMeta(io.cdap.cdap.proto.DatasetTypeMeta)

Aggregations

DatasetTypeMeta (io.cdap.cdap.proto.DatasetTypeMeta)21 DatasetTypeNotFoundException (io.cdap.cdap.common.DatasetTypeNotFoundException)8 DatasetTypeId (io.cdap.cdap.proto.id.DatasetTypeId)7 DatasetSpecification (io.cdap.cdap.api.dataset.DatasetSpecification)5 DatasetModuleMeta (io.cdap.cdap.proto.DatasetModuleMeta)5 DatasetId (io.cdap.cdap.proto.id.DatasetId)5 DatasetProperties (io.cdap.cdap.api.dataset.DatasetProperties)4 DatasetNotFoundException (io.cdap.cdap.common.DatasetNotFoundException)4 DatasetModuleId (io.cdap.cdap.proto.id.DatasetModuleId)3 NamespaceId (io.cdap.cdap.proto.id.NamespaceId)3 HttpResponse (io.cdap.common.http.HttpResponse)3 RowMaker (io.cdap.cdap.cli.util.RowMaker)2 Table (io.cdap.cdap.cli.util.table.Table)2 DatasetTypeClient (io.cdap.cdap.client.DatasetTypeClient)2 NamespaceNotFoundException (io.cdap.cdap.common.NamespaceNotFoundException)2 NotFoundException (io.cdap.cdap.common.NotFoundException)2 DatasetCreationResponse (io.cdap.cdap.data2.datafabric.dataset.service.executor.DatasetCreationResponse)2 DatasetInstanceConfiguration (io.cdap.cdap.proto.DatasetInstanceConfiguration)2 DatasetMeta (io.cdap.cdap.proto.DatasetMeta)2 Principal (io.cdap.cdap.proto.security.Principal)2