Search in sources :

Example 71 with DatasetSpecification

use of co.cask.cdap.api.dataset.DatasetSpecification in project cdap by caskdata.

the class ProgramScheduleStoreDefinition method configure.

@Override
public DatasetSpecification configure(String name, DatasetProperties properties) {
    TableProperties.Builder indexProps = TableProperties.builder();
    indexProps.addAll(properties.getProperties());
    indexProps.add(IndexedTable.INDEX_COLUMNS_CONF_KEY, ProgramScheduleStoreDataset.INDEX_COLUMNS);
    indexProps.setConflictDetection(ConflictDetection.COLUMN);
    DatasetSpecification indexSpec = getDelegate(ProgramScheduleStoreDataset.EMBEDDED_TABLE_NAME).configure(ProgramScheduleStoreDataset.EMBEDDED_TABLE_NAME, indexProps.build());
    return DatasetSpecification.builder(name, getName()).datasets(indexSpec).build();
}
Also used : DatasetSpecification(co.cask.cdap.api.dataset.DatasetSpecification) TableProperties(co.cask.cdap.api.dataset.table.TableProperties)

Example 72 with DatasetSpecification

use of co.cask.cdap.api.dataset.DatasetSpecification in project cdap by caskdata.

the class JobQueueDatasetDefinition method configure.

@Override
public DatasetSpecification configure(String instanceName, DatasetProperties properties) {
    TableProperties.Builder tableProps = TableProperties.builder();
    tableProps.addAll(properties.getProperties());
    tableProps.setConflictDetection(ConflictDetection.COLUMN);
    DatasetSpecification tableSpec = super.getDelegate(JobQueueDataset.EMBEDDED_TABLE_NAME).configure(JobQueueDataset.EMBEDDED_TABLE_NAME, tableProps.build());
    return DatasetSpecification.builder(instanceName, getName()).properties(properties.getProperties()).datasets(Collections.singletonList(tableSpec)).build();
}
Also used : DatasetSpecification(co.cask.cdap.api.dataset.DatasetSpecification) TableProperties(co.cask.cdap.api.dataset.table.TableProperties)

Aggregations

DatasetSpecification (co.cask.cdap.api.dataset.DatasetSpecification)72 DatasetId (co.cask.cdap.proto.id.DatasetId)21 DatasetProperties (co.cask.cdap.api.dataset.DatasetProperties)17 IncompatibleUpdateException (co.cask.cdap.api.dataset.IncompatibleUpdateException)15 Test (org.junit.Test)14 DatasetDefinition (co.cask.cdap.api.dataset.DatasetDefinition)11 DatasetManagementException (co.cask.cdap.api.dataset.DatasetManagementException)10 POST (javax.ws.rs.POST)10 Path (javax.ws.rs.Path)10 DatasetAdmin (co.cask.cdap.api.dataset.DatasetAdmin)9 DatasetTypeMeta (co.cask.cdap.proto.DatasetTypeMeta)9 NotFoundException (co.cask.cdap.common.NotFoundException)8 AbstractDatasetDefinition (co.cask.cdap.api.dataset.lib.AbstractDatasetDefinition)7 BadRequestException (co.cask.cdap.common.BadRequestException)7 IOException (java.io.IOException)7 DatasetSpecificationSummary (co.cask.cdap.proto.DatasetSpecificationSummary)6 Map (java.util.Map)6 DatasetNotFoundException (co.cask.cdap.common.DatasetNotFoundException)5 Reconfigurable (co.cask.cdap.api.dataset.Reconfigurable)4 Updatable (co.cask.cdap.api.dataset.Updatable)4