/** * Create a constrained copy of the source table. * * @param constraint The dataSourceConstraint which narrows the view of the underlying availability * * @return a constrained table whose availability and serialization are narrowed by this constraint */ @Override public ConstrainedTable withConstraint(DataSourceConstraint constraint) { return getSourceTable().withConstraint(constraint); } }
@Override public String toString() { return super.toString() + " datasourceName: " + getDataSourceName(); } }
@Override public String toString() { return super.toString() + " datasourceName: " + getDataSourceName(); } }
@Override public String getPhysicalColumnName(String logicalName) { if (!getSchema().containsLogicalName(logicalName)) { LOG.warn( "No mapping found for logical name '{}' to physical name on table '{}'. Will use logical name as " + "physical name. This is unexpected and should not happen for properly configured " + "dimensions.", logicalName, getName() ); } return getSchema().getPhysicalColumnName(logicalName); }
/** * Create a constrained copy of this table. * * @param constraint The dataSourceConstraint which narrows the view of the underlying availability * * @return a constrained table whose availability and serialization are narrowed by this constraint */ @Override public ConstrainedTable withConstraint(DataSourceConstraint constraint) { validateConstraintSchema(constraint); return new ConstrainedTable(this, new PhysicalDataSourceConstraint(constraint, getSchema())); }
/** * Builder. * * @param request API Request for which to build a table identifier * * @return the table identifier for the request */ public static TableIdentifier create(DataApiRequest request) { return new TableIdentifier(request.getTable().getName(), getGranularityPeriod(request.getGranularity())); }
@Override public String getPhysicalColumnName(String logicalName) { return getSourceTable().getPhysicalColumnName(logicalName); }
@Override public TableName getTableName() { return getSourceTable().getTableName(); }
@Override public DateTime getTableAlignment() { return getSourceTable().getTableAlignment(); }
@Override public String getName() { return getSourceTable().getName(); }
@Override public PhysicalTableSchema getSchema() { return getSourceTable().getSchema(); }
/** * Constructor. * * @param schema schema to copy construct */ public ZonedSchema(ZonedSchema schema) { this(schema.getGranularity(), schema.getDateTimeZone(), schema.getColumns()); } public DateTimeZone getDateTimeZone() {
/** * Constructor. * * @param table Logical table for the table identifier */ public TableIdentifier(LogicalTable table) { this(table.getName(), table.getGranularity()); }
@Override public String apply(String input) { return physicalTableSchema.getPhysicalColumnName(input); }
@Override public String toString() { return String.format("%s datasourceName: %s ", super.toString(), getDataSourceName()); } }
/** * Get the columns from the schema for this physical table. * * @return The columns of this physical table * * @deprecated In favor of getting the columns directly from the schema */ @Deprecated default Set<Column> getColumns() { return getSchema().getColumns(); }
/** * Return the {@link DataSourceName} of the dataSources which back this table given a constraint. * * @param constraint A constraint which may narrow the data sources participating. * * @return A set of names for backing dataSources, given the constraints */ default Set<DataSourceName> getDataSourceNames(DataSourceConstraint constraint) { return getDataSourceNames(); }
/** * Constructor. * * @param tableGroup The table group used to initial this logical table * @param granularity The granularity for this schema * @param metricDictionary The dictionary to resolve metric names from the table group against */ public LogicalTableSchema(TableGroup tableGroup, Granularity granularity, MetricDictionary metricDictionary) { super(granularity, buildLogicalColumns(tableGroup, granularity, metricDictionary)); }
/** * Constructor. * * @param logicalTableName Name for the table identifier * @param granularity Granularity of the table identifier */ public TableIdentifier(String logicalTableName, Granularity granularity) { super(logicalTableName, getGranularityPeriod(granularity)); }
/** * Return a view of the available intervals for this table given a constraint. * * @param constraint The constraint which limits available intervals * * @return The widest set of intervals that the table can report on, given the constraints */ default SimplifiedIntervalList getAvailableIntervals(DataSourceConstraint constraint) { // Default to unconstrained return getAvailableIntervals(); }