📄 sysconglomeratesrowfactory.java
字号:
* @param indexNumber The specified index number. * * @return The Properties associated with creating the specified index. */ public Properties getCreateIndexProperties(int indexNumber) { Properties properties = new Properties(); // keep page size for all indexes at 4K since its a big table properties.put("derby.storage.pageSize","4096"); return properties; } /////////////////////////////////////////////////////////////////////////// // // ABSTRACT METHODS TO BE IMPLEMENTED BY CHILDREN OF CatalogRowFactory // /////////////////////////////////////////////////////////////////////////// /** * * @param row a SYSCOLUMNS row * @param parentTupleDescriptor Null for this kind of descriptor. * @param dd dataDictionary * * @return a conglomerate descriptor equivalent to a SYSCONGOMERATES row * * @exception StandardException thrown on failure */ public TupleDescriptor buildDescriptor( ExecRow row, TupleDescriptor parentTupleDescriptor, DataDictionary dd ) throws StandardException { if (SanityManager.DEBUG) SanityManager.ASSERT( row.nColumns() == SYSCONGLOMERATES_COLUMN_COUNT, "Wrong number of columns for a SYSCONGLOMERATES row"); DataDescriptorGenerator ddg = dd.getDataDescriptorGenerator(); long conglomerateNumber; String name; boolean isConstraint; boolean isIndex; IndexRowGenerator indexRowGenerator; DataValueDescriptor col; ConglomerateDescriptor conglomerateDesc; String conglomUUIDString; UUID conglomUUID; String schemaUUIDString; UUID schemaUUID; String tableUUIDString; UUID tableUUID; /* 1st column is SCHEMAID (UUID - char(36)) */ col = row.getColumn(1); schemaUUIDString = col.getString(); schemaUUID = getUUIDFactory().recreateUUID(schemaUUIDString); /* 2nd column is TABLEID (UUID - char(36)) */ col = row.getColumn(2); tableUUIDString = col.getString(); tableUUID = getUUIDFactory().recreateUUID(tableUUIDString); /* 3nd column is CONGLOMERATENUMBER (long) */ col = row.getColumn(3); conglomerateNumber = col.getLong(); /* 4rd column is CONGLOMERATENAME (varchar(128)) */ col = row.getColumn(4); name = col.getString(); /* 5th column is ISINDEX (boolean) */ col = row.getColumn(5); isIndex = col.getBoolean(); /* 6th column is DESCRIPTOR */ col = row.getColumn(6); indexRowGenerator = new IndexRowGenerator( (IndexDescriptor) col.getObject()); /* 7th column is ISCONSTRAINT (boolean) */ col = row.getColumn(7); isConstraint = col.getBoolean(); /* 8th column is CONGLOMERATEID (UUID - char(36)) */ col = row.getColumn(8); conglomUUIDString = col.getString(); conglomUUID = getUUIDFactory().recreateUUID(conglomUUIDString); /* now build and return the descriptor */ conglomerateDesc = ddg.newConglomerateDescriptor(conglomerateNumber, name, isIndex, indexRowGenerator, isConstraint, conglomUUID, tableUUID, schemaUUID); return conglomerateDesc; } /** * Get the conglomerate's UUID of the row. * * @param row The row from sysconglomerates * * @return UUID The conglomerates UUID * * @exception StandardException thrown on failure */ protected UUID getConglomerateUUID(ExecRow row) throws StandardException { DataValueDescriptor col; String conglomerateUUIDString; /* 8th column is CONGLOMERATEID (UUID - char(36)) */ col = row.getColumn(SYSCONGLOMERATES_CONGLOMERATEID); conglomerateUUIDString = col.getString(); return getUUIDFactory().recreateUUID(conglomerateUUIDString); } /** * Get the table's UUID from the row. * * @param row The row from sysconglomerates * * @return UUID The table's UUID * * @exception StandardException thrown on failure */ protected UUID getTableUUID(ExecRow row) throws StandardException { DataValueDescriptor col; String tableUUIDString; /* 2nd column is TABLEID (UUID - char(36)) */ col = row.getColumn(SYSCONGLOMERATES_TABLEID); tableUUIDString = col.getString(); return getUUIDFactory().recreateUUID(tableUUIDString); } /** * Get the schema's UUID from the row. * * @param row The row from sysconglomerates * * @return UUID The schema's UUID * * @exception StandardException thrown on failure */ protected UUID getSchemaUUID(ExecRow row) throws StandardException { DataValueDescriptor col; String schemaUUIDString; /* 1st column is SCHEMAID (UUID - char(36)) */ col = row.getColumn(SYSCONGLOMERATES_SCHEMAID); schemaUUIDString = col.getString(); return getUUIDFactory().recreateUUID(schemaUUIDString); } /** * Get the conglomerate's name of the row. * * @param row The row from sysconglomerates * * @return String The conglomerates name * * @exception StandardException thrown on failure */ protected String getConglomerateName(ExecRow row) throws StandardException { DataValueDescriptor col; /* 4th column is CONGLOMERATENAME (varchar(128)) */ col = row.getColumn(SYSCONGLOMERATES_CONGLOMERATENAME); return col.getString(); } /** * Builds a list of columns suitable for creating this Catalog. * * * @return array of SystemColumn suitable for making this catalog. */ public SystemColumn[] buildColumnList() { int index = 0; SystemColumn[] columnList = new SystemColumn[SYSCONGLOMERATES_COLUMN_COUNT]; // describe columns columnList[index++] = new SystemColumnImpl( convertIdCase( "SCHEMAID"), // column name SYSCONGLOMERATES_SCHEMAID, // column number 0, // precision 0, // scale false, // nullability "CHAR", // dataType true, // built-in type 36 // maxLength ); columnList[index++] = new SystemColumnImpl( convertIdCase( "TABLEID"), // column name SYSCONGLOMERATES_TABLEID, // column number 0, // precision 0, // scale false, // nullability "CHAR", // dataType true, // built-in type 36 // maxLength ); columnList[index++] = new SystemColumnImpl( convertIdCase( "CONGLOMERATENUMBER"), // column name SYSCONGLOMERATES_CONGLOMERATENUMBER, // column number 0, // precision 0, // scale false, // nullability "BIGINT", // dataType true, // built-in type TypeId.LONGINT_MAXWIDTH // maxLength ); columnList[index++] = new SystemColumnImpl( // SQL IDENTIFIER convertIdCase( "CONGLOMERATENAME"), // column name SYSCONGLOMERATES_CONGLOMERATENAME, true // nullability ); columnList[index++] = new SystemColumnImpl( convertIdCase( "ISINDEX"), // column name SYSCONGLOMERATES_ISINDEX, // column number 0, // precision 0, // scale false, // nullability "BOOLEAN", // dataType true, // built-in type 1 // maxLength ); columnList[index++] = new SystemColumnImpl( convertIdCase( "DESCRIPTOR"), // column name SYSCONGLOMERATES_DESCRIPTOR, 0, // precision 0, // scale true, // nullability "org.apache.derby.catalog.IndexDescriptor", // datatype false, // built-in type TypeDescriptor.MAXIMUM_WIDTH_UNKNOWN // maxLength ); columnList[index++] = new SystemColumnImpl( convertIdCase( "ISCONSTRAINT"), // column name SYSCONGLOMERATES_ISCONSTRAINT, 0, // precision 0, // scale true, // nullability "BOOLEAN", // datatype true, // built-in type 1 // maxLength ); columnList[index++] = new SystemColumnImpl( convertIdCase( "CONGLOMERATEID"), // column name SYSCONGLOMERATES_CONGLOMERATEID, 0, // precision 0, // scale false, // nullability "CHAR", // datatype true, // built-in type 36 // maxLength ); return columnList; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -