Package org.apache.derby.iapi.sql.dictionary

Examples of org.apache.derby.iapi.sql.dictionary.TabInfo


                     TransactionController tc)
        throws StandardException 
  {
    ExecIndexRow      keyRow1 = null;
    DataValueDescriptor    dependentIDOrderable;
    TabInfo          ti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);

    /* Use dependentIDOrderable in both start
     * and stop position for index 1 scan.
     */
    dependentIDOrderable = getValueAsDVD(dependentsUUID);

    /* Set up the start/stop position for the scan */
    keyRow1 = (ExecIndexRow) exFactory.getIndexableRow(1);
    keyRow1.setColumn(1, dependentIDOrderable);

    ti.deleteRow( tc, keyRow1, SYSDEPENDSRowFactory.SYSDEPENDS_INDEX1_ID );

  }
View Full Code Here


  public AliasDescriptor getAliasDescriptor(UUID uuid)
        throws StandardException
  {
    DataValueDescriptor    UUIDStringOrderable;
    SYSALIASESRowFactory  rf;
    TabInfo          ti = getNonCoreTI(SYSALIASES_CATALOG_NUM);

    rf = (SYSALIASESRowFactory) ti.getCatalogRowFactory();

    /* Use UUIDStringOrderable in both start and stop positions for scan */
    UUIDStringOrderable = dvf.getCharDataValue(uuid.toString());

    /* Set up the start/stop position for the scan */
 
View Full Code Here

  public AliasDescriptor getAliasDescriptor(String schemaId, String aliasName, char nameSpace)
      throws StandardException
  {
    DataValueDescriptor      aliasNameOrderable;
    DataValueDescriptor      nameSpaceOrderable;
    TabInfo            ti = getNonCoreTI(SYSALIASES_CATALOG_NUM);
    SYSALIASESRowFactory    rf = (SYSALIASESRowFactory) ti.getCatalogRowFactory();

    /* Use aliasNameOrderable and aliasTypeOrderable in both start
     * and stop position for scan.
     */
    aliasNameOrderable = dvf.getVarcharDataValue(aliasName);
View Full Code Here

      throws StandardException
 
    ExecIndexRow      keyRow1 = null;
    DataValueDescriptor    aliasNameOrderable;
    DataValueDescriptor    nameSpaceOrderable;
    TabInfo          ti = getNonCoreTI(SYSALIASES_CATALOG_NUM);

    /* Use aliasNameOrderable and nameSpaceOrderable in both start
     * and stop position for index 1 scan.
     */
    aliasNameOrderable = dvf.getVarcharDataValue(ad.getDescriptorName());
    char[] charArray = new char[1];
    charArray[0] = ad.getNameSpace();
    nameSpaceOrderable = dvf.getCharDataValue(new String(charArray));

    /* Set up the start/stop position for the scan */
    keyRow1 = (ExecIndexRow) exFactory.getIndexableRow(3);
    keyRow1.setColumn(1, dvf.getCharDataValue(ad.getSchemaUUID().toString()));
    keyRow1.setColumn(2, aliasNameOrderable);
    keyRow1.setColumn(3, nameSpaceOrderable);

    ti.deleteRow( tc, keyRow1, SYSALIASESRowFactory.SYSALIASES_INDEX1_ID );

  }
View Full Code Here

    throws StandardException
  {
    int      ictr;
    int      numIndexes;
    int      indexCtr;
    TabInfo    catalog;
    int      catalogCount = catalogArray.length;

    /* Initialize the various variables associated with index scans of these catalogs */
    for (ictr = 0; ictr < catalogCount; ictr++)
    {
      // NOTE: This only works for core catalogs, which are initialized
      // up front.
      catalog = catalogArray[ictr];

      numIndexes = catalog.getNumberOfIndexes();

      if (numIndexes > 0)
      {
        for (indexCtr = 0; indexCtr < numIndexes; indexCtr++)
        {
View Full Code Here

     * RESOLVE - This loop will eventually drive all of the
     * work for creating the core tables.
     */
    for (int coreCtr = 0; coreCtr < NUM_CORE; coreCtr++)
    {
      TabInfo  ti = coreInfo[coreCtr];

      Properties  heapProperties = ti.getCreateHeapProperties();

      ti.setHeapConglomerate(
        createConglomerate(
              ti.getTableName(),
              tc,
              ti.getCatalogRowFactory().makeEmptyRow(),
              heapProperties
              )
        );

      // bootstrap indexes on core tables before bootstraping the tables themselves
      if (coreInfo[coreCtr].getNumberOfIndexes() > 0)
      {
        bootStrapSystemIndexes(systemSchemaDesc, tc, ddg, ti);
      }
    }

    // bootstrap the core tables into the data dictionary
    for ( int ictr = 0; ictr < NUM_CORE; ictr++ )
    {
      /* RESOLVE - need to do something with COLUMNTYPE in following table creating code */
      TabInfo      ti = coreInfo[ictr];

      addSystemTableToDictionary(ti, systemSchemaDesc, tc, ddg);
    }

    // Add the bootstrap information to the configuration
    params.put(CFG_SYSTABLES_ID,
           Long.toString(
            coreInfo[SYSTABLES_CORE_NUM].getHeapConglomerate()));
    params.put(CFG_SYSTABLES_INDEX1_ID,
           Long.toString(
            coreInfo[SYSTABLES_CORE_NUM].getIndexConglomerate(
              ((SYSTABLESRowFactory) coreInfo[SYSTABLES_CORE_NUM].
                getCatalogRowFactory()).SYSTABLES_INDEX1_ID)));
    params.put(CFG_SYSTABLES_INDEX2_ID,
           Long.toString(
            coreInfo[SYSTABLES_CORE_NUM].getIndexConglomerate(
              ((SYSTABLESRowFactory) coreInfo[SYSTABLES_CORE_NUM].
                getCatalogRowFactory()).SYSTABLES_INDEX2_ID)));

    params.put(CFG_SYSCOLUMNS_ID,
           Long.toString(
            coreInfo[SYSCOLUMNS_CORE_NUM].getHeapConglomerate()));
    params.put(CFG_SYSCOLUMNS_INDEX1_ID,
          Long.toString(
            coreInfo[SYSCOLUMNS_CORE_NUM].getIndexConglomerate(
              ((SYSCOLUMNSRowFactory) coreInfo[SYSCOLUMNS_CORE_NUM].
                getCatalogRowFactory()).SYSCOLUMNS_INDEX1_ID)));
    params.put(CFG_SYSCOLUMNS_INDEX2_ID,
          Long.toString(
            coreInfo[SYSCOLUMNS_CORE_NUM].getIndexConglomerate(
              ((SYSCOLUMNSRowFactory) coreInfo[SYSCOLUMNS_CORE_NUM].
                getCatalogRowFactory()).SYSCOLUMNS_INDEX2_ID)));

    params.put(CFG_SYSCONGLOMERATES_ID,
           Long.toString(
            coreInfo[SYSCONGLOMERATES_CORE_NUM].getHeapConglomerate()));
    params.put(CFG_SYSCONGLOMERATES_INDEX1_ID,
          Long.toString(
            coreInfo[SYSCONGLOMERATES_CORE_NUM].getIndexConglomerate(
              ((SYSCONGLOMERATESRowFactory) coreInfo[SYSCONGLOMERATES_CORE_NUM].
                getCatalogRowFactory()).SYSCONGLOMERATES_INDEX1_ID)));
    params.put(CFG_SYSCONGLOMERATES_INDEX2_ID,
          Long.toString(
            coreInfo[SYSCONGLOMERATES_CORE_NUM].getIndexConglomerate(
              ((SYSCONGLOMERATESRowFactory) coreInfo[SYSCONGLOMERATES_CORE_NUM].
                getCatalogRowFactory()).SYSCONGLOMERATES_INDEX2_ID)));
    params.put(CFG_SYSCONGLOMERATES_INDEX3_ID,
          Long.toString(
            coreInfo[SYSCONGLOMERATES_CORE_NUM].getIndexConglomerate(
              ((SYSCONGLOMERATESRowFactory) coreInfo[SYSCONGLOMERATES_CORE_NUM].
                getCatalogRowFactory()).SYSCONGLOMERATES_INDEX3_ID)));

    params.put(CFG_SYSSCHEMAS_ID,
           Long.toString(
            coreInfo[SYSSCHEMAS_CORE_NUM].getHeapConglomerate()));
    params.put(CFG_SYSSCHEMAS_INDEX1_ID,
          Long.toString(
            coreInfo[SYSSCHEMAS_CORE_NUM].getIndexConglomerate(
              ((SYSSCHEMASRowFactory) coreInfo[SYSSCHEMAS_CORE_NUM].
                getCatalogRowFactory()).SYSSCHEMAS_INDEX1_ID)));
    params.put(CFG_SYSSCHEMAS_INDEX2_ID,
          Long.toString(
            coreInfo[SYSSCHEMAS_CORE_NUM].getIndexConglomerate(
              ((SYSSCHEMASRowFactory) coreInfo[SYSSCHEMAS_CORE_NUM].
                getCatalogRowFactory()).SYSSCHEMAS_INDEX2_ID)));

    //Add the SYSIBM Schema
    sysIBMSchemaDesc =
            addSystemSchema(
                SchemaDescriptor.IBM_SYSTEM_SCHEMA_NAME,
                SchemaDescriptor.SYSIBM_SCHEMA_UUID, tc);

    /* Create the non-core tables and generate the UUIDs for their
     * heaps (before creating the indexes).
     * RESOLVE - This loop will eventually drive all of the
     * work for creating the non-core tables.
     */
    for (int noncoreCtr = 0; noncoreCtr < NUM_NONCORE; noncoreCtr++)
    {
      int catalogNumber = noncoreCtr + NUM_CORE;
      boolean isDummy = (catalogNumber == SYSDUMMY1_CATALOG_NUM);

      TabInfo ti = getNonCoreTIByNumber(catalogNumber);

      makeCatalog(ti, isDummy ? sysIBMSchemaDesc : systemSchemaDesc, tc );

      if (isDummy)
        populateSYSDUMMY1(tc);
View Full Code Here

   * @param   catalogNumber  catalogNumber
   */
  protected void upgradeMakeCatalog(TransactionController tc, int catalogNumber)
    throws StandardException
  {
    TabInfo ti;
    if (catalogNumber >= NUM_CORE)
      ti = getNonCoreTIByNumber(catalogNumber);
    else
      ti = coreInfo[catalogNumber];
   
View Full Code Here

    ExecIndexRow        indexRow1;
    ExecRow          row;
    DataValueDescriptor      schemaIDOrderable;
    DataValueDescriptor    tableNameOrderable;
    ScanController      scanController;
    TabInfo          ti = coreInfo[SYSTABLES_CORE_NUM];
    CatalogRowFactory    rf = ti.getCatalogRowFactory();

    // We only want the 1st column from the heap
    row = exFactory.getValueRow(1);

    /* Use tableNameOrderable and schemaIdOrderable in both start
     * and stop position for scan.
     */
    tableNameOrderable = dvf.getVarcharDataValue(tableName);
    schemaIDOrderable = dvf.getCharDataValue(schemaUUID);

    /* Set up the start/stop position for the scan */
    ExecIndexRow keyRow = exFactory.getIndexableRow(2);
    keyRow.setColumn(1, tableNameOrderable);
    keyRow.setColumn(2, schemaIDOrderable);

    heapCC = tc.openConglomerate(
                ti.getHeapConglomerate(), false, 0,
                TransactionController.MODE_RECORD,
                TransactionController.ISOLATION_REPEATABLE_READ);

    ExecRow indexTemplateRow = rf.buildEmptyIndexRow( SYSTABLESRowFactory.SYSTABLES_INDEX1_ID, heapCC.newRowLocationTemplate() );

    /* Scan the index and go to the data pages for qualifying rows to
     * build the column descriptor.
     */
    scanController = tc.openScan(
        ti.getIndexConglomerate(SYSTABLESRowFactory.SYSTABLES_INDEX1_ID)// conglomerate to open
        false, // don't hold open across commit
        0,
                TransactionController.MODE_RECORD,
                TransactionController.ISOLATION_REPEATABLE_READ,
        (FormatableBitSet) null,         // all fields as objects
View Full Code Here

  private void modifySysTableNullability(TransactionController tc, int catalogNum)
  throws StandardException
  {

    TabInfo ti = bootingDictionary.getNonCoreTIByNumber(catalogNum);
    CatalogRowFactory rowFactory = ti.getCatalogRowFactory();
    if (catalogNum == DataDictionaryImpl.SYSALIASES_CATALOG_NUM) {
    // SYSALIASES table ==> ALIASINFO needs to be modified.
      bootingDictionary.upgrade_setNullability(rowFactory,
        SYSALIASESRowFactory.SYSALIASES_ALIASINFO, true, tc);
    }
View Full Code Here

  private SchemaDescriptor locateSchemaRow(UUID schemaId,
                TransactionController tc)
    throws StandardException
  {
    DataValueDescriptor    UUIDStringOrderable;
    TabInfo          ti = coreInfo[SYSSCHEMAS_CORE_NUM];

    /* Use UUIDStringOrderable in both start and stop positions for scan */
    UUIDStringOrderable = dvf.getCharDataValue(schemaId.toString());

    /* Set up the start/stop position for the scan */
 
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.dictionary.TabInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.