public abstract class BaseTableLoader extends Object implements TableLoader
Modifier and Type | Field and Description |
---|---|
protected org.joda.time.DateTimeZone |
defaultTimeZone |
Modifier | Constructor and Description |
---|---|
protected |
BaseTableLoader(DataSourceMetadataService metadataService)
A table loader using a standard time context and UTC default time zone.
|
protected |
BaseTableLoader(org.joda.time.DateTimeZone defaultTimeZone,
DataSourceMetadataService metadataService)
A table loader using a time context and a default time zone.
|
Modifier and Type | Method and Description |
---|---|
TableGroup |
buildDimensionSpanningTableGroup(Set<ApiMetricName> apiMetrics,
Set<FieldName> druidMetrics,
Set<PhysicalTableDefinition> tableDefinitions,
ResourceDictionaries dictionaries)
Deprecated.
does not load table with external dependency, use the other buildDimensionSpanningTableGroup instead
|
TableGroup |
buildDimensionSpanningTableGroup(Set<TableName> currentTableGroupTableNames,
Set<PhysicalTableDefinition> tableDefinitions,
ResourceDictionaries dictionaries,
Set<ApiMetricName> apiMetrics)
Builds a table group that derive its dimensions by taking the union of all the underlying physical dimensions.
|
LogicalTable |
buildLogicalTable(String name,
Granularity granularity,
String category,
String longName,
org.joda.time.ReadablePeriod retention,
String description,
TableGroup group,
MetricDictionary metrics)
Deprecated.
The LogicalTable constructor is being mirrored here, can be referenced directly
|
LogicalTable |
buildLogicalTable(String name,
Granularity granularity,
TableGroup group,
MetricDictionary metrics)
Deprecated.
use new LogicalTable(...) by preferences
|
protected ConfigPhysicalTable |
buildPhysicalTableWithDependency(String currentTableName,
Map<String,PhysicalTableDefinition> availableTableDefinitions,
ResourceDictionaries dictionaries)
Build and return the current physical table given its table name and definition, if dependency exists, build its
dependencies and load the dependencies into physical table dictionary.
|
TableGroup |
buildTableGroup(String logicalTableName,
Set<ApiMetricName> apiMetrics,
Set<FieldName> druidMetrics,
Set<PhysicalTableDefinition> tableDefinitions,
ResourceDictionaries dictionaries)
Deprecated.
logicalTableName is not used in TableGroup, use buildDimensionSpanningTableGroup instead
|
protected DataSourceMetadataService |
getDataSourceMetadataService()
Getter for the data source metadata service use for creating physical tables.
|
void |
loadLogicalTablesWithGranularities(Map<String,TableGroup> nameGroupMap,
Set<? extends Granularity> validGrains,
LogicalTableDictionary tableDictionary,
Map<String,MetricDictionary> scopedMetrics)
Load several logical tables into the logicalDictionary, each with their own scoped metric dictionary.
|
void |
loadLogicalTablesWithGranularities(Map<String,TableGroup> nameGroupMap,
Set<? extends Granularity> validGrains,
ResourceDictionaries dictionaries)
Load several logical tables into the logicalDictionary, all with the globally-scoped metric dictionary.
|
void |
loadLogicalTableWithGranularities(String logicalTableName,
TableGroup nameGroup,
Set<? extends Granularity> validGrains,
LogicalTableDictionary tableDictionary,
MetricDictionary metricDictionary)
Load a logical table into the logicalDictionary.
|
void |
loadLogicalTableWithGranularities(String logicalTableName,
TableGroup nameGroup,
Set<? extends Granularity> validGrains,
ResourceDictionaries dictionaries)
Load a logical table into the logicalDictionary.
|
protected PhysicalTable |
loadPhysicalTable(PhysicalTableDefinition definition,
Set<FieldName> metricNames,
ResourceDictionaries dictionaries)
Deprecated.
use buildPhysicalTableWithDependency instead, which also supports building table with dependencies
|
abstract void |
loadTableDictionary(ResourceDictionaries dictionaries)
Load user configured tables into resource dictionary.
|
protected BaseTableLoader(DataSourceMetadataService metadataService)
metadataService
- Service containing the segment data for constructing tablesprotected BaseTableLoader(org.joda.time.DateTimeZone defaultTimeZone, DataSourceMetadataService metadataService)
defaultTimeZone
- The default time zone to tables being loadedmetadataService
- Service containing the segment data for constructing tablespublic abstract void loadTableDictionary(ResourceDictionaries dictionaries)
loadTableDictionary
in interface TableLoader
dictionaries
- dictionary to be loaded with configured tablespublic TableGroup buildDimensionSpanningTableGroup(Set<TableName> currentTableGroupTableNames, Set<PhysicalTableDefinition> tableDefinitions, ResourceDictionaries dictionaries, Set<ApiMetricName> apiMetrics)
Builds and loads the physical tables from table definitions for the current table group.
currentTableGroupTableNames
- Set of table name of tables belonging to this table grouptableDefinitions
- A list of config objects for building physical tables and its dependent physical tablesdictionaries
- The container for all the data dictionariesapiMetrics
- The set of metric names surfaced to the apipublic void loadLogicalTablesWithGranularities(Map<String,TableGroup> nameGroupMap, Set<? extends Granularity> validGrains, ResourceDictionaries dictionaries)
Note: This builds the logical tables as well.
nameGroupMap
- A map of logical table name to table group informationvalidGrains
- The accepted grains for the logical tabledictionaries
- The resource dictionaries for reading and storing configurationpublic void loadLogicalTablesWithGranularities(Map<String,TableGroup> nameGroupMap, Set<? extends Granularity> validGrains, LogicalTableDictionary tableDictionary, Map<String,MetricDictionary> scopedMetrics)
Note: This builds the logical tables as well.
nameGroupMap
- A map of logical table name to table group informationvalidGrains
- The accepted grains for the logical tabletableDictionary
- The logical table dictionary to be populatedscopedMetrics
- A mapping from table name to the scoped MetricDictionary to use for that tablepublic void loadLogicalTableWithGranularities(String logicalTableName, TableGroup nameGroup, Set<? extends Granularity> validGrains, ResourceDictionaries dictionaries)
Note: This builds the logical table as well.
logicalTableName
- The logical table namenameGroup
- The table group information for the logical tablevalidGrains
- The accepted grains for the logical tabledictionaries
- The resource dictionaries for reading and storing configurationpublic void loadLogicalTableWithGranularities(String logicalTableName, TableGroup nameGroup, Set<? extends Granularity> validGrains, LogicalTableDictionary tableDictionary, MetricDictionary metricDictionary)
Note: This builds the logical table as well.
logicalTableName
- The logical table namenameGroup
- The table group information for the logical tablevalidGrains
- The accepted grains for the logical tabletableDictionary
- The dictionary to load the logical table intometricDictionary
- The dictionary to use when looking up metrics for this tableprotected ConfigPhysicalTable buildPhysicalTableWithDependency(String currentTableName, Map<String,PhysicalTableDefinition> availableTableDefinitions, ResourceDictionaries dictionaries)
note: current physical table not loaded into physical table dictionary, only dependencies will
currentTableName
- Table name of the table being builtavailableTableDefinitions
- A map of table name to table definition that are available globallydictionaries
- Contains both dimension and physical table dictionary for building and dependency resolutionprotected DataSourceMetadataService getDataSourceMetadataService()
@Deprecated protected PhysicalTable loadPhysicalTable(PhysicalTableDefinition definition, Set<FieldName> metricNames, ResourceDictionaries dictionaries)
definition
- A config object for the physical tablemetricNames
- The Set of metric names on the tabledictionaries
- The resource dictionaries for reading and storing resource data@Deprecated public TableGroup buildDimensionSpanningTableGroup(Set<ApiMetricName> apiMetrics, Set<FieldName> druidMetrics, Set<PhysicalTableDefinition> tableDefinitions, ResourceDictionaries dictionaries)
Builds and loads the physical tables for the physical table definitions as well.
apiMetrics
- The set of metric names surfaced to the apidruidMetrics
- Names of druid datasource metric columnstableDefinitions
- A list of config objects for physical tablesdictionaries
- The container for all the data dictionaries@Deprecated public LogicalTable buildLogicalTable(String name, Granularity granularity, TableGroup group, MetricDictionary metrics)
Note: This builds a logical table with all valid metrics for the grain of the table
name
- The name for this logical tablegranularity
- The granularity for this logical tablegroup
- The group of physical tables for this logical tablemetrics
- The dictionary of all metrics@Deprecated public LogicalTable buildLogicalTable(String name, Granularity granularity, String category, String longName, org.joda.time.ReadablePeriod retention, String description, TableGroup group, MetricDictionary metrics)
Note: This builds a logical table with all valid metrics for the grain of the table.
name
- The name for this logical tablegranularity
- The granularity for this logical tablecategory
- The category for this logical tablelongName
- The long name for this logical tableretention
- The retention for this logical tabledescription
- The description for this logical tablegroup
- The group of physical tables for this logical tablemetrics
- The dictionary of all metrics@Deprecated public TableGroup buildTableGroup(String logicalTableName, Set<ApiMetricName> apiMetrics, Set<FieldName> druidMetrics, Set<PhysicalTableDefinition> tableDefinitions, ResourceDictionaries dictionaries)
Builds and loads the physical tables for the physical table definitions as well.
logicalTableName
- The logical table for the table groupapiMetrics
- The set of metric names surfaced to the apidruidMetrics
- Names of druid datasource metric columnstableDefinitions
- A list of config objects for physical tablesdictionaries
- The container for all the data dictionariesCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.