Merge lp:~nwilliams/akiban-server/cleanup-table-usertable into lp:~akiban-technologies/akiban-server/trunk

Proposed by Nathan Williams
Status: Work in progress
Proposed branch: lp:~nwilliams/akiban-server/cleanup-table-usertable
Merge into: lp:~akiban-technologies/akiban-server/trunk
Diff against target: 25212 lines (+3517/-3796)
402 files modified
src/main/java/com/akiban/ais/AISCloner.java (+3/-3)
src/main/java/com/akiban/ais/model/AISBuilder.java (+47/-44)
src/main/java/com/akiban/ais/model/AISMerge.java (+28/-29)
src/main/java/com/akiban/ais/model/AISSchemaChanger.java (+2/-2)
src/main/java/com/akiban/ais/model/AISTableNameChanger.java (+5/-5)
src/main/java/com/akiban/ais/model/AkibanInformationSchema.java (+40/-58)
src/main/java/com/akiban/ais/model/Column.java (+1/-6)
src/main/java/com/akiban/ais/model/DefaultIndexNameGenerator.java (+1/-2)
src/main/java/com/akiban/ais/model/DefaultNameGenerator.java (+11/-11)
src/main/java/com/akiban/ais/model/FullTextIndex.java (+11/-11)
src/main/java/com/akiban/ais/model/Group.java (+3/-3)
src/main/java/com/akiban/ais/model/GroupIndex.java (+26/-26)
src/main/java/com/akiban/ais/model/GroupIndexHelper.java (+7/-8)
src/main/java/com/akiban/ais/model/HKey.java (+4/-5)
src/main/java/com/akiban/ais/model/HKeyColumn.java (+4/-9)
src/main/java/com/akiban/ais/model/HKeySegment.java (+3/-3)
src/main/java/com/akiban/ais/model/Index.java (+0/-1)
src/main/java/com/akiban/ais/model/IndexToHKey.java (+1/-1)
src/main/java/com/akiban/ais/model/Join.java (+9/-9)
src/main/java/com/akiban/ais/model/NopVisitor.java (+1/-1)
src/main/java/com/akiban/ais/model/PendingOSC.java (+1/-1)
src/main/java/com/akiban/ais/model/Schema.java (+12/-12)
src/main/java/com/akiban/ais/model/Table.java (+169/-62)
src/main/java/com/akiban/ais/model/TableIndex.java (+2/-5)
src/main/java/com/akiban/ais/model/Visitor.java (+1/-1)
src/main/java/com/akiban/ais/model/aisb2/AISBBasedBuilder.java (+84/-82)
src/main/java/com/akiban/ais/model/aisb2/NewAISBuilder.java (+6/-6)
src/main/java/com/akiban/ais/model/aisb2/NewAkibanJoinBuilder.java (+1/-1)
src/main/java/com/akiban/ais/model/aisb2/NewTableBuilder.java (+30/-30)
src/main/java/com/akiban/ais/model/aisb2/NewViewBuilder.java (+1/-1)
src/main/java/com/akiban/ais/model/staticgrouping/GroupsBuilder.java (+2/-2)
src/main/java/com/akiban/ais/model/validation/CharacterSetSupported.java (+2/-2)
src/main/java/com/akiban/ais/model/validation/CollationSupported.java (+2/-2)
src/main/java/com/akiban/ais/model/validation/ColumnMaxAndPrefixSizesMatch.java (+2/-2)
src/main/java/com/akiban/ais/model/validation/ColumnPositionDense.java (+1/-1)
src/main/java/com/akiban/ais/model/validation/GroupSingleRoot.java (+6/-6)
src/main/java/com/akiban/ais/model/validation/GroupTreeNamesUnique.java (+3/-3)
src/main/java/com/akiban/ais/model/validation/IndexColumnIsNotPartial.java (+2/-2)
src/main/java/com/akiban/ais/model/validation/IndexHasColumns.java (+2/-2)
src/main/java/com/akiban/ais/model/validation/IndexIDsPositive.java (+2/-2)
src/main/java/com/akiban/ais/model/validation/IndexIDsUnique.java (+2/-2)
src/main/java/com/akiban/ais/model/validation/IndexSizes.java (+3/-3)
src/main/java/com/akiban/ais/model/validation/IndexTreeNamesUnique.java (+2/-2)
src/main/java/com/akiban/ais/model/validation/JoinToOneParent.java (+2/-2)
src/main/java/com/akiban/ais/model/validation/MemoryTablesNotMixed.java (+6/-6)
src/main/java/com/akiban/ais/model/validation/PrimaryKeyIsNotNull.java (+2/-2)
src/main/java/com/akiban/ais/model/validation/ReferencesCorrect.java (+6/-10)
src/main/java/com/akiban/ais/model/validation/SupportedColumnTypes.java (+2/-2)
src/main/java/com/akiban/ais/model/validation/TableHasPrimaryKey.java (+2/-2)
src/main/java/com/akiban/ais/model/validation/TableIDsUnique.java (+1/-2)
src/main/java/com/akiban/ais/model/validation/TablesInAGroup.java (+3/-3)
src/main/java/com/akiban/ais/model/validation/TreeNamesAreNotNull.java (+2/-7)
src/main/java/com/akiban/ais/protobuf/ProtobufReader.java (+22/-22)
src/main/java/com/akiban/ais/protobuf/ProtobufWriter.java (+7/-7)
src/main/java/com/akiban/ais/util/AISPrinter.java (+3/-3)
src/main/java/com/akiban/ais/util/ChangedTableDescription.java (+4/-4)
src/main/java/com/akiban/ais/util/DDLGenerator.java (+2/-6)
src/main/java/com/akiban/ais/util/TableChangeValidator.java (+14/-14)
src/main/java/com/akiban/ais/util/UuidAssigner.java (+4/-4)
src/main/java/com/akiban/direct/ClassBuilder.java (+19/-19)
src/main/java/com/akiban/qp/loadableplan/std/DumpGroupLoadablePlan.java (+9/-9)
src/main/java/com/akiban/qp/memoryadapter/BasicFactoryBase.java (+1/-1)
src/main/java/com/akiban/qp/memoryadapter/MemoryAdapter.java (+3/-8)
src/main/java/com/akiban/qp/memoryadapter/SimpleMemoryGroupScan.java (+1/-1)
src/main/java/com/akiban/qp/operator/API.java (+16/-17)
src/main/java/com/akiban/qp/operator/AncestorLookup_Default.java (+22/-22)
src/main/java/com/akiban/qp/operator/AncestorLookup_Nested.java (+15/-15)
src/main/java/com/akiban/qp/operator/BranchLookup_Default.java (+19/-19)
src/main/java/com/akiban/qp/operator/BranchLookup_Nested.java (+24/-24)
src/main/java/com/akiban/qp/operator/Count_TableStatus.java (+3/-3)
src/main/java/com/akiban/qp/operator/Delete_Default.java (+1/-1)
src/main/java/com/akiban/qp/operator/Delete_Returning.java (+1/-1)
src/main/java/com/akiban/qp/operator/ExecutionBase.java (+2/-2)
src/main/java/com/akiban/qp/operator/Flatten_HKeyOrdered.java (+1/-1)
src/main/java/com/akiban/qp/operator/GroupScan_Default.java (+10/-10)
src/main/java/com/akiban/qp/operator/HKeyUnion_Ordered.java (+5/-5)
src/main/java/com/akiban/qp/operator/IndexScanSelector.java (+15/-15)
src/main/java/com/akiban/qp/operator/IndexScan_Default.java (+9/-9)
src/main/java/com/akiban/qp/operator/Insert_Default.java (+2/-2)
src/main/java/com/akiban/qp/operator/Insert_Returning.java (+1/-1)
src/main/java/com/akiban/qp/operator/Operator.java (+3/-3)
src/main/java/com/akiban/qp/operator/Product_NestedLoops.java (+3/-3)
src/main/java/com/akiban/qp/operator/Project_Default.java (+8/-8)
src/main/java/com/akiban/qp/operator/QueryContext.java (+2/-2)
src/main/java/com/akiban/qp/operator/SimpleQueryContext.java (+2/-2)
src/main/java/com/akiban/qp/operator/UnionAll_Default.java (+3/-3)
src/main/java/com/akiban/qp/operator/Update_Default.java (+1/-1)
src/main/java/com/akiban/qp/operator/Update_Returning.java (+1/-1)
src/main/java/com/akiban/qp/persistitadapter/NewRowBackedIndexRow.java (+3/-3)
src/main/java/com/akiban/qp/persistitadapter/OneTableRowCollector.java (+6/-6)
src/main/java/com/akiban/qp/persistitadapter/OperatorBasedRowCollector.java (+28/-33)
src/main/java/com/akiban/qp/persistitadapter/OperatorStore.java (+26/-26)
src/main/java/com/akiban/qp/persistitadapter/OperatorStoreGIHandler.java (+10/-10)
src/main/java/com/akiban/qp/persistitadapter/OperatorStoreMaintenance.java (+39/-39)
src/main/java/com/akiban/qp/persistitadapter/OperatorStoreMaintenancePlans.java (+12/-12)
src/main/java/com/akiban/qp/persistitadapter/PersistitAdapter.java (+9/-9)
src/main/java/com/akiban/qp/persistitadapter/PersistitGroupRow.java (+7/-8)
src/main/java/com/akiban/qp/persistitadapter/indexrow/PersistitGroupIndexRow.java (+2/-2)
src/main/java/com/akiban/qp/persistitadapter/indexrow/PersistitIndexRow.java (+3/-8)
src/main/java/com/akiban/qp/persistitadapter/indexrow/PersistitTableIndexRow.java (+2/-2)
src/main/java/com/akiban/qp/row/AbstractRow.java (+3/-5)
src/main/java/com/akiban/qp/row/DelegateRow.java (+4/-4)
src/main/java/com/akiban/qp/row/FlattenedRow.java (+6/-6)
src/main/java/com/akiban/qp/row/HKeyRow.java (+2/-2)
src/main/java/com/akiban/qp/row/RowBase.java (+3/-3)
src/main/java/com/akiban/qp/rowtype/CompoundRowType.java (+2/-5)
src/main/java/com/akiban/qp/rowtype/DerivedTypesSchema.java (+1/-1)
src/main/java/com/akiban/qp/rowtype/FlattenedRowType.java (+2/-2)
src/main/java/com/akiban/qp/rowtype/IndexRowType.java (+8/-8)
src/main/java/com/akiban/qp/rowtype/ProductRowType.java (+6/-6)
src/main/java/com/akiban/qp/rowtype/ProjectedTableRowType.java (+15/-10)
src/main/java/com/akiban/qp/rowtype/RowType.java (+11/-11)
src/main/java/com/akiban/qp/rowtype/Schema.java (+26/-31)
src/main/java/com/akiban/qp/rowtype/SingleBranchTypeComposition.java (+6/-6)
src/main/java/com/akiban/qp/rowtype/TableRowChecker.java (+10/-10)
src/main/java/com/akiban/qp/rowtype/TableRowType.java (+8/-8)
src/main/java/com/akiban/qp/rowtype/TypeComposition.java (+4/-4)
src/main/java/com/akiban/qp/util/HKeyCache.java (+2/-2)
src/main/java/com/akiban/rest/resources/ModelResource.java (+2/-2)
src/main/java/com/akiban/server/api/DDLFunctions.java (+3/-13)
src/main/java/com/akiban/server/api/dml/scan/NewRowBuilder.java (+1/-1)
src/main/java/com/akiban/server/entity/changes/DDLBasedSpaceModifier.java (+13/-15)
src/main/java/com/akiban/server/entity/changes/EntityParser.java (+15/-15)
src/main/java/com/akiban/server/entity/changes/EntityToAIS.java (+8/-8)
src/main/java/com/akiban/server/entity/fromais/AisToSpace.java (+2/-4)
src/main/java/com/akiban/server/entity/fromais/EntityBuilder.java (+13/-13)
src/main/java/com/akiban/server/error/ErrorCode.java (+2/-2)
src/main/java/com/akiban/server/error/GroupMissingIndexException.java (+0/-26)
src/main/java/com/akiban/server/error/GroupMissingTableColumnException.java (+0/-27)
src/main/java/com/akiban/server/manage/ManageMXBeanImpl.java (+3/-3)
src/main/java/com/akiban/server/manage/SchemaMXBean.java (+3/-4)
src/main/java/com/akiban/server/rowdata/RowData.java (+1/-1)
src/main/java/com/akiban/server/rowdata/RowDef.java (+18/-36)
src/main/java/com/akiban/server/rowdata/RowDefCache.java (+8/-9)
src/main/java/com/akiban/server/service/dxl/AlterTableHelper.java (+6/-6)
src/main/java/com/akiban/server/service/dxl/BasicDDLFunctions.java (+51/-66)
src/main/java/com/akiban/server/service/dxl/BasicDMLFunctions.java (+12/-16)
src/main/java/com/akiban/server/service/dxl/DXLFunctionsHook.java (+1/-3)
src/main/java/com/akiban/server/service/dxl/DXLTransactionHook.java (+0/-2)
src/main/java/com/akiban/server/service/dxl/HookableDDLFunctions.java (+5/-21)
src/main/java/com/akiban/server/service/externaldata/CsvRowReader.java (+2/-2)
src/main/java/com/akiban/server/service/externaldata/ExternalDataService.java (+3/-3)
src/main/java/com/akiban/server/service/externaldata/ExternalDataServiceImpl.java (+10/-10)
src/main/java/com/akiban/server/service/externaldata/JsonRowWriter.java (+3/-3)
src/main/java/com/akiban/server/service/externaldata/MysqlDumpRowReader.java (+2/-2)
src/main/java/com/akiban/server/service/externaldata/PlanGenerator.java (+8/-8)
src/main/java/com/akiban/server/service/externaldata/RowReader.java (+2/-2)
src/main/java/com/akiban/server/service/externaldata/TableRowTracker.java (+7/-7)
src/main/java/com/akiban/server/service/is/BasicInfoSchemaTablesServiceImpl.java (+54/-54)
src/main/java/com/akiban/server/service/is/SchemaTablesService.java (+2/-2)
src/main/java/com/akiban/server/service/is/ServerSchemaTablesServiceImpl.java (+11/-11)
src/main/java/com/akiban/server/service/is/StorageSchemaTablesServiceImpl.java (+11/-11)
src/main/java/com/akiban/server/service/restdml/DMLProcessor.java (+6/-7)
src/main/java/com/akiban/server/service/restdml/InsertGenerator.java (+6/-6)
src/main/java/com/akiban/server/service/restdml/InsertProcessor.java (+0/-2)
src/main/java/com/akiban/server/service/restdml/ModelBuilder.java (+20/-20)
src/main/java/com/akiban/server/service/restdml/OperatorGenerator.java (+6/-6)
src/main/java/com/akiban/server/service/restdml/RestDMLServiceImpl.java (+5/-5)
src/main/java/com/akiban/server/service/restdml/UpdateGenerator.java (+6/-6)
src/main/java/com/akiban/server/service/security/SecurityServiceImpl.java (+6/-7)
src/main/java/com/akiban/server/service/text/FullTextIndexInfo.java (+15/-18)
src/main/java/com/akiban/server/service/text/FullTextIndexServiceImpl.java (+2/-2)
src/main/java/com/akiban/server/service/text/RowIndexer.java (+4/-11)
src/main/java/com/akiban/server/store/AbstractSchemaManager.java (+24/-25)
src/main/java/com/akiban/server/store/AbstractStore.java (+6/-7)
src/main/java/com/akiban/server/store/DelegatingStore.java (+2/-2)
src/main/java/com/akiban/server/store/PersistitStore.java (+23/-23)
src/main/java/com/akiban/server/store/PersistitStoreSchemaManager.java (+10/-10)
src/main/java/com/akiban/server/store/SchemaManager.java (+4/-5)
src/main/java/com/akiban/server/store/SequenceFixUpRoutines.java (+3/-3)
src/main/java/com/akiban/server/store/Store.java (+2/-2)
src/main/java/com/akiban/server/store/TreeRecordVisitor.java (+5/-5)
src/main/java/com/akiban/server/store/statistics/AbstractIndexStatisticsService.java (+10/-10)
src/main/java/com/akiban/server/store/statistics/PersistitStoreIndexStatistics.java (+1/-1)
src/main/java/com/akiban/server/t3expressions/T3RegistryServiceImpl.java (+10/-10)
src/main/java/com/akiban/server/util/GroupIndexCreator.java (+4/-4)
src/main/java/com/akiban/sql/aisddl/AlterTableDDL.java (+11/-13)
src/main/java/com/akiban/sql/aisddl/IndexDDL.java (+13/-13)
src/main/java/com/akiban/sql/aisddl/SequenceDDL.java (+0/-2)
src/main/java/com/akiban/sql/aisddl/TableDDL.java (+13/-15)
src/main/java/com/akiban/sql/embedded/EmbeddedOperatorCompiler.java (+3/-5)
src/main/java/com/akiban/sql/embedded/ExecuteAutoGeneratedKeys.java (+5/-5)
src/main/java/com/akiban/sql/embedded/JDBCConnection.java (+2/-6)
src/main/java/com/akiban/sql/optimizer/AISBinder.java (+4/-5)
src/main/java/com/akiban/sql/optimizer/AISTypeComputer.java (+2/-2)
src/main/java/com/akiban/sql/optimizer/plan/BasePlannable.java (+4/-4)
src/main/java/com/akiban/sql/optimizer/plan/ColumnExpression.java (+1/-1)
src/main/java/com/akiban/sql/optimizer/plan/IndexIntersectionNode.java (+3/-3)
src/main/java/com/akiban/sql/optimizer/plan/MultiIndexEnumerator.java (+7/-10)
src/main/java/com/akiban/sql/optimizer/plan/MultiIndexIntersectScan.java (+3/-3)
src/main/java/com/akiban/sql/optimizer/plan/PhysicalSelect.java (+2/-2)
src/main/java/com/akiban/sql/optimizer/plan/PhysicalUpdate.java (+2/-2)
src/main/java/com/akiban/sql/optimizer/plan/SingleIndexScan.java (+4/-4)
src/main/java/com/akiban/sql/optimizer/plan/TableNode.java (+2/-2)
src/main/java/com/akiban/sql/optimizer/plan/TableSubTreeBase.java (+4/-4)
src/main/java/com/akiban/sql/optimizer/plan/TableTree.java (+2/-2)
src/main/java/com/akiban/sql/optimizer/plan/TableTreeBase.java (+6/-6)
src/main/java/com/akiban/sql/optimizer/rule/ASTStatementLoader.java (+10/-10)
src/main/java/com/akiban/sql/optimizer/rule/GroupJoinFinder.java (+3/-3)
src/main/java/com/akiban/sql/optimizer/rule/OperatorAssembler.java (+19/-20)
src/main/java/com/akiban/sql/optimizer/rule/PlanGenerator.java (+13/-13)
src/main/java/com/akiban/sql/optimizer/rule/cost/CostEstimator.java (+16/-15)
src/main/java/com/akiban/sql/optimizer/rule/cost/CostModel.java (+17/-17)
src/main/java/com/akiban/sql/optimizer/rule/cost/PlanCostEstimator.java (+8/-8)
src/main/java/com/akiban/sql/optimizer/rule/cost/TreeStatistics.java (+8/-8)
src/main/java/com/akiban/sql/optimizer/rule/join_enum/GroupIndexGoal.java (+3/-3)
src/main/java/com/akiban/sql/pg/PostgresBaseOperatorStatement.java (+4/-4)
src/main/java/com/akiban/sql/pg/PostgresCopyInStatement.java (+3/-4)
src/main/java/com/akiban/sql/pg/PostgresEmulatedMetaDataStatement.java (+34/-34)
src/main/java/com/akiban/sql/pg/PostgresServerConnection.java (+3/-3)
src/main/java/com/akiban/sql/server/ServerQueryContext.java (+2/-2)
src/main/java/com/akiban/sql/server/ServerSession.java (+2/-3)
src/main/java/com/akiban/sql/server/ServerSessionBase.java (+2/-3)
src/main/protobuf/akiban_information_schema.proto (+1/-4)
src/main/resources/com/akiban/server/error/error_code.properties (+1/-3)
src/test/java/com/akiban/ais/AISComparator.java (+5/-5)
src/test/java/com/akiban/ais/CAOIBuilderFiller.java (+5/-5)
src/test/java/com/akiban/ais/model/AISBuilderTest.java (+140/-140)
src/test/java/com/akiban/ais/model/AISMergeTest.java (+90/-91)
src/test/java/com/akiban/ais/model/AISTest.java (+21/-21)
src/test/java/com/akiban/ais/model/HKeyDependentTableTest.java (+18/-18)
src/test/java/com/akiban/ais/model/HKeySegmentTest.java (+10/-10)
src/test/java/com/akiban/ais/model/aisb2/AISBBasedBuilderTest.java (+8/-8)
src/test/java/com/akiban/ais/model/staticgrouping/GroupsBuilderTest.java (+4/-4)
src/test/java/com/akiban/ais/model/validation/AISCollationValidationTest.java (+3/-3)
src/test/java/com/akiban/ais/model/validation/AISInvariantsTest.java (+8/-8)
src/test/java/com/akiban/ais/model/validation/ColumnMaxAndPrefixSizesMatchTest.java (+2/-2)
src/test/java/com/akiban/ais/model/validation/IndexColumnIsNotPartialTest.java (+1/-1)
src/test/java/com/akiban/ais/model/validation/IndexSizeTest.java (+3/-3)
src/test/java/com/akiban/ais/model/validation/JoinToOneParentTest.java (+3/-3)
src/test/java/com/akiban/ais/model/validation/JoinToParentPKTest.java (+11/-11)
src/test/java/com/akiban/ais/protobuf/ProtobufReaderWriterTest.java (+35/-35)
src/test/java/com/akiban/ais/util/DDLGeneratorTest.java (+13/-13)
src/test/java/com/akiban/ais/util/TableChangeValidatorTest.java (+112/-115)
src/test/java/com/akiban/qp/operator/IndexScanSelectorTest.java (+13/-13)
src/test/java/com/akiban/qp/row/CompoundRowTest.java (+15/-15)
src/test/java/com/akiban/qp/rowtype/CompoundRowTypeTest.java (+37/-37)
src/test/java/com/akiban/qp/rowtype/TableRowCheckerTest.java (+13/-13)
src/test/java/com/akiban/server/api/ddl/DDLFunctionsMockBase.java (+2/-8)
src/test/java/com/akiban/server/entity/changes/AISDumper.java (+2/-3)
src/test/java/com/akiban/server/entity/changes/DDLBasedSpaceModifierIT.java (+3/-3)
src/test/java/com/akiban/server/entity/changes/EntityParserIT.java (+23/-23)
src/test/java/com/akiban/server/entity/fromais/AisToSpaceTest.java (+5/-6)
src/test/java/com/akiban/server/rowdata/PKLessTableRowDefCacheTest.java (+3/-3)
src/test/java/com/akiban/server/rowdata/RowDataConversionTest.java (+2/-2)
src/test/java/com/akiban/server/rowdata/RowDataFormatTest.java (+21/-21)
src/test/java/com/akiban/server/rowdata/RowDataTest.java (+2/-2)
src/test/java/com/akiban/server/rowdata/RowDefCacheTest.java (+20/-20)
src/test/java/com/akiban/server/rowdata/SchemaFactory.java (+4/-7)
src/test/java/com/akiban/server/service/dxl/DXLMXBeanImplTest.java (+17/-17)
src/test/java/com/akiban/server/service/externaldata/CsvRowReaderTest.java (+2/-2)
src/test/java/com/akiban/server/service/externaldata/MysqlDumpRowReaderTest.java (+2/-3)
src/test/java/com/akiban/server/service/is/BasicInfoSchemaTablesServiceImplTest.java (+23/-24)
src/test/java/com/akiban/server/service/is/SchemaTableServiceIT.java (+42/-42)
src/test/java/com/akiban/server/service/restdml/ModelBuilderIT.java (+7/-7)
src/test/java/com/akiban/server/service/restdml/PrimaryKeyParserTest.java (+2/-3)
src/test/java/com/akiban/server/service/text/FullTextIndexServiceIT.java (+1/-3)
src/test/java/com/akiban/server/store/PersistitStoreSchemaManagerIT.java (+5/-5)
src/test/java/com/akiban/server/test/ApiTestBase.java (+39/-50)
src/test/java/com/akiban/server/test/costmodel/CostModelBase.java (+15/-16)
src/test/java/com/akiban/server/test/costmodel/DistinctCT.java (+1/-2)
src/test/java/com/akiban/server/test/costmodel/FlattenCT.java (+5/-5)
src/test/java/com/akiban/server/test/costmodel/HKeyUnionCT.java (+3/-4)
src/test/java/com/akiban/server/test/costmodel/IntersectCT.java (+3/-4)
src/test/java/com/akiban/server/test/costmodel/MapCT.java (+7/-7)
src/test/java/com/akiban/server/test/costmodel/ProductCT.java (+7/-7)
src/test/java/com/akiban/server/test/costmodel/ProjectCT.java (+1/-1)
src/test/java/com/akiban/server/test/costmodel/SelectCT.java (+1/-1)
src/test/java/com/akiban/server/test/costmodel/Select_BloomFilterCT.java (+5/-6)
src/test/java/com/akiban/server/test/costmodel/SortCT.java (+1/-1)
src/test/java/com/akiban/server/test/costmodel/SortWithLimitCT.java (+1/-1)
src/test/java/com/akiban/server/test/costmodel/TreeScanCT.java (+1/-2)
src/test/java/com/akiban/server/test/it/ITBase.java (+0/-3)
src/test/java/com/akiban/server/test/it/bugs/bug1017621/TableIDCollisionIT.java (+4/-4)
src/test/java/com/akiban/server/test/it/bugs/bug1033617/DropTablesInNewSessionIT.java (+1/-1)
src/test/java/com/akiban/server/test/it/bugs/bug1043377/FailureDuringIndexBuildingIT.java (+2/-2)
src/test/java/com/akiban/server/test/it/bugs/bug1047046/AlterColumnInSpatialIndexIT.java (+5/-5)
src/test/java/com/akiban/server/test/it/bugs/bug1112940/AccumLiveValueAfterAbortIT.java (+1/-1)
src/test/java/com/akiban/server/test/it/bugs/bug1145249/ManyLongTextFieldsIT.java (+3/-3)
src/test/java/com/akiban/server/test/it/bugs/bug696156/MultipleNullUniqueIndexIT.java (+2/-2)
src/test/java/com/akiban/server/test/it/bugs/bug701580/SpuriousDuplicateKeyIT.java (+3/-3)
src/test/java/com/akiban/server/test/it/bugs/bug701614/MissingColumnsIT.java (+2/-2)
src/test/java/com/akiban/server/test/it/bugs/bug720768/GroupNameCollisionIT.java (+2/-2)
src/test/java/com/akiban/server/test/it/dxl/AddMultipleAkibanFKsIT.java (+5/-5)
src/test/java/com/akiban/server/test/it/dxl/AlterTableBasicIT.java (+60/-60)
src/test/java/com/akiban/server/test/it/dxl/AlterTableCAOIConflatedKeysIT.java (+5/-5)
src/test/java/com/akiban/server/test/it/dxl/AlterTableCAOIIT.java (+8/-8)
src/test/java/com/akiban/server/test/it/dxl/AlterTableITBase.java (+8/-8)
src/test/java/com/akiban/server/test/it/dxl/AtomicSchemaChangesIT.java (+2/-2)
src/test/java/com/akiban/server/test/it/dxl/CBasicIT.java (+8/-8)
src/test/java/com/akiban/server/test/it/dxl/COIBasicIT.java (+8/-8)
src/test/java/com/akiban/server/test/it/dxl/CreateIndexesIT.java (+32/-33)
src/test/java/com/akiban/server/test/it/dxl/DDLInvalidatesScansIT.java (+2/-2)
src/test/java/com/akiban/server/test/it/dxl/DropIndexesIT.java (+9/-9)
src/test/java/com/akiban/server/test/it/dxl/DropSchemaIT.java (+5/-6)
src/test/java/com/akiban/server/test/it/dxl/DropTreesIT.java (+38/-39)
src/test/java/com/akiban/server/test/it/dxl/DuplicateIndexTreeNameIT.java (+1/-1)
src/test/java/com/akiban/server/test/it/dxl/GroupIndexIT.java (+12/-12)
src/test/java/com/akiban/server/test/it/dxl/RenameTableIT.java (+3/-3)
src/test/java/com/akiban/server/test/it/dxl/ScanBufferTooSmallIT.java (+3/-5)
src/test/java/com/akiban/server/test/it/dxl/ScanFlagsIT.java (+2/-2)
src/test/java/com/akiban/server/test/it/dxl/StableUuidsIT.java (+2/-2)
src/test/java/com/akiban/server/test/it/keyupdate/BasicKeyUpdateIT.java (+1/-1)
src/test/java/com/akiban/server/test/it/keyupdate/FixCountStarIT.java (+3/-3)
src/test/java/com/akiban/server/test/it/keyupdate/GIUpdateITBase.java (+7/-7)
src/test/java/com/akiban/server/test/it/keyupdate/HKey.java (+8/-8)
src/test/java/com/akiban/server/test/it/keyupdate/IndexEntryCountIT.java (+7/-7)
src/test/java/com/akiban/server/test/it/keyupdate/KeyUpdateAcrossTransactionsIT.java (+2/-2)
src/test/java/com/akiban/server/test/it/keyupdate/NewGiUpdateIT.java (+6/-6)
src/test/java/com/akiban/server/test/it/memorytable/MemoryAdapterIT.java (+11/-13)
src/test/java/com/akiban/server/test/it/multiscan_update/MultiScanUpdateIT.java (+1/-1)
src/test/java/com/akiban/server/test/it/qp/AncestorLookup_DefaultIT.java (+4/-5)
src/test/java/com/akiban/server/test/it/qp/AncestorLookup_NestedIT.java (+10/-11)
src/test/java/com/akiban/server/test/it/qp/BranchLookup_NestedIT.java (+9/-10)
src/test/java/com/akiban/server/test/it/qp/ConcurrentUpdateIT.java (+5/-6)
src/test/java/com/akiban/server/test/it/qp/Distinct_Partial_CaseInsensitive_IT.java (+5/-10)
src/test/java/com/akiban/server/test/it/qp/FilterIT.java (+4/-5)
src/test/java/com/akiban/server/test/it/qp/FlattenIT.java (+1/-2)
src/test/java/com/akiban/server/test/it/qp/FlattenLeftJoinIT.java (+11/-12)
src/test/java/com/akiban/server/test/it/qp/GroupIndexRowIT.java (+7/-8)
src/test/java/com/akiban/server/test/it/qp/GroupIndexScanIT.java (+7/-8)
src/test/java/com/akiban/server/test/it/qp/GroupScanIT.java (+1/-1)
src/test/java/com/akiban/server/test/it/qp/GroupSkipScanIT.java (+3/-6)
src/test/java/com/akiban/server/test/it/qp/HKeyUnion_OrderedIT.java (+5/-7)
src/test/java/com/akiban/server/test/it/qp/IndexRowAndAncestorIT.java (+19/-20)
src/test/java/com/akiban/server/test/it/qp/IndexScanBoundedIT.java (+1/-3)
src/test/java/com/akiban/server/test/it/qp/IndexScanInvolvingUndeclaredColumnsIT.java (+1/-3)
src/test/java/com/akiban/server/test/it/qp/IndexScanJumpBoundedIT.java (+1/-3)
src/test/java/com/akiban/server/test/it/qp/IndexScanJumpUnboundedIT.java (+1/-1)
src/test/java/com/akiban/server/test/it/qp/IndexScanLexicographicIT.java (+1/-9)
src/test/java/com/akiban/server/test/it/qp/IndexScanNullIT.java (+1/-3)
src/test/java/com/akiban/server/test/it/qp/IndexScanUnboundedIT.java (+1/-3)
src/test/java/com/akiban/server/test/it/qp/Intersect_OrderedByteArrayComparisonIT.java (+1/-3)
src/test/java/com/akiban/server/test/it/qp/Intersect_OrderedIT.java (+2/-4)
src/test/java/com/akiban/server/test/it/qp/Intersect_OrderedSkipScanIT.java (+2/-4)
src/test/java/com/akiban/server/test/it/qp/Intersect_OrderedVsHKeyColumnEquivalenceIT.java (+2/-3)
src/test/java/com/akiban/server/test/it/qp/MultiCursorIT.java (+3/-4)
src/test/java/com/akiban/server/test/it/qp/MultiIndexCrossBranchIT.java (+9/-11)
src/test/java/com/akiban/server/test/it/qp/NWaySkipScanIT.java (+1/-4)
src/test/java/com/akiban/server/test/it/qp/NonRootPKIndexScanIT.java (+2/-3)
src/test/java/com/akiban/server/test/it/qp/OperatorITBase.java (+24/-24)
src/test/java/com/akiban/server/test/it/qp/OrphanResolutionIT.java (+5/-6)
src/test/java/com/akiban/server/test/it/qp/ParentAndChildSkipScanIT.java (+2/-4)
src/test/java/com/akiban/server/test/it/qp/Product3WayIT.java (+10/-11)
src/test/java/com/akiban/server/test/it/qp/Product_NestedLoopsIT.java (+3/-4)
src/test/java/com/akiban/server/test/it/qp/Select_BloomFilterIT.java (+5/-7)
src/test/java/com/akiban/server/test/it/qp/Select_BloomFilter_CaseInsensitive_IT.java (+6/-10)
src/test/java/com/akiban/server/test/it/qp/SkipScanPerformanceIT.java (+1/-5)
src/test/java/com/akiban/server/test/it/qp/Sort_MixedColumnTypesIT.java (+5/-9)
src/test/java/com/akiban/server/test/it/qp/Sort_Tree_LargeKeyIT.java (+1/-1)
src/test/java/com/akiban/server/test/it/qp/Sort_Tree_RandomIT.java (+1/-3)
src/test/java/com/akiban/server/test/it/qp/SpatialLatLonGroupIndexScanIT.java (+7/-9)
src/test/java/com/akiban/server/test/it/qp/SpatialLatLonTableIndexScanIT.java (+4/-5)
src/test/java/com/akiban/server/test/it/qp/UnionAll_DefaultIT.java (+3/-4)
src/test/java/com/akiban/server/test/it/qp/Union_OrderedIT.java (+1/-3)
src/test/java/com/akiban/server/test/it/qp/UniqueIndexJumpUnboundedCompositeKeyIT.java (+2/-5)
src/test/java/com/akiban/server/test/it/qp/UniqueIndexScanIT.java (+1/-2)
src/test/java/com/akiban/server/test/it/qp/UniqueIndexScanJumpBoundedUnboundedWithNulls2IT.java (+2/-5)
src/test/java/com/akiban/server/test/it/qp/UniqueIndexScanJumpBoundedWithNullsIT.java (+2/-5)
src/test/java/com/akiban/server/test/it/qp/UniqueIndexScanJumpUnboundedIT.java (+1/-3)
src/test/java/com/akiban/server/test/it/qp/UniqueIndexScanJumpUnboundedWithNullsIT.java (+2/-3)
src/test/java/com/akiban/server/test/it/qp/UniqueIndexScanUnboundedIT.java (+1/-3)
src/test/java/com/akiban/server/test/it/qp/UniqueIndexUpdateIT.java (+3/-4)
src/test/java/com/akiban/server/test/it/routines/TestPlan.java (+3/-3)
src/test/java/com/akiban/server/test/it/rowtests/KeyToObjectIT.java (+1/-1)
src/test/java/com/akiban/server/test/it/rowtests/ObjectToKeyIT.java (+2/-2)
src/test/java/com/akiban/server/test/it/rowtests/UnsignedFieldsIT.java (+1/-1)
src/test/java/com/akiban/server/test/it/store/AbstractScanBase.java (+4/-5)
src/test/java/com/akiban/server/test/it/store/AnalyzeSpatialIT.java (+1/-1)
src/test/java/com/akiban/server/test/it/store/DataDictionaryDDL.java (+5/-5)
src/test/java/com/akiban/server/test/it/store/IndexHistogramsIT.java (+9/-9)
src/test/java/com/akiban/server/test/it/store/SchemaManagerIT.java (+45/-46)
src/test/java/com/akiban/server/test/it/store/SimpleBlobIT.java (+2/-2)
src/test/java/com/akiban/server/test/it/tablestatus/TableStatusRecoveryIT.java (+3/-3)
src/test/java/com/akiban/server/test/mt/mtatomics/ConcurrentAtomicsBase.java (+8/-9)
src/test/java/com/akiban/server/test/mt/mtatomics/ConcurrentDDLAtomicsMT.java (+22/-22)
src/test/java/com/akiban/server/test/mt/mtatomics/ConcurrentDMLAtomicsMT.java (+5/-5)
src/test/java/com/akiban/server/test/pt/TraversalsPerWritePT.java (+1/-1)
src/test/java/com/akiban/server/test/pt/gi/GIUpdateProfilePT.java (+22/-22)
src/test/java/com/akiban/server/test/pt/qp/GroupScanProfilePT.java (+4/-4)
src/test/java/com/akiban/server/test/pt/qp/HKeyChangePropagationCascadedKeysProfilePT.java (+4/-4)
src/test/java/com/akiban/server/test/pt/qp/HKeyChangePropagationProfilePT.java (+4/-4)
src/test/java/com/akiban/server/test/pt/qp/IndexScanPT.java (+1/-2)
src/test/java/com/akiban/server/test/pt/qp/InsertProfilePT.java (+4/-4)
src/test/java/com/akiban/server/test/pt/qp/QPProfilePTBase.java (+16/-17)
src/test/java/com/akiban/server/test/pt/qp/SimpleJoinPT.java (+9/-9)
src/test/java/com/akiban/server/test/pt/qp/SortPT.java (+1/-2)
src/test/java/com/akiban/server/util/GroupIndexCreatorTest.java (+7/-7)
src/test/java/com/akiban/sql/aisddl/AlterTableDDLTest.java (+96/-96)
src/test/java/com/akiban/sql/aisddl/IndexDDLIT.java (+18/-18)
src/test/java/com/akiban/sql/aisddl/SchemaDDLTest.java (+1/-1)
src/test/java/com/akiban/sql/aisddl/TableDDLIT.java (+22/-22)
src/test/java/com/akiban/sql/aisddl/TableDDLTest.java (+22/-22)
src/test/java/com/akiban/sql/optimizer/rule/MultipleIndexCostSensitivityTest.java (+5/-5)
src/test/java/com/akiban/sql/optimizer/rule/RulesTestHelper.java (+1/-1)
src/test/java/com/akiban/sql/optimizer/rule/cost/CostEstimatorTest.java (+4/-4)
src/test/java/com/akiban/sql/optimizer/rule/cost/UnorderedIntersectCostSensitivityTest.java (+7/-7)
src/test/java/com/akiban/sql/optimizer/rule/range/TUtils.java (+3/-3)
src/test/java/com/akiban/sql/pg/IndexStatisticsLifecycleIT.java (+4/-6)
src/test/java/com/akiban/sql/pg/PostgresServerPreparedStatementIT.java (+2/-2)
src/test/java/com/akiban/sql/pg/PostgresServerSessionIT.java (+4/-6)
src/test/resources/com/akiban/sql/pg/yaml/bulkload/test-bl-prohibits.yaml (+1/-1)
To merge this branch: bzr merge lp:~nwilliams/akiban-server/cleanup-table-usertable
Reviewer Review Type Date Requested Status
Thomas Jones-Low Needs Fixing
Review via email: mp+166154@code.launchpad.net

Description of the change

Collapse Table and UserTable and rename most referencing classes, methods, and variables.

Very large diff but 99% IDE generated. Certainly not required, but there isn't much outstanding and the sooner we do the big cleanups the better.

While doing that, remove engine and migration usage from it. Minor cascade to DDLGenerator based tests.

To post a comment you must log in.
Revision history for this message
Thomas Jones-Low (tjoneslo) wrote :

It looks like you only managed to touch about 1/3 of the files in the system.

This looks good, let see what the build system does with it.

review: Approve
Revision history for this message
Thomas Jones-Low (tjoneslo) wrote :

There were 8 failures during build/test:

* job data-compat-and-upgrade-test failed at build number 1001: http://sneezy.softstart.com:8080/job/data-compat-and-upgrade-test/1001/

* job insert-regression-test failed at build number 3796: http://sneezy.softstart.com:8080/job/insert-regression-test/3796/

* job sqlselect-regression-test failed at build number 1886: http://sneezy.softstart.com:8080/job/sqlselect-regression-test/1886/

* job recovery-test failed at build number 3526: http://sneezy.softstart.com:8080/job/recovery-test/3526/

* view must-pass failed: data-compat-and-upgrade-test is red

* view must-pass failed: insert-regression-test is red

* view must-pass failed: sqlselect-regression-test is red

* view must-pass failed: recovery-test is red

review: Needs Fixing
Revision history for this message
Thomas Jones-Low (tjoneslo) wrote :

This fails currently because the akiban-server-mysqladapter plugin also needs to be udpated, but is currently locked in a private github repository. The failing tests all rely on doing some setup through MySQL (schema creation, data loading, something). I'll disable/remove these tests in the morning and try this again.

These test will need to be fixed/rewritten/discarded.

Revision history for this message
Nathan Williams (nwilliams) wrote :

Thanks for monitoring this Thomas.

Don't worry about disabling tests for now. This was 30m of mindless work
and can wait until that repo is sorted out.

Unmerged revisions

2673. By Nathan Williams

Update DDLGenerator based tests

2672. By Nathan Williams

Remove spurious casts

2671. By Nathan Williams

More variable renaming

2670. By Nathan Williams

Simple parameter renames

2669. By Nathan Williams

Comment cleanup

2668. By Nathan Williams

Rename various classes, more method names.

2667. By Nathan Williams

Rename various getUserTable(s) methods

2666. By Nathan Williams

Move Table methods into UserTable, remove Table, rename UserTable to Table.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/main/java/com/akiban/ais/AISCloner.java'
2--- src/main/java/com/akiban/ais/AISCloner.java 2013-03-22 20:05:57 +0000
3+++ src/main/java/com/akiban/ais/AISCloner.java 2013-05-28 23:28:27 +0000
4@@ -20,7 +20,7 @@
5 import com.akiban.ais.model.AkibanInformationSchema;
6 import com.akiban.ais.model.Schema;
7 import com.akiban.ais.model.TableName;
8-import com.akiban.ais.model.UserTable;
9+import com.akiban.ais.model.Table;
10 import com.akiban.ais.protobuf.AISProtobuf;
11 import com.akiban.ais.protobuf.ProtobufReader;
12 import com.akiban.ais.protobuf.ProtobufWriter;
13@@ -44,8 +44,8 @@
14 // Preserve the memory table factories for any I_S tables
15 Schema schema = destAIS.getSchema(TableName.INFORMATION_SCHEMA);
16 if(schema != null) {
17- for(UserTable newTable : schema.getUserTables().values()) {
18- UserTable oldTable = srcAIS.getUserTable(newTable.getName());
19+ for(Table newTable : schema.getTables().values()) {
20+ Table oldTable = srcAIS.getTable(newTable.getName());
21 if(oldTable != null) {
22 newTable.setMemoryTableFactory(oldTable.getMemoryTableFactory());
23 }
24
25=== modified file 'src/main/java/com/akiban/ais/model/AISBuilder.java'
26--- src/main/java/com/akiban/ais/model/AISBuilder.java 2013-04-28 02:44:03 +0000
27+++ src/main/java/com/akiban/ais/model/AISBuilder.java 2013-05-28 23:28:27 +0000
28@@ -33,7 +33,7 @@
29 import com.akiban.ais.model.Join.SourceType;
30
31 // AISBuilder can be used to create an AIS. The API is designed to sify the creation of an AIS during a scan
32-// of a dump. The user need not search the AIS and hold on to AIS objects (UserTable, Column, etc.). Instead,
33+// of a dump. The user need not search the AIS and hold on to AIS objects (Table, Column, etc.). Instead,
34 // only names from the dump need be supplied.
35
36 public class AISBuilder {
37@@ -83,17 +83,20 @@
38 return identityGenerator;
39 }
40
41- public UserTable userTable(String schemaName, String tableName) {
42- LOG.trace("userTable: " + schemaName + "." + tableName);
43- return UserTable.create(ais, schemaName, tableName, nameGenerator.generateTableID(new TableName(schemaName, tableName)));
44+ public Table table(String schemaName, String tableName) {
45+ LOG.trace("table: " + schemaName + "." + tableName);
46+ return Table.create(ais,
47+ schemaName,
48+ tableName,
49+ nameGenerator.generateTableID(new TableName(schemaName, tableName)));
50 }
51
52- public UserTable userTableInitialAutoIncrement(String schemaName,
53- String tableName, Long initialAutoIncrementValue) {
54- LOG.trace("userTableInitialAutoIncrement: " + schemaName + "."
55+ public Table tableInitialAutoIncrement(String schemaName,
56+ String tableName, Long initialAutoIncrementValue) {
57+ LOG.trace("tableInitialAutoIncrement: " + schemaName + "."
58 + tableName + " = " + initialAutoIncrementValue);
59- UserTable table = ais.getUserTable(schemaName, tableName);
60- checkFound(table, "setting initial autoincrement value", "user table",
61+ Table table = ais.getTable(schemaName, tableName);
62+ checkFound(table, "setting initial autoincrement value", "table",
63 concat(schemaName, tableName));
64 table.setInitialAutoIncrementValue(initialAutoIncrementValue);
65 return table;
66@@ -121,7 +124,7 @@
67 String charset, String collation, String defaultValue, String defaultFunction) {
68 LOG.trace("column: " + schemaName + "." + tableName + "." + columnName);
69 Columnar table = ais.getColumnar(schemaName, tableName);
70- checkFound(table, "creating column", "user table",
71+ checkFound(table, "creating column", "table",
72 concat(schemaName, tableName));
73 Type type = ais.getType(typeName);
74 checkFound(type, "creating column", "type", typeName);
75@@ -232,7 +235,7 @@
76 public void fullTextIndex(TableName tableName, String indexName)
77 {
78 LOG.trace("fullTextIndex: " + tableName + "." + indexName);
79- UserTable table = ais.getUserTable(tableName);
80+ Table table = ais.getTable(tableName);
81 checkFound(table, "creating full text index", "table", tableName);
82 int indexID = nameGenerator.generateIndexID(getRooTableID(table));
83 Index index = FullTextIndex.create(ais, table, indexName, indexID);
84@@ -242,7 +245,7 @@
85 String schemaName, String tableName, String columnName, Integer position)
86 {
87 LOG.trace("fullTextIndexColumn: " + indexedTableName + "." + indexName + ":" + columnName);
88- UserTable indexedTable = ais.getUserTable(indexedTableName);
89+ Table indexedTable = ais.getTable(indexedTableName);
90 checkFound(indexedTable, "creating full text index column", "table", indexedTableName);
91 Index index = indexedTable.getFullTextIndex(indexName);
92 checkFound(index, "creating full text index column", "index", concat(tableName.toString(), indexName));
93@@ -259,10 +262,10 @@
94 LOG.trace("joinTables: " + joinName + ": " + childSchemaName + "."
95 + childTableName + " -> " + parentSchemaName + "."
96 + parentTableName);
97- UserTable child = ais.getUserTable(childSchemaName, childTableName);
98+ Table child = ais.getTable(childSchemaName, childTableName);
99 checkFound(child, "creating join", "child table",
100 concat(childSchemaName, childTableName));
101- UserTable parent = ais.getUserTable(parentSchemaName, parentTableName);
102+ Table parent = ais.getTable(parentSchemaName, parentTableName);
103 if (parent == null) {
104 TableName parentName = new TableName(parentSchemaName,
105 parentTableName);
106@@ -285,16 +288,16 @@
107 + parentSchemaName + "." + parentTableName + "."
108 + parentColumnName);
109 // Get child info
110- UserTable childTable = ais
111- .getUserTable(childSchemaName, childTableName);
112+ Table childTable = ais
113+ .getTable(childSchemaName, childTableName);
114 checkFound(childTable, "creating join column", "child table",
115 concat(childSchemaName, childTableName));
116 Column childColumn = childTable.getColumn(childColumnName);
117 checkFound(childColumn, "creating join column", "child column",
118 concat(childSchemaName, childTableName, childColumnName));
119 // Handle parent - could be a forward reference
120- UserTable parentTable = ais.getUserTable(parentSchemaName,
121- parentTableName);
122+ Table parentTable = ais.getTable(parentSchemaName,
123+ parentTableName);
124 if (parentTable == null) {
125 // forward reference
126 ForwardTableReference forwardTableReference = forwardReferences
127@@ -408,10 +411,10 @@
128 public void basicSchemaIsComplete() {
129 LOG.trace("basicSchemaIsComplete");
130 for (ForwardTableReference forwardTableReference : forwardReferences.values()) {
131- UserTable childTable = forwardTableReference.childTable();
132- UserTable parentTable = ais.getUserTable(forwardTableReference
133- .parentTableName().getSchemaName(), forwardTableReference
134- .parentTableName().getTableName());
135+ Table childTable = forwardTableReference.childTable();
136+ Table parentTable = ais.getTable(forwardTableReference
137+ .parentTableName().getSchemaName(), forwardTableReference
138+ .parentTableName().getTableName());
139
140 if (parentTable != null){
141 Join join = Join.create(ais, forwardTableReference.joinName(),
142@@ -449,8 +452,8 @@
143 Group group = ais.getGroup(groupName);
144 checkFound(group, "deleting group", "group", groupName);
145 boolean groupEmpty = true;
146- for (UserTable userTable : ais.getUserTables().values()) {
147- if (userTable.getGroup() == group) {
148+ for (Table table : ais.getTables().values()) {
149+ if (table.getGroup() == group) {
150 groupEmpty = false;
151 }
152 }
153@@ -474,7 +477,7 @@
154 Group group = ais.getGroup(groupName);
155 checkFound(group, "adding table to group", "group", groupName);
156 // table
157- UserTable table = ais.getUserTable(schemaName, tableName);
158+ Table table = ais.getTable(schemaName, tableName);
159 checkFound(table, "adding table to group", "table",
160 concat(schemaName, tableName));
161 checkGroupAddition(group, table.getGroup(),
162@@ -504,7 +507,7 @@
163 // parent
164 String parentSchemaName = join.getParent().getName().getSchemaName();
165 String parentTableName = join.getParent().getName().getTableName();
166- UserTable parent = ais.getUserTable(parentSchemaName, parentTableName);
167+ Table parent = ais.getTable(parentSchemaName, parentTableName);
168 checkFound(parent, "adding join to group", "parent table",
169 concat(parentSchemaName, parentTableName));
170 checkGroupAddition(group, parent.getGroup(),
171@@ -513,7 +516,7 @@
172 // child
173 String childSchemaName = join.getChild().getName().getSchemaName();
174 String childTableName = join.getChild().getName().getTableName();
175- UserTable child = ais.getUserTable(childSchemaName, childTableName);
176+ Table child = ais.getTable(childSchemaName, childTableName);
177 checkFound(child, "adding join to group", "child table",
178 concat(childSchemaName, childTableName));
179 checkGroupAddition(group, child.getGroup(),
180@@ -539,7 +542,7 @@
181 Group group = ais.getGroup(groupName);
182 checkFound(group, "removing join from group", "group", groupName);
183 // table
184- UserTable table = ais.getUserTable(schemaName, tableName);
185+ Table table = ais.getTable(schemaName, tableName);
186 checkFound(table, "removing join from group", "table table",
187 concat(schemaName, tableName));
188 checkInGroup(group, table, "removing join from group", "table table");
189@@ -569,14 +572,14 @@
190 // parent
191 String parentSchemaName = join.getParent().getName().getSchemaName();
192 String parentTableName = join.getParent().getName().getTableName();
193- UserTable parent = ais.getUserTable(parentSchemaName, parentTableName);
194+ Table parent = ais.getTable(parentSchemaName, parentTableName);
195 checkFound(parent, "removing join from group", "parent table",
196 concat(parentSchemaName, parentTableName));
197 checkInGroup(group, parent, "removing join from group", "parent table");
198 // child
199 String childSchemaName = join.getChild().getName().getSchemaName();
200 String childTableName = join.getChild().getName().getTableName();
201- UserTable child = ais.getUserTable(childSchemaName, childTableName);
202+ Table child = ais.getTable(childSchemaName, childTableName);
203 checkFound(child, "removing join from group", "child table",
204 concat(childSchemaName, childTableName));
205 checkInGroup(group, child, "removing join from group", "child table");
206@@ -605,7 +608,7 @@
207 LOG.trace("moveTree: " + schemaName + "." + tableName + " -> "
208 + groupName + " via join " + joinName);
209 // table
210- UserTable table = ais.getUserTable(schemaName, tableName);
211+ Table table = ais.getTable(schemaName, tableName);
212 checkFound(table, "moving tree", "table", concat(schemaName, tableName));
213
214 // group
215@@ -651,7 +654,7 @@
216 LOG.trace("moveTree: " + schemaName + "." + tableName
217 + " -> empty group " + groupName);
218 // table
219- UserTable table = ais.getUserTable(schemaName, tableName);
220+ Table table = ais.getTable(schemaName, tableName);
221 checkFound(table, "moving tree", "table", concat(schemaName, tableName));
222
223 // group
224@@ -685,10 +688,10 @@
225 setRootIfNeeded(group);
226 }
227 // Create hidden PKs if needed. Needs group hooked up before it can be called (to generate index id).
228- for (UserTable userTable : ais.getUserTables().values()) {
229- userTable.endTable(nameGenerator);
230+ for (Table table : ais.getTables().values()) {
231+ table.endTable(nameGenerator);
232 // endTable may have created new index, set its tree name if so
233- Index index = userTable.getPrimaryKeyIncludingInternal().getIndex();
234+ Index index = table.getPrimaryKeyIncludingInternal().getIndex();
235 if (index.getTreeName() == null) {
236 index.setTreeName(nameGenerator.generateIndexTreeName(index));
237 }
238@@ -698,7 +701,7 @@
239 public void clearGroupings() {
240 LOG.trace("clear groupings");
241 ais.getGroups().clear();
242- for (UserTable table : ais.getUserTables().values()) {
243+ for (Table table : ais.getTables().values()) {
244 setTablesGroup(table, null);
245 }
246 for (Join join : ais.getJoins().values()) {
247@@ -713,9 +716,9 @@
248 return ais;
249 }
250
251- private UserTable findRoot(Group group) {
252- UserTable root = null;
253- for(UserTable table : ais.getUserTables().values()) {
254+ private Table findRoot(Group group) {
255+ Table root = null;
256+ for(Table table : ais.getTables().values()) {
257 if((table.getGroup() == group) && table.isRoot()) {
258 if(root != null) {
259 return null; // Multiple roots
260@@ -768,7 +771,7 @@
261 }
262 }
263
264- private void checkCycle(UserTable table, Group group) {
265+ private void checkCycle(Table table, Group group) {
266 if (table.getGroup() == group) {
267 String exception = table + " is already in " + group
268 + ". Group must be acyclic";
269@@ -869,7 +872,7 @@
270
271 private class ForwardTableReference {
272 public ForwardTableReference(String joinName,
273- TableName parentTableName, UserTable childTable) {
274+ TableName parentTableName, Table childTable) {
275 this.joinName = joinName;
276 this.parentTableName = parentTableName;
277 this.childTable = childTable;
278@@ -883,7 +886,7 @@
279 return parentTableName;
280 }
281
282- public UserTable childTable() {
283+ public Table childTable() {
284 return childTable;
285 }
286
287@@ -898,7 +901,7 @@
288 }
289
290 private final String joinName;
291- private final UserTable childTable;
292+ private final Table childTable;
293 private final TableName parentTableName;
294 private final List<ForwardColumnReference> forwardColumnReferences = new ArrayList<>();
295 }
296@@ -946,7 +949,7 @@
297 super(
298 "Group "
299 + group.getName()
300- + " cannot be deleted because it contains at least one user table.");
301+ + " cannot be deleted because it contains at least one table.");
302 }
303 }
304
305
306=== modified file 'src/main/java/com/akiban/ais/model/AISMerge.java'
307--- src/main/java/com/akiban/ais/model/AISMerge.java 2013-05-28 21:18:45 +0000
308+++ src/main/java/com/akiban/ais/model/AISMerge.java 2013-05-28 23:28:27 +0000
309@@ -46,8 +46,8 @@
310 import java.util.Set;
311
312 /**
313- * AISMerge is designed to merge a single UserTable definition into an existing AIS. The merge process
314- * does not assume that UserTable.getAIS() returns a validated and complete
315+ * AISMerge is designed to merge a single Table definition into an existing AIS. The merge process
316+ * does not assume that Table.getAIS() returns a validated and complete
317 * AkibanInformationSchema object.
318 *
319 * AISMerge makes a copy of the primaryAIS (from the constructor) before performing the merge process.
320@@ -104,7 +104,7 @@
321
322 /* state */
323 private final AkibanInformationSchema targetAIS;
324- private final UserTable sourceTable;
325+ private final Table sourceTable;
326 private final NameGenerator nameGenerator;
327 private final MergeType mergeType;
328 private final List<JoinChange> changedJoins;
329@@ -113,12 +113,12 @@
330
331
332 /** Legacy test constructor. Creates an AISMerge for adding a table with a new {@link DefaultNameGenerator}. */
333- AISMerge(AkibanInformationSchema sourceAIS, UserTable newTable) {
334+ AISMerge(AkibanInformationSchema sourceAIS, Table newTable) {
335 this(new DefaultNameGenerator(sourceAIS), copyAISForAdd(sourceAIS), newTable, MergeType.ADD_TABLE, null, null, null);
336 }
337
338 /** Create a new AISMerge to be used for adding a new table. */
339- public static AISMerge newForAddTable(NameGenerator generator, AkibanInformationSchema sourceAIS, UserTable newTable) {
340+ public static AISMerge newForAddTable(NameGenerator generator, AkibanInformationSchema sourceAIS, Table newTable) {
341 return new AISMerge(generator, copyAISForAdd(sourceAIS), newTable, MergeType.ADD_TABLE, null, null, null);
342 }
343
344@@ -141,7 +141,7 @@
345 return new AISMerge(generator, copyAISForAdd(sourceAIS), null, MergeType.OTHER, null, null, null);
346 }
347
348- private AISMerge(NameGenerator nameGenerator, AkibanInformationSchema targetAIS, UserTable sourceTable,
349+ private AISMerge(NameGenerator nameGenerator, AkibanInformationSchema targetAIS, Table sourceTable,
350 MergeType mergeType, List<JoinChange> changedJoins, Map<IndexName,IndexInfo> indexesToFix,
351 List<IdentityInfo> identityToFix) {
352 this.nameGenerator = nameGenerator;
353@@ -166,11 +166,11 @@
354 {
355 final Set<Sequence> excludedSequences = new HashSet<>();
356 final Set<Group> excludedGroups = new HashSet<>();
357- final Map<TableName,UserTable> filteredTables = new HashMap<>();
358+ final Map<TableName,Table> filteredTables = new HashMap<>();
359 for(ChangedTableDescription desc : changedTables) {
360 // Copy tree names and IDs for pre-existing table and it's indexes
361- UserTable oldTable = oldAIS.getUserTable(desc.getOldName());
362- UserTable newTable = desc.getNewDefinition();
363+ Table oldTable = oldAIS.getTable(desc.getOldName());
364+ Table newTable = desc.getNewDefinition();
365
366 // These don't affect final outcome and may be reset later. Needed by clone process.
367 if((newTable != null) && (newTable.getGroup() != null)) {
368@@ -211,7 +211,7 @@
369 throw new IllegalStateException("Unhandled GroupChange: " + desc.getParentChange());
370 }
371
372- UserTable indexSearchTable = newTable;
373+ Table indexSearchTable = newTable;
374 if(newTable == null) {
375 indexSearchTable = oldTable;
376 } else {
377@@ -287,7 +287,7 @@
378 * Returns the final, updated AkibanInformationSchema. This AIS has been fully
379 * validated and is frozen (no more changes), hence ready for update into the
380 * server.
381- * @return - the primaryAIS, after merge() with the UserTable added.
382+ * @return - the primaryAIS, after merge() with the Table added.
383 */
384 public AkibanInformationSchema getAIS () {
385 return targetAIS;
386@@ -323,7 +323,7 @@
387 case TABLE:
388 {
389 final TableName tableName = new TableName(indexName.getSchemaName(), indexName.getTableName());
390- final UserTable newTable = targetAIS.getUserTable(tableName);
391+ final Table newTable = targetAIS.getTable(tableName);
392 if(newTable == null) {
393 throw new NoSuchTableException(tableName);
394 }
395@@ -350,7 +350,7 @@
396 case FULL_TEXT:
397 {
398 final TableName tableName = new TableName(indexName.getSchemaName(), indexName.getTableName());
399- final UserTable newTable = targetAIS.getUserTable(tableName);
400+ final Table newTable = targetAIS.getTable(tableName);
401 if(newTable == null) {
402 throw new NoSuchTableException(tableName);
403 }
404@@ -377,7 +377,7 @@
405
406 for(IndexColumn indexCol : index.getKeyColumns()) {
407 final TableName refTableName = indexCol.getColumn().getTable().getName();
408- final UserTable newRefTable = targetAIS.getUserTable(refTableName);
409+ final Table newRefTable = targetAIS.getTable(refTableName);
410 if(newRefTable == null) {
411 throw new NoSuchTableException(refTableName);
412 }
413@@ -406,7 +406,7 @@
414
415 private void doAddTableMerge() {
416 // I should use TableSubsetWriter(new AISTarget(targetAIS))
417- // but that assumes the UserTable.getAIS() is complete and valid.
418+ // but that assumes the Table.getAIS() is complete and valid.
419 // i.e. has a group and group table, joins are accurate, etc.
420 // this may not be true
421 // Also the tableIDs need to be assigned correctly, which
422@@ -419,14 +419,14 @@
423 if (sourceTable.getParentJoin() != null) {
424 String parentSchemaName = sourceTable.getParentJoin().getParent().getName().getSchemaName();
425 String parentTableName = sourceTable.getParentJoin().getParent().getName().getTableName();
426- UserTable parentTable = targetAIS.getUserTable(parentSchemaName, parentTableName);
427+ Table parentTable = targetAIS.getTable(parentSchemaName, parentTableName);
428 if (parentTable == null) {
429 throw new JoinToUnknownTableException (sourceTable.getName(), new TableName(parentSchemaName, parentTableName));
430 }
431 targetGroup = parentTable.getGroup();
432 }
433
434- // Add the user table to the targetAIS
435+ // Add the table to the targetAIS
436 addTable (builder, sourceTable, targetGroup);
437
438 // Joins or group table?
439@@ -446,7 +446,7 @@
440 TableIndex index = sourceTable.getPrimaryKey().getIndex();
441 final int rootTableID = (targetGroup != null) ?
442 targetGroup.getRoot().getTableId() :
443- builder.akibanInformationSchema().getUserTable(sourceTable.getName()).getTableId();
444+ builder.akibanInformationSchema().getTable(sourceTable.getName()).getTableId();
445 IndexName indexName = index.getIndexName();
446 builder.index(sourceTable.getName().getSchemaName(),
447 sourceTable.getName().getTableName(),
448@@ -487,7 +487,7 @@
449
450 // Fix up groups
451 for(JoinChange tnj : changedJoins) {
452- final UserTable table = targetAIS.getUserTable(tnj.newChildName);
453+ final Table table = targetAIS.getTable(tnj.newChildName);
454 if(tnj.isNewGroup) {
455 addNewGroup(builder, table);
456 } else if(tnj.newParentName != null) {
457@@ -501,7 +501,7 @@
458 for(Map.Entry<IndexName,IndexInfo> entry : indexesToFix.entrySet()) {
459 IndexName name = entry.getKey();
460 IndexInfo info = entry.getValue();
461- UserTable table = targetAIS.getUserTable(name.getSchemaName(), name.getTableName());
462+ Table table = targetAIS.getTable(name.getSchemaName(), name.getTableName());
463 Index index = table.getIndexIncludingInternal(name.getName());
464 index.setIndexId((info.id != null) ? info.id : newIndexID(table.getGroup()));
465 index.setTreeName((info.tree != null) ? info.tree : nameGenerator.generateIndexTreeName(index));
466@@ -523,10 +523,10 @@
467 builder.akibanInformationSchema().freeze();
468 }
469
470- private void addTable(AISBuilder builder, final UserTable table, final Group targetGroup) {
471+ private void addTable(AISBuilder builder, final Table table, final Group targetGroup) {
472
473 // I should use TableSubsetWriter(new AISTarget(targetAIS)) or AISCloner.clone()
474- // but both assume the UserTable.getAIS() is complete and valid.
475+ // but both assume the Table.getAIS() is complete and valid.
476 // i.e. has a group and group table, and the joins point to a valid table
477 // which, given the use of AISMerge, is not true.
478
479@@ -535,9 +535,8 @@
480 final String tableName = table.getName().getTableName();
481
482
483- builder.userTable(schemaName, tableName);
484- UserTable targetTable = targetAIS.getUserTable(schemaName, tableName);
485- targetTable.setEngine(table.getEngine());
486+ builder.table(schemaName, tableName);
487+ Table targetTable = targetAIS.getTable(schemaName, tableName);
488 targetTable.setCharsetAndCollation(table.getCharsetAndCollation());
489 targetTable.setPendingOSC(table.getPendingOSC());
490 targetTable.setUuid(table.getUuid());
491@@ -582,7 +581,7 @@
492 LOG.debug("Generated sequence: {}, with tree name; {}", sequenceName, newSeq.getTreeName());
493 }
494
495- private void addNewGroup (AISBuilder builder, UserTable rootTable) {
496+ private void addNewGroup (AISBuilder builder, Table rootTable) {
497 TableName groupName = rootTable.getName();
498 builder.createGroup(groupName.getTableName(), groupName.getSchemaName());
499 builder.addTableToGroup(groupName,
500@@ -590,7 +589,7 @@
501 rootTable.getName().getTableName());
502 }
503
504- private void addJoin (AISBuilder builder, Join join, UserTable childTable) {
505+ private void addJoin (AISBuilder builder, Join join, Table childTable) {
506 Map<String,String> emptyMap = Collections.emptyMap();
507 addJoin(builder, join.getParent().getName(), emptyMap, join, emptyMap, childTable);
508 }
509@@ -601,10 +600,10 @@
510 }
511
512 private void addJoin (AISBuilder builder, TableName parentName, Map<String,String> parentCols,
513- Join join, Map<String,String> childCols, UserTable childTable) {
514+ Join join, Map<String,String> childCols, Table childTable) {
515 String parentSchemaName = parentName.getSchemaName();
516 String parentTableName = parentName.getTableName();
517- UserTable parentTable = targetAIS.getUserTable(parentSchemaName, parentTableName);
518+ Table parentTable = targetAIS.getTable(parentSchemaName, parentTableName);
519 if (parentTable == null) {
520 throw new JoinToUnknownTableException(childTable.getName(), new TableName(parentSchemaName, parentTableName));
521 }
522
523=== modified file 'src/main/java/com/akiban/ais/model/AISSchemaChanger.java'
524--- src/main/java/com/akiban/ais/model/AISSchemaChanger.java 2013-03-22 20:05:57 +0000
525+++ src/main/java/com/akiban/ais/model/AISSchemaChanger.java 2013-05-28 23:28:27 +0000
526@@ -92,8 +92,8 @@
527 }
528
529 @Override
530- public void visitUserTable(UserTable userTable)
531+ public void visitTable(Table table)
532 {
533- updateTableName( userTable );
534+ updateTableName(table);
535 }
536 }
537
538=== modified file 'src/main/java/com/akiban/ais/model/AISTableNameChanger.java'
539--- src/main/java/com/akiban/ais/model/AISTableNameChanger.java 2013-03-22 20:05:57 +0000
540+++ src/main/java/com/akiban/ais/model/AISTableNameChanger.java 2013-05-28 23:28:27 +0000
541@@ -20,18 +20,18 @@
542 import java.util.ArrayList;
543
544 public class AISTableNameChanger {
545- public AISTableNameChanger(UserTable table)
546+ public AISTableNameChanger(Table table)
547 {
548 this.table = table;
549 this.newSchemaName = table.getName().getSchemaName();
550 this.newTableName = table.getName().getTableName();
551 }
552
553- public AISTableNameChanger(UserTable table, TableName newName) {
554+ public AISTableNameChanger(Table table, TableName newName) {
555 this(table, newName.getSchemaName(), newName.getTableName());
556 }
557
558- public AISTableNameChanger(UserTable table, String newSchemaName, String newTableName) {
559+ public AISTableNameChanger(Table table, String newSchemaName, String newTableName) {
560 this.table = table;
561 this.newSchemaName = newSchemaName;
562 this.newTableName = newTableName;
563@@ -71,11 +71,11 @@
564 }
565 // Rename the table and put back in AIS
566 table.setTableName(newName);
567- ais.addUserTable(table);
568+ ais.addTable(table);
569 }
570
571
572- UserTable table;
573+ Table table;
574 String newSchemaName;
575 String newTableName;
576 }
577
578=== modified file 'src/main/java/com/akiban/ais/model/AkibanInformationSchema.java'
579--- src/main/java/com/akiban/ais/model/AkibanInformationSchema.java 2013-04-12 22:11:57 +0000
580+++ src/main/java/com/akiban/ais/model/AkibanInformationSchema.java 2013-05-28 23:28:27 +0000
581@@ -102,39 +102,29 @@
582 return groups;
583 }
584
585- public Map<TableName, UserTable> getUserTables()
586+ public Map<TableName,Table> getTables()
587 {
588- return userTables;
589+ return tables;
590 }
591
592 public void removeGroup(Group group) {
593 groups.remove(group.getName());
594 }
595
596- public Table getTable(String schemaName, String tableName)
597- {
598- return getUserTable(schemaName, tableName);
599- }
600-
601- public Table getTable(TableName tableName)
602- {
603- return getUserTable(tableName);
604- }
605-
606- public UserTable getUserTable(final String schemaName, final String tableName)
607- {
608- return getUserTable(new TableName(schemaName, tableName));
609- }
610-
611- public UserTable getUserTable(final TableName tableName)
612- {
613- return userTables.get(tableName);
614- }
615-
616- public synchronized UserTable getUserTable(int tableId)
617+ public Table getTable(final String schemaName, final String tableName)
618+ {
619+ return getTable(new TableName(schemaName, tableName));
620+ }
621+
622+ public Table getTable(final TableName tableName)
623+ {
624+ return tables.get(tableName);
625+ }
626+
627+ public synchronized Table getTable(int tableId)
628 {
629 ensureTableIdLookup();
630- return userTablesById.get(tableId);
631+ return tablesById.get(tableId);
632 }
633
634 public Map<TableName, View> getViews()
635@@ -272,9 +262,9 @@
636 for (Type type : types.values()) {
637 visitor.visitType(type);
638 }
639- for (UserTable userTable : userTables.values()) {
640- visitor.visitUserTable(userTable);
641- userTable.traversePreOrder(visitor);
642+ for (Table table : tables.values()) {
643+ visitor.visitTable(table);
644+ table.traversePreOrder(visitor);
645 }
646 for (Join join : joins.values()) {
647 visitor.visitJoin(join);
648@@ -292,9 +282,9 @@
649 for (Type type : types.values()) {
650 visitor.visitType(type);
651 }
652- for (UserTable userTable : userTables.values()) {
653- userTable.traversePostOrder(visitor);
654- visitor.visitUserTable(userTable);
655+ for (Table table : tables.values()) {
656+ table.traversePostOrder(visitor);
657+ visitor.visitTable(table);
658 }
659 for (Join join : joins.values()) {
660 join.traversePreOrder(visitor);
661@@ -313,10 +303,10 @@
662 groups.put(group.getName(), group);
663 }
664
665- public void addUserTable(UserTable table)
666+ public void addTable(Table table)
667 {
668 TableName tableName = table.getName();
669- userTables.put(tableName, table);
670+ tables.put(tableName, table);
671
672 // TODO: Create on demand until Schema is more of a first class citizen
673 Schema schema = getSchema(tableName.getSchemaName());
674@@ -324,7 +314,7 @@
675 schema = new Schema(tableName.getSchemaName());
676 addSchema(schema);
677 }
678- schema.addUserTable(table);
679+ schema.addTable(table);
680 }
681
682 public void addView(View view)
683@@ -452,11 +442,9 @@
684 * @deprecated - use {@link #validate(Collection)}
685 * @param out
686 * @param tables
687- * @param isUserTable
688 * @param seenTables
689 */
690- private void checkTables(List<String> out, Map<TableName, ? extends Table> tables,
691- boolean isUserTable, Set<TableName> seenTables)
692+ private void checkTables(List<String> out, Map<TableName, ? extends Table> tables, Set<TableName> seenTables)
693 {
694 for (Map.Entry<TableName, ? extends Table> entry : tables.entrySet())
695 {
696@@ -471,12 +459,6 @@
697 else if (!tableName.equals(table.getName())) {
698 out.add("name mismatch, expected <" + tableName + "> for table " + table);
699 }
700- else if(table.isGroupTable() == isUserTable) {
701- out.add("wrong value for isGroupTable(): " + tableName);
702- }
703- else if (table.isUserTable() != isUserTable) {
704- out.add("wrong value for isUserTable(): " + tableName);
705- }
706 else if (!seenTables.add(tableName)) {
707 out.add("duplicate table name: " + tableName);
708 }
709@@ -509,13 +491,13 @@
710 }
711 else if(join.checkIntegrity(out))
712 {
713- UserTable child = join.getChild();
714- UserTable parent = join.getParent();
715- if (!userTables.containsKey(child.getName())) {
716- out.add("child not in user tables list: " + child.getName());
717+ Table child = join.getChild();
718+ Table parent = join.getParent();
719+ if (!tables.containsKey(child.getName())) {
720+ out.add("child not in tables list: " + child.getName());
721 }
722- else if (!userTables.containsKey(parent.getName())) {
723- out.add("parent not in user tables list: " + child.getName());
724+ else if (!tables.containsKey(parent.getName())) {
725+ out.add("parent not in tables list: " + child.getName());
726 }
727 else if (join.getAIS() != this) {
728 out.add("AIS self-reference failure");
729@@ -578,8 +560,8 @@
730 public void checkIntegrity(List<String> out) throws IllegalStateException
731 {
732 checkGroups(out);
733- Set<TableName> seenTables = new HashSet<>(userTables.size(), 1.0f);
734- checkTables(out, userTables, true, seenTables);
735+ Set<TableName> seenTables = new HashSet<>(tables.size(), 1.0f);
736+ checkTables(out, tables, seenTables);
737 checkJoins(out);
738 checkTypesNames(out);
739 }
740@@ -620,21 +602,21 @@
741
742 synchronized void invalidateTableIdMap()
743 {
744- userTablesById = null;
745+ tablesById = null;
746 }
747
748 private void ensureTableIdLookup()
749 {
750- if (userTablesById == null) {
751- userTablesById = new HashMap<>();
752- for (UserTable userTable : userTables.values()) {
753- userTablesById.put(userTable.getTableId(), userTable);
754+ if (tablesById == null) {
755+ tablesById = new HashMap<>();
756+ for (Table table : tables.values()) {
757+ tablesById.put(table.getTableId(), table);
758 }
759 }
760 }
761
762 void removeTable(TableName name) {
763- userTables.remove(name);
764+ tables.remove(name);
765 Schema schema = getSchema(name.getSchemaName());
766 if (schema != null) {
767 schema.removeTable(name.getTableName());
768@@ -710,7 +692,7 @@
769 private static String defaultCollation = "utf8_bin";
770
771 private final Map<TableName, Group> groups = new TreeMap<>();
772- private final Map<TableName, UserTable> userTables = new TreeMap<>();
773+ private final Map<TableName,Table> tables = new TreeMap<>();
774 private final Map<TableName, Sequence> sequences = new TreeMap<>();
775 private final Map<TableName, View> views = new TreeMap<>();
776 private final Map<TableName, Routine> routines = new TreeMap<>();
777@@ -722,7 +704,7 @@
778 private final ConcurrentMap cachedValues = new ConcurrentHashMap(4,0.75f,4); // Very few, write-once entries expected
779 private long generation = -1;
780
781- private Map<Integer, UserTable> userTablesById = null;
782+ private Map<Integer,Table> tablesById = null;
783 private boolean isFrozen = false;
784
785 private static class AISFailureList extends AISValidationResults implements AISValidationOutput {
786
787=== modified file 'src/main/java/com/akiban/ais/model/Column.java'
788--- src/main/java/com/akiban/ais/model/Column.java 2013-04-28 02:44:03 +0000
789+++ src/main/java/com/akiban/ais/model/Column.java 2013-05-28 23:28:27 +0000
790@@ -257,12 +257,7 @@
791
792 public Table getTable()
793 {
794- return (Table) table;
795- }
796-
797- public UserTable getUserTable()
798- {
799- return (UserTable) getTable();
800+ return (Table)table;
801 }
802
803 /**
804
805=== modified file 'src/main/java/com/akiban/ais/model/DefaultIndexNameGenerator.java'
806--- src/main/java/com/akiban/ais/model/DefaultIndexNameGenerator.java 2013-03-22 20:05:57 +0000
807+++ src/main/java/com/akiban/ais/model/DefaultIndexNameGenerator.java 2013-05-28 23:28:27 +0000
808@@ -18,7 +18,6 @@
809 package com.akiban.ais.model;
810
811 import java.util.Collection;
812-import java.util.Collections;
813 import java.util.HashSet;
814 import java.util.Set;
815
816@@ -29,7 +28,7 @@
817 indexNames.addAll(initialIndexNames);
818 }
819
820- public static DefaultIndexNameGenerator forTable(UserTable table) {
821+ public static DefaultIndexNameGenerator forTable(Table table) {
822 Set<String> indexNames = new HashSet<>();
823 for(Index index : table.getIndexesIncludingInternal()) {
824 indexNames.add(index.getIndexName().getName());
825
826=== modified file 'src/main/java/com/akiban/ais/model/DefaultNameGenerator.java'
827--- src/main/java/com/akiban/ais/model/DefaultNameGenerator.java 2013-04-15 19:20:36 +0000
828+++ src/main/java/com/akiban/ais/model/DefaultNameGenerator.java 2013-05-28 23:28:27 +0000
829@@ -44,14 +44,14 @@
830 private final Set<String> treeNames;
831 private final Set<TableName> sequenceNames;
832 private final SortedSet<Integer> isTableIDSet;
833- private final SortedSet<Integer> userTableIDSet;
834+ private final SortedSet<Integer> tableIDSet;
835 private final Map<Integer,Integer> indexIDMap;
836
837
838 public DefaultNameGenerator() {
839 treeNames = new HashSet<>();
840 sequenceNames = new HashSet<>();
841- userTableIDSet = new TreeSet<>();
842+ tableIDSet = new TreeSet<>();
843 isTableIDSet = new TreeSet<>();
844 indexIDMap = new HashMap<>();
845 }
846@@ -60,7 +60,7 @@
847 treeNames = collectTreeNames(ais);
848 sequenceNames = new HashSet<>(ais.getSequences().keySet());
849 isTableIDSet = collectTableIDs(ais, true);
850- userTableIDSet = collectTableIDs(ais, false);
851+ tableIDSet = collectTableIDs(ais, false);
852 indexIDMap = collectMaxIndexIDs(ais);
853 }
854
855@@ -137,7 +137,7 @@
856 tableName = ((TableIndex)index).getTable().getName();
857 break;
858 case GROUP:
859- UserTable root = ((GroupIndex)index).getGroup().getRoot();
860+ Table root = ((GroupIndex)index).getGroup().getRoot();
861 if(root == null) {
862 throw new IllegalArgumentException("Grouping incomplete (no root)");
863 }
864@@ -174,7 +174,7 @@
865 @Override
866 public void removeTableID(int tableID) {
867 isTableIDSet.remove(tableID);
868- userTableIDSet.remove(tableID);
869+ tableIDSet.remove(tableID);
870 }
871
872 @Override
873@@ -199,15 +199,15 @@
874 if(isISTable) {
875 nextID = isTableIDSet.isEmpty() ? IS_TABLE_ID_OFFSET : isTableIDSet.last() + 1;
876 } else {
877- nextID = userTableIDSet.isEmpty() ? USER_TABLE_ID_OFFSET : userTableIDSet.last() + 1;
878+ nextID = tableIDSet.isEmpty() ? USER_TABLE_ID_OFFSET : tableIDSet.last() + 1;
879 }
880- while(isTableIDSet.contains(nextID) || userTableIDSet.contains(nextID)) {
881+ while(isTableIDSet.contains(nextID) || tableIDSet.contains(nextID)) {
882 nextID += 1;
883 }
884 if(isISTable) {
885 isTableIDSet.add(nextID);
886 } else {
887- userTableIDSet.add(nextID);
888+ tableIDSet.add(nextID);
889 }
890 return nextID;
891 }
892@@ -218,7 +218,7 @@
893 if(TableName.INFORMATION_SCHEMA.equals(schema.getName()) != onlyISTables) {
894 continue;
895 }
896- for(UserTable table : schema.getUserTables().values()) {
897+ for(Table table : schema.getTables().values()) {
898 idSet.add(table.getTableId());
899 }
900 }
901@@ -243,7 +243,7 @@
902 treeNames.add(index.getTreeName());
903 }
904 }
905- for(UserTable table : ais.getUserTables().values()) {
906+ for(Table table : ais.getTables().values()) {
907 for(Index index : table.getIndexesIncludingInternal()) {
908 treeNames.add(index.getTreeName());
909 }
910@@ -313,7 +313,7 @@
911 }
912
913 @Override
914- public void visitUserTable(UserTable table) {
915+ public void visitTable(Table table) {
916 checkIndexes(table.getIndexesIncludingInternal());
917 }
918
919
920=== modified file 'src/main/java/com/akiban/ais/model/FullTextIndex.java'
921--- src/main/java/com/akiban/ais/model/FullTextIndex.java 2013-03-28 02:28:43 +0000
922+++ src/main/java/com/akiban/ais/model/FullTextIndex.java 2013-05-28 23:28:27 +0000
923@@ -61,11 +61,11 @@
924 public Table leafMostTable() {
925 // This is not entirely well-defined, since more than one
926 // descendant to the same depth can be indexed.
927- UserTable deepest = null;
928+ Table deepest = null;
929 for (IndexColumn indexColumn : keyColumns) {
930 if ((deepest == null) ||
931- (indexColumn.getColumn().getUserTable().getDepth() > deepest.getDepth())) {
932- deepest = indexColumn.getColumn().getUserTable();
933+ (indexColumn.getColumn().getTable().getDepth() > deepest.getDepth())) {
934+ deepest = indexColumn.getColumn().getTable();
935 }
936 }
937 return deepest;
938@@ -73,11 +73,11 @@
939
940 @Override
941 public Table rootMostTable() {
942- UserTable shallowest = null;
943+ Table shallowest = null;
944 for (IndexColumn indexColumn : keyColumns) {
945 if ((shallowest == null) ||
946- (indexColumn.getColumn().getUserTable().getDepth() < shallowest.getDepth())) {
947- shallowest = indexColumn.getColumn().getUserTable();
948+ (indexColumn.getColumn().getTable().getDepth() < shallowest.getDepth())) {
949+ shallowest = indexColumn.getColumn().getTable();
950 }
951 }
952 return shallowest;
953@@ -99,7 +99,7 @@
954
955 @Override
956 public void addColumn(IndexColumn indexColumn) {
957- UserTable table = indexColumn.getColumn().getUserTable();
958+ Table table = indexColumn.getColumn().getTable();
959 if (!((table == indexedTable) ||
960 table.isDescendantOf(indexedTable) ||
961 indexedTable.isDescendantOf(table))) {
962@@ -119,12 +119,12 @@
963
964 /* FullTextIndex */
965
966- public UserTable getIndexedTable() {
967+ public Table getIndexedTable() {
968 return indexedTable;
969 }
970
971 public static FullTextIndex create(AkibanInformationSchema ais,
972- UserTable table, String indexName,
973+ Table table, String indexName,
974 Integer indexId)
975 {
976 ais.checkMutability();
977@@ -137,11 +137,11 @@
978
979 public static final String FULL_TEXT_CONSTRAINT = "FULL_TEXT";
980
981- public FullTextIndex(UserTable indexedTable, String indexName, Integer indexId)
982+ public FullTextIndex(Table indexedTable, String indexName, Integer indexId)
983 {
984 super(indexedTable.getName(), indexName, indexId, false, FULL_TEXT_CONSTRAINT);
985 this.indexedTable = indexedTable;
986 }
987
988- private final UserTable indexedTable;
989+ private final Table indexedTable;
990 }
991
992=== modified file 'src/main/java/com/akiban/ais/model/Group.java'
993--- src/main/java/com/akiban/ais/model/Group.java 2013-03-22 20:05:57 +0000
994+++ src/main/java/com/akiban/ais/model/Group.java 2013-05-28 23:28:27 +0000
995@@ -64,12 +64,12 @@
996 return name.toString();
997 }
998
999- public void setRootTable(UserTable rootTable)
1000+ public void setRootTable(Table rootTable)
1001 {
1002 this.rootTable = rootTable;
1003 }
1004
1005- public UserTable getRoot()
1006+ public Table getRoot()
1007 {
1008 return rootTable;
1009 }
1010@@ -182,5 +182,5 @@
1011 private final Map<String, GroupIndex> indexMap;
1012 private final AtomicReference<TreeCache> treeCache = new AtomicReference<>();
1013 private String treeName;
1014- private UserTable rootTable;
1015+ private Table rootTable;
1016 }
1017
1018=== modified file 'src/main/java/com/akiban/ais/model/GroupIndex.java'
1019--- src/main/java/com/akiban/ais/model/GroupIndex.java 2013-03-22 20:05:57 +0000
1020+++ src/main/java/com/akiban/ais/model/GroupIndex.java 2013-05-28 23:28:27 +0000
1021@@ -28,14 +28,14 @@
1022 // Index interface
1023
1024 @Override
1025- public UserTable leafMostTable()
1026+ public Table leafMostTable()
1027 {
1028 assert !tablesByDepth.isEmpty() : "no tables participate in this group index";
1029 return tablesByDepth.lastEntry().getValue().table;
1030 }
1031
1032 @Override
1033- public UserTable rootMostTable()
1034+ public Table rootMostTable()
1035 {
1036 assert !tablesByDepth.isEmpty() : "no tables participate in this group index";
1037 return tablesByDepth.firstEntry().getValue().table;
1038@@ -51,8 +51,8 @@
1039 public Collection<Integer> getAllTableIDs()
1040 {
1041 List<Integer> branchIDs = new ArrayList<>(tablesByDepth.size());
1042- for (UserTable userTable = leafMostTable(); userTable != null; userTable = userTable.parentTable()) {
1043- branchIDs.add(userTable.getTableId());
1044+ for (Table table = leafMostTable(); table != null; table = table.parentTable()) {
1045+ branchIDs.add(table.getTableId());
1046 }
1047 return branchIDs;
1048 }
1049@@ -61,11 +61,11 @@
1050 public void addColumn(IndexColumn indexColumn)
1051 {
1052 Table indexGenericTable = indexColumn.getColumn().getTable();
1053- if (!(indexGenericTable instanceof UserTable)) {
1054+ if (!(indexGenericTable instanceof Table)) {
1055 throw new IndexColNotInGroupException(indexColumn.getIndex().getIndexName().getName(),
1056 indexColumn.getColumn().getName());
1057 }
1058- UserTable indexTable = (UserTable) indexGenericTable;
1059+ Table indexTable = indexGenericTable;
1060 Integer indexTableDepth = indexTable.getDepth();
1061 assert indexTableDepth != null;
1062
1063@@ -99,19 +99,19 @@
1064 @Override
1065 public void computeFieldAssociations(Map<Table, Integer> ordinalMap)
1066 {
1067- List<UserTable> branchTables = new ArrayList<>();
1068- for (UserTable userTable = leafMostTable(); userTable != null; userTable = userTable.parentTable()) {
1069- branchTables.add(userTable);
1070+ List<Table> branchTables = new ArrayList<>();
1071+ for (Table table = leafMostTable(); table != null; table = table.parentTable()) {
1072+ branchTables.add(table);
1073 }
1074 Collections.reverse(branchTables);
1075
1076- Map<UserTable, Integer> offsetsMap = new HashMap<>();
1077+ Map<Table, Integer> offsetsMap = new HashMap<>();
1078 int offset = 0;
1079 columnsPerFlattenedField = new ArrayList<>();
1080- for (UserTable userTable : branchTables) {
1081- offsetsMap.put(userTable, offset);
1082- offset += userTable.getColumnsIncludingInternal().size();
1083- columnsPerFlattenedField.addAll(userTable.getColumnsIncludingInternal());
1084+ for (Table table : branchTables) {
1085+ offsetsMap.put(table, offset);
1086+ offset += table.getColumnsIncludingInternal().size();
1087+ columnsPerFlattenedField.addAll(table.getColumnsIncludingInternal());
1088 }
1089 computeFieldAssociations(ordinalMap, offsetsMap);
1090 // Complete computation of inIndex bitsets
1091@@ -131,7 +131,7 @@
1092 // A row of the given table is being changed in the columns described by modifiedColumnPositions.
1093 // Return true iff there are any columns in common with those columns of the table contributing to the
1094 // index. A result of false means that the row change need not result in group index maintenance.
1095- public boolean columnsOverlap(UserTable table, BitSet modifiedColumnPositions)
1096+ public boolean columnsOverlap(Table table, BitSet modifiedColumnPositions)
1097 {
1098 ParticipatingTable participatingTable = tablesByDepth.get(table.getDepth());
1099 if (participatingTable != null) {
1100@@ -241,7 +241,7 @@
1101 private void computeHKeyDerivations(Map<Table, Integer> ordinalMap)
1102 {
1103 indexToHKeys = new IndexToHKey[leafMostTable().getDepth() + 1];
1104- UserTable table = leafMostTable();
1105+ Table table = leafMostTable();
1106 while (table != null) {
1107 int tableDepth = table.getDepth();
1108 assert tableDepth <= leafMostTable().getDepth() : table;
1109@@ -271,7 +271,7 @@
1110 case LEFT:
1111 // use a rootward bias, but no more rootward than the rootmost table
1112 for (Column equivalentColumn : equivalentColumns) {
1113- int equivalentColumnDepth = equivalentColumn.getUserTable().getDepth();
1114+ int equivalentColumnDepth = equivalentColumn.getTable().getDepth();
1115 if (undeclaredHKeyColumn == null && equivalentColumnDepth >= rootMostDepth) {
1116 undeclaredHKeyColumn = equivalentColumn;
1117 }
1118@@ -284,7 +284,7 @@
1119 reverseCols.hasPrevious();)
1120 {
1121 Column equivalentColumn = reverseCols.previous();
1122- int equivalentColumnDepth = equivalentColumn.getUserTable().getDepth();
1123+ int equivalentColumnDepth = equivalentColumn.getTable().getDepth();
1124 if (undeclaredHKeyColumn == null && equivalentColumnDepth <= leafMostDepth) {
1125 undeclaredHKeyColumn = equivalentColumn;
1126 }
1127@@ -310,7 +310,7 @@
1128 // - For a left join index, use the nearest rootward equivalent column.
1129 // - For a right join index, use the nearest leafward equivalent column.
1130 List<Column> equivalentColumns = hKeyColumn.equivalentColumns(); // sorted by depth, root first
1131- Integer targetTableDepth = hKeyColumn.column().getUserTable().getDepth();
1132+ Integer targetTableDepth = hKeyColumn.column().getTable().getDepth();
1133 if (targetTableDepth < rootMostTable().getDepth()) {
1134 for (int i = 0; substituteHKeyColumnPosition == -1 && i < equivalentColumns.size(); i++) {
1135 Column equivalentColumn = equivalentColumns.get(i);
1136@@ -344,7 +344,7 @@
1137
1138 private int depth(Column column)
1139 {
1140- return column.getUserTable().getDepth();
1141+ return column.getTable().getDepth();
1142 }
1143
1144 private int positionOf(Column column)
1145@@ -368,7 +368,7 @@
1146 return position;
1147 }
1148
1149- private void checkIndexTableInBranchNew(IndexColumn indexColumn, UserTable indexTable, int indexTableDepth,
1150+ private void checkIndexTableInBranchNew(IndexColumn indexColumn, Table indexTable, int indexTableDepth,
1151 Map.Entry<Integer, ParticipatingTable> entry, boolean entryIsRootward)
1152 {
1153 if (entry == null) {
1154@@ -378,10 +378,10 @@
1155 throw new BranchingGroupIndexException(indexColumn.getIndex().getIndexName().getName(),
1156 indexTable.getName(), entry.getValue().table.getName());
1157 }
1158- UserTable entryTable = entry.getValue().table;
1159+ Table entryTable = entry.getValue().table;
1160
1161- final UserTable rootward;
1162- final UserTable leafward;
1163+ final Table rootward;
1164+ final Table leafward;
1165 if (entryIsRootward) {
1166 assert entry.getKey() < indexTableDepth : String.format("failed %d < %d", entry.getKey(), indexTableDepth);
1167 rootward = entryTable;
1168@@ -428,14 +428,14 @@
1169 }
1170 }
1171
1172- public ParticipatingTable(UserTable table)
1173+ public ParticipatingTable(Table table)
1174 {
1175 this.table = table;
1176 this.inIndex = new BitSet(table.getColumnsIncludingInternal().size());
1177 }
1178
1179 // The table participating in the group index
1180- final UserTable table;
1181+ final Table table;
1182 // The columns of the table that contribute to the group index key or value. This includes PK columns,
1183 // FK columns, and any columns declared in the key. The PK and FK columns may not always be necessary, as
1184 // the logic here does not account for whether the index includes the leafward or rootward side of an FK.
1185
1186=== modified file 'src/main/java/com/akiban/ais/model/GroupIndexHelper.java'
1187--- src/main/java/com/akiban/ais/model/GroupIndexHelper.java 2013-03-22 20:05:57 +0000
1188+++ src/main/java/com/akiban/ais/model/GroupIndexHelper.java 2013-05-28 23:28:27 +0000
1189@@ -25,9 +25,8 @@
1190 if (!indexColumn.getIndex().equals(index)) {
1191 throw new IllegalArgumentException("indexColumn must belong to index: " + indexColumn + "not of " + index);
1192 }
1193- UserTable userTable = indexColumn.getColumn().getUserTable();
1194- assert userTable.isUserTable() : "not a user table: " + userTable;
1195- action.act(index, userTable);
1196+ Table table = indexColumn.getColumn().getTable();
1197+ action.act(index, table);
1198 }
1199
1200 static void actOnGroupIndexTables(GroupIndex index, IndexAction action) {
1201@@ -38,15 +37,15 @@
1202
1203 // nested classes
1204 private static interface IndexAction {
1205- void act(GroupIndex groupIndex, UserTable onTable);
1206+ void act(GroupIndex groupIndex, Table onTable);
1207 }
1208
1209 // class state
1210
1211 final static IndexAction REMOVE = new IndexAction() {
1212 @Override
1213- public void act(GroupIndex groupIndex, UserTable onTable) {
1214- UserTable ancestor = onTable;
1215+ public void act(GroupIndex groupIndex, Table onTable) {
1216+ Table ancestor = onTable;
1217 while(ancestor != null) {
1218 ancestor.removeGroupIndex(groupIndex);
1219 ancestor = ancestor.parentTable();
1220@@ -61,8 +60,8 @@
1221
1222 final static IndexAction ADD = new IndexAction() {
1223 @Override
1224- public void act(GroupIndex groupIndex, UserTable onTable) {
1225- UserTable ancestor = onTable;
1226+ public void act(GroupIndex groupIndex, Table onTable) {
1227+ Table ancestor = onTable;
1228 while(ancestor != null) {
1229 ancestor.addGroupIndex(groupIndex);
1230 ancestor = ancestor.parentTable();
1231
1232=== modified file 'src/main/java/com/akiban/ais/model/HKey.java'
1233--- src/main/java/com/akiban/ais/model/HKey.java 2013-03-22 20:05:57 +0000
1234+++ src/main/java/com/akiban/ais/model/HKey.java 2013-05-28 23:28:27 +0000
1235@@ -18,7 +18,6 @@
1236 package com.akiban.ais.model;
1237
1238 import com.akiban.server.types.AkType;
1239-import com.akiban.server.types3.pvalue.PUnderlying;
1240
1241 import java.util.ArrayList;
1242 import java.util.List;
1243@@ -43,9 +42,9 @@
1244 return buffer.toString();
1245 }
1246
1247- public UserTable userTable()
1248+ public Table table()
1249 {
1250- return (UserTable) table;
1251+ return table;
1252 }
1253
1254 public List<HKeySegment> segments()
1255@@ -76,10 +75,10 @@
1256 this.table = table;
1257 }
1258
1259- public synchronized HKeySegment addSegment(UserTable segmentTable)
1260+ public synchronized HKeySegment addSegment(Table segmentTable)
1261 {
1262 assert keyDepth == null : segmentTable; // Should only be computed after HKeySegments are completely formed.
1263- UserTable lastSegmentTable = segments.isEmpty() ? null : segments.get(segments.size() - 1).table();
1264+ Table lastSegmentTable = segments.isEmpty() ? null : segments.get(segments.size() - 1).table();
1265 assert segmentTable.parentTable() == lastSegmentTable;
1266 HKeySegment segment = new HKeySegment(this, segmentTable);
1267 segments.add(segment);
1268
1269=== modified file 'src/main/java/com/akiban/ais/model/HKeyColumn.java'
1270--- src/main/java/com/akiban/ais/model/HKeyColumn.java 2013-03-22 20:05:57 +0000
1271+++ src/main/java/com/akiban/ais/model/HKeyColumn.java 2013-05-28 23:28:27 +0000
1272@@ -45,7 +45,6 @@
1273 public List<Column> equivalentColumns()
1274 {
1275 if (equivalentColumns == null) {
1276- assert column.getTable().isGroupTable() : "null equivalentColumns on non-group-table column: " + column;
1277 throw new UnsupportedOperationException("group tables have no equivalent columns");
1278 }
1279 return equivalentColumns;
1280@@ -61,17 +60,13 @@
1281 this.segment = segment;
1282 this.column = column;
1283 this.positionInHKey = segment.positionInHKey() + segment.columns().size() + 1;
1284- if (column.getTable().isUserTable()) {
1285- UserTable userTable = (UserTable) column.getTable();
1286- this.equivalentColumns = Collections.unmodifiableList(userTable.matchingColumns(column));
1287- } else {
1288- this.equivalentColumns = null;
1289- }
1290+ Table table = column.getTable();
1291+ this.equivalentColumns = Collections.unmodifiableList(table.matchingColumns(column));
1292 }
1293
1294 // For use by this class
1295
1296- private void findDependentTables(Column column, UserTable table, List<UserTable> dependentTables)
1297+ private void findDependentTables(Column column, Table table, List<Table> dependentTables)
1298 {
1299 boolean dependent = false;
1300 for (HKeySegment segment : table.hKey().segments()) {
1301@@ -93,7 +88,7 @@
1302 private final Column column;
1303 private final int positionInHKey;
1304 // If column is a group table column, then we need to know all columns in the group table that are constrained
1305- // to have matching values, e.g. customer$cid and order$cid. For a user table, equivalentColumns contains just
1306+ // to have matching values, e.g. customer$cid and order$cid. For a table, equivalentColumns contains just
1307 // column.
1308 private final List<Column> equivalentColumns;
1309 }
1310
1311=== modified file 'src/main/java/com/akiban/ais/model/HKeySegment.java'
1312--- src/main/java/com/akiban/ais/model/HKeySegment.java 2013-03-22 20:05:57 +0000
1313+++ src/main/java/com/akiban/ais/model/HKeySegment.java 2013-05-28 23:28:27 +0000
1314@@ -41,7 +41,7 @@
1315 return buffer.toString();
1316 }
1317
1318- public HKeySegment(HKey hKey, UserTable table)
1319+ public HKeySegment(HKey hKey, Table table)
1320 {
1321 this.hKey = hKey;
1322 this.table = table;
1323@@ -61,7 +61,7 @@
1324 return hKey;
1325 }
1326
1327- public UserTable table()
1328+ public Table table()
1329 {
1330 return table;
1331 }
1332@@ -85,7 +85,7 @@
1333 }
1334
1335 private final HKey hKey;
1336- private final UserTable table;
1337+ private final Table table;
1338 private final List<HKeyColumn> columns = new ArrayList<>();
1339 private final int positionInHKey;
1340 }
1341
1342=== modified file 'src/main/java/com/akiban/ais/model/Index.java'
1343--- src/main/java/com/akiban/ais/model/Index.java 2013-04-11 05:51:16 +0000
1344+++ src/main/java/com/akiban/ais/model/Index.java 2013-05-28 23:28:27 +0000
1345@@ -24,7 +24,6 @@
1346 import com.akiban.server.geophile.Space;
1347 import com.akiban.server.geophile.SpaceLatLon;
1348 import com.akiban.server.rowdata.IndexDef;
1349-import com.akiban.server.service.tree.TreeService;
1350 import com.akiban.server.types.AkType;
1351 import com.akiban.server.types3.TInstance;
1352 import com.akiban.server.types3.Types3Switch;
1353
1354=== modified file 'src/main/java/com/akiban/ais/model/IndexToHKey.java'
1355--- src/main/java/com/akiban/ais/model/IndexToHKey.java 2013-03-22 20:05:57 +0000
1356+++ src/main/java/com/akiban/ais/model/IndexToHKey.java 2013-05-28 23:28:27 +0000
1357@@ -20,7 +20,7 @@
1358 /**
1359 * IndexToHKey is an interface useful in constructing HKey values from an index row.
1360 * There are two types of entries, ordinal values and index fields. An ordinal identifies
1361- * a user table. An index field selects a field within the index row.
1362+ * a table. An index field selects a field within the index row.
1363 */
1364 public class IndexToHKey
1365 {
1366
1367=== modified file 'src/main/java/com/akiban/ais/model/Join.java'
1368--- src/main/java/com/akiban/ais/model/Join.java 2013-03-22 20:05:57 +0000
1369+++ src/main/java/com/akiban/ais/model/Join.java 2013-05-28 23:28:27 +0000
1370@@ -27,8 +27,8 @@
1371 {
1372 public static Join create(AkibanInformationSchema ais,
1373 String joinName,
1374- UserTable parent,
1375- UserTable child)
1376+ Table parent,
1377+ Table child)
1378 {
1379 ais.checkMutability();
1380 Join join = new Join(ais, joinName, parent, child);
1381@@ -74,12 +74,12 @@
1382 return joinName;
1383 }
1384
1385- public UserTable getParent()
1386+ public Table getParent()
1387 {
1388 return parent;
1389 }
1390
1391- public UserTable getChild()
1392+ public Table getChild()
1393 {
1394 return child;
1395 }
1396@@ -174,7 +174,7 @@
1397 joinName = newName;
1398 }
1399
1400- private Join(AkibanInformationSchema ais, String joinName, UserTable parent, UserTable child)
1401+ private Join(AkibanInformationSchema ais, String joinName, Table parent, Table child)
1402 {
1403 this.ais = ais;
1404 this.joinName = joinName;
1405@@ -220,9 +220,9 @@
1406 out.add("join contained null child column: " + this);
1407 } else if (parent == null) {
1408 out.add("join contained null parent column: " + this);
1409- } else if (!child.getUserTable().equals(this.child)) {
1410+ } else if (!child.getTable().equals(this.child)) {
1411 out.add("child column's table wasn't child table: " + child + " <--> " + this.child);
1412- } else if (!parent.getUserTable().equals(this.parent)) {
1413+ } else if (!parent.getTable().equals(this.parent)) {
1414 out.add("parent column's table wasn't parent table: " + child + " <--> " + this.parent);
1415 }
1416 }
1417@@ -234,8 +234,8 @@
1418 // State
1419
1420 private final AkibanInformationSchema ais;
1421- private final UserTable parent;
1422- private final UserTable child;
1423+ private final Table parent;
1424+ private final Table child;
1425 private final List<JoinColumn> joinColumns;
1426 private String joinName;
1427 private Integer weight;
1428
1429=== modified file 'src/main/java/com/akiban/ais/model/NopVisitor.java'
1430--- src/main/java/com/akiban/ais/model/NopVisitor.java 2013-03-22 20:05:57 +0000
1431+++ src/main/java/com/akiban/ais/model/NopVisitor.java 2013-05-28 23:28:27 +0000
1432@@ -27,7 +27,7 @@
1433 }
1434
1435 @Override
1436- public void visitUserTable(UserTable userTable) {
1437+ public void visitTable(Table table) {
1438 }
1439
1440 @Override
1441
1442=== modified file 'src/main/java/com/akiban/ais/model/PendingOSC.java'
1443--- src/main/java/com/akiban/ais/model/PendingOSC.java 2013-03-22 20:05:57 +0000
1444+++ src/main/java/com/akiban/ais/model/PendingOSC.java 2013-05-28 23:28:27 +0000
1445@@ -21,7 +21,7 @@
1446
1447 import java.util.List;
1448
1449-/** Attached to a <code>UserTable</code> on which <code>ALTER</code> has been performed
1450+/** Attached to a <code>Table</code> on which <code>ALTER</code> has been performed
1451 * by <a href="http://www.percona.com/doc/percona-toolkit/2.1/pt-online-schema-change.html">pt-online-schema-change.html</a>.
1452 * The same alter will be done to the <code>originalName</code> when a
1453 * <code>RENAME</code> is requested after all the row copying.
1454
1455=== modified file 'src/main/java/com/akiban/ais/model/Schema.java'
1456--- src/main/java/com/akiban/ais/model/Schema.java 2013-03-22 20:05:57 +0000
1457+++ src/main/java/com/akiban/ais/model/Schema.java 2013-05-28 23:28:27 +0000
1458@@ -32,20 +32,20 @@
1459 return name;
1460 }
1461
1462- public Map<String, UserTable> getUserTables() {
1463- return userTables;
1464- }
1465-
1466- public UserTable getUserTable(String tableName) {
1467- return userTables.get(tableName);
1468- }
1469-
1470- void addUserTable(UserTable userTable) {
1471- userTables.put(userTable.getName().getTableName(), userTable);
1472+ public Map<String,Table> getTables() {
1473+ return tables;
1474+ }
1475+
1476+ public Table getTable(String tableName) {
1477+ return tables.get(tableName);
1478+ }
1479+
1480+ void addTable(Table table) {
1481+ tables.put(table.getName().getTableName(), table);
1482 }
1483
1484 void removeTable(String tableName) {
1485- userTables.remove(tableName);
1486+ tables.remove(tableName);
1487 }
1488
1489 public Map<String, Sequence> getSequences() {
1490@@ -122,7 +122,7 @@
1491 }
1492
1493 private final String name;
1494- private final Map<String, UserTable> userTables = new TreeMap<>();
1495+ private final Map<String,Table> tables = new TreeMap<>();
1496 private final Map<String, Sequence> sequences = new TreeMap<>();
1497 private final Map<String, View> views = new TreeMap<>();
1498 private final Map<String, Routine> routines = new TreeMap<>();
1499
1500=== removed file 'src/main/java/com/akiban/ais/model/Table.java'
1501--- src/main/java/com/akiban/ais/model/Table.java 2013-05-24 21:45:54 +0000
1502+++ src/main/java/com/akiban/ais/model/Table.java 1970-01-01 00:00:00 +0000
1503@@ -1,267 +0,0 @@
1504-/**
1505- * Copyright (C) 2009-2013 Akiban Technologies, Inc.
1506- *
1507- * This program is free software: you can redistribute it and/or modify
1508- * it under the terms of the GNU Affero General Public License as published by
1509- * the Free Software Foundation, either version 3 of the License, or
1510- * (at your option) any later version.
1511- *
1512- * This program is distributed in the hope that it will be useful,
1513- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1514- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515- * GNU Affero General Public License for more details.
1516- *
1517- * You should have received a copy of the GNU Affero General Public License
1518- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1519- */
1520-
1521-package com.akiban.ais.model;
1522-
1523-import java.util.*;
1524-
1525-import com.akiban.server.rowdata.RowDef;
1526-
1527-public abstract class Table extends Columnar implements Traversable, HasGroup
1528-{
1529- public abstract boolean isUserTable();
1530-
1531- @Override
1532- public boolean isView() {
1533- return false;
1534- }
1535-
1536- protected Table(AkibanInformationSchema ais, String schemaName, String tableName, Integer tableId)
1537- {
1538- super(ais, schemaName, tableName);
1539- this.tableId = tableId;
1540-
1541- this.groupIndexes = new HashSet<>();
1542- this.unmodifiableGroupIndexes = Collections.unmodifiableCollection(groupIndexes);
1543- this.indexMap = new TreeMap<>();
1544- this.unmodifiableIndexMap = Collections.unmodifiableMap(indexMap);
1545- }
1546-
1547- public boolean isGroupTable()
1548- {
1549- return !isUserTable();
1550- }
1551-
1552- public Integer getTableId()
1553- {
1554- return tableId;
1555- }
1556-
1557- /**
1558- * Temporary mutator so that prototype AIS management can renumber all
1559- * the tables once created. Longer term we want to give the table
1560- * its ID when generated.
1561- *
1562- * @param tableId
1563- */
1564- public void setTableId(final int tableId)
1565- {
1566- this.tableId = tableId;
1567- }
1568-
1569- public Integer getOrdinal()
1570- {
1571- return ordinal;
1572- }
1573-
1574- public void setOrdinal(Integer ordinal)
1575- {
1576- this.ordinal = ordinal;
1577- }
1578-
1579- public Group getGroup()
1580- {
1581- return group;
1582- }
1583-
1584- public void setGroup(Group group)
1585- {
1586- this.group = group;
1587- }
1588-
1589- public Collection<TableIndex> getIndexes()
1590- {
1591- return unmodifiableIndexMap.values();
1592- }
1593-
1594- public TableIndex getIndex(String indexName)
1595- {
1596- return unmodifiableIndexMap.get(indexName.toLowerCase());
1597- }
1598-
1599- /**
1600- * Get all GroupIndexes this table participates in, both explicit and implicit (i.e. as a declared column or
1601- * as an ancestor of a declared column
1602- */
1603- public final Collection<GroupIndex> getGroupIndexes() {
1604- return unmodifiableGroupIndexes;
1605- }
1606-
1607- public MigrationUsage getMigrationUsage() {
1608- return migrationUsage;
1609- }
1610-
1611- public void setMigrationUsage(MigrationUsage migrationUsage) {
1612- this.migrationUsage = migrationUsage;
1613- }
1614-
1615- protected void addIndex(TableIndex index)
1616- {
1617- indexMap.put(index.getIndexName().getName().toLowerCase(), index);
1618- }
1619-
1620- void clearIndexes() {
1621- indexMap.clear();
1622- }
1623-
1624- final void addGroupIndex(GroupIndex groupIndex) {
1625- groupIndexes.add(groupIndex);
1626- }
1627-
1628- final void removeGroupIndex(GroupIndex groupIndex) {
1629- groupIndexes.remove(groupIndex);
1630- }
1631-
1632- public void removeIndexes(Collection<TableIndex> indexesToDrop) {
1633- indexMap.values().removeAll(indexesToDrop);
1634- }
1635-
1636- /**
1637- * <p>Our intended migration policy; the grouping algorithm must also take these values into account.</p>
1638- * <p/>
1639- * <p>The enums {@linkplain #KEEP_ENGINE} and {@linkplain #INCOMPATIBLE} have similar effects on grouping and
1640- * migration: tables marked with these values will not be included in any groups, and during migration, their
1641- * storage engine is not changed to AkibanDb. The difference between the two enums is that {@linkplain #KEEP_ENGINE}
1642- * is set by the user and can later be changed to {@linkplain #AKIBAN_STANDARD} or
1643- * {@linkplain @#AKIBAN_LOOKUP_TABLE}; on the other hand, {@linkplain #INCOMPATIBLE} is set during analysis and
1644- * signifies that migration will not work for this table. The user should not be able to set this flag, and if
1645- * this flag is set, the user should not be able to change it.</p>
1646- */
1647- public enum MigrationUsage
1648- {
1649- /**
1650- * Migrate this table to AkibanDb, grouping it as a standard user table. This is just a normal migration.
1651- */
1652- AKIBAN_STANDARD,
1653- /**
1654- * Migrate this table to AkibanDb, but as a lookup table. Lookup tables are grouped alone.
1655- */
1656- AKIBAN_LOOKUP_TABLE,
1657- /**
1658- * User wants to keep this table's engine as-is; don't migrate it to AkibanDb.
1659- */
1660- KEEP_ENGINE,
1661- /**
1662- * This table can't be migrated to AkibanDb.
1663- */
1664- INCOMPATIBLE;
1665-
1666- /**
1667- * Returns whether this usage requires an AkibanDB engine.
1668- *
1669- * @return whether this enum is one that requires AkibanDB
1670- */
1671- public boolean isAkiban()
1672- {
1673- return (this == AKIBAN_STANDARD) || (this == AKIBAN_LOOKUP_TABLE);
1674- }
1675-
1676- /**
1677- * <p>Returns whether this usage requires that the table participate in grouping.</p>
1678- * <p/>
1679- * <p>Tables participate in grouping if they're AkibanDB (see {@linkplain #isAkiban()} <em>and</em>
1680- * are not lookups.</p>
1681- *
1682- * @return
1683- */
1684- public boolean includeInGrouping()
1685- {
1686- return this == AKIBAN_STANDARD;
1687- }
1688- }
1689-
1690- /**
1691- * @deprecated - use AkibanInfomationSchema#validate() instead
1692- * @param out
1693- */
1694- public void checkIntegrity(List<String> out)
1695- {
1696- if (tableName == null) {
1697- out.add("table had null table name");
1698- }
1699- for (Map.Entry<String, Column> entry : columnMap.entrySet()) {
1700- String name = entry.getKey();
1701- Column column = entry.getValue();
1702- if (column == null) {
1703- out.add("null column for name: " + name);
1704- } else if (name == null) {
1705- out.add("null name for column: " + column);
1706- } else if (!name.equals(column.getName())) {
1707- out.add("name mismatch, expected <" + name + "> for column " + column);
1708- }
1709- }
1710- if (!columnsStale) {
1711- for (Column column : columns) {
1712- if (column == null) {
1713- out.add("null column in columns list");
1714- } else if (!columnMap.containsKey(column.getName())) {
1715- out.add("columns not stale, but map didn't contain column: " + column.getName());
1716- }
1717- }
1718- }
1719- for (Map.Entry<String, TableIndex> entry : indexMap.entrySet()) {
1720- String name = entry.getKey();
1721- TableIndex index = entry.getValue();
1722- if (name == null) {
1723- out.add("null name for index: " + index);
1724- } else if (index == null) {
1725- out.add("null index for name: " + name);
1726- } else if (index.getTable() != this) {
1727- out.add("table's index.getTable() wasn't the table" + index + " <--> " + this);
1728- }
1729- if (index != null) {
1730- for (IndexColumn indexColumn : index.getKeyColumns()) {
1731- if (!index.equals(indexColumn.getIndex())) {
1732- out.add("index's indexColumn.getIndex() wasn't index: " + indexColumn);
1733- }
1734- Column column = indexColumn.getColumn();
1735- if (!columnMap.containsKey(column.getName())) {
1736- out.add("index referenced a column not in the table: " + column);
1737- }
1738- }
1739- }
1740- }
1741- }
1742-
1743- public String getEngine()
1744- {
1745- return engine;
1746- }
1747-
1748- public void rowDef(RowDef rowDef)
1749- {
1750- this.rowDef = rowDef;
1751- }
1752-
1753- public RowDef rowDef()
1754- {
1755- return rowDef;
1756- }
1757-
1758- // State
1759- private final Map<String, TableIndex> indexMap;
1760- private final Map<String, TableIndex> unmodifiableIndexMap;
1761- private final Collection<GroupIndex> groupIndexes;
1762- private final Collection<GroupIndex> unmodifiableGroupIndexes;
1763-
1764- protected Group group;
1765- private Integer tableId;
1766- protected MigrationUsage migrationUsage = MigrationUsage.AKIBAN_STANDARD;
1767- protected String engine;
1768- private RowDef rowDef;
1769- private Integer ordinal;
1770-}
1771
1772=== renamed file 'src/main/java/com/akiban/ais/model/UserTable.java' => 'src/main/java/com/akiban/ais/model/Table.java'
1773--- src/main/java/com/akiban/ais/model/UserTable.java 2013-05-20 14:18:40 +0000
1774+++ src/main/java/com/akiban/ais/model/Table.java 2013-05-28 23:28:27 +0000
1775@@ -18,51 +18,52 @@
1776 package com.akiban.ais.model;
1777
1778 import com.akiban.qp.memoryadapter.MemoryTableFactory;
1779+import com.akiban.server.rowdata.RowDef;
1780 import com.akiban.util.ArgumentValidation;
1781
1782 import java.util.*;
1783
1784-public class UserTable extends Table
1785+public class Table extends Columnar implements Traversable, HasGroup
1786 {
1787- public static UserTable create(AkibanInformationSchema ais,
1788+ public static Table create(AkibanInformationSchema ais,
1789 String schemaName,
1790 String tableName,
1791 Integer tableId)
1792 {
1793- UserTable userTable = new UserTable(ais, schemaName, tableName, tableId);
1794- ais.addUserTable(userTable);
1795- return userTable;
1796+ Table table = new Table(ais, schemaName, tableName, tableId);
1797+ ais.addTable(table);
1798+ return table;
1799 }
1800
1801 /**
1802- * Create an independent copy of an existing UserTable.
1803+ * Create an independent copy of an existing Table.
1804 * @param ais Destination AkibanInformationSchema.
1805- * @param userTable UserTable to copy.
1806- * @return The new copy of the UserTable.
1807+ * @param table Table to copy.
1808+ * @return The new copy of the Table.
1809 */
1810- public static UserTable create(AkibanInformationSchema ais, UserTable userTable) {
1811- UserTable copy = create(ais, userTable.tableName.getSchemaName(), userTable.tableName.getTableName(), userTable.getTableId());
1812- copy.setUuid(userTable.getUuid());
1813+ public static Table create(AkibanInformationSchema ais, Table table) {
1814+ Table copy = create(ais, table.tableName.getSchemaName(), table.tableName.getTableName(), table.getTableId());
1815+ copy.setUuid(table.getUuid());
1816 return copy;
1817 }
1818
1819- private UserTable(AkibanInformationSchema ais, String schemaName, String tableName, Integer tableId)
1820+ private Table(AkibanInformationSchema ais, String schemaName, String tableName, Integer tableId)
1821 {
1822- super(ais, schemaName, tableName, tableId);
1823+ super(ais, schemaName, tableName);
1824+ this.tableId = tableId;
1825+
1826+ this.groupIndexes = new HashSet<>();
1827+ this.unmodifiableGroupIndexes = Collections.unmodifiableCollection(groupIndexes);
1828+ this.indexMap = new TreeMap<>();
1829+ this.unmodifiableIndexMap = Collections.unmodifiableMap(indexMap);
1830+
1831 this.fullTextIndexes = new HashSet<>();
1832 this.unmodifiableFullTextIndexes = Collections.unmodifiableCollection(fullTextIndexes);
1833 }
1834
1835- @Override
1836- public boolean isUserTable()
1837- {
1838- return true;
1839- }
1840-
1841- @Override
1842 protected void addIndex(TableIndex index)
1843 {
1844- super.addIndex(index);
1845+ indexMap.put(index.getIndexName().getName().toLowerCase(), index);
1846 if (index.isPrimaryKey()) {
1847 assert primaryKey == null;
1848 primaryKey = new PrimaryKey(index);
1849@@ -75,12 +76,11 @@
1850 super.dropColumns();
1851 }
1852
1853- @Override
1854 public void removeIndexes(Collection<TableIndex> indexesToDrop) {
1855 if((primaryKey != null) && indexesToDrop.contains(primaryKey.getIndex())) {
1856 primaryKey = null;
1857 }
1858- super.removeIndexes(indexesToDrop);
1859+ indexMap.values().removeAll(indexesToDrop);
1860 }
1861
1862 /**
1863@@ -105,7 +105,7 @@
1864
1865 private void findMatchingAncestorColumns(Column fromColumn, List<Column> matchingColumns)
1866 {
1867- Join join = ((UserTable)fromColumn.getTable()).getParentJoin();
1868+ Join join = fromColumn.getTable().getParentJoin();
1869 if (join != null) {
1870 JoinColumn ancestorJoinColumn = null;
1871 for (JoinColumn joinColumn : join.getJoinColumns()) {
1872@@ -222,19 +222,17 @@
1873 return identity;
1874 }
1875
1876- @Override
1877 public Collection<TableIndex> getIndexes()
1878 {
1879- Collection<TableIndex> indexes = super.getIndexes();
1880+ Collection<TableIndex> indexes = getIndexesIncludingInternal();
1881 return removeInternalColumnIndexes(indexes);
1882 }
1883
1884 public Collection<TableIndex> getIndexesIncludingInternal()
1885 {
1886- return super.getIndexes();
1887+ return unmodifiableIndexMap.values();
1888 }
1889
1890- @Override
1891 public TableIndex getIndex(String indexName)
1892 {
1893 TableIndex index = null;
1894@@ -243,16 +241,16 @@
1895 PrimaryKey primaryKey = getPrimaryKey();
1896 index = primaryKey == null ? null : primaryKey.getIndex();
1897 } else {
1898- index = super.getIndex(indexName);
1899+ index = unmodifiableIndexMap.get(indexName.toLowerCase());
1900 }
1901 return index;
1902 }
1903
1904- public boolean isDescendantOf(UserTable other) {
1905+ public boolean isDescendantOf(Table other) {
1906 if (getGroup() == null || !getGroup().equals(other.getGroup())) {
1907 return false;
1908 }
1909- UserTable possibleDescendant = this;
1910+ Table possibleDescendant = this;
1911 while (possibleDescendant != null) {
1912 if (possibleDescendant.equals(other)) {
1913 return true;
1914@@ -264,7 +262,7 @@
1915
1916 public Index getIndexIncludingInternal(String indexName)
1917 {
1918- return super.getIndex(indexName);
1919+ return unmodifiableIndexMap.get(indexName.toLowerCase());
1920 }
1921
1922 @Override
1923@@ -292,19 +290,19 @@
1924 }
1925
1926 public void traverseTableAndDescendants(Visitor visitor) {
1927- List<UserTable> remainingTables = new ArrayList<>();
1928+ List<Table> remainingTables = new ArrayList<>();
1929 List<Join> remainingJoins = new ArrayList<>();
1930 remainingTables.add(this);
1931 remainingJoins.addAll(getCandidateChildJoins());
1932 // Add before visit in-case visitor changes group or joins
1933 while(!remainingJoins.isEmpty()) {
1934 Join join = remainingJoins.remove(remainingJoins.size() - 1);
1935- UserTable child = join.getChild();
1936+ Table child = join.getChild();
1937 remainingTables.add(child);
1938 remainingJoins.addAll(child.getCandidateChildJoins());
1939 }
1940- for(UserTable table : remainingTables) {
1941- visitor.visitUserTable(table);
1942+ for(Table table : remainingTables) {
1943+ visitor.visitTable(table);
1944 }
1945 }
1946
1947@@ -369,7 +367,7 @@
1948 }
1949
1950 // put the child tables into their ordered list.
1951- TreeMap<String, UserTable> childTables = new TreeMap<String, UserTable>();
1952+ TreeMap<String,Table> childTables = new TreeMap<String,Table>();
1953 for (Join childJoin : candidateChildJoins ) {
1954 String childName;
1955 if (childJoin.getChild().getName().getSchemaName().equals(getName().getSchemaName())) {
1956@@ -418,23 +416,6 @@
1957 return getGroup() == null || getParentJoin() == null;
1958 }
1959
1960- public MigrationUsage getMigrationUsage()
1961- {
1962- return migrationUsage;
1963- }
1964-
1965- public void setMigrationUsage(MigrationUsage migrationUsage)
1966- {
1967- assert (this.migrationUsage != MigrationUsage.INCOMPATIBLE || migrationUsage == MigrationUsage.INCOMPATIBLE)
1968- : "cannot change migration usage from INCOMPATIBLE to " + migrationUsage;
1969- this.migrationUsage = migrationUsage;
1970- }
1971-
1972- public void setEngine(String engine)
1973- {
1974- this.engine = engine;
1975- }
1976-
1977 public HKey hKey()
1978 {
1979 assert getGroup() != null;
1980@@ -466,7 +447,7 @@
1981 return containsOwnHKey;
1982 }
1983
1984- public UserTable parentTable()
1985+ public Table parentTable()
1986 {
1987 Join join = getParentJoin();
1988 return join == null ? null : join.getParent();
1989@@ -481,14 +462,14 @@
1990 }
1991
1992 // Descendent tables whose hkeys are affected by a change to this table's PK or FK.
1993- public List<UserTable> hKeyDependentTables()
1994+ public List<Table> hKeyDependentTables()
1995 {
1996 if (hKeyDependentTables == null) {
1997 synchronized (lazyEvaluationLock) {
1998 if (hKeyDependentTables == null) {
1999 hKeyDependentTables = new ArrayList<>();
2000 for (Join join : getChildJoins()) {
2001- UserTable child = join.getChild();
2002+ Table child = join.getChild();
2003 if (!child.containsOwnHKey()) {
2004 addTableAndDescendents(child, hKeyDependentTables);
2005 }
2006@@ -532,7 +513,7 @@
2007 return nameForOutput;
2008 }
2009
2010- private void addTableAndDescendents(UserTable table, List<UserTable> accumulator)
2011+ private void addTableAndDescendents(Table table, List<Table> accumulator)
2012 {
2013 accumulator.add(table);
2014 for (Join join : table.getChildJoins()) {
2015@@ -648,32 +629,158 @@
2016 return null;
2017 }
2018
2019+ @Override
2020+ public boolean isView() {
2021+ return false;
2022+ }
2023+
2024+ public Integer getTableId()
2025+ {
2026+ return tableId;
2027+ }
2028+
2029+ public void setTableId(final int tableId)
2030+ {
2031+ this.tableId = tableId;
2032+ }
2033+
2034+ public Integer getOrdinal()
2035+ {
2036+ return ordinal;
2037+ }
2038+
2039+ public void setOrdinal(Integer ordinal)
2040+ {
2041+ this.ordinal = ordinal;
2042+ }
2043+
2044+ public Group getGroup()
2045+ {
2046+ return group;
2047+ }
2048+
2049+ public void setGroup(Group group)
2050+ {
2051+ this.group = group;
2052+ }
2053+
2054+ /**
2055+ * Get all GroupIndexes this table participates in, both explicit and implicit (i.e. as a declared column or
2056+ * as an ancestor of a declared column
2057+ */
2058+ public final Collection<GroupIndex> getGroupIndexes() {
2059+ return unmodifiableGroupIndexes;
2060+ }
2061+
2062+ void clearIndexes() {
2063+ indexMap.clear();
2064+ }
2065+
2066+ final void addGroupIndex(GroupIndex groupIndex) {
2067+ groupIndexes.add(groupIndex);
2068+ }
2069+
2070+ final void removeGroupIndex(GroupIndex groupIndex) {
2071+ groupIndexes.remove(groupIndex);
2072+ }
2073+
2074+ /**
2075+ * @deprecated - use AkibanInfomationSchema#validate() instead
2076+ * @param out
2077+ */
2078+ public void checkIntegrity(List<String> out)
2079+ {
2080+ if (tableName == null) {
2081+ out.add("table had null table name");
2082+ }
2083+ for (Map.Entry<String, Column> entry : columnMap.entrySet()) {
2084+ String name = entry.getKey();
2085+ Column column = entry.getValue();
2086+ if (column == null) {
2087+ out.add("null column for name: " + name);
2088+ } else if (name == null) {
2089+ out.add("null name for column: " + column);
2090+ } else if (!name.equals(column.getName())) {
2091+ out.add("name mismatch, expected <" + name + "> for column " + column);
2092+ }
2093+ }
2094+ if (!columnsStale) {
2095+ for (Column column : columns) {
2096+ if (column == null) {
2097+ out.add("null column in columns list");
2098+ } else if (!columnMap.containsKey(column.getName())) {
2099+ out.add("columns not stale, but map didn't contain column: " + column.getName());
2100+ }
2101+ }
2102+ }
2103+ for (Map.Entry<String, TableIndex> entry : indexMap.entrySet()) {
2104+ String name = entry.getKey();
2105+ TableIndex index = entry.getValue();
2106+ if (name == null) {
2107+ out.add("null name for index: " + index);
2108+ } else if (index == null) {
2109+ out.add("null index for name: " + name);
2110+ } else if (index.getTable() != this) {
2111+ out.add("table's index.getTable() wasn't the table" + index + " <--> " + this);
2112+ }
2113+ if (index != null) {
2114+ for (IndexColumn indexColumn : index.getKeyColumns()) {
2115+ if (!index.equals(indexColumn.getIndex())) {
2116+ out.add("index's indexColumn.getIndex() wasn't index: " + indexColumn);
2117+ }
2118+ Column column = indexColumn.getColumn();
2119+ if (!columnMap.containsKey(column.getName())) {
2120+ out.add("index referenced a column not in the table: " + column);
2121+ }
2122+ }
2123+ }
2124+ }
2125+ }
2126+
2127+ public void rowDef(RowDef rowDef)
2128+ {
2129+ this.rowDef = rowDef;
2130+ }
2131+
2132+ public RowDef rowDef()
2133+ {
2134+ return rowDef;
2135+ }
2136+
2137+
2138 // State
2139-
2140+ private final Map<String, TableIndex> indexMap;
2141+ private final Map<String, TableIndex> unmodifiableIndexMap;
2142+ private final Collection<GroupIndex> groupIndexes;
2143+ private final Collection<GroupIndex> unmodifiableGroupIndexes;
2144 private final List<Join> candidateParentJoins = new ArrayList<>();
2145 private final List<Join> candidateChildJoins = new ArrayList<>();
2146 private final Object lazyEvaluationLock = new Object();
2147
2148+ private Group group;
2149+ private Integer tableId;
2150+ private RowDef rowDef;
2151+ private Integer ordinal;
2152 private UUID uuid;
2153 private PrimaryKey primaryKey;
2154 private HKey hKey;
2155 private boolean containsOwnHKey;
2156 private List<Column> allHKeyColumns;
2157 private Integer depth = null;
2158- private volatile List<UserTable> hKeyDependentTables;
2159+ private volatile List<Table> hKeyDependentTables;
2160 private MemoryTableFactory tableFactory;
2161 private Integer version;
2162 private PendingOSC pendingOSC;
2163 private final Collection<FullTextIndex> fullTextIndexes;
2164 private final Collection<FullTextIndex> unmodifiableFullTextIndexes;
2165 private String nameForOutput;
2166-
2167+
2168 // consts
2169
2170 private static final Comparator<Column> COLUMNS_BY_TABLE_DEPTH = new Comparator<Column>() {
2171 @Override
2172 public int compare(Column o1, Column o2) {
2173- return o1.getUserTable().getDepth() - o2.getUserTable().getDepth();
2174+ return o1.getTable().getDepth() - o2.getTable().getDepth();
2175 }
2176 };
2177 }
2178
2179=== modified file 'src/main/java/com/akiban/ais/model/TableIndex.java'
2180--- src/main/java/com/akiban/ais/model/TableIndex.java 2013-05-24 21:45:54 +0000
2181+++ src/main/java/com/akiban/ais/model/TableIndex.java 2013-05-28 23:28:27 +0000
2182@@ -108,7 +108,6 @@
2183 if (table.getColumnsIncludingInternal().contains(column)) {
2184 toIndexRowBuilder.rowCompEntry(column.getPosition(), -1);
2185 } else {
2186- assert hKeySegment.table().isUserTable() : this;
2187 toIndexRowBuilder.rowCompEntry(-1, hKeyColumn.positionInHKey());
2188 }
2189 indexColumns.add(column);
2190@@ -169,14 +168,12 @@
2191 return uniqueAndMayContainNulls;
2192 }
2193
2194- // For a user table index: the user table hkey
2195- // For a group table index: the hkey of the leafmost user table, but with user table columns replaced by
2196- // group table columns.
2197+ // For a table index: the table hkey
2198 @Override
2199 public HKey hKey()
2200 {
2201 if (hKey == null) {
2202- hKey = ((UserTable) table).hKey();
2203+ hKey = table.hKey();
2204 }
2205 return hKey;
2206 }
2207
2208=== modified file 'src/main/java/com/akiban/ais/model/Visitor.java'
2209--- src/main/java/com/akiban/ais/model/Visitor.java 2013-03-22 20:05:57 +0000
2210+++ src/main/java/com/akiban/ais/model/Visitor.java 2013-05-28 23:28:27 +0000
2211@@ -21,7 +21,7 @@
2212 {
2213 void visitType(Type type);
2214 void visitGroup(Group group);
2215- void visitUserTable(UserTable userTable);
2216+ void visitTable(Table table);
2217 void visitColumn(Column column);
2218 void visitJoin(Join join) ;
2219 void visitJoinColumn(JoinColumn joinColumn);
2220
2221=== modified file 'src/main/java/com/akiban/ais/model/aisb2/AISBBasedBuilder.java'
2222--- src/main/java/com/akiban/ais/model/aisb2/AISBBasedBuilder.java 2013-04-12 21:41:19 +0000
2223+++ src/main/java/com/akiban/ais/model/aisb2/AISBBasedBuilder.java 2013-05-28 23:28:27 +0000
2224@@ -24,7 +24,7 @@
2225 import com.akiban.ais.model.Parameter;
2226 import com.akiban.ais.model.Routine;
2227 import com.akiban.ais.model.TableName;
2228-import com.akiban.ais.model.UserTable;
2229+import com.akiban.ais.model.Table;
2230 import com.akiban.ais.model.View;
2231 import com.akiban.ais.model.validation.AISInvariants;
2232 import com.akiban.ais.model.validation.AISValidationResults;
2233@@ -90,18 +90,18 @@
2234 }
2235
2236 @Override
2237- public NewUserTableBuilder userTable(String table) {
2238- return userTable(defaultSchema, table);
2239+ public NewTableBuilder table(String table) {
2240+ return table(defaultSchema, table);
2241 }
2242
2243 @Override
2244- public NewUserTableBuilder userTable(String schema, String table) {
2245+ public NewTableBuilder table(String schema, String table) {
2246 checkUsable();
2247 AISInvariants.checkDuplicateTables(aisb.akibanInformationSchema(), schema, table);
2248 this.schema = schema;
2249- this.userTable = table;
2250+ this.table = table;
2251 TableName tableName= new TableName (schema, table);
2252- aisb.userTable(schema, table);
2253+ aisb.table(schema, table);
2254 aisb.createGroup(table, schema);
2255 aisb.addTableToGroup(tableName, schema, table);
2256 tablesToGroups.put(TableName.create(schema, table), tableName);
2257@@ -110,15 +110,15 @@
2258 }
2259
2260 @Override
2261- public NewUserTableBuilder getUserTable() {
2262+ public NewTableBuilder getTable() {
2263 return this;
2264 }
2265
2266 @Override
2267- public NewUserTableBuilder getUserTable(TableName table) {
2268+ public NewTableBuilder getTable(TableName table) {
2269 checkUsable();
2270 this.schema = table.getSchemaName();
2271- this.userTable = table.getTableName();
2272+ this.table = table.getTableName();
2273 assert aisb.akibanInformationSchema().getTable(table) != null;
2274 uTableColumnPos = aisb.akibanInformationSchema().getTable(table).getColumns().size();
2275 return this;
2276@@ -138,8 +138,8 @@
2277 }
2278
2279 @Override
2280- public NewUserTableBuilder userTable(TableName tableName) {
2281- return userTable(tableName.getSchemaName(), tableName.getTableName());
2282+ public NewTableBuilder table(TableName tableName) {
2283+ return table(tableName.getSchemaName(), tableName.getTableName());
2284 }
2285
2286 @Override
2287@@ -152,7 +152,7 @@
2288 checkUsable();
2289 AISInvariants.checkDuplicateTables(aisb.akibanInformationSchema(), schema, view);
2290 this.schema = schema;
2291- this.userTable = view;
2292+ this.table = view;
2293 return this;
2294 }
2295
2296@@ -171,7 +171,7 @@
2297 checkUsable();
2298 AISInvariants.checkDuplicateRoutine(aisb.akibanInformationSchema(), schema, procedure);
2299 this.schema = schema;
2300- this.userTable = procedure;
2301+ this.table = procedure;
2302 return this;
2303 }
2304
2305@@ -190,7 +190,7 @@
2306 checkUsable();
2307 AISInvariants.checkDuplicateSQLJJar(aisb.akibanInformationSchema(), schema, jarName);
2308 this.schema = schema;
2309- this.userTable = jarName;
2310+ this.table = jarName;
2311 return this;
2312 }
2313
2314@@ -210,41 +210,41 @@
2315 return actual.groupIndex(indexName, joinType);
2316 }
2317
2318- // NewUserTableBuilder interface
2319+ // NewTableBuilder interface
2320
2321 @Override
2322- public NewUserTableBuilder colLong(String name) {
2323+ public NewTableBuilder colLong(String name) {
2324 return colLong(name, NULLABLE_DEFAULT, null, null);
2325 }
2326
2327 @Override
2328- public NewUserTableBuilder colLong(String name, boolean nullable) {
2329+ public NewTableBuilder colLong(String name, boolean nullable) {
2330 return colLong(name, nullable, null, null);
2331 }
2332
2333 @Override
2334- public NewUserTableBuilder autoIncLong(String name, int initialValue) {
2335+ public NewTableBuilder autoIncLong(String name, int initialValue) {
2336 return colLong(name, false, initialValue, true);
2337 }
2338
2339 @Override
2340- public NewUserTableBuilder autoIncLong(String name, int initialValue, boolean always) {
2341+ public NewTableBuilder autoIncLong(String name, int initialValue, boolean always) {
2342 return colLong(name, false, initialValue, !always);
2343 }
2344
2345- private NewUserTableBuilder colLong(String name, boolean nullable, Integer initialAutoInc, Boolean defaultIdentity) {
2346+ private NewTableBuilder colLong(String name, boolean nullable, Integer initialAutoInc, Boolean defaultIdentity) {
2347 checkUsable();
2348- aisb.column(schema, userTable, name, uTableColumnPos++, "INT", 10L, null, nullable, false, null, null);
2349+ aisb.column(schema, table, name, uTableColumnPos++, "INT", 10L, null, nullable, false, null, null);
2350 if (initialAutoInc != null) {
2351 assert defaultIdentity != null;
2352- String sequenceName = "temp-seq-" + userTable + "-" + name;
2353+ String sequenceName = "temp-seq-" + table + "-" + name;
2354 long initValue = initialAutoInc.longValue();
2355 aisb.sequence(schema, sequenceName,
2356 initValue, 1L, initValue, Long.MAX_VALUE,
2357 false);
2358- aisb.columnAsIdentity(schema, userTable, name, sequenceName, defaultIdentity);
2359+ aisb.columnAsIdentity(schema, table, name, sequenceName, defaultIdentity);
2360 aisb.akibanInformationSchema().
2361- getUserTable(schema, userTable).
2362+ getTable(schema, table).
2363 getColumn(name).
2364 setInitialAutoIncrementValue(initValue);
2365 }
2366@@ -252,117 +252,119 @@
2367 }
2368
2369 @Override
2370- public NewUserTableBuilder colBoolean(String name, boolean nullable) {
2371+ public NewTableBuilder colBoolean(String name, boolean nullable) {
2372 checkUsable();
2373- aisb.column(schema, userTable, name, uTableColumnPos++, "BOOLEAN", null, null, nullable, false, null, null);
2374+ aisb.column(schema, table, name, uTableColumnPos++, "BOOLEAN", null, null, nullable, false, null, null);
2375 return this;
2376 }
2377
2378 @Override
2379- public NewUserTableBuilder colString(String name, int length) {
2380+ public NewTableBuilder colString(String name, int length) {
2381 return colString(name, length, NULLABLE_DEFAULT);
2382 }
2383
2384 @Override
2385- public NewUserTableBuilder colString(String name, int length, boolean nullable) {
2386+ public NewTableBuilder colString(String name, int length, boolean nullable) {
2387 return colString(name, length, nullable, CHARSET_DEFAULT);
2388 }
2389
2390 @Override
2391- public NewUserTableBuilder colString(String name, int length, boolean nullable, String charset) {
2392+ public NewTableBuilder colString(String name, int length, boolean nullable, String charset) {
2393 checkUsable();
2394- aisb.column(schema, userTable, name, uTableColumnPos++, "VARCHAR", (long)length, null, nullable, false, charset, null);
2395+ aisb.column(schema,
2396+ table, name, uTableColumnPos++, "VARCHAR", (long)length, null, nullable, false, charset, null);
2397 return this;
2398 }
2399
2400 @Override
2401- public NewUserTableBuilder colDouble(String name) {
2402+ public NewTableBuilder colDouble(String name) {
2403 return colDouble(name, NULLABLE_DEFAULT);
2404 }
2405
2406 @Override
2407- public NewUserTableBuilder colDouble(String name, boolean nullable) {
2408+ public NewTableBuilder colDouble(String name, boolean nullable) {
2409 checkUsable();
2410- aisb.column(schema, userTable, name, uTableColumnPos++, "DOUBLE", null, null, nullable, false, null, null);
2411+ aisb.column(schema, table, name, uTableColumnPos++, "DOUBLE", null, null, nullable, false, null, null);
2412 return this;
2413 }
2414
2415 @Override
2416- public NewUserTableBuilder colTimestamp(String name) {
2417+ public NewTableBuilder colTimestamp(String name) {
2418 return colTimestamp(name, NULLABLE_DEFAULT);
2419 }
2420
2421 @Override
2422- public NewUserTableBuilder colTimestamp(String name, boolean nullable) {
2423- aisb.column(schema, userTable, name, uTableColumnPos++, "TIMESTAMP", null, null, nullable, false, null, null);
2424+ public NewTableBuilder colTimestamp(String name, boolean nullable) {
2425+ aisb.column(schema, table, name, uTableColumnPos++, "TIMESTAMP", null, null, nullable, false, null, null);
2426 return this;
2427 }
2428
2429 @Override
2430- public NewUserTableBuilder colBigInt(String name) {
2431+ public NewTableBuilder colBigInt(String name) {
2432 return colBigInt(name, NULLABLE_DEFAULT);
2433 }
2434
2435 @Override
2436- public NewUserTableBuilder colBigInt(String name, boolean nullable) {
2437- aisb.column(schema, userTable, name, uTableColumnPos++, "BIGINT", null, null, nullable, false, null, null);
2438+ public NewTableBuilder colBigInt(String name, boolean nullable) {
2439+ aisb.column(schema, table, name, uTableColumnPos++, "BIGINT", null, null, nullable, false, null, null);
2440 return this;
2441 }
2442
2443 @Override
2444- public NewUserTableBuilder colVarBinary(String name, int length) {
2445+ public NewTableBuilder colVarBinary(String name, int length) {
2446 return colVarBinary(name, length, NULLABLE_DEFAULT);
2447 }
2448
2449 @Override
2450- public NewUserTableBuilder colVarBinary(String name, int length, boolean nullable) {
2451- aisb.column(schema, userTable, name, uTableColumnPos++, "VARBINARY", (long)length, null, nullable, false, null, null);
2452+ public NewTableBuilder colVarBinary(String name, int length, boolean nullable) {
2453+ aisb.column(schema,
2454+ table, name, uTableColumnPos++, "VARBINARY", (long)length, null, nullable, false, null, null);
2455 return this;
2456 }
2457
2458 @Override
2459- public NewUserTableBuilder colText(String name) {
2460+ public NewTableBuilder colText(String name) {
2461 return colText(name, NULLABLE_DEFAULT);
2462 }
2463
2464 @Override
2465- public NewUserTableBuilder colText(String name, boolean nullable) {
2466- aisb.column(schema, userTable, name, uTableColumnPos++, "TEXT", null, null, nullable, false, null, null);
2467+ public NewTableBuilder colText(String name, boolean nullable) {
2468+ aisb.column(schema, table, name, uTableColumnPos++, "TEXT", null, null, nullable, false, null, null);
2469 return this;
2470 }
2471
2472 @Override
2473- public NewUserTableBuilder colDateTime (String name) {
2474+ public NewTableBuilder colDateTime (String name) {
2475 return colDateTime(name, NULLABLE_DEFAULT);
2476 }
2477
2478 @Override
2479- public NewUserTableBuilder colDateTime (String name, boolean nullable) {
2480- aisb.column(schema, userTable, name, uTableColumnPos++, "DATETIME", null, null, nullable, false, null, null);
2481+ public NewTableBuilder colDateTime (String name, boolean nullable) {
2482+ aisb.column(schema, table, name, uTableColumnPos++, "DATETIME", null, null, nullable, false, null, null);
2483 return this;
2484 }
2485
2486
2487 @Override
2488- public NewUserTableBuilder pk(String... columns) {
2489+ public NewTableBuilder pk(String... columns) {
2490 return key(PRIMARY, columns, true, Index.PRIMARY_KEY_CONSTRAINT);
2491 }
2492
2493 @Override
2494- public NewUserTableBuilder uniqueKey(String indexName, String... columns) {
2495+ public NewTableBuilder uniqueKey(String indexName, String... columns) {
2496 return key(indexName, columns, true, Index.UNIQUE_KEY_CONSTRAINT);
2497 }
2498
2499 @Override
2500- public NewUserTableBuilder key(String indexName, String... columns) {
2501+ public NewTableBuilder key(String indexName, String... columns) {
2502 return key(indexName, columns, false, Index.KEY_CONSTRAINT);
2503 }
2504
2505- private NewUserTableBuilder key(String indexName, String[] columns, boolean unique, String constraint) {
2506+ private NewTableBuilder key(String indexName, String[] columns, boolean unique, String constraint) {
2507 checkUsable();
2508- aisb.index(schema, userTable, indexName, unique, constraint);
2509+ aisb.index(schema, table, indexName, unique, constraint);
2510 for (int i=0; i < columns.length; ++i) {
2511- aisb.indexColumn(schema, userTable, indexName, columns[i], i, true, null);
2512+ aisb.indexColumn(schema, table, indexName, columns[i], i, true, null);
2513 }
2514 return this;
2515 }
2516@@ -379,7 +381,7 @@
2517
2518 @Override
2519 public NewAkibanJoinBuilder joinTo(String schema, String table) {
2520- String generated = "autogenerated_"+userTable+"_references_" + table;
2521+ String generated = "autogenerated_"+ this.table +"_references_" + table;
2522 return joinTo(schema, table, generated);
2523 }
2524
2525@@ -392,15 +394,15 @@
2526 this.referencesSchema = schema;
2527 this.referencesTable = table;
2528
2529- Group oldGroup = aisb.akibanInformationSchema().getUserTable(this.schema, this.userTable).getGroup();
2530+ Group oldGroup = aisb.akibanInformationSchema().getTable(this.schema, this.table).getGroup();
2531
2532- aisb.index(this.schema, this.userTable, fkIndexName, false, Index.FOREIGN_KEY_CONSTRAINT);
2533- aisb.joinTables(fkJoinName, schema, table, this.schema, this.userTable);
2534+ aisb.index(this.schema, this.table, fkIndexName, false, Index.FOREIGN_KEY_CONSTRAINT);
2535+ aisb.joinTables(fkJoinName, schema, table, this.schema, this.table);
2536
2537 TableName fkGroupName = tablesToGroups.get(TableName.create(referencesSchema, referencesTable));
2538- aisb.moveTreeToGroup(this.schema, this.userTable, fkGroupName, fkJoinName);
2539+ aisb.moveTreeToGroup(this.schema, this.table, fkGroupName, fkJoinName);
2540 aisb.akibanInformationSchema().removeGroup(oldGroup);
2541- TableName oldGroupName = tablesToGroups.put(TableName.create(this.schema, this.userTable), fkGroupName);
2542+ TableName oldGroupName = tablesToGroups.put(TableName.create(this.schema, this.table), fkGroupName);
2543 assert oldGroup.getName().equals(oldGroupName) : oldGroup.getName() + " != " + oldGroupName;
2544 return this;
2545 }
2546@@ -410,8 +412,8 @@
2547 @Override
2548 public NewAkibanJoinBuilder on(String childColumn, String parentColumn) {
2549 checkUsable();
2550- aisb.indexColumn(schema, userTable, fkIndexName, childColumn, fkIndexPos, true, null);
2551- aisb.joinColumns(fkJoinName, referencesSchema, referencesTable, parentColumn, schema, userTable, childColumn);
2552+ aisb.indexColumn(schema, table, fkIndexName, childColumn, fkIndexPos, true, null);
2553+ aisb.joinColumns(fkJoinName, referencesSchema, referencesTable, parentColumn, schema, table, childColumn);
2554 return this;
2555 }
2556
2557@@ -431,7 +433,7 @@
2558
2559 @Override
2560 public NewViewBuilder definition(String definition, Properties properties) {
2561- aisb.view(schema, userTable,
2562+ aisb.view(schema, table,
2563 definition, properties,
2564 new HashMap<TableName,Collection<String>>());
2565 return this;
2566@@ -445,7 +447,7 @@
2567 @Override
2568 public NewViewBuilder references(String schema, String table, String... columns) {
2569 checkUsable();
2570- View view = aisb.akibanInformationSchema().getView(this.schema, this.userTable);
2571+ View view = aisb.akibanInformationSchema().getView(this.schema, this.table);
2572 TableName tableName = TableName.create(schema, table);
2573 Collection<String> entry = view.getTableColumnReferences().get(tableName);
2574 if (entry == null) {
2575@@ -462,43 +464,43 @@
2576
2577 @Override
2578 public NewRoutineBuilder language(String language, Routine.CallingConvention callingConvention) {
2579- aisb.routine(schema, userTable, language, callingConvention);
2580+ aisb.routine(schema, table, language, callingConvention);
2581 return this;
2582 }
2583
2584 @Override
2585 public NewRoutineBuilder paramLongIn(String name) {
2586- aisb.parameter(schema, userTable, name, Parameter.Direction.IN, "BIGINT", null, null);
2587+ aisb.parameter(schema, table, name, Parameter.Direction.IN, "BIGINT", null, null);
2588 return this;
2589 }
2590
2591 @Override
2592 public NewRoutineBuilder paramStringIn(String name, int length) {
2593- aisb.parameter(schema, userTable, name, Parameter.Direction.IN, "VARCHAR", (long)length, null);
2594+ aisb.parameter(schema, table, name, Parameter.Direction.IN, "VARCHAR", (long)length, null);
2595 return this;
2596 }
2597
2598 @Override
2599 public NewRoutineBuilder paramDoubleIn(String name) {
2600- aisb.parameter(schema, userTable, name, Parameter.Direction.IN, "DOUBLE", null, null);
2601+ aisb.parameter(schema, table, name, Parameter.Direction.IN, "DOUBLE", null, null);
2602 return this;
2603 }
2604
2605 @Override
2606 public NewRoutineBuilder paramLongOut(String name) {
2607- aisb.parameter(schema, userTable, name, Parameter.Direction.OUT, "BIGINT", null, null);
2608+ aisb.parameter(schema, table, name, Parameter.Direction.OUT, "BIGINT", null, null);
2609 return this;
2610 }
2611
2612 @Override
2613 public NewRoutineBuilder paramStringOut(String name, int length) {
2614- aisb.parameter(schema, userTable, name, Parameter.Direction.OUT, "VARCHAR", (long)length, null);
2615+ aisb.parameter(schema, table, name, Parameter.Direction.OUT, "VARCHAR", (long)length, null);
2616 return this;
2617 }
2618
2619 @Override
2620 public NewRoutineBuilder paramDoubleOut(String name) {
2621- aisb.parameter(schema, userTable, name, Parameter.Direction.OUT, "DOUBLE", null, null);
2622+ aisb.parameter(schema, table, name, Parameter.Direction.OUT, "DOUBLE", null, null);
2623 return this;
2624 }
2625
2626@@ -521,7 +523,7 @@
2627 @Override
2628 public NewRoutineBuilder externalName(String jarSchema, String jarName,
2629 String className, String methodName) {
2630- aisb.routineExternalName(schema, userTable,
2631+ aisb.routineExternalName(schema, table,
2632 jarSchema, jarName,
2633 className, methodName);
2634 return this;
2635@@ -529,31 +531,31 @@
2636
2637 @Override
2638 public NewRoutineBuilder procDef(String definition) {
2639- aisb.routineDefinition(schema, userTable, definition);
2640+ aisb.routineDefinition(schema, table, definition);
2641 return this;
2642 }
2643
2644 @Override
2645 public NewRoutineBuilder sqlAllowed(Routine.SQLAllowed sqlAllowed) {
2646- aisb.routineSQLAllowed(schema, userTable, sqlAllowed);
2647+ aisb.routineSQLAllowed(schema, table, sqlAllowed);
2648 return this;
2649 }
2650
2651 @Override
2652 public NewRoutineBuilder dynamicResultSets(int dynamicResultSets) {
2653- aisb.routineDynamicResultSets(schema, userTable, dynamicResultSets);
2654+ aisb.routineDynamicResultSets(schema, table, dynamicResultSets);
2655 return this;
2656 }
2657
2658 @Override
2659 public NewRoutineBuilder deterministic(boolean deterministic) {
2660- aisb.routineDeterministic(schema, userTable, deterministic);
2661+ aisb.routineDeterministic(schema, table, deterministic);
2662 return this;
2663 }
2664
2665 @Override
2666 public NewRoutineBuilder calledOnNullInput(boolean calledOnNullInput) {
2667- aisb.routineCalledOnNullInput(schema, userTable, calledOnNullInput);
2668+ aisb.routineCalledOnNullInput(schema, table, calledOnNullInput);
2669 return this;
2670 }
2671
2672@@ -572,7 +574,7 @@
2673 }
2674 catch (MalformedURLException ex2) {
2675 // Report original failure.
2676- throw new InvalidSQLJJarURLException(schema, userTable, ex1);
2677+ throw new InvalidSQLJJarURLException(schema, table, ex1);
2678 }
2679 if (checkReadable && file.canRead())
2680 checkReadable = false; // Can tell quickly.
2681@@ -583,7 +585,7 @@
2682 istr = url.openStream(); // Must be able to load it.
2683 }
2684 catch (IOException ex) {
2685- throw new InvalidSQLJJarURLException(schema, userTable, ex);
2686+ throw new InvalidSQLJJarURLException(schema, table, ex);
2687 }
2688 finally {
2689 if (istr != null) {
2690@@ -595,7 +597,7 @@
2691 }
2692 }
2693 }
2694- aisb.sqljJar(schema, userTable, url);
2695+ aisb.sqljJar(schema, table, url);
2696 return this;
2697 }
2698
2699@@ -620,7 +622,7 @@
2700 private final AISBuilder aisb;
2701 private String defaultSchema;
2702 private String schema;
2703- private String userTable;
2704+ private String table;
2705
2706 private int uTableColumnPos;
2707
2708@@ -684,7 +686,7 @@
2709
2710 @Override
2711 public NewAISGroupIndexBuilder on(String schema, String table, String column) {
2712- UserTable userTable = aisb.akibanInformationSchema().getUserTable(schema, table);
2713+ Table userTable = aisb.akibanInformationSchema().getTable(schema, table);
2714 if (userTable == null) {
2715 throw new NoSuchElementException("no table " + schema + '.' + table);
2716 }
2717
2718=== modified file 'src/main/java/com/akiban/ais/model/aisb2/NewAISBuilder.java'
2719--- src/main/java/com/akiban/ais/model/aisb2/NewAISBuilder.java 2013-03-22 20:05:57 +0000
2720+++ src/main/java/com/akiban/ais/model/aisb2/NewAISBuilder.java 2013-05-28 23:28:27 +0000
2721@@ -32,7 +32,7 @@
2722 * @param table the table's name
2723 * @return the new table's builder
2724 */
2725- NewUserTableBuilder userTable(String table);
2726+ NewTableBuilder table(String table);
2727
2728 /**
2729 * Starts creating a new table using the given schema
2730@@ -40,16 +40,16 @@
2731 * @param table the new table's table name
2732 * @return the new table's builder
2733 */
2734- NewUserTableBuilder userTable(String schema, String table);
2735+ NewTableBuilder table(String schema, String table);
2736
2737- NewUserTableBuilder userTable(TableName tableName);
2738+ NewTableBuilder table(TableName tableName);
2739
2740 /**
2741- * Returns the NewUserTableBuilder for the table being built
2742+ * Returns the NewTableBuilder for the table being built
2743 * @return
2744 */
2745- NewUserTableBuilder getUserTable();
2746- NewUserTableBuilder getUserTable(TableName table);
2747+ NewTableBuilder getTable();
2748+ NewTableBuilder getTable(TableName table);
2749
2750 /**
2751 * create a new sequence
2752
2753=== modified file 'src/main/java/com/akiban/ais/model/aisb2/NewAkibanJoinBuilder.java'
2754--- src/main/java/com/akiban/ais/model/aisb2/NewAkibanJoinBuilder.java 2013-03-22 20:05:57 +0000
2755+++ src/main/java/com/akiban/ais/model/aisb2/NewAkibanJoinBuilder.java 2013-05-28 23:28:27 +0000
2756@@ -17,7 +17,7 @@
2757
2758 package com.akiban.ais.model.aisb2;
2759
2760-public interface NewAkibanJoinBuilder extends NewUserTableBuilder {
2761+public interface NewAkibanJoinBuilder extends NewTableBuilder {
2762 /**
2763 * Adds a child -&gt; parent column pair to this join.
2764 *
2765
2766=== renamed file 'src/main/java/com/akiban/ais/model/aisb2/NewUserTableBuilder.java' => 'src/main/java/com/akiban/ais/model/aisb2/NewTableBuilder.java'
2767--- src/main/java/com/akiban/ais/model/aisb2/NewUserTableBuilder.java 2013-04-12 21:41:19 +0000
2768+++ src/main/java/com/akiban/ais/model/aisb2/NewTableBuilder.java 2013-05-28 23:28:27 +0000
2769@@ -19,7 +19,7 @@
2770
2771 import com.akiban.ais.model.TableName;
2772
2773-public interface NewUserTableBuilder extends NewAISBuilder {
2774+public interface NewTableBuilder extends NewAISBuilder {
2775 /**
2776 * Joins this table to another one, using the default schema
2777 * @param table the table to join to
2778@@ -56,7 +56,7 @@
2779 * @param name the column's name
2780 * @return this
2781 */
2782- NewUserTableBuilder colLong(String name);
2783+ NewTableBuilder colLong(String name);
2784
2785 /**
2786 * Adds an optionally nullable Long column
2787@@ -64,7 +64,7 @@
2788 * @param nullable whether the column is nullable
2789 * @return this
2790 */
2791- NewUserTableBuilder colLong(String name, boolean nullable);
2792+ NewTableBuilder colLong(String name, boolean nullable);
2793
2794 /**
2795 * Adds a non-nullable, sequence backed, auto-incrementing BY DEFAULT identity column
2796@@ -72,7 +72,7 @@
2797 * @param initialValue the START WITH value
2798 * @return this
2799 */
2800- NewUserTableBuilder autoIncLong(String name, int initialValue);
2801+ NewTableBuilder autoIncLong(String name, int initialValue);
2802
2803 /**
2804 * Adds a non-nullable, sequence backed, auto-incrementing identity column
2805@@ -81,7 +81,7 @@
2806 * @param always ALWAYS if <code>true</code>, otherwise DEFAULT
2807 * @return this
2808 */
2809- NewUserTableBuilder autoIncLong(String name, int initialValue, boolean always);
2810+ NewTableBuilder autoIncLong(String name, int initialValue, boolean always);
2811
2812 /**
2813 * Adds an optionally nullable boolean column
2814@@ -89,7 +89,7 @@
2815 * @param nullable whether the column is nullable
2816 * @return this
2817 */
2818- NewUserTableBuilder colBoolean(String name, boolean nullable);
2819+ NewTableBuilder colBoolean(String name, boolean nullable);
2820
2821 /**
2822 * Adds a non-nullable varchar with UTF-8 encoding
2823@@ -97,7 +97,7 @@
2824 * @param length the varchar's max length
2825 * @return this
2826 */
2827- NewUserTableBuilder colString(String name, int length);
2828+ NewTableBuilder colString(String name, int length);
2829
2830 /**
2831 * Adds an optionally nullable varchar with UTF-8 encoding
2832@@ -106,7 +106,7 @@
2833 * @param nullable whether the column is nullable
2834 * @return this
2835 */
2836- NewUserTableBuilder colString(String name, int length, boolean nullable);
2837+ NewTableBuilder colString(String name, int length, boolean nullable);
2838
2839 /**
2840 * Adds an optionally nullable varchar with a specified encoding
2841@@ -116,32 +116,32 @@
2842 * @param charset the column's encoding
2843 * @return this
2844 */
2845- NewUserTableBuilder colString(String name, int length, boolean nullable, String charset);
2846-
2847- NewUserTableBuilder colDouble(String name);
2848- NewUserTableBuilder colDouble(String name, boolean nullable);
2849-
2850- NewUserTableBuilder colTimestamp(String name);
2851- NewUserTableBuilder colTimestamp(String name, boolean nullable);
2852-
2853- NewUserTableBuilder colBigInt(String name);
2854- NewUserTableBuilder colBigInt(String name, boolean nullable);
2855-
2856- NewUserTableBuilder colVarBinary(String name, int length);
2857- NewUserTableBuilder colVarBinary(String name, int length, boolean nullable);
2858-
2859- NewUserTableBuilder colText(String name);
2860- NewUserTableBuilder colText(String name, boolean nullable);
2861-
2862- NewUserTableBuilder colDateTime (String name);
2863- NewUserTableBuilder colDateTime (String name, boolean nullable);
2864+ NewTableBuilder colString(String name, int length, boolean nullable, String charset);
2865+
2866+ NewTableBuilder colDouble(String name);
2867+ NewTableBuilder colDouble(String name, boolean nullable);
2868+
2869+ NewTableBuilder colTimestamp(String name);
2870+ NewTableBuilder colTimestamp(String name, boolean nullable);
2871+
2872+ NewTableBuilder colBigInt(String name);
2873+ NewTableBuilder colBigInt(String name, boolean nullable);
2874+
2875+ NewTableBuilder colVarBinary(String name, int length);
2876+ NewTableBuilder colVarBinary(String name, int length, boolean nullable);
2877+
2878+ NewTableBuilder colText(String name);
2879+ NewTableBuilder colText(String name, boolean nullable);
2880+
2881+ NewTableBuilder colDateTime (String name);
2882+ NewTableBuilder colDateTime (String name, boolean nullable);
2883
2884 /**
2885 * Adds a PK
2886 * @param columns the columns that are in the PK
2887 * @return this
2888 */
2889- NewUserTableBuilder pk(String... columns);
2890+ NewTableBuilder pk(String... columns);
2891
2892 /**
2893 * Adds a unique key
2894@@ -149,7 +149,7 @@
2895 * @param columns the columns in the key
2896 * @return this
2897 */
2898- NewUserTableBuilder uniqueKey(String indexName, String... columns);
2899+ NewTableBuilder uniqueKey(String indexName, String... columns);
2900
2901 /**
2902 * Adds a non-unique key
2903@@ -157,5 +157,5 @@
2904 * @param columns the columns in the key
2905 * @return this
2906 */
2907- NewUserTableBuilder key(String indexName, String... columns);
2908+ NewTableBuilder key(String indexName, String... columns);
2909 }
2910
2911=== modified file 'src/main/java/com/akiban/ais/model/aisb2/NewViewBuilder.java'
2912--- src/main/java/com/akiban/ais/model/aisb2/NewViewBuilder.java 2013-03-22 20:05:57 +0000
2913+++ src/main/java/com/akiban/ais/model/aisb2/NewViewBuilder.java 2013-05-28 23:28:27 +0000
2914@@ -19,7 +19,7 @@
2915
2916 import java.util.Properties;
2917
2918-public interface NewViewBuilder extends NewUserTableBuilder {
2919+public interface NewViewBuilder extends NewTableBuilder {
2920 NewViewBuilder definition(String definition);
2921
2922 NewViewBuilder definition(String definition, Properties properties);
2923
2924=== modified file 'src/main/java/com/akiban/ais/model/staticgrouping/GroupsBuilder.java'
2925--- src/main/java/com/akiban/ais/model/staticgrouping/GroupsBuilder.java 2013-03-22 20:05:57 +0000
2926+++ src/main/java/com/akiban/ais/model/staticgrouping/GroupsBuilder.java 2013-05-28 23:28:27 +0000
2927@@ -28,7 +28,7 @@
2928 import com.akiban.ais.model.Join;
2929 import com.akiban.ais.model.JoinColumn;
2930 import com.akiban.ais.model.TableName;
2931-import com.akiban.ais.model.UserTable;
2932+import com.akiban.ais.model.Table;
2933
2934 public final class GroupsBuilder
2935 {
2936@@ -214,7 +214,7 @@
2937 public static Grouping fromAis(AkibanInformationSchema ais, String defaultSchema) {
2938 GroupsBuilder builder = new GroupsBuilder(defaultSchema);
2939
2940- for (UserTable uTable : ais.getUserTables().values()) {
2941+ for (Table uTable : ais.getTables().values()) {
2942 if (uTable.getGroup() == null) {
2943 continue;
2944 }
2945
2946=== modified file 'src/main/java/com/akiban/ais/model/validation/CharacterSetSupported.java'
2947--- src/main/java/com/akiban/ais/model/validation/CharacterSetSupported.java 2013-03-22 20:05:57 +0000
2948+++ src/main/java/com/akiban/ais/model/validation/CharacterSetSupported.java 2013-05-28 23:28:27 +0000
2949@@ -21,7 +21,7 @@
2950
2951 import com.akiban.ais.model.AkibanInformationSchema;
2952 import com.akiban.ais.model.Column;
2953-import com.akiban.ais.model.UserTable;
2954+import com.akiban.ais.model.Table;
2955 import com.akiban.server.error.UnsupportedCharsetException;
2956
2957 /**
2958@@ -34,7 +34,7 @@
2959
2960 @Override
2961 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
2962- for (UserTable table : ais.getUserTables().values()) {
2963+ for (Table table : ais.getTables().values()) {
2964 final String tableCharset = table.getCharsetAndCollation().charset();
2965 if (tableCharset != null && !Charset.isSupported(tableCharset)) {
2966 output.reportFailure(new AISValidationFailure (
2967
2968=== modified file 'src/main/java/com/akiban/ais/model/validation/CollationSupported.java'
2969--- src/main/java/com/akiban/ais/model/validation/CollationSupported.java 2013-03-22 20:05:57 +0000
2970+++ src/main/java/com/akiban/ais/model/validation/CollationSupported.java 2013-05-28 23:28:27 +0000
2971@@ -19,7 +19,7 @@
2972
2973 import com.akiban.ais.model.AkibanInformationSchema;
2974 import com.akiban.ais.model.Column;
2975-import com.akiban.ais.model.UserTable;
2976+import com.akiban.ais.model.Table;
2977 import com.akiban.server.collation.AkCollatorFactory;
2978 import com.akiban.server.collation.InvalidCollationException;
2979 import com.akiban.server.error.UnsupportedCollationException;
2980@@ -35,7 +35,7 @@
2981
2982 @Override
2983 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
2984- for (UserTable table : ais.getUserTables().values()) {
2985+ for (Table table : ais.getTables().values()) {
2986 for (Column column : table.getColumnsIncludingInternal()) {
2987 validateCollationByName(column.getCharsetAndCollation().collation(), table.getName().getSchemaName(),
2988 table.getName().getTableName(), column.getName(), output);
2989
2990=== modified file 'src/main/java/com/akiban/ais/model/validation/ColumnMaxAndPrefixSizesMatch.java'
2991--- src/main/java/com/akiban/ais/model/validation/ColumnMaxAndPrefixSizesMatch.java 2013-03-22 20:05:57 +0000
2992+++ src/main/java/com/akiban/ais/model/validation/ColumnMaxAndPrefixSizesMatch.java 2013-05-28 23:28:27 +0000
2993@@ -19,13 +19,13 @@
2994
2995 import com.akiban.ais.model.AkibanInformationSchema;
2996 import com.akiban.ais.model.Column;
2997-import com.akiban.ais.model.UserTable;
2998+import com.akiban.ais.model.Table;
2999 import com.akiban.server.error.ColumnSizeMismatchException;
3000
3001 public class ColumnMaxAndPrefixSizesMatch implements AISValidation {
3002 @Override
3003 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
3004- for(UserTable table : ais.getUserTables().values()) {
3005+ for(Table table : ais.getTables().values()) {
3006 for(Column column : table.getColumnsIncludingInternal()) {
3007 Long maxStorage = column.getMaxStorageSize();
3008 Long computedMaxStorage = column.computeMaxStorageSize();
3009
3010=== modified file 'src/main/java/com/akiban/ais/model/validation/ColumnPositionDense.java'
3011--- src/main/java/com/akiban/ais/model/validation/ColumnPositionDense.java 2013-03-22 20:05:57 +0000
3012+++ src/main/java/com/akiban/ais/model/validation/ColumnPositionDense.java 2013-05-28 23:28:27 +0000
3013@@ -25,7 +25,7 @@
3014
3015 @Override
3016 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
3017- for (Table table : ais.getUserTables().values()) {
3018+ for (Table table : ais.getTables().values()) {
3019 checkTable (table, output);
3020 }
3021 }
3022
3023=== modified file 'src/main/java/com/akiban/ais/model/validation/GroupSingleRoot.java'
3024--- src/main/java/com/akiban/ais/model/validation/GroupSingleRoot.java 2013-03-22 20:05:57 +0000
3025+++ src/main/java/com/akiban/ais/model/validation/GroupSingleRoot.java 2013-05-28 23:28:27 +0000
3026@@ -19,7 +19,7 @@
3027
3028 import com.akiban.ais.model.AkibanInformationSchema;
3029 import com.akiban.ais.model.Group;
3030-import com.akiban.ais.model.UserTable;
3031+import com.akiban.ais.model.Table;
3032 import com.akiban.server.error.GroupHasMultipleRootsException;
3033
3034 class GroupSingleRoot implements AISValidation {
3035@@ -32,14 +32,14 @@
3036 }
3037
3038 private void validateGroup (AkibanInformationSchema ais, Group group, AISValidationOutput output) {
3039- UserTable root = null;
3040- for (UserTable userTable : ais.getUserTables().values()) {
3041- if (userTable.getGroup() == group && userTable.isRoot()) {
3042+ Table root = null;
3043+ for (Table table : ais.getTables().values()) {
3044+ if (table.getGroup() == group && table.isRoot()) {
3045 if (root == null) {
3046- root = userTable;
3047+ root = table;
3048 } else {
3049 output.reportFailure(new AISValidationFailure (
3050- new GroupHasMultipleRootsException(group.getName(), root.getName(), userTable.getName())));
3051+ new GroupHasMultipleRootsException(group.getName(), root.getName(), table.getName())));
3052 }
3053 }
3054 }
3055
3056=== modified file 'src/main/java/com/akiban/ais/model/validation/GroupTreeNamesUnique.java'
3057--- src/main/java/com/akiban/ais/model/validation/GroupTreeNamesUnique.java 2013-03-22 20:05:57 +0000
3058+++ src/main/java/com/akiban/ais/model/validation/GroupTreeNamesUnique.java 2013-05-28 23:28:27 +0000
3059@@ -19,7 +19,7 @@
3060
3061 import com.akiban.ais.model.AkibanInformationSchema;
3062 import com.akiban.ais.model.Group;
3063-import com.akiban.ais.model.UserTable;
3064+import com.akiban.ais.model.Table;
3065 import com.akiban.server.error.DuplicateGroupTreeNamesException;
3066
3067 import java.util.HashMap;
3068@@ -35,8 +35,8 @@
3069 String treeName = group.getTreeName();
3070 Group curGroup = treeNameMap.put(treeName, group);
3071 if(curGroup != null) {
3072- UserTable root = group.getRoot();
3073- UserTable curRoot = curGroup.getRoot();
3074+ Table root = group.getRoot();
3075+ Table curRoot = curGroup.getRoot();
3076 output.reportFailure(
3077 new AISValidationFailure(
3078 new DuplicateGroupTreeNamesException(root.getName(), curRoot.getName(), treeName)));
3079
3080=== modified file 'src/main/java/com/akiban/ais/model/validation/IndexColumnIsNotPartial.java'
3081--- src/main/java/com/akiban/ais/model/validation/IndexColumnIsNotPartial.java 2013-03-22 20:05:57 +0000
3082+++ src/main/java/com/akiban/ais/model/validation/IndexColumnIsNotPartial.java 2013-05-28 23:28:27 +0000
3083@@ -20,7 +20,7 @@
3084 import com.akiban.ais.model.AkibanInformationSchema;
3085 import com.akiban.ais.model.Index;
3086 import com.akiban.ais.model.IndexColumn;
3087-import com.akiban.ais.model.UserTable;
3088+import com.akiban.ais.model.Table;
3089 import com.akiban.server.error.IndexColumnIsPartialException;
3090
3091 /**
3092@@ -30,7 +30,7 @@
3093 public class IndexColumnIsNotPartial implements AISValidation {
3094 @Override
3095 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
3096- for(UserTable table : ais.getUserTables().values()) {
3097+ for(Table table : ais.getTables().values()) {
3098 for(Index index : table.getIndexesIncludingInternal()) {
3099 for(IndexColumn indexColumn : index.getKeyColumns()) {
3100 if(indexColumn.getIndexedLength() != null) {
3101
3102=== modified file 'src/main/java/com/akiban/ais/model/validation/IndexHasColumns.java'
3103--- src/main/java/com/akiban/ais/model/validation/IndexHasColumns.java 2013-03-22 20:05:57 +0000
3104+++ src/main/java/com/akiban/ais/model/validation/IndexHasColumns.java 2013-05-28 23:28:27 +0000
3105@@ -19,14 +19,14 @@
3106
3107 import com.akiban.ais.model.AkibanInformationSchema;
3108 import com.akiban.ais.model.TableIndex;
3109-import com.akiban.ais.model.UserTable;
3110+import com.akiban.ais.model.Table;
3111 import com.akiban.server.error.IndexLacksColumnsException;
3112
3113 class IndexHasColumns implements AISValidation {
3114
3115 @Override
3116 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
3117- for (UserTable table : ais.getUserTables().values()) {
3118+ for (Table table : ais.getTables().values()) {
3119 for (TableIndex index : table.getIndexesIncludingInternal()) {
3120 if (index.getKeyColumns().size() == 0) {
3121 output.reportFailure(new AISValidationFailure (
3122
3123=== modified file 'src/main/java/com/akiban/ais/model/validation/IndexIDsPositive.java'
3124--- src/main/java/com/akiban/ais/model/validation/IndexIDsPositive.java 2013-03-22 20:05:57 +0000
3125+++ src/main/java/com/akiban/ais/model/validation/IndexIDsPositive.java 2013-05-28 23:28:27 +0000
3126@@ -20,7 +20,7 @@
3127 import com.akiban.ais.model.AkibanInformationSchema;
3128 import com.akiban.ais.model.Group;
3129 import com.akiban.ais.model.Index;
3130-import com.akiban.ais.model.UserTable;
3131+import com.akiban.ais.model.Table;
3132 import com.akiban.server.error.InvalidIndexIDException;
3133
3134 import java.util.Collection;
3135@@ -34,7 +34,7 @@
3136 public class IndexIDsPositive implements AISValidation {
3137 @Override
3138 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
3139- for(UserTable table : ais.getUserTables().values()) {
3140+ for(Table table : ais.getTables().values()) {
3141 checkIDs(table.getIndexesIncludingInternal(), output);
3142 }
3143 for(Group group : ais.getGroups().values()) {
3144
3145=== modified file 'src/main/java/com/akiban/ais/model/validation/IndexIDsUnique.java'
3146--- src/main/java/com/akiban/ais/model/validation/IndexIDsUnique.java 2013-03-22 20:05:57 +0000
3147+++ src/main/java/com/akiban/ais/model/validation/IndexIDsUnique.java 2013-05-28 23:28:27 +0000
3148@@ -20,7 +20,7 @@
3149 import com.akiban.ais.model.AkibanInformationSchema;
3150 import com.akiban.ais.model.Group;
3151 import com.akiban.ais.model.Index;
3152-import com.akiban.ais.model.UserTable;
3153+import com.akiban.ais.model.Table;
3154
3155 import com.akiban.server.error.DuplicateIndexIdException;
3156
3157@@ -32,7 +32,7 @@
3158 @Override
3159 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
3160 Map<Group, Map<Integer, Index>> byGroup = new HashMap<>();
3161- for (UserTable table : ais.getUserTables().values()) {
3162+ for (Table table : ais.getTables().values()) {
3163 for (Index index : table.getIndexesIncludingInternal()) {
3164 checkIndexID(byGroup, table.getGroup(), index, output);
3165 }
3166
3167=== modified file 'src/main/java/com/akiban/ais/model/validation/IndexSizes.java'
3168--- src/main/java/com/akiban/ais/model/validation/IndexSizes.java 2013-03-22 20:05:57 +0000
3169+++ src/main/java/com/akiban/ais/model/validation/IndexSizes.java 2013-05-28 23:28:27 +0000
3170@@ -27,7 +27,7 @@
3171 import com.akiban.ais.model.Index;
3172 import com.akiban.ais.model.IndexColumn;
3173 import com.akiban.ais.model.Type;
3174-import com.akiban.ais.model.UserTable;
3175+import com.akiban.ais.model.Table;
3176 import com.akiban.server.encoding.EncoderFactory;
3177 import com.akiban.server.error.JoinParentNoExplicitPK;
3178 import com.akiban.server.error.UnsupportedIndexPrefixException;
3179@@ -54,7 +54,7 @@
3180
3181 @Override
3182 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
3183- for (UserTable table : ais.getUserTables().values()) {
3184+ for (Table table : ais.getTables().values()) {
3185 long hkeySize = 0;
3186 if (table.getGroup() != null) {
3187 hkeySize = validateHKeySize (table, output);
3188@@ -114,7 +114,7 @@
3189 return EncoderFactory.valueOf(type.encoding(), type).getMaxKeyStorageSize(column);
3190 }
3191
3192- private long validateHKeySize (UserTable table, AISValidationOutput output) {
3193+ private long validateHKeySize (Table table, AISValidationOutput output) {
3194 long hkeySize = 0;
3195 HKey hkey;
3196 try {
3197
3198=== modified file 'src/main/java/com/akiban/ais/model/validation/IndexTreeNamesUnique.java'
3199--- src/main/java/com/akiban/ais/model/validation/IndexTreeNamesUnique.java 2013-03-22 20:05:57 +0000
3200+++ src/main/java/com/akiban/ais/model/validation/IndexTreeNamesUnique.java 2013-05-28 23:28:27 +0000
3201@@ -20,7 +20,7 @@
3202 import com.akiban.ais.model.AkibanInformationSchema;
3203 import com.akiban.ais.model.Group;
3204 import com.akiban.ais.model.Index;
3205-import com.akiban.ais.model.UserTable;
3206+import com.akiban.ais.model.Table;
3207 import com.akiban.server.error.DuplicateIndexTreeNamesException;
3208
3209 import java.util.Collection;
3210@@ -36,7 +36,7 @@
3211 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
3212 Map<String,Index> treeNameMap = new HashMap<>();
3213
3214- for(UserTable table : ais.getUserTables().values()) {
3215+ for(Table table : ais.getTables().values()) {
3216 checkIndexes(output, treeNameMap, table.getIndexesIncludingInternal());
3217 }
3218
3219
3220=== modified file 'src/main/java/com/akiban/ais/model/validation/JoinToOneParent.java'
3221--- src/main/java/com/akiban/ais/model/validation/JoinToOneParent.java 2013-03-22 20:05:57 +0000
3222+++ src/main/java/com/akiban/ais/model/validation/JoinToOneParent.java 2013-05-28 23:28:27 +0000
3223@@ -22,7 +22,7 @@
3224
3225 import com.akiban.ais.model.AkibanInformationSchema;
3226 import com.akiban.ais.model.Join;
3227-import com.akiban.ais.model.UserTable;
3228+import com.akiban.ais.model.Table;
3229 import com.akiban.server.error.JoinToMultipleParentsException;
3230
3231
3232@@ -35,7 +35,7 @@
3233
3234 @Override
3235 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
3236- Set<UserTable> childTables = new HashSet<>();
3237+ Set<Table> childTables = new HashSet<>();
3238
3239 for (Join join : ais.getJoins().values()) {
3240 if (childTables.contains(join.getChild())) {
3241
3242=== modified file 'src/main/java/com/akiban/ais/model/validation/MemoryTablesNotMixed.java'
3243--- src/main/java/com/akiban/ais/model/validation/MemoryTablesNotMixed.java 2013-03-22 20:05:57 +0000
3244+++ src/main/java/com/akiban/ais/model/validation/MemoryTablesNotMixed.java 2013-05-28 23:28:27 +0000
3245@@ -19,7 +19,7 @@
3246
3247 import com.akiban.ais.model.AkibanInformationSchema;
3248 import com.akiban.ais.model.Group;
3249-import com.akiban.ais.model.UserTable;
3250+import com.akiban.ais.model.Table;
3251 import com.akiban.server.error.GroupMixedTableTypes;
3252
3253 /**
3254@@ -37,16 +37,16 @@
3255 }
3256
3257 private static void validateGroup (AkibanInformationSchema ais, Group group, AISValidationOutput output) {
3258- UserTable rootTable = group.getRoot();
3259+ Table rootTable = group.getRoot();
3260 if(rootTable == null) {
3261 return; // Caught elsewhere
3262 }
3263 boolean rootMemoryTable = rootTable.hasMemoryTableFactory();
3264- for (UserTable userTable : ais.getUserTables().values()) {
3265- if (userTable.getGroup() == group &&
3266- userTable.hasMemoryTableFactory() != rootMemoryTable) {
3267+ for (Table table : ais.getTables().values()) {
3268+ if (table.getGroup() == group &&
3269+ table.hasMemoryTableFactory() != rootMemoryTable) {
3270 output.reportFailure(new AISValidationFailure (
3271- new GroupMixedTableTypes(group.getName(), rootMemoryTable, userTable.getName())));
3272+ new GroupMixedTableTypes(group.getName(), rootMemoryTable, table.getName())));
3273 }
3274 }
3275 }
3276
3277=== modified file 'src/main/java/com/akiban/ais/model/validation/PrimaryKeyIsNotNull.java'
3278--- src/main/java/com/akiban/ais/model/validation/PrimaryKeyIsNotNull.java 2013-03-22 20:05:57 +0000
3279+++ src/main/java/com/akiban/ais/model/validation/PrimaryKeyIsNotNull.java 2013-05-28 23:28:27 +0000
3280@@ -20,7 +20,7 @@
3281 import com.akiban.ais.model.AkibanInformationSchema;
3282 import com.akiban.ais.model.Column;
3283 import com.akiban.ais.model.PrimaryKey;
3284-import com.akiban.ais.model.UserTable;
3285+import com.akiban.ais.model.Table;
3286 import com.akiban.server.error.PrimaryKeyNullColumnException;
3287
3288 /**
3289@@ -34,7 +34,7 @@
3290
3291 @Override
3292 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
3293- for (UserTable table : ais.getUserTables().values()) {
3294+ for (Table table : ais.getTables().values()) {
3295 PrimaryKey index = table.getPrimaryKeyIncludingInternal();
3296 if(index == null) {
3297 continue; // Checked by TableHasPrimaryKey
3298
3299=== modified file 'src/main/java/com/akiban/ais/model/validation/ReferencesCorrect.java'
3300--- src/main/java/com/akiban/ais/model/validation/ReferencesCorrect.java 2013-03-22 20:05:57 +0000
3301+++ src/main/java/com/akiban/ais/model/validation/ReferencesCorrect.java 2013-05-28 23:28:27 +0000
3302@@ -27,7 +27,6 @@
3303 import com.akiban.ais.model.JoinColumn;
3304 import com.akiban.ais.model.Table;
3305 import com.akiban.ais.model.Type;
3306-import com.akiban.ais.model.UserTable;
3307 import com.akiban.ais.model.Visitor;
3308 import com.akiban.server.error.AISNullReferenceException;
3309 import com.akiban.server.error.BadAISInternalSettingException;
3310@@ -56,14 +55,11 @@
3311 }
3312
3313 @Override
3314- public void visitUserTable(UserTable userTable) {
3315- visitingTable = userTable;
3316- if (userTable == null) {
3317- output.reportFailure(new AISValidationFailure(
3318- new AISNullReferenceException ("ais", "", "user table")));
3319- } else if (userTable.isGroupTable()) {
3320- output.reportFailure(new AISValidationFailure(
3321- new BadAISInternalSettingException("User table", userTable.getName().toString(), "isGroupTable")));
3322+ public void visitTable(Table table) {
3323+ visitingTable = table;
3324+ if (table == null) {
3325+ output.reportFailure(new AISValidationFailure(
3326+ new AISNullReferenceException ("ais", "", "table")));
3327 }
3328 }
3329
3330@@ -71,7 +67,7 @@
3331 public void visitColumn(Column column) {
3332 if (column == null) {
3333 output.reportFailure(new AISValidationFailure(
3334- new AISNullReferenceException ("user table", visitingTable.getName().toString(), "column")));
3335+ new AISNullReferenceException ("table", visitingTable.getName().toString(), "column")));
3336 } else if (column.getTable() != visitingTable) {
3337 output.reportFailure(new AISValidationFailure(
3338 new BadAISReferenceException ("column", column.getName(), "table", visitingTable.getName().toString())));
3339
3340=== modified file 'src/main/java/com/akiban/ais/model/validation/SupportedColumnTypes.java'
3341--- src/main/java/com/akiban/ais/model/validation/SupportedColumnTypes.java 2013-03-22 20:05:57 +0000
3342+++ src/main/java/com/akiban/ais/model/validation/SupportedColumnTypes.java 2013-05-28 23:28:27 +0000
3343@@ -26,7 +26,7 @@
3344 import com.akiban.ais.model.JoinColumn;
3345 import com.akiban.ais.model.TableName;
3346 import com.akiban.ais.model.Type;
3347-import com.akiban.ais.model.UserTable;
3348+import com.akiban.ais.model.Table;
3349 import com.akiban.ais.model.Visitor;
3350 import com.akiban.server.error.UnsupportedDataTypeException;
3351 import com.akiban.server.error.UnsupportedIndexDataTypeException;
3352@@ -91,7 +91,7 @@
3353 }
3354
3355 @Override
3356- public void visitUserTable(UserTable userTable) {
3357+ public void visitTable(Table table) {
3358 }
3359 }
3360 }
3361
3362=== modified file 'src/main/java/com/akiban/ais/model/validation/TableHasPrimaryKey.java'
3363--- src/main/java/com/akiban/ais/model/validation/TableHasPrimaryKey.java 2013-03-22 20:05:57 +0000
3364+++ src/main/java/com/akiban/ais/model/validation/TableHasPrimaryKey.java 2013-05-28 23:28:27 +0000
3365@@ -18,14 +18,14 @@
3366 package com.akiban.ais.model.validation;
3367
3368 import com.akiban.ais.model.AkibanInformationSchema;
3369-import com.akiban.ais.model.UserTable;
3370+import com.akiban.ais.model.Table;
3371 import com.akiban.server.error.NoPrimaryKeyException;
3372
3373 class TableHasPrimaryKey implements AISValidation {
3374
3375 @Override
3376 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
3377- for (UserTable table : ais.getUserTables().values()) {
3378+ for (Table table : ais.getTables().values()) {
3379 if (table.getPrimaryKeyIncludingInternal() == null) {
3380 output.reportFailure(new AISValidationFailure (
3381 new NoPrimaryKeyException(table.getName())));
3382
3383=== modified file 'src/main/java/com/akiban/ais/model/validation/TableIDsUnique.java'
3384--- src/main/java/com/akiban/ais/model/validation/TableIDsUnique.java 2013-03-22 20:05:57 +0000
3385+++ src/main/java/com/akiban/ais/model/validation/TableIDsUnique.java 2013-05-28 23:28:27 +0000
3386@@ -23,14 +23,13 @@
3387 import com.akiban.ais.model.AkibanInformationSchema;
3388 import com.akiban.ais.model.Table;
3389 import com.akiban.ais.model.TableName;
3390-import com.akiban.ais.model.UserTable;
3391 import com.akiban.server.error.DuplicateTableIdException;
3392
3393 class TableIDsUnique implements AISValidation {
3394 @Override
3395 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
3396 final Map<Integer, Table> tableIDList= new TreeMap<>();
3397- for (UserTable table : ais.getUserTables().values()) {
3398+ for (Table table : ais.getTables().values()) {
3399 checkTableID (output, tableIDList, table);
3400 }
3401 }
3402
3403=== modified file 'src/main/java/com/akiban/ais/model/validation/TablesInAGroup.java'
3404--- src/main/java/com/akiban/ais/model/validation/TablesInAGroup.java 2013-03-22 20:05:57 +0000
3405+++ src/main/java/com/akiban/ais/model/validation/TablesInAGroup.java 2013-05-28 23:28:27 +0000
3406@@ -18,19 +18,19 @@
3407 package com.akiban.ais.model.validation;
3408
3409 import com.akiban.ais.model.AkibanInformationSchema;
3410-import com.akiban.ais.model.UserTable;
3411+import com.akiban.ais.model.Table;
3412 import com.akiban.server.error.TableNotInGroupException;
3413
3414 /**
3415 * Validates that all tables belong to a group,
3416- * All user tables should be in a group.
3417+ * All tables should be in a group.
3418 * @author tjoneslo
3419 */
3420 class TablesInAGroup implements AISValidation {
3421
3422 @Override
3423 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
3424- for (UserTable table : ais.getUserTables().values()) {
3425+ for (Table table : ais.getTables().values()) {
3426 if (table.getGroup() == null) {
3427 output.reportFailure(new AISValidationFailure (
3428 new TableNotInGroupException (table.getName())));
3429
3430=== modified file 'src/main/java/com/akiban/ais/model/validation/TreeNamesAreNotNull.java'
3431--- src/main/java/com/akiban/ais/model/validation/TreeNamesAreNotNull.java 2013-03-22 20:05:57 +0000
3432+++ src/main/java/com/akiban/ais/model/validation/TreeNamesAreNotNull.java 2013-05-28 23:28:27 +0000
3433@@ -23,7 +23,6 @@
3434 import com.akiban.ais.model.Sequence;
3435 import com.akiban.ais.model.Table;
3436 import com.akiban.ais.model.TableIndex;
3437-import com.akiban.ais.model.UserTable;
3438 import com.akiban.server.error.GroupTreeNameIsNullException;
3439 import com.akiban.server.error.IndexTreeNameIsNullException;
3440 import com.akiban.server.error.SequenceTreeNameIsNullException;
3441@@ -37,7 +36,7 @@
3442
3443 @Override
3444 public void validate(AkibanInformationSchema ais, AISValidationOutput output) {
3445- for(UserTable table : ais.getUserTables().values()) {
3446+ for(Table table : ais.getTables().values()) {
3447 checkTable(table);
3448 }
3449 for(Group group : ais.getGroups().values()) {
3450@@ -59,11 +58,7 @@
3451
3452 private static void checkTable(Table table) {
3453 final Collection<TableIndex> indexes;
3454- if(table.isUserTable()) {
3455- indexes = ((UserTable)table).getIndexesIncludingInternal();
3456- } else {
3457- indexes = table.getIndexes();
3458- }
3459+ indexes = table.getIndexesIncludingInternal();
3460 for(Index index : indexes) {
3461 checkIndex(index);
3462 }
3463
3464=== modified file 'src/main/java/com/akiban/ais/protobuf/ProtobufReader.java'
3465--- src/main/java/com/akiban/ais/protobuf/ProtobufReader.java 2013-05-24 21:45:54 +0000
3466+++ src/main/java/com/akiban/ais/protobuf/ProtobufReader.java 2013-05-28 23:28:27 +0000
3467@@ -169,10 +169,10 @@
3468
3469 for(NewGroupInfo newGroupInfo : newGroups) {
3470 String rootTableName = newGroupInfo.pbGroup.getRootTableName();
3471- UserTable rootUserTable = destAIS.getUserTable(newGroupInfo.schema, rootTableName);
3472- rootUserTable.setGroup(newGroupInfo.group);
3473- joinsNeedingGroup.addAll(rootUserTable.getCandidateChildJoins());
3474- newGroupInfo.group.setRootTable(rootUserTable);
3475+ Table rootTable = destAIS.getTable(newGroupInfo.schema, rootTableName);
3476+ rootTable.setGroup(newGroupInfo.group);
3477+ joinsNeedingGroup.addAll(rootTable.getCandidateChildJoins());
3478+ newGroupInfo.group.setRootTable(rootTable);
3479 }
3480
3481 for(int i = 0; i < joinsNeedingGroup.size(); ++i) {
3482@@ -193,14 +193,14 @@
3483 int generatedId = 1;
3484 for(AISProtobuf.Table pbTable : pbTables) {
3485 hasRequiredFields(pbTable);
3486- UserTable userTable = UserTable.create(
3487+ Table table = Table.create(
3488 destAIS,
3489 schema,
3490 pbTable.getTableName(),
3491 pbTable.hasTableId() ? pbTable.getTableId() : generatedId++
3492 );
3493 if(pbTable.hasOrdinal()) {
3494- userTable.setOrdinal(pbTable.getOrdinal());
3495+ table.setOrdinal(pbTable.getOrdinal());
3496 }
3497 UUID uuid;
3498 if (pbTable.hasUuid()) {
3499@@ -211,16 +211,16 @@
3500 AISProtobuf.Table.getDescriptor().getFullName(),
3501 "invalid UUID string: " + pbTable.getUuid());
3502 }
3503- userTable.setUuid(uuid);
3504+ table.setUuid(uuid);
3505 }
3506- userTable.setCharsetAndCollation(getCharColl(pbTable.hasCharColl(), pbTable.getCharColl()));
3507+ table.setCharsetAndCollation(getCharColl(pbTable.hasCharColl(), pbTable.getCharColl()));
3508 if(pbTable.hasVersion()) {
3509- userTable.setVersion(pbTable.getVersion());
3510+ table.setVersion(pbTable.getVersion());
3511 }
3512- loadColumns(userTable, pbTable.getColumnsList());
3513- loadTableIndexes(userTable, pbTable.getIndexesList());
3514+ loadColumns(table, pbTable.getColumnsList());
3515+ loadTableIndexes(table, pbTable.getIndexesList());
3516 if (pbTable.hasPendingOSC()) {
3517- userTable.setPendingOSC(loadPendingOSC(pbTable.getPendingOSC()));
3518+ table.setPendingOSC(loadPendingOSC(pbTable.getPendingOSC()));
3519 }
3520 }
3521 }
3522@@ -254,8 +254,8 @@
3523 hasRequiredFields(pbJoin);
3524 AISProtobuf.TableName pbParentName = pbJoin.getParentTable();
3525 hasRequiredFields(pbParentName);
3526- UserTable childTable = destAIS.getUserTable(schema, pbTable.getTableName());
3527- UserTable parentTable = destAIS.getUserTable(pbParentName.getSchemaName(), pbParentName.getTableName());
3528+ Table childTable = destAIS.getTable(schema, pbTable.getTableName());
3529+ Table parentTable = destAIS.getTable(pbParentName.getSchemaName(), pbParentName.getTableName());
3530
3531 if(parentTable == null) {
3532 throw new ProtobufReadException(
3533@@ -375,12 +375,12 @@
3534 }
3535 }
3536
3537- private void loadTableIndexes(UserTable userTable, Collection<AISProtobuf.Index> pbIndexes) {
3538+ private void loadTableIndexes(Table table, Collection<AISProtobuf.Index> pbIndexes) {
3539 for(AISProtobuf.Index pbIndex : pbIndexes) {
3540 hasRequiredFields(pbIndex);
3541 TableIndex tableIndex = TableIndex.create(
3542 destAIS,
3543- userTable,
3544+ table,
3545 pbIndex.getIndexName(),
3546 pbIndex.getIndexId(),
3547 pbIndex.getIsUnique(),
3548@@ -388,7 +388,7 @@
3549 );
3550 handleTreeName(tableIndex, pbIndex);
3551 handleSpatial(tableIndex, pbIndex);
3552- loadIndexColumns(userTable, tableIndex, pbIndex.getColumnsList());
3553+ loadIndexColumns(table, tableIndex, pbIndex.getColumnsList());
3554 }
3555 }
3556
3557@@ -414,16 +414,16 @@
3558 for(AISProtobuf.Table pbTable : pbTables) {
3559 for(AISProtobuf.Index pbIndex : pbTable.getFullTextIndexesList()) {
3560 hasRequiredFields(pbIndex);
3561- UserTable userTable = destAIS.getUserTable(schema, pbTable.getTableName());
3562+ Table table = destAIS.getTable(schema, pbTable.getTableName());
3563 FullTextIndex textIndex = FullTextIndex.create(
3564 destAIS,
3565- userTable,
3566+ table,
3567 pbIndex.getIndexName(),
3568 pbIndex.getIndexId()
3569 );
3570 handleTreeName(textIndex, pbIndex);
3571 handleSpatial(textIndex, pbIndex);
3572- loadIndexColumns(userTable, textIndex, pbIndex.getColumnsList());
3573+ loadIndexColumns(table, textIndex, pbIndex.getColumnsList());
3574 }
3575 }
3576 }
3577@@ -451,12 +451,12 @@
3578 }
3579 }
3580
3581- private void loadIndexColumns(UserTable table, Index index, Collection<AISProtobuf.IndexColumn> pbIndexColumns) {
3582+ private void loadIndexColumns(Table table, Index index, Collection<AISProtobuf.IndexColumn> pbIndexColumns) {
3583 for(AISProtobuf.IndexColumn pbIndexColumn : pbIndexColumns) {
3584 hasRequiredFields(pbIndexColumn);
3585 if(pbIndexColumn.hasTableName()) {
3586 hasRequiredFields(pbIndexColumn.getTableName());
3587- table = destAIS.getUserTable(convertTableNameOrNull(true, pbIndexColumn.getTableName()));
3588+ table = destAIS.getTable(convertTableNameOrNull(true, pbIndexColumn.getTableName()));
3589 }
3590 Integer indexedLength = null;
3591 if(pbIndexColumn.hasIndexedLength()) {
3592
3593=== modified file 'src/main/java/com/akiban/ais/protobuf/ProtobufWriter.java'
3594--- src/main/java/com/akiban/ais/protobuf/ProtobufWriter.java 2013-05-24 21:45:54 +0000
3595+++ src/main/java/com/akiban/ais/protobuf/ProtobufWriter.java 2013-05-28 23:28:27 +0000
3596@@ -33,9 +33,9 @@
3597 public static interface WriteSelector {
3598 Columnar getSelected(Columnar columnar);
3599 boolean isSelected(Group group);
3600- /** Called for all parent joins where getSelected(UserTable) is not null **/
3601+ /** Called for all parent joins where getSelected(Table) is not null **/
3602 boolean isSelected(Join parentJoin);
3603- /** Called for all GroupIndexes and all table indexes where getSelected(UserTable) is not null **/
3604+ /** Called for all GroupIndexes and all table indexes where getSelected(Table) is not null **/
3605 boolean isSelected(Index index);
3606 boolean isSelected(Sequence sequence);
3607 boolean isSelected(Routine routine);
3608@@ -258,8 +258,8 @@
3609 boolean isEmpty = true;
3610
3611 // Write groups into same schema as root table
3612- for(UserTable table : schema.getUserTables().values()) {
3613- table = (UserTable)selector.getSelected(table);
3614+ for(Table table : schema.getTables().values()) {
3615+ table = (Table)selector.getSelected(table);
3616 if(table != null) {
3617 Group group = table.getGroup();
3618 if((table.getParentJoin() == null) && (group != null) && selector.isSelected(group)) {
3619@@ -305,7 +305,7 @@
3620 }
3621
3622 private static void writeGroup(AISProtobuf.Schema.Builder schemaBuilder, Group group, WriteSelector selector) {
3623- final UserTable rootTable = group.getRoot();
3624+ final Table rootTable = group.getRoot();
3625 AISProtobuf.Group.Builder groupBuilder = AISProtobuf.Group.newBuilder().
3626 setRootTableName(rootTable.getName().getTableName());
3627 if(group.getTreeName() != null) {
3628@@ -321,7 +321,7 @@
3629 schemaBuilder.addGroups(groupBuilder.build());
3630 }
3631
3632- private static void writeTable(AISProtobuf.Schema.Builder schemaBuilder, UserTable table, WriteSelector selector) {
3633+ private static void writeTable(AISProtobuf.Schema.Builder schemaBuilder, Table table, WriteSelector selector) {
3634 AISProtobuf.Table.Builder tableBuilder = AISProtobuf.Table.newBuilder();
3635 tableBuilder.
3636 setTableName(table.getName().getTableName()).
3637@@ -353,7 +353,7 @@
3638
3639 Join join = table.getParentJoin();
3640 if((join != null) && selector.isSelected(join)) {
3641- final UserTable parent = join.getParent();
3642+ final Table parent = join.getParent();
3643 AISProtobuf.Join.Builder joinBuilder = AISProtobuf.Join.newBuilder();
3644 joinBuilder.setParentTable(AISProtobuf.TableName.newBuilder().
3645 setSchemaName(parent.getName().getSchemaName()).
3646
3647=== modified file 'src/main/java/com/akiban/ais/util/AISPrinter.java'
3648--- src/main/java/com/akiban/ais/util/AISPrinter.java 2013-03-22 20:05:57 +0000
3649+++ src/main/java/com/akiban/ais/util/AISPrinter.java 2013-05-28 23:28:27 +0000
3650@@ -29,7 +29,7 @@
3651 import com.akiban.ais.model.Join;
3652 import com.akiban.ais.model.JoinColumn;
3653 import com.akiban.ais.model.Type;
3654-import com.akiban.ais.model.UserTable;
3655+import com.akiban.ais.model.Table;
3656 import com.akiban.ais.model.Visitor;
3657
3658 public class AISPrinter
3659@@ -75,9 +75,9 @@
3660 }
3661
3662 @Override
3663- public void visitUserTable(UserTable userTable)
3664+ public void visitTable(Table table)
3665 {
3666- output.println(userTable);
3667+ output.println(table);
3668 }
3669
3670 @Override
3671
3672=== modified file 'src/main/java/com/akiban/ais/util/ChangedTableDescription.java'
3673--- src/main/java/com/akiban/ais/util/ChangedTableDescription.java 2013-05-28 21:18:45 +0000
3674+++ src/main/java/com/akiban/ais/util/ChangedTableDescription.java 2013-05-28 23:28:27 +0000
3675@@ -18,7 +18,7 @@
3676 package com.akiban.ais.util;
3677
3678 import com.akiban.ais.model.TableName;
3679-import com.akiban.ais.model.UserTable;
3680+import com.akiban.ais.model.Table;
3681 import com.akiban.util.ArgumentValidation;
3682
3683 import java.util.Collection;
3684@@ -42,7 +42,7 @@
3685 }
3686
3687 private final TableName tableName;
3688- private final UserTable newDefinition;
3689+ private final Table newDefinition;
3690 private final Map<String,String> colNames;
3691 private final ParentChange parentChange;
3692 private final TableName parentName;
3693@@ -56,7 +56,7 @@
3694 * @param newDefinition New definition of the table.
3695 * @param preserveIndexes Mapping of new index names to old.
3696 */
3697- public ChangedTableDescription(TableName tableName, UserTable newDefinition, Map<String,String> colNames,
3698+ public ChangedTableDescription(TableName tableName, Table newDefinition, Map<String,String> colNames,
3699 ParentChange parentChange, TableName parentName, Map<String,String> parentColNames,
3700 Map<String, String> preserveIndexes, Collection<TableName> droppedSequences,
3701 Collection<String> identityAdded) {
3702@@ -81,7 +81,7 @@
3703 return (newDefinition != null) ? newDefinition.getName() : tableName;
3704 }
3705
3706- public UserTable getNewDefinition() {
3707+ public Table getNewDefinition() {
3708 return newDefinition;
3709 }
3710
3711
3712=== modified file 'src/main/java/com/akiban/ais/util/DDLGenerator.java'
3713--- src/main/java/com/akiban/ais/util/DDLGenerator.java 2013-03-22 20:05:57 +0000
3714+++ src/main/java/com/akiban/ais/util/DDLGenerator.java 2013-05-28 23:28:27 +0000
3715@@ -30,7 +30,6 @@
3716 import com.akiban.ais.model.Type;
3717 import com.akiban.ais.model.Join;
3718 import com.akiban.ais.model.Types;
3719-import com.akiban.ais.model.UserTable;
3720
3721 public class DDLGenerator
3722 {
3723@@ -159,8 +158,8 @@
3724 columnDecls.add(declaration(indexColumn));
3725 }
3726
3727- if(index.getConstraint().equals("FOREIGN KEY") && index.getTable().isUserTable()) {
3728- Join join = ((UserTable)index.getTable()).getParentJoin();
3729+ if(index.getConstraint().equals("FOREIGN KEY")) {
3730+ Join join = (index.getTable()).getParentJoin();
3731
3732 if(join == null) {
3733 return new String("");
3734@@ -197,9 +196,6 @@
3735
3736 private String tableOptions(Table table) {
3737 StringBuilder tableOptions = new StringBuilder();
3738- final String engine = table.getEngine() != null ? table.getEngine() : "akibandb";
3739- tableOptions.append(" engine=");
3740- tableOptions.append(engine);
3741 final CharsetAndCollation charAndCol = table.getCharsetAndCollation();
3742 tableOptions.append(" DEFAULT CHARSET=");
3743 tableOptions.append(charAndCol.charset());
3744
3745=== modified file 'src/main/java/com/akiban/ais/util/TableChangeValidator.java'
3746--- src/main/java/com/akiban/ais/util/TableChangeValidator.java 2013-05-28 21:18:45 +0000
3747+++ src/main/java/com/akiban/ais/util/TableChangeValidator.java 2013-05-28 23:28:27 +0000
3748@@ -28,7 +28,7 @@
3749 import com.akiban.ais.model.Sequence;
3750 import com.akiban.ais.model.TableIndex;
3751 import com.akiban.ais.model.TableName;
3752-import com.akiban.ais.model.UserTable;
3753+import com.akiban.ais.model.Table;
3754 import com.akiban.server.types3.Types3Switch;
3755 import com.akiban.util.ArgumentValidation;
3756 import com.akiban.util.MultipleCauseException;
3757@@ -77,8 +77,8 @@
3758 }
3759 }
3760
3761- private final UserTable oldTable;
3762- private final UserTable newTable;
3763+ private final Table oldTable;
3764+ private final Table newTable;
3765 private final List<TableChange> columnChanges;
3766 private final List<TableChange> indexChanges;
3767 private final List<RuntimeException> errors;
3768@@ -91,7 +91,7 @@
3769 private boolean primaryKeyChanged;
3770 private boolean didCompare;
3771
3772- public TableChangeValidator(UserTable oldTable, UserTable newTable,
3773+ public TableChangeValidator(Table oldTable, Table newTable,
3774 List<TableChange> columnChanges, List<TableChange> indexChanges,
3775 boolean automaticIndexChanges) {
3776 ArgumentValidation.notNull("oldTable", oldTable);
3777@@ -229,8 +229,8 @@
3778 }
3779
3780 private void compareGroupIndexes() {
3781- final Set<UserTable> keepTables = new HashSet<>();
3782- final UserTable traverseStart;
3783+ final Set<Table> keepTables = new HashSet<>();
3784+ final Table traverseStart;
3785 if(parentChange == ParentChange.DROP) {
3786 traverseStart = oldTable;
3787 } else {
3788@@ -239,7 +239,7 @@
3789
3790 traverseStart.traverseTableAndDescendants(new NopVisitor() {
3791 @Override
3792- public void visitUserTable(UserTable table) {
3793+ public void visitTable(Table table) {
3794 keepTables.add(table);
3795 }
3796 });
3797@@ -249,7 +249,7 @@
3798 List<TableColumnNames> remainingCols = new ArrayList<>();
3799 for(IndexColumn iCol : index.getKeyColumns()) {
3800 Column column = iCol.getColumn();
3801- if(!keepTables.contains(column.getUserTable())) {
3802+ if(!keepTables.contains(column.getTable())) {
3803 remainingCols.clear();
3804 break;
3805 }
3806@@ -443,7 +443,7 @@
3807
3808 Collection<Join> oldChildJoins = new ArrayList<>(oldTable.getCandidateChildJoins());
3809 for(Join join : oldChildJoins) {
3810- UserTable oldChildTable = join.getChild();
3811+ Table oldChildTable = join.getChild();
3812
3813 // If referenced column has anymore has a TABLE change (or is missing), join needs dropped
3814 boolean dropParent = false;
3815@@ -488,10 +488,10 @@
3816 }
3817 }
3818
3819- private void propagateChildChange(final UserTable table, final ParentChange change, final boolean allIndexes) {
3820+ private void propagateChildChange(final Table table, final ParentChange change, final boolean allIndexes) {
3821 table.traverseTableAndDescendants(new NopVisitor() {
3822 @Override
3823- public void visitUserTable(UserTable curTable) {
3824+ public void visitTable(Table curTable) {
3825 if(table != curTable) {
3826 TableName parentName = curTable.getParentJoin().getParent().getName();
3827 trackChangedTable(curTable, change, parentName, null, allIndexes);
3828@@ -500,7 +500,7 @@
3829 });
3830 }
3831
3832- private void trackChangedTable(UserTable table, ParentChange parentChange, TableName parentName,
3833+ private void trackChangedTable(Table table, ParentChange parentChange, TableName parentName,
3834 Map<String, String> parentRenames, boolean doPreserve) {
3835 Map<String,String> preserved = new HashMap<>();
3836 if(doPreserve) {
3837@@ -634,8 +634,8 @@
3838 return ParentChange.ADD;
3839 }
3840
3841- UserTable oldParent = oldJoin.getParent();
3842- UserTable newParent = newJoin.getParent();
3843+ Table oldParent = oldJoin.getParent();
3844+ Table newParent = newJoin.getParent();
3845 if(!oldParent.getName().equals(newParent.getName()) ||
3846 (oldJoin.getJoinColumns().size() != newJoin.getJoinColumns().size())) {
3847 return ParentChange.ADD;
3848
3849=== modified file 'src/main/java/com/akiban/ais/util/UuidAssigner.java'
3850--- src/main/java/com/akiban/ais/util/UuidAssigner.java 2013-03-22 20:05:57 +0000
3851+++ src/main/java/com/akiban/ais/util/UuidAssigner.java 2013-05-28 23:28:27 +0000
3852@@ -19,17 +19,17 @@
3853
3854 import com.akiban.ais.model.Column;
3855 import com.akiban.ais.model.NopVisitor;
3856-import com.akiban.ais.model.UserTable;
3857+import com.akiban.ais.model.Table;
3858
3859 import java.util.UUID;
3860
3861 public class UuidAssigner extends NopVisitor {
3862
3863 @Override
3864- public void visitUserTable(UserTable userTable) {
3865- if (userTable.getUuid() == null) {
3866+ public void visitTable(Table table) {
3867+ if (table.getUuid() == null) {
3868 assignedAny = true;
3869- userTable.setUuid(UUID.randomUUID());
3870+ table.setUuid(UUID.randomUUID());
3871 }
3872 }
3873
3874
3875=== modified file 'src/main/java/com/akiban/direct/ClassBuilder.java'
3876--- src/main/java/com/akiban/direct/ClassBuilder.java 2013-04-24 15:50:16 +0000
3877+++ src/main/java/com/akiban/direct/ClassBuilder.java 2013-05-28 23:28:27 +0000
3878@@ -35,7 +35,7 @@
3879 import com.akiban.ais.model.PrimaryKey;
3880 import com.akiban.ais.model.Schema;
3881 import com.akiban.ais.model.TableName;
3882-import com.akiban.ais.model.UserTable;
3883+import com.akiban.ais.model.Table;
3884 import com.akiban.server.error.NoSuchTableException;
3885 import com.akiban.server.types.AkType;
3886 import com.sun.jersey.core.impl.provider.entity.Inflector;
3887@@ -118,7 +118,7 @@
3888 Map<Integer, CtClass> implClassMap = new TreeMap<Integer, CtClass>();
3889
3890 helper.startClass(scn, true, null, null, IMPORTS);
3891- for (final UserTable table : ais.getSchema(schema).getUserTables().values()) {
3892+ for (final Table table : ais.getSchema(schema).getTables().values()) {
3893 if (table.isRoot()) {
3894 helper.addExtentAccessor(table, scn, true);
3895 }
3896@@ -132,7 +132,7 @@
3897 * Precompile the implementation classes
3898 */
3899
3900- for (final UserTable table : ais.getSchema(schema).getUserTables().values()) {
3901+ for (final Table table : ais.getSchema(schema).getTables().values()) {
3902 helper.generateImplementationClass(table, schema);
3903 implClassMap.put(table.getTableId(), helper.getCurrentClass());
3904 }
3905@@ -140,7 +140,7 @@
3906 * Precompile the extent class
3907 */
3908 helper.startExtentClass(schema, scn);
3909- for (final UserTable table : ais.getSchema(schema).getUserTables().values()) {
3910+ for (final Table table : ais.getSchema(schema).getTables().values()) {
3911 if (table.isRoot()) {
3912 helper.addExtentAccessor(table, scn, false);
3913 }
3914@@ -157,14 +157,14 @@
3915 String scn = schemaClassName(schema);
3916 startClass(scn, true, null, null, IMPORTS);
3917 if ("*".equals(tableName.getTableName())) {
3918- for (final UserTable table : ais.getSchema(schema).getUserTables().values()) {
3919+ for (final Table table : ais.getSchema(schema).getTables().values()) {
3920 if (table.isRoot()) {
3921 addExtentAccessor(table, scn, true);
3922 }
3923 generateInterfaceClass(table, scn);
3924 }
3925 } else {
3926- final UserTable table = ais.getUserTable(tableName);
3927+ final Table table = ais.getTable(tableName);
3928 if (table == null) {
3929 throw new NoSuchTableException(tableName);
3930 }
3931@@ -180,12 +180,12 @@
3932 throws CannotCompileException, NotFoundException {
3933 if ("*".equals(tableName.getTableName())) {
3934 Schema schema = ais.getSchema(tableName.getSchemaName());
3935- for (final UserTable table : schema.getUserTables().values()) {
3936+ for (final Table table : schema.getTables().values()) {
3937 generateImplementationClass(table, tableName.getSchemaName());
3938 }
3939 String scn = schemaClassName(tableName.getSchemaName());
3940 startExtentClass(tableName.getSchemaName(), scn);
3941- for (final UserTable table : schema.getUserTables().values()) {
3942+ for (final Table table : schema.getTables().values()) {
3943 if (table.isRoot()) {
3944 addExtentAccessor(table, scn, false);
3945 }
3946@@ -193,7 +193,7 @@
3947 end();
3948
3949 } else {
3950- UserTable table = ais.getUserTable(tableName);
3951+ Table table = ais.getTable(tableName);
3952 if (table == null) {
3953 throw new NoSuchTableException(tableName);
3954 }
3955@@ -206,11 +206,11 @@
3956 final String schema = tableName.getSchemaName();
3957 String scn = schemaClassName(schema);
3958 if ("*".equals(tableName.getTableName())) {
3959- for (final UserTable table : ais.getSchema(schema).getUserTables().values()) {
3960+ for (final Table table : ais.getSchema(schema).getTables().values()) {
3961 generateInterfaceClass(table, scn);
3962 }
3963 startClass("$$$extent$$$", true, null, null, null);
3964- for (final UserTable table : ais.getSchema(schema).getUserTables().values()) {
3965+ for (final Table table : ais.getSchema(schema).getTables().values()) {
3966 if (table.isRoot()) {
3967 addExtentAccessor(table, scn, false);
3968 }
3969@@ -218,7 +218,7 @@
3970 end();
3971
3972 } else {
3973- final UserTable table = ais.getUserTable(tableName);
3974+ final Table table = ais.getTable(tableName);
3975 if (table == null) {
3976 throw new NoSuchTableException(tableName);
3977 }
3978@@ -226,7 +226,7 @@
3979 }
3980 }
3981
3982- void generateInterfaceClass(UserTable table, String scn) throws CannotCompileException, NotFoundException {
3983+ void generateInterfaceClass(Table table, String scn) throws CannotCompileException, NotFoundException {
3984 table.getName().getTableName();
3985 String typeName = scn + "$" + asJavaName(table.getName().getTableName(), true);
3986 startClass(typeName, true, null, null, null);
3987@@ -235,7 +235,7 @@
3988 end();
3989 }
3990
3991- void generateImplementationClass(UserTable table, String schemaName) throws CannotCompileException,
3992+ void generateImplementationClass(Table table, String schemaName) throws CannotCompileException,
3993 NotFoundException {
3994 table.getName().getTableName();
3995 String scn = schemaClassName(schemaName);
3996@@ -254,7 +254,7 @@
3997 addStaticInitializer(null);
3998 }
3999
4000- void addExtentAccessor(UserTable table, String scn, boolean iface) {
4001+ void addExtentAccessor(Table table, String scn, boolean iface) {
4002 String tableName = table.getName().getTableName();
4003 String className = scn + "$" + asJavaName(tableName, true);
4004
4005@@ -293,7 +293,7 @@
4006 }
4007 }
4008
4009- private void addMethods(UserTable table, String scn, String typeName, String className, boolean iface) {
4010+ private void addMethods(Table table, String scn, String typeName, String className, boolean iface) {
4011 /*
4012 * Add a property per column
4013 */
4014@@ -314,7 +314,7 @@
4015 */
4016 Join parentJoin = table.getParentJoin();
4017 if (parentJoin != null) {
4018- UserTable parentTable = parentJoin.getParent();
4019+ Table parentTable = parentJoin.getParent();
4020 String parentTableName = parentTable.getName().getTableName();
4021 String parentClassName = scn + "$" + asJavaName(parentTableName, true);
4022 String[] body = null;
4023@@ -393,7 +393,7 @@
4024 * will give the base class metadata about the columns.
4025 */
4026 @SuppressWarnings("unchecked")
4027- private String columnMetadataString(final UserTable table) {
4028+ private String columnMetadataString(final Table table) {
4029 String[] columnArray = new String[table == null ? 0 : table.getColumns().size()];
4030 if (table != null) {
4031 PrimaryKey pk = table.getPrimaryKey();
4032@@ -490,7 +490,7 @@
4033
4034 }
4035
4036- private String buildDirectIterableExpr(final String className, final UserTable table) {
4037+ private String buildDirectIterableExpr(final String className, final Table table) {
4038 return String.format("(new com.akiban.direct.DirectIterableImpl" + "(%s.class, \"%s\", this))",
4039 className, table.getName().getTableName());
4040 }
4041
4042=== modified file 'src/main/java/com/akiban/qp/loadableplan/std/DumpGroupLoadablePlan.java'
4043--- src/main/java/com/akiban/qp/loadableplan/std/DumpGroupLoadablePlan.java 2013-03-22 20:05:57 +0000
4044+++ src/main/java/com/akiban/qp/loadableplan/std/DumpGroupLoadablePlan.java 2013-05-28 23:28:27 +0000
4045@@ -18,7 +18,7 @@
4046 package com.akiban.qp.loadableplan.std;
4047
4048 import com.akiban.ais.model.TableName;
4049-import com.akiban.ais.model.UserTable;
4050+import com.akiban.ais.model.Table;
4051 import com.akiban.qp.loadableplan.DirectObjectCursor;
4052 import com.akiban.qp.loadableplan.DirectObjectPlan;
4053 import com.akiban.qp.loadableplan.LoadableDirectObjectPlan;
4054@@ -65,9 +65,9 @@
4055
4056 public static class DumpGroupDirectObjectCursor extends DirectObjectCursor {
4057 private final QueryContext context;
4058- private UserTable rootTable;
4059+ private Table rootTable;
4060 private Cursor cursor;
4061- private Map<UserTable,Integer> tableSizes;
4062+ private Map<Table,Integer> tableSizes;
4063 private StringBuilder buffer;
4064 private GroupRowFormatter formatter;
4065 private int messagesSent;
4066@@ -95,7 +95,7 @@
4067 tableName = context.getValue(1).getString();
4068 }
4069 rootTable = context.getStore().schema().ais()
4070- .getUserTable(schemaName, tableName);
4071+ .getTable(schemaName, tableName);
4072 if (rootTable == null)
4073 throw new NoSuchTableException(schemaName, tableName);
4074 cursor = context.getStore(rootTable)
4075@@ -132,7 +132,7 @@
4076 break;
4077 }
4078 RowType rowType = row.rowType();
4079- UserTable rowTable = rowType.userTable();
4080+ Table rowTable = rowType.table();
4081 int size = tableSize(rowTable);
4082 if (size < 0)
4083 continue;
4084@@ -163,7 +163,7 @@
4085 }
4086 }
4087
4088- private int tableSize(UserTable table) {
4089+ private int tableSize(Table table) {
4090 Integer size = tableSizes.get(table);
4091 if (size == null) {
4092 if (table.isDescendantOf(rootTable))
4093@@ -191,7 +191,7 @@
4094 }
4095
4096 public static class SQLRowFormatter extends GroupRowFormatter {
4097- private Map<UserTable,String> tableNames = new HashMap<>();
4098+ private Map<Table,String> tableNames = new HashMap<>();
4099 private int maxRowCount;
4100 private SqlLiteralValueFormatter literalFormatter;
4101 private AkibanAppender appender;
4102@@ -224,7 +224,7 @@
4103 flush();
4104 int pos = buffer.length();
4105 buffer.append("INSERT INTO ");
4106- buffer.append(tableName(rowType.userTable()));
4107+ buffer.append(tableName(rowType.table()));
4108 buffer.append(" VALUES");
4109 insertWidth = buffer.length() - pos;
4110 lastRowType = rowType;
4111@@ -252,7 +252,7 @@
4112 }
4113 }
4114
4115- protected String tableName(UserTable table) {
4116+ protected String tableName(Table table) {
4117 String name = tableNames.get(table);
4118 if (name == null) {
4119 TableName tableName = table.getName();
4120
4121=== modified file 'src/main/java/com/akiban/qp/memoryadapter/BasicFactoryBase.java'
4122--- src/main/java/com/akiban/qp/memoryadapter/BasicFactoryBase.java 2013-03-22 20:05:57 +0000
4123+++ src/main/java/com/akiban/qp/memoryadapter/BasicFactoryBase.java 2013-05-28 23:28:27 +0000
4124@@ -52,7 +52,7 @@
4125 }
4126
4127 public RowType getRowType(MemoryAdapter adapter) {
4128- return adapter.schema().userTableRowType(adapter.schema().ais().getUserTable(sourceTable));
4129+ return adapter.schema().tableRowType(adapter.schema().ais().getTable(sourceTable));
4130 }
4131
4132 public static String boolResult(boolean bool) {
4133
4134=== modified file 'src/main/java/com/akiban/qp/memoryadapter/MemoryAdapter.java'
4135--- src/main/java/com/akiban/qp/memoryadapter/MemoryAdapter.java 2013-03-22 20:05:57 +0000
4136+++ src/main/java/com/akiban/qp/memoryadapter/MemoryAdapter.java 2013-05-28 23:28:27 +0000
4137@@ -21,7 +21,6 @@
4138 import com.akiban.ais.model.Index;
4139 import com.akiban.ais.model.Table;
4140 import com.akiban.ais.model.TableName;
4141-import com.akiban.ais.model.UserTable;
4142 import com.akiban.qp.expression.IndexKeyRange;
4143 import com.akiban.qp.operator.Cursor;
4144 import com.akiban.qp.operator.GroupCursor;
4145@@ -69,19 +68,15 @@
4146 public Cursor newIndexCursor(QueryContext context, Index index,
4147 IndexKeyRange keyRange, Ordering ordering,
4148 IndexScanSelector scanSelector, boolean usePValues) {
4149-
4150 Table table = index.rootMostTable();
4151- if (table.isUserTable()) {
4152- return ((UserTable)table).getMemoryTableFactory().getIndexCursor(index, getSession(), keyRange, ordering, scanSelector);
4153- }
4154- throw new UnsupportedOperationException();
4155+ return table.getMemoryTableFactory().getIndexCursor(index, getSession(), keyRange, ordering, scanSelector);
4156 }
4157
4158 @Override
4159 public long rowCount(RowType tableType) {
4160 long count = 0;
4161- if (tableType.hasUserTable()) {
4162- count = tableType.userTable().getMemoryTableFactory().rowCount();
4163+ if (tableType.hasTable()) {
4164+ count = tableType.table().getMemoryTableFactory().rowCount();
4165 }
4166 return count;
4167 }
4168
4169=== modified file 'src/main/java/com/akiban/qp/memoryadapter/SimpleMemoryGroupScan.java'
4170--- src/main/java/com/akiban/qp/memoryadapter/SimpleMemoryGroupScan.java 2013-03-22 20:05:57 +0000
4171+++ src/main/java/com/akiban/qp/memoryadapter/SimpleMemoryGroupScan.java 2013-05-28 23:28:27 +0000
4172@@ -43,7 +43,7 @@
4173
4174 public SimpleMemoryGroupScan(MemoryAdapter adapter, TableName tableName, Iterator<? extends T> iterator) {
4175 this.iterator = iterator;
4176- this.rowType = adapter.schema().userTableRowType(adapter.schema().ais().getUserTable(tableName));
4177+ this.rowType = adapter.schema().tableRowType(adapter.schema().ais().getTable(tableName));
4178 }
4179
4180 private final Iterator<? extends T> iterator;
4181
4182=== modified file 'src/main/java/com/akiban/qp/operator/API.java'
4183--- src/main/java/com/akiban/qp/operator/API.java 2013-04-30 23:01:23 +0000
4184+++ src/main/java/com/akiban/qp/operator/API.java 2013-05-28 23:28:27 +0000
4185@@ -18,19 +18,18 @@
4186 package com.akiban.qp.operator;
4187
4188 import com.akiban.ais.model.Group;
4189-import com.akiban.ais.model.UserTable;
4190+import com.akiban.ais.model.Table;
4191 import com.akiban.qp.exec.UpdatePlannable;
4192 import com.akiban.qp.expression.IndexKeyRange;
4193 import com.akiban.qp.row.BindableRow;
4194 import com.akiban.qp.row.RowBase;
4195 import com.akiban.qp.rowtype.IndexRowType;
4196 import com.akiban.qp.rowtype.RowType;
4197-import com.akiban.qp.rowtype.UserTableRowType;
4198+import com.akiban.qp.rowtype.TableRowType;
4199 import com.akiban.server.aggregation.AggregatorRegistry;
4200 import com.akiban.server.aggregation.Aggregators;
4201 import com.akiban.server.collation.AkCollator;
4202 import com.akiban.server.expression.Expression;
4203-import com.akiban.server.types.AkType;
4204 import com.akiban.server.types3.TAggregator;
4205 import com.akiban.server.types3.TComparison;
4206 import com.akiban.server.types3.TInstance;
4207@@ -168,8 +167,8 @@
4208 public static Operator groupScan_Default(Group group,
4209 int hKeyBindingPosition,
4210 boolean deep,
4211- UserTable hKeyType,
4212- UserTable shortenUntil)
4213+ Table hKeyType,
4214+ Table shortenUntil)
4215 {
4216 return new GroupScan_Default(
4217 new GroupScan_Default.PositionalGroupCursorCreator(group, hKeyBindingPosition, deep, hKeyType, shortenUntil));
4218@@ -187,7 +186,7 @@
4219 public static Operator branchLookup_Default(Operator inputOperator,
4220 Group group,
4221 RowType inputRowType,
4222- UserTableRowType outputRowType,
4223+ TableRowType outputRowType,
4224 InputPreservationOption flag)
4225 {
4226 return branchLookup_Default(inputOperator, group, inputRowType, outputRowType, flag, NO_LIMIT);
4227@@ -196,7 +195,7 @@
4228 public static Operator branchLookup_Default(Operator inputOperator,
4229 Group group,
4230 RowType inputRowType,
4231- UserTableRowType outputRowType,
4232+ TableRowType outputRowType,
4233 InputPreservationOption flag,
4234 Limit limit)
4235 {
4236@@ -206,7 +205,7 @@
4237 /** deprecated */
4238 public static Operator branchLookup_Nested(Group group,
4239 RowType inputRowType,
4240- UserTableRowType outputRowType,
4241+ TableRowType outputRowType,
4242 InputPreservationOption flag,
4243 int inputBindingPosition)
4244 {
4245@@ -220,8 +219,8 @@
4246
4247 public static Operator branchLookup_Nested(Group group,
4248 RowType inputRowType,
4249- UserTableRowType ancestorRowType,
4250- UserTableRowType outputRowType,
4251+ TableRowType ancestorRowType,
4252+ TableRowType outputRowType,
4253 InputPreservationOption flag,
4254 int inputBindingPosition)
4255 {
4256@@ -254,7 +253,7 @@
4257 public static Operator ancestorLookup_Default(Operator inputOperator,
4258 Group group,
4259 RowType rowType,
4260- Collection<UserTableRowType> ancestorTypes,
4261+ Collection<TableRowType> ancestorTypes,
4262 InputPreservationOption flag)
4263 {
4264 return new AncestorLookup_Default(inputOperator, group, rowType, ancestorTypes, flag);
4265@@ -262,7 +261,7 @@
4266
4267 public static Operator ancestorLookup_Nested(Group group,
4268 RowType rowType,
4269- Collection<UserTableRowType> ancestorTypes,
4270+ Collection<TableRowType> ancestorTypes,
4271 int hKeyBindingPosition)
4272 {
4273 return new AncestorLookup_Nested(group, rowType, ancestorTypes, hKeyBindingPosition);
4274@@ -329,7 +328,7 @@
4275 public static Operator indexScan_Default(IndexRowType indexType,
4276 boolean reverse,
4277 IndexKeyRange indexKeyRange,
4278- UserTableRowType innerJoinUntilRowType)
4279+ TableRowType innerJoinUntilRowType)
4280 {
4281 Ordering ordering = new Ordering();
4282 int fields = indexType.nFields();
4283@@ -372,13 +371,13 @@
4284 public static Operator indexScan_Default(IndexRowType indexType,
4285 IndexKeyRange indexKeyRange,
4286 Ordering ordering,
4287- UserTableRowType innerJoinUntilRowType)
4288+ TableRowType innerJoinUntilRowType)
4289 {
4290 return indexScan_Default(indexType,
4291 indexKeyRange,
4292 ordering,
4293 IndexScanSelector.leftJoinAfter(indexType.index(),
4294- innerJoinUntilRowType.userTable()));
4295+ innerJoinUntilRowType.table()));
4296 }
4297
4298 public static Operator indexScan_Default(IndexRowType indexType,
4299@@ -436,7 +435,7 @@
4300 public static Operator product_NestedLoops(Operator outerInput,
4301 Operator innerInput,
4302 RowType outerType,
4303- UserTableRowType branchType,
4304+ TableRowType branchType,
4305 RowType innerType,
4306 int inputBindingPosition)
4307 {
4308@@ -596,7 +595,7 @@
4309 RowType leftRowType, RowType rightRowType,
4310 int leftOrderingFields, int rightOrderingFields,
4311 int comparisonFields,
4312- UserTableRowType outputHKeyTableRowType)
4313+ TableRowType outputHKeyTableRowType)
4314 {
4315 return new HKeyUnion_Ordered(leftInput, rightInput,
4316 leftRowType, rightRowType,
4317
4318=== modified file 'src/main/java/com/akiban/qp/operator/AncestorLookup_Default.java'
4319--- src/main/java/com/akiban/qp/operator/AncestorLookup_Default.java 2013-03-22 20:05:57 +0000
4320+++ src/main/java/com/akiban/qp/operator/AncestorLookup_Default.java 2013-05-28 23:28:27 +0000
4321@@ -18,14 +18,14 @@
4322 package com.akiban.qp.operator;
4323
4324 import com.akiban.ais.model.Group;
4325-import com.akiban.ais.model.UserTable;
4326+import com.akiban.ais.model.Table;
4327 import com.akiban.qp.row.HKey;
4328 import com.akiban.qp.row.Row;
4329 import com.akiban.qp.rowtype.HKeyRowType;
4330 import com.akiban.qp.rowtype.IndexRowType;
4331 import com.akiban.qp.rowtype.RowType;
4332 import com.akiban.qp.rowtype.Schema;
4333-import com.akiban.qp.rowtype.UserTableRowType;
4334+import com.akiban.qp.rowtype.TableRowType;
4335 import com.akiban.server.explain.*;
4336 import com.akiban.server.explain.std.LookUpOperatorExplainer;
4337 import com.akiban.util.ArgumentValidation;
4338@@ -65,7 +65,7 @@
4339 <li><b>RowType rowType:</b> Ancestors will be located for input rows
4340 of this type.
4341
4342- <li><b>Collection<UserTableRowType> ancestorTypes:</b> Ancestor types to be located.
4343+ <li><b>Collection<TableRowType> ancestorTypes:</b> Ancestor types to be located.
4344
4345 <li><b>API.InputPreservationOption flag:</b> Indicates whether rows of type rowType
4346 will be preserved in the output stream (flag = KEEP_INPUT), or
4347@@ -155,7 +155,7 @@
4348 public AncestorLookup_Default(Operator inputOperator,
4349 Group group,
4350 RowType rowType,
4351- Collection<UserTableRowType> ancestorTypes,
4352+ Collection<TableRowType> ancestorTypes,
4353 API.InputPreservationOption flag)
4354 {
4355 validateArguments(rowType, ancestorTypes, flag);
4356@@ -165,15 +165,15 @@
4357 this.keepInput = flag == API.InputPreservationOption.KEEP_INPUT;
4358 // Sort ancestor types by depth
4359 this.ancestors = new ArrayList<>(ancestorTypes.size());
4360- for (UserTableRowType ancestorType : ancestorTypes) {
4361- this.ancestors.add(ancestorType.userTable());
4362+ for (TableRowType ancestorType : ancestorTypes) {
4363+ this.ancestors.add(ancestorType.table());
4364 }
4365 if (this.ancestors.size() > 1) {
4366 Collections.sort(this.ancestors,
4367- new Comparator<UserTable>()
4368+ new Comparator<Table>()
4369 {
4370 @Override
4371- public int compare(UserTable x, UserTable y)
4372+ public int compare(Table x, Table y)
4373 {
4374 return x.getDepth() - y.getDepth();
4375 }
4376@@ -183,7 +183,7 @@
4377
4378 // For use by this class
4379
4380- private void validateArguments(RowType rowType, Collection<UserTableRowType> ancestorTypes, API.InputPreservationOption flag)
4381+ private void validateArguments(RowType rowType, Collection<TableRowType> ancestorTypes, API.InputPreservationOption flag)
4382 {
4383 ArgumentValidation.notEmpty("ancestorTypes", ancestorTypes);
4384 if (rowType instanceof IndexRowType) {
4385@@ -193,13 +193,13 @@
4386 RowType tableRowType = ((IndexRowType) rowType).tableType();
4387 // Each ancestorType must be an ancestor of rowType. ancestorType = tableRowType is OK only if the input
4388 // is from an index. I.e., this operator can be used for an index lookup.
4389- for (UserTableRowType ancestorType : ancestorTypes) {
4390+ for (TableRowType ancestorType : ancestorTypes) {
4391 ArgumentValidation.isTrue("ancestorType.ancestorOf(tableRowType)",
4392 ancestorType.ancestorOf(tableRowType));
4393- ArgumentValidation.isTrue("ancestorType.userTable().getGroup() == tableRowType.userTable().getGroup()",
4394- ancestorType.userTable().getGroup() == tableRowType.userTable().getGroup());
4395+ ArgumentValidation.isTrue("ancestorType.table().getGroup() == tableRowType.table().getGroup()",
4396+ ancestorType.table().getGroup() == tableRowType.table().getGroup());
4397 }
4398- } else if (rowType instanceof UserTableRowType) {
4399+ } else if (rowType instanceof TableRowType) {
4400 // Each ancestorType must be an ancestor of rowType. ancestorType = tableRowType is OK only if the input
4401 // is from an index. I.e., this operator can be used for an index lookup.
4402 for (RowType ancestorType : ancestorTypes) {
4403@@ -207,19 +207,19 @@
4404 ancestorType != rowType);
4405 ArgumentValidation.isTrue("ancestorType.ancestorOf(tableRowType)",
4406 ancestorType.ancestorOf(rowType));
4407- ArgumentValidation.isTrue("ancestorType.userTable().getGroup() == tableRowType.userTable().getGroup()",
4408- ancestorType.userTable().getGroup() == rowType.userTable().getGroup());
4409+ ArgumentValidation.isTrue("ancestorType.table().getGroup() == tableRowType.table().getGroup()",
4410+ ancestorType.table().getGroup() == rowType.table().getGroup());
4411 }
4412 } else if (rowType instanceof HKeyRowType) {
4413 ArgumentValidation.isTrue("flag == API.InputPreservationOption.DISCARD_INPUT",
4414 flag == API.InputPreservationOption.DISCARD_INPUT);
4415- for (UserTableRowType ancestorType : ancestorTypes) {
4416+ for (TableRowType ancestorType : ancestorTypes) {
4417 HKeyRowType hKeyRowType = (HKeyRowType) rowType;
4418- UserTableRowType tableRowType = ancestorType.schema().userTableRowType(hKeyRowType.hKey().userTable());
4419+ TableRowType tableRowType = ancestorType.schema().tableRowType(hKeyRowType.hKey().table());
4420 ArgumentValidation.isTrue("ancestorType.ancestorOf(tableRowType)",
4421 ancestorType.ancestorOf(tableRowType));
4422- ArgumentValidation.isTrue("ancestorType.userTable().getGroup() == tableRowType.userTable().getGroup()",
4423- ancestorType.userTable().getGroup() == tableRowType.userTable().getGroup());
4424+ ArgumentValidation.isTrue("ancestorType.table().getGroup() == tableRowType.table().getGroup()",
4425+ ancestorType.table().getGroup() == tableRowType.table().getGroup());
4426 }
4427 } else {
4428 ArgumentValidation.isTrue("invalid rowType", false);
4429@@ -237,15 +237,15 @@
4430 private final Operator inputOperator;
4431 private final Group group;
4432 private final RowType rowType;
4433- private final List<UserTable> ancestors;
4434+ private final List<Table> ancestors;
4435 private final boolean keepInput;
4436
4437 @Override
4438 public CompoundExplainer getExplainer(ExplainContext context)
4439 {
4440 Attributes atts = new Attributes();
4441- for (UserTable table : ancestors) {
4442- atts.put(Label.OUTPUT_TYPE, ((Schema)rowType.schema()).userTableRowType(table).getExplainer(context));
4443+ for (Table table : ancestors) {
4444+ atts.put(Label.OUTPUT_TYPE, ((Schema)rowType.schema()).tableRowType(table).getExplainer(context));
4445 }
4446 return new LookUpOperatorExplainer(getName(), atts, rowType, keepInput, inputOperator, context);
4447 }
4448
4449=== modified file 'src/main/java/com/akiban/qp/operator/AncestorLookup_Nested.java'
4450--- src/main/java/com/akiban/qp/operator/AncestorLookup_Nested.java 2013-03-22 20:05:57 +0000
4451+++ src/main/java/com/akiban/qp/operator/AncestorLookup_Nested.java 2013-05-28 23:28:27 +0000
4452@@ -18,14 +18,14 @@
4453 package com.akiban.qp.operator;
4454
4455 import com.akiban.ais.model.Group;
4456-import com.akiban.ais.model.UserTable;
4457+import com.akiban.ais.model.Table;
4458 import com.akiban.qp.row.HKey;
4459 import com.akiban.qp.row.Row;
4460 import com.akiban.qp.rowtype.HKeyRowType;
4461 import com.akiban.qp.rowtype.IndexRowType;
4462 import com.akiban.qp.rowtype.RowType;
4463 import com.akiban.qp.rowtype.Schema;
4464-import com.akiban.qp.rowtype.UserTableRowType;
4465+import com.akiban.qp.rowtype.TableRowType;
4466 import com.akiban.server.explain.*;
4467 import com.akiban.server.explain.std.LookUpOperatorExplainer;
4468 import com.akiban.util.ArgumentValidation;
4469@@ -144,7 +144,7 @@
4470
4471 public AncestorLookup_Nested(Group group,
4472 RowType rowType,
4473- Collection<UserTableRowType> ancestorTypes,
4474+ Collection<TableRowType> ancestorTypes,
4475 int inputBindingPosition)
4476 {
4477 validateArguments(group, rowType, ancestorTypes, inputBindingPosition);
4478@@ -153,15 +153,15 @@
4479 this.inputBindingPosition = inputBindingPosition;
4480 // Sort ancestor types by depth
4481 this.ancestors = new ArrayList<>(ancestorTypes.size());
4482- for (UserTableRowType ancestorType : ancestorTypes) {
4483- this.ancestors.add(ancestorType.userTable());
4484+ for (TableRowType ancestorType : ancestorTypes) {
4485+ this.ancestors.add(ancestorType.table());
4486 }
4487 if (this.ancestors.size() > 1) {
4488 Collections.sort(this.ancestors,
4489- new Comparator<UserTable>()
4490+ new Comparator<Table>()
4491 {
4492 @Override
4493- public int compare(UserTable x, UserTable y)
4494+ public int compare(Table x, Table y)
4495 {
4496 return x.getDepth() - y.getDepth();
4497 }
4498@@ -189,10 +189,10 @@
4499 for (RowType ancestorType : ancestorTypes) {
4500 ArgumentValidation.isTrue("ancestorType.ancestorOf(tableRowType)",
4501 ancestorType.ancestorOf(tableRowType));
4502- ArgumentValidation.isTrue("ancestorType.userTable().getGroup() == tableRowType.userTable().getGroup()",
4503- ancestorType.userTable().getGroup() == tableRowType.userTable().getGroup());
4504+ ArgumentValidation.isTrue("ancestorType.table().getGroup() == tableRowType.table().getGroup()",
4505+ ancestorType.table().getGroup() == tableRowType.table().getGroup());
4506 }
4507- } else if (rowType instanceof UserTableRowType) {
4508+ } else if (rowType instanceof TableRowType) {
4509 // Each ancestorType must be an ancestor of rowType. ancestorType = tableRowType is OK only if the input
4510 // is from an index. I.e., this operator can be used for an index lookup.
4511 for (RowType ancestorType : ancestorTypes) {
4512@@ -200,8 +200,8 @@
4513 ancestorType != rowType);
4514 ArgumentValidation.isTrue("ancestorType.ancestorOf(tableRowType)",
4515 ancestorType.ancestorOf(rowType));
4516- ArgumentValidation.isTrue("ancestorType.userTable().getGroup() == tableRowType.userTable().getGroup()",
4517- ancestorType.userTable().getGroup() == rowType.userTable().getGroup());
4518+ ArgumentValidation.isTrue("ancestorType.table().getGroup() == tableRowType.table().getGroup()",
4519+ ancestorType.table().getGroup() == rowType.table().getGroup());
4520 }
4521 } else if (rowType instanceof HKeyRowType) {
4522 } else {
4523@@ -219,7 +219,7 @@
4524
4525 private final Group group;
4526 private final RowType rowType;
4527- private final List<UserTable> ancestors;
4528+ private final List<Table> ancestors;
4529 private final int inputBindingPosition;
4530
4531 @Override
4532@@ -227,8 +227,8 @@
4533 {
4534 Attributes atts = new Attributes();
4535 atts.put(Label.BINDING_POSITION, PrimitiveExplainer.getInstance(inputBindingPosition));
4536- for (UserTable table : ancestors) {
4537- atts.put(Label.OUTPUT_TYPE, ((Schema)rowType.schema()).userTableRowType(table).getExplainer(context));
4538+ for (Table table : ancestors) {
4539+ atts.put(Label.OUTPUT_TYPE, ((Schema)rowType.schema()).tableRowType(table).getExplainer(context));
4540 }
4541 return new LookUpOperatorExplainer(getName(), atts, rowType, false, null, context);
4542 }
4543
4544=== modified file 'src/main/java/com/akiban/qp/operator/BranchLookup_Default.java'
4545--- src/main/java/com/akiban/qp/operator/BranchLookup_Default.java 2013-03-22 20:05:57 +0000
4546+++ src/main/java/com/akiban/qp/operator/BranchLookup_Default.java 2013-05-28 23:28:27 +0000
4547@@ -18,13 +18,13 @@
4548 package com.akiban.qp.operator;
4549
4550 import com.akiban.ais.model.Group;
4551-import com.akiban.ais.model.UserTable;
4552+import com.akiban.ais.model.Table;
4553 import com.akiban.qp.row.HKey;
4554 import com.akiban.qp.row.Row;
4555 import com.akiban.qp.rowtype.IndexRowType;
4556 import com.akiban.qp.rowtype.*;
4557 import com.akiban.qp.rowtype.RowType;
4558-import com.akiban.qp.rowtype.UserTableRowType;
4559+import com.akiban.qp.rowtype.TableRowType;
4560 import com.akiban.server.explain.*;
4561 import com.akiban.server.explain.std.LookUpOperatorExplainer;
4562 import com.akiban.util.ArgumentValidation;
4563@@ -67,7 +67,7 @@
4564 discarded (flag = DISCARD_INPUT).
4565
4566 <li><b>Limit limit (DEPRECATED):</b> A limit on the number of rows to
4567- be returned. The limit is specific to one UserTable. Deprecated
4568+ be returned. The limit is specific to one Table. Deprecated
4569 because the result is not well-defined. In the case of a branching
4570 group, a limit on one sibling has impliciations on the return of rows
4571 of other siblings.
4572@@ -186,7 +186,7 @@
4573 public BranchLookup_Default(Operator inputOperator,
4574 Group group,
4575 RowType inputRowType,
4576- UserTableRowType outputRowType,
4577+ TableRowType outputRowType,
4578 API.InputPreservationOption flag,
4579 Limit limit)
4580 {
4581@@ -194,20 +194,20 @@
4582 ArgumentValidation.notNull("outputRowType", outputRowType);
4583 ArgumentValidation.notNull("limit", limit);
4584 ArgumentValidation.isTrue("outputRowType != inputRowType", outputRowType != inputRowType);
4585- ArgumentValidation.isTrue("inputRowType instanceof UserTableRowType || flag == API.InputPreservationOption.DISCARD_INPUT",
4586- inputRowType instanceof UserTableRowType || flag == API.InputPreservationOption.DISCARD_INPUT);
4587- UserTableRowType inputTableType = null;
4588- if (inputRowType instanceof UserTableRowType) {
4589- inputTableType = (UserTableRowType) inputRowType;
4590+ ArgumentValidation.isTrue("inputRowType instanceof TableRowType || flag == API.InputPreservationOption.DISCARD_INPUT",
4591+ inputRowType instanceof TableRowType || flag == API.InputPreservationOption.DISCARD_INPUT);
4592+ TableRowType inputTableType = null;
4593+ if (inputRowType instanceof TableRowType) {
4594+ inputTableType = (TableRowType) inputRowType;
4595 } else if (inputRowType instanceof IndexRowType) {
4596 inputTableType = ((IndexRowType) inputRowType).tableType();
4597 } else if (inputRowType instanceof HKeyRowType) {
4598 Schema schema = outputRowType.schema();
4599- inputTableType = schema.userTableRowType(inputRowType.hKey().userTable());
4600+ inputTableType = schema.tableRowType(inputRowType.hKey().table());
4601 }
4602 assert inputTableType != null : inputRowType;
4603- UserTable inputTable = inputTableType.userTable();
4604- UserTable outputTable = outputRowType.userTable();
4605+ Table inputTable = inputTableType.table();
4606+ Table outputTable = outputRowType.table();
4607 ArgumentValidation.isSame("inputTable.getGroup()",
4608 inputTable.getGroup(),
4609 "outputTable.getGroup()",
4610@@ -242,7 +242,7 @@
4611 this.inputPrecedesBranch = true;
4612 } else {
4613 // neither input type nor output type is the common ancestor
4614- UserTable ancestorOfInputAndChildOfCommon = inputTable;
4615+ Table ancestorOfInputAndChildOfCommon = inputTable;
4616 while (ancestorOfInputAndChildOfCommon.parentTable() != commonAncestor) {
4617 ancestorOfInputAndChildOfCommon = ancestorOfInputAndChildOfCommon.parentTable();
4618 }
4619@@ -252,14 +252,14 @@
4620
4621 // For use by this class
4622
4623- private static UserTable commonAncestor(UserTable inputTable, UserTable outputTable)
4624+ private static Table commonAncestor(Table inputTable, Table outputTable)
4625 {
4626 int minLevel = min(inputTable.getDepth(), outputTable.getDepth());
4627- UserTable inputAncestor = inputTable;
4628+ Table inputAncestor = inputTable;
4629 while (inputAncestor.getDepth() > minLevel) {
4630 inputAncestor = inputAncestor.parentTable();
4631 }
4632- UserTable outputAncestor = outputTable;
4633+ Table outputAncestor = outputTable;
4634 while (outputAncestor.getDepth() > minLevel) {
4635 outputAncestor = outputAncestor.parentTable();
4636 }
4637@@ -281,11 +281,11 @@
4638 private final Operator inputOperator;
4639 private final Group group;
4640 private final RowType inputRowType;
4641- private final UserTableRowType outputRowType;
4642+ private final TableRowType outputRowType;
4643 private final boolean keepInput;
4644 // If keepInput is true, inputPrecedesBranch controls whether input row appears before the retrieved branch.
4645 private final boolean inputPrecedesBranch;
4646- private final UserTable commonAncestor;
4647+ private final Table commonAncestor;
4648 private final int branchRootOrdinal;
4649 private final Limit limit;
4650
4651@@ -294,7 +294,7 @@
4652 {
4653 Attributes atts = new Attributes();
4654 atts.put(Label.OUTPUT_TYPE, outputRowType.getExplainer(context));
4655- UserTableRowType ancestorRowType = outputRowType.schema().userTableRowType(commonAncestor);
4656+ TableRowType ancestorRowType = outputRowType.schema().tableRowType(commonAncestor);
4657 if ((ancestorRowType != inputRowType) && (ancestorRowType != outputRowType))
4658 atts.put(Label.ANCESTOR_TYPE, ancestorRowType.getExplainer(context));
4659 return new LookUpOperatorExplainer(getName(), atts, inputRowType, keepInput, inputOperator, context);
4660
4661=== modified file 'src/main/java/com/akiban/qp/operator/BranchLookup_Nested.java'
4662--- src/main/java/com/akiban/qp/operator/BranchLookup_Nested.java 2013-03-22 20:05:57 +0000
4663+++ src/main/java/com/akiban/qp/operator/BranchLookup_Nested.java 2013-05-28 23:28:27 +0000
4664@@ -18,12 +18,12 @@
4665 package com.akiban.qp.operator;
4666
4667 import com.akiban.ais.model.Group;
4668-import com.akiban.ais.model.UserTable;
4669+import com.akiban.ais.model.Table;
4670 import com.akiban.qp.row.HKey;
4671 import com.akiban.qp.row.Row;
4672 import com.akiban.qp.rowtype.IndexRowType;
4673 import com.akiban.qp.rowtype.RowType;
4674-import com.akiban.qp.rowtype.UserTableRowType;
4675+import com.akiban.qp.rowtype.TableRowType;
4676 import com.akiban.qp.rowtype.*;
4677 import com.akiban.server.explain.*;
4678 import com.akiban.server.explain.std.LookUpOperatorExplainer;
4679@@ -59,10 +59,10 @@
4680 <li><b>RowType inputRowType:</b> Branches will be located for input
4681 rows of this type.
4682
4683- <li><b>UserTableRowType ancestorRowType:</b> Identifies the table in the group at which branching occurs.
4684+ <li><b>TableRowType ancestorRowType:</b> Identifies the table in the group at which branching occurs.
4685 Must be an ancestor of both inputRowType's table and outputRowType's table.
4686
4687- <li><b>UserTableRowType outputRowType:</b> Type at the root of the branch to be
4688+ <li><b>TableRowType outputRowType:</b> Type at the root of the branch to be
4689 retrieved.
4690
4691 <li><b>API.InputPreservationOption flag:</b> Indicates whether rows of type rowType
4692@@ -74,8 +74,8 @@
4693
4694 </ul>
4695
4696- inputRowType may be an index row type, a user table row type, or an hkey row type. flag = KEEP_INPUT is permitted
4697- only for user table row types.
4698+ inputRowType may be an index row type, a table row type, or an hkey row type. flag = KEEP_INPUT is permitted
4699+ only for table row types.
4700
4701 The groupTable, inputRowType, and outputRowType must belong to the
4702 same group.
4703@@ -163,8 +163,8 @@
4704
4705 public BranchLookup_Nested(Group group,
4706 RowType inputRowType,
4707- UserTableRowType ancestorRowType,
4708- UserTableRowType outputRowType,
4709+ TableRowType ancestorRowType,
4710+ TableRowType outputRowType,
4711 API.InputPreservationOption flag,
4712 int inputBindingPosition)
4713 {
4714@@ -172,21 +172,21 @@
4715 ArgumentValidation.notNull("inputRowType", inputRowType);
4716 ArgumentValidation.notNull("outputRowType", outputRowType);
4717 ArgumentValidation.notNull("flag", flag);
4718- ArgumentValidation.isTrue("inputRowType instanceof UserTableRowType || flag == API.InputPreservationOption.DISCARD_INPUT",
4719- inputRowType instanceof UserTableRowType || flag == API.InputPreservationOption.DISCARD_INPUT);
4720+ ArgumentValidation.isTrue("inputRowType instanceof TableRowType || flag == API.InputPreservationOption.DISCARD_INPUT",
4721+ inputRowType instanceof TableRowType || flag == API.InputPreservationOption.DISCARD_INPUT);
4722 ArgumentValidation.isGTE("hKeyBindingPosition", inputBindingPosition, 0);
4723- UserTableRowType inputTableType = null;
4724- if (inputRowType instanceof UserTableRowType) {
4725- inputTableType = (UserTableRowType) inputRowType;
4726+ TableRowType inputTableType = null;
4727+ if (inputRowType instanceof TableRowType) {
4728+ inputTableType = (TableRowType) inputRowType;
4729 } else if (inputRowType instanceof IndexRowType) {
4730 inputTableType = ((IndexRowType) inputRowType).tableType();
4731 } else if (inputRowType instanceof HKeyRowType) {
4732 Schema schema = outputRowType.schema();
4733- inputTableType = schema.userTableRowType(inputRowType.hKey().userTable());
4734+ inputTableType = schema.tableRowType(inputRowType.hKey().table());
4735 }
4736 assert inputTableType != null : inputRowType;
4737- UserTable inputTable = inputTableType.userTable();
4738- UserTable outputTable = outputRowType.userTable();
4739+ Table inputTable = inputTableType.table();
4740+ Table outputTable = outputRowType.table();
4741 ArgumentValidation.isSame("inputTable.getGroup()",
4742 inputTable.getGroup(),
4743 "outputTable.getGroup()",
4744@@ -199,7 +199,7 @@
4745 if (ancestorRowType == null) {
4746 this.commonAncestor = commonAncestor(inputTable, outputTable);
4747 } else {
4748- this.commonAncestor = ancestorRowType.userTable();
4749+ this.commonAncestor = ancestorRowType.table();
4750 ArgumentValidation.isTrue("ancestorRowType.ancestorOf(inputTableType)",
4751 ancestorRowType.ancestorOf(inputTableType));
4752 ArgumentValidation.isTrue("ancestorRowType.ancestorOf(outputRowType)",
4753@@ -225,7 +225,7 @@
4754 } else if (inputTable == commonAncestor) {
4755 this.inputPrecedesBranch = true;
4756 } else {
4757- UserTable ancestorOfInputAndChildOfCommon = inputTable;
4758+ Table ancestorOfInputAndChildOfCommon = inputTable;
4759 while (ancestorOfInputAndChildOfCommon.parentTable() != commonAncestor) {
4760 ancestorOfInputAndChildOfCommon = ancestorOfInputAndChildOfCommon.parentTable();
4761 }
4762@@ -235,14 +235,14 @@
4763
4764 // For use by this class
4765
4766- private static UserTable commonAncestor(UserTable inputTable, UserTable outputTable)
4767+ private static Table commonAncestor(Table inputTable, Table outputTable)
4768 {
4769 int minLevel = min(inputTable.getDepth(), outputTable.getDepth());
4770- UserTable inputAncestor = inputTable;
4771+ Table inputAncestor = inputTable;
4772 while (inputAncestor.getDepth() > minLevel) {
4773 inputAncestor = inputAncestor.parentTable();
4774 }
4775- UserTable outputAncestor = outputTable;
4776+ Table outputAncestor = outputTable;
4777 while (outputAncestor.getDepth() > minLevel) {
4778 outputAncestor = outputAncestor.parentTable();
4779 }
4780@@ -263,12 +263,12 @@
4781
4782 private final Group group;
4783 private final RowType inputRowType;
4784- private final UserTableRowType outputRowType;
4785+ private final TableRowType outputRowType;
4786 private final boolean keepInput;
4787 // If keepInput is true, inputPrecedesBranch controls whether input row appears before the retrieved branch.
4788 private final boolean inputPrecedesBranch;
4789 private final int inputBindingPosition;
4790- private final UserTable commonAncestor;
4791+ private final Table commonAncestor;
4792 private final int branchRootOrdinal;
4793
4794 @Override
4795@@ -277,7 +277,7 @@
4796 Attributes atts = new Attributes();
4797 atts.put(Label.BINDING_POSITION, PrimitiveExplainer.getInstance(inputBindingPosition));
4798 atts.put(Label.OUTPUT_TYPE, outputRowType.getExplainer(context));
4799- UserTableRowType ancestorRowType = outputRowType.schema().userTableRowType(commonAncestor);
4800+ TableRowType ancestorRowType = outputRowType.schema().tableRowType(commonAncestor);
4801 if ((ancestorRowType != inputRowType) && (ancestorRowType != outputRowType))
4802 atts.put(Label.ANCESTOR_TYPE, ancestorRowType.getExplainer(context));
4803 return new LookUpOperatorExplainer(getName(), atts, inputRowType, false, null, context);
4804
4805=== modified file 'src/main/java/com/akiban/qp/operator/Count_TableStatus.java'
4806--- src/main/java/com/akiban/qp/operator/Count_TableStatus.java 2013-03-22 20:05:57 +0000
4807+++ src/main/java/com/akiban/qp/operator/Count_TableStatus.java 2013-05-28 23:28:27 +0000
4808@@ -21,7 +21,7 @@
4809 import com.akiban.qp.row.Row;
4810 import com.akiban.qp.row.ValuesRow;
4811 import com.akiban.qp.rowtype.RowType;
4812-import com.akiban.qp.rowtype.UserTableRowType;
4813+import com.akiban.qp.rowtype.TableRowType;
4814 import com.akiban.qp.rowtype.ValuesRowType;
4815 import com.akiban.server.explain.CompoundExplainer;
4816 import com.akiban.server.explain.ExplainContext;
4817@@ -108,8 +108,8 @@
4818 public Count_TableStatus(RowType tableType, boolean usePValues)
4819 {
4820 ArgumentValidation.notNull("tableType", tableType);
4821- ArgumentValidation.isTrue("tableType instanceof UserTableRowType",
4822- tableType instanceof UserTableRowType);
4823+ ArgumentValidation.isTrue("tableType instanceof TableRowType",
4824+ tableType instanceof TableRowType);
4825 this.tableType = tableType;
4826 this.resultType = usePValues
4827 ? tableType.schema().newValuesType(MNumeric.BIGINT.instance(false))
4828
4829=== modified file 'src/main/java/com/akiban/qp/operator/Delete_Default.java'
4830--- src/main/java/com/akiban/qp/operator/Delete_Default.java 2013-03-22 20:05:57 +0000
4831+++ src/main/java/com/akiban/qp/operator/Delete_Default.java 2013-05-28 23:28:27 +0000
4832@@ -70,7 +70,7 @@
4833 of the same RowType.
4834
4835 The Delete_Default operator assumes (and requires) the input row types
4836- be of a UserTableRowType, and not any derived type. This can't be
4837+ be of a TableRowType, and not any derived type. This can't be
4838 enforced by the constructor because <i>PhysicalOperator#rowType()</i>
4839 isn't implemented for all operators.
4840
4841
4842=== modified file 'src/main/java/com/akiban/qp/operator/Delete_Returning.java'
4843--- src/main/java/com/akiban/qp/operator/Delete_Returning.java 2013-03-22 20:05:57 +0000
4844+++ src/main/java/com/akiban/qp/operator/Delete_Returning.java 2013-05-28 23:28:27 +0000
4845@@ -64,7 +64,7 @@
4846 of the same RowType.
4847
4848 The Delete_Returning operator assumes (and requires) the input row types
4849-be of a UserTableRowType, and not any derived type. This can't be
4850+be of a TableRowType, and not any derived type. This can't be
4851 enforced by the constructor because <i>PhysicalOperator#rowType()</i>
4852 isn't implemented for all operators.
4853
4854
4855=== modified file 'src/main/java/com/akiban/qp/operator/ExecutionBase.java'
4856--- src/main/java/com/akiban/qp/operator/ExecutionBase.java 2013-03-22 20:05:57 +0000
4857+++ src/main/java/com/akiban/qp/operator/ExecutionBase.java 2013-05-28 23:28:27 +0000
4858@@ -17,7 +17,7 @@
4859
4860 package com.akiban.qp.operator;
4861
4862-import com.akiban.ais.model.UserTable;
4863+import com.akiban.ais.model.Table;
4864
4865 public abstract class ExecutionBase
4866 {
4867@@ -26,7 +26,7 @@
4868 return context.getStore();
4869 }
4870
4871- protected StoreAdapter adapter(UserTable name)
4872+ protected StoreAdapter adapter(Table name)
4873 {
4874 return context.getStore(name);
4875 }
4876
4877=== modified file 'src/main/java/com/akiban/qp/operator/Flatten_HKeyOrdered.java'
4878--- src/main/java/com/akiban/qp/operator/Flatten_HKeyOrdered.java 2013-05-24 21:45:54 +0000
4879+++ src/main/java/com/akiban/qp/operator/Flatten_HKeyOrdered.java 2013-05-28 23:28:27 +0000
4880@@ -235,7 +235,7 @@
4881 List<HKeySegment> childHKeySegments = childType.hKey().segments();
4882 HKeySegment lastChildHKeySegment = childHKeySegments.get(childHKeySegments.size() - 1);
4883 RowDef childRowDef = lastChildHKeySegment.table().rowDef();
4884- this.childOrdinal = childRowDef.userTable().getOrdinal();
4885+ this.childOrdinal = childRowDef.table().getOrdinal();
4886 this.nChildHKeySegmentFields = lastChildHKeySegment.columns().size();
4887 this.parentHKeySegments = parentType.hKey().segments().size();
4888 }
4889
4890=== modified file 'src/main/java/com/akiban/qp/operator/GroupScan_Default.java'
4891--- src/main/java/com/akiban/qp/operator/GroupScan_Default.java 2013-03-22 20:05:57 +0000
4892+++ src/main/java/com/akiban/qp/operator/GroupScan_Default.java 2013-05-28 23:28:27 +0000
4893@@ -19,7 +19,7 @@
4894
4895 import com.akiban.ais.model.Group;
4896 import com.akiban.ais.model.TableName;
4897-import com.akiban.ais.model.UserTable;
4898+import com.akiban.ais.model.Table;
4899 import com.akiban.qp.row.HKey;
4900 import com.akiban.qp.row.Row;
4901 import com.akiban.server.explain.*;
4902@@ -42,7 +42,7 @@
4903 The group table to be scanned.
4904
4905 <li><b>Limit limit (DEPRECATED):</b>
4906- A limit on the number of rows to be returned. The limit is specific to one UserTable.
4907+ A limit on the number of rows to be returned. The limit is specific to one Table.
4908 Deprecated because the result is not well-defined. In the case of a branching group, a
4909 limit on one sibling has impliciations on the return of rows of other siblings.
4910
4911@@ -296,8 +296,8 @@
4912 PositionalGroupCursorCreator(Group group,
4913 int hKeyBindingPosition,
4914 boolean deep,
4915- UserTable hKeyType,
4916- UserTable shortenUntil)
4917+ Table hKeyType,
4918+ Table shortenUntil)
4919 {
4920 super(group);
4921 this.hKeyBindingPosition = hKeyBindingPosition;
4922@@ -325,8 +325,8 @@
4923
4924 private final int hKeyBindingPosition;
4925 private final boolean deep;
4926- private final UserTable shortenUntil;
4927- private final UserTable hKeyType;
4928+ private final Table shortenUntil;
4929+ private final Table hKeyType;
4930 }
4931
4932 private static class HKeyBoundCursor extends ChainedCursor
4933@@ -370,8 +370,8 @@
4934 GroupCursor input,
4935 int hKeyBindingPosition,
4936 boolean deep,
4937- UserTable hKeyType,
4938- UserTable shortenUntil)
4939+ Table hKeyType,
4940+ Table shortenUntil)
4941 {
4942 super(context, input);
4943 this.input = input;
4944@@ -388,8 +388,8 @@
4945 private final GroupCursor input;
4946 private final int hKeyBindingPosition;
4947 private final boolean deep;
4948- private UserTable atTable;
4949- private final UserTable stopSearchTable;
4950+ private Table atTable;
4951+ private final Table stopSearchTable;
4952 private boolean sawOne = false;
4953 }
4954 }
4955
4956=== modified file 'src/main/java/com/akiban/qp/operator/HKeyUnion_Ordered.java'
4957--- src/main/java/com/akiban/qp/operator/HKeyUnion_Ordered.java 2013-03-22 20:05:57 +0000
4958+++ src/main/java/com/akiban/qp/operator/HKeyUnion_Ordered.java 2013-05-28 23:28:27 +0000
4959@@ -22,7 +22,7 @@
4960 import com.akiban.qp.row.Row;
4961 import com.akiban.qp.rowtype.HKeyRowType;
4962 import com.akiban.qp.rowtype.RowType;
4963-import com.akiban.qp.rowtype.UserTableRowType;
4964+import com.akiban.qp.rowtype.TableRowType;
4965 import com.akiban.qp.util.HKeyCache;
4966 import com.akiban.server.explain.*;
4967 import com.akiban.server.types.util.ValueSources;
4968@@ -55,7 +55,7 @@
4969 <li><b>int leftOrderingFields:</b> Number of trailing fields of left input rows to be used for ordering and matching rows.
4970 <li><b>int rightOrderingFields:</b> Number of trailing fields of right input rows to be used for ordering and matching rows.
4971 <li><b>int comparisonFields:</b> Number of ordering fields to be compared.
4972-<li><b>UserTableRowType outputHKeyTableRowType:</b> Before eliminating duplicate hkeys, hkeys from the input stream
4973+<li><b>TableRowType outputHKeyTableRowType:</b> Before eliminating duplicate hkeys, hkeys from the input stream
4974 are shortened to match <tt>outputHKeyTableRowType</tt>'s table's hkey type.
4975
4976 <h1>Behavior</h1>
4977@@ -128,7 +128,7 @@
4978 int leftOrderingFields,
4979 int rightOrderingFields,
4980 int comparisonFields,
4981- UserTableRowType outputHKeyTableRowType)
4982+ TableRowType outputHKeyTableRowType)
4983 {
4984 ArgumentValidation.notNull("left", left);
4985 ArgumentValidation.notNull("right", right);
4986@@ -149,7 +149,7 @@
4987 this.advanceLeftOnMatch = leftOrderingFields >= rightOrderingFields;
4988 this.advanceRightOnMatch = rightOrderingFields >= leftOrderingFields;
4989 this.outputHKeyTableRowType = outputHKeyTableRowType;
4990- com.akiban.ais.model.HKey outputHKeyDefinition = outputHKeyTableRowType.userTable().hKey();
4991+ com.akiban.ais.model.HKey outputHKeyDefinition = outputHKeyTableRowType.table().hKey();
4992 this.outputHKeyRowType = outputHKeyTableRowType.schema().newHKeyRowType(outputHKeyDefinition);
4993 this.outputHKeySegments = outputHKeyDefinition.segments().size();
4994 // Setup for row comparisons
4995@@ -174,7 +174,7 @@
4996 private final RankExpressions fieldRankingExpressions;
4997 private final boolean advanceLeftOnMatch;
4998 private final boolean advanceRightOnMatch;
4999- private final UserTableRowType outputHKeyTableRowType;
5000+ private final TableRowType outputHKeyTableRowType;
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches