Search in sources :

Example 1 with DefaultMetricDatasetFactory

use of co.cask.cdap.metrics.store.DefaultMetricDatasetFactory in project cdap by caskdata.

the class UpgradeTool method initializeDSFramework.

/**
   * Sets up a {@link DatasetFramework} instance for standalone usage.  NOTE: should NOT be used by applications!!!
   * Note: includeNewDatasets boolean is required because upgrade tool has two mode: 1. Normal CDAP upgrade and
   * 2. Upgrading co processor for tables after hbase upgrade. This parameter specifies whether new system dataset
   * which were added in the current release needs to be added in the dataset framework or not.
   * During Normal CDAP upgrade (1) we don't need these datasets to be added in the ds framework as they will get
   * created during upgrade rather than when cdap starts after upgrade which is what we want.
   * Whereas during Hbase upgrade (2) we want these new tables to be added so that the co processor of these tables
   * can be upgraded when the user runs CDAP's Hbase Upgrade after upgrading to a newer version of Hbase.
   */
private void initializeDSFramework(CConfiguration cConf, DatasetFramework datasetFramework, boolean includeNewDatasets) throws IOException, DatasetManagementException {
    // dataset service
    DatasetMetaTableUtil.setupDatasets(datasetFramework);
    // artifacts
    ArtifactStore.setupDatasets(datasetFramework);
    // Note: do no remove this if block even if it's empty. Read comment below and function doc above
    if (includeNewDatasets) {
        // Add all new system dataset introduced in the current release in this block. If no new dataset was introduced
        // then leave this block empty but do not remove block so that it can be used in next release if needed
        // owner meta
        DefaultOwnerStore.setupDatasets(datasetFramework);
    }
    // metadata and lineage
    DefaultMetadataStore.setupDatasets(datasetFramework);
    LineageStore.setupDatasets(datasetFramework);
    // app metadata
    DefaultStore.setupDatasets(datasetFramework);
    // config store
    DefaultConfigStore.setupDatasets(datasetFramework);
    // logs metadata
    LoggingStoreTableUtil.setupDatasets(datasetFramework);
    // scheduler metadata
    ScheduleStoreTableUtil.setupDatasets(datasetFramework);
    // metrics data
    DefaultMetricDatasetFactory factory = new DefaultMetricDatasetFactory(cConf, datasetFramework);
    DefaultMetricDatasetFactory.setupDatasets(factory);
    // Usage registry
    DefaultUsageRegistry.setupDatasets(datasetFramework);
}
Also used : DefaultMetricDatasetFactory(co.cask.cdap.metrics.store.DefaultMetricDatasetFactory)

Aggregations

DefaultMetricDatasetFactory (co.cask.cdap.metrics.store.DefaultMetricDatasetFactory)1