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

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


  {
    ExecIndexRow        keyRow1 = null;
    ExecRow              row;
    DataValueDescriptor      IDOrderable;
    DataValueDescriptor      columnNameOrderable;
    TabInfo            ti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);
    SYSTRIGGERSRowFactory      rf = (SYSTRIGGERSRowFactory) ti.getCatalogRowFactory();

    /* Use objectID in both start
     * and stop position for index 1 scan.
     */
    IDOrderable = getValueAsDVD(formerUUID);

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

    // build the row to be stuffed into SYSTRIGGERS.
    row = rf.makeRow(triggerd, null);

    /*
    ** Figure out if the index in systriggers needs
    ** to be updated.
    */
    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(rf.getNumIndexes() == 3,
          "There are more indexes on systriggers than expected, the code herein needs to change");
    }

    boolean[] bArray = new boolean[3];

    /*
    ** Do we need to update indexes?
    */
    if (colsToSet == null)
    {
      bArray[0] = true;
      bArray[1] = true;
      bArray[2] = true;
    }
    else
    {
      /*
      ** Check the specific columns for indexed
      ** columns.
      */
      for (int i = 0; i < colsToSet.length; i++)
      {
        switch (colsToSet[i])
        {
          case SYSTRIGGERSRowFactory.SYSTRIGGERS_TRIGGERID:
            bArray[0] = true;
            break;

          case SYSTRIGGERSRowFactory.SYSTRIGGERS_TRIGGERNAME:
          case SYSTRIGGERSRowFactory.SYSTRIGGERS_SCHEMAID:
            bArray[1] = true;
            break;
         
          case SYSTRIGGERSRowFactory.SYSTRIGGERS_TABLEID:
            bArray[2] = true;
            break;
        }
      }
    }

    ti.updateRow(keyRow1, row,
           SYSTRIGGERSRowFactory.SYSTRIGGERS_INDEX1_ID,
           bArray,
           colsToSet,
           tc);
  }
View Full Code Here


   */
  public ConstraintDescriptor getConstraintDescriptor(UUID uuid)
        throws StandardException
  {
    DataValueDescriptor    UUIDStringOrderable;
    TabInfo          ti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);

    /* 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

    )
    throws StandardException
  {
    DataValueDescriptor    UUIDStringOrderable;
    DataValueDescriptor    constraintNameOrderable;
    TabInfo          ti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);

    /* Construct keys for both start and stop positions for scan */
    constraintNameOrderable = dvf.getVarcharDataValue(constraintName);
    UUIDStringOrderable = dvf.getCharDataValue(schemaID.toString());

View Full Code Here

   * @param  td  Table Descriptor for which I need statistics
   */
  public List getStatisticsDescriptors(TableDescriptor td)
    throws StandardException
  {
    TabInfo ti = getNonCoreTI(SYSSTATISTICS_CATALOG_NUM);
    List statDescriptorList = newSList();
    DataValueDescriptor UUIDStringOrderable;

    /* set up the start/stop position for the scan */
    UUIDStringOrderable = dvf.getCharDataValue(td.getUUID().toString());
View Full Code Here

   private void getConstraintDescriptorsScan(TableDescriptor td, boolean forUpdate)
      throws StandardException
  {
    ConstraintDescriptorList  cdl = td.getConstraintDescriptorList();
    DataValueDescriptor      tableIDOrderable = null;
    TabInfo            ti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);

    /* Use tableIDOrderable in both start and stop positions for scan */
    tableIDOrderable = getValueAsDVD(td.getUUID());

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

   * @exception StandardException    Thrown on error
   */
  public ConstraintDescriptorList getForeignKeys(UUID constraintId)
      throws StandardException
  {
    TabInfo ti = getNonCoreTI(SYSFOREIGNKEYS_CATALOG_NUM);
    List fkList = newSList();

    // Use constraintIDOrderable in both start and stop positions for scan
    DataValueDescriptor constraintIDOrderable = getValueAsDVD(constraintId);

View Full Code Here

    ExecRow         outRow;
    RowLocation        baseRowLocation;
    ConglomerateController  heapCC = null;
    ScanController      scanController = null;
    TransactionController  tc;
    TabInfo         ti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);
    SYSCONSTRAINTSRowFactory rf = (SYSCONSTRAINTSRowFactory) ti.getCatalogRowFactory();
    TableDescriptor      td = null;
    List          slist = newSList();

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(indexId == SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_INDEX1_ID ||
                 indexId == SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_INDEX3_ID,
                  "bad index id, must be one of the indexes on a uuid");
      SanityManager.ASSERT(columnNum > 0 &&
                 columnNum <= SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_COLUMN_COUNT,
                  "invalid column number for column to be retrieved");
    }

    try
    {
      /* Use tableIDOrderable in both start and stop positions for scan */
      DataValueDescriptor orderable = getValueAsDVD(uuid);
 
      /* Set up the start/stop position for the scan */
      ExecIndexRow keyRow = (ExecIndexRow) exFactory.getIndexableRow(1);
      keyRow.setColumn(1, orderable);

      // Get the current transaction controller
      tc = getTransactionCompile();
 
      outRow = rf.makeEmptyRow();
 
      heapCC =
                tc.openConglomerate(
                    ti.getHeapConglomerate(), false, 0,
                    TransactionController.MODE_RECORD,
                    TransactionController.ISOLATION_REPEATABLE_READ);

      // create an index row template
      indexRow1 = getIndexRowFromHeapRow(
                ti.getIndexRowGenerator(indexId),
                heapCC.newRowLocationTemplate(),
                outRow);
 
      // just interested in one column
      DataValueDescriptor[] rowTemplate    =
              new DataValueDescriptor[SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_COLUMN_COUNT];
      FormatableBitSet  columnToGetSet =
              new FormatableBitSet(SYSCONSTRAINTSRowFactory.SYSCONSTRAINTS_COLUMN_COUNT);
      columnToGetSet.set(columnNum - 1);

      rowTemplate[columnNum - 1] =
                dvf.getNullChar((StringDataValue) null);
 
      // Scan the index and go to the data pages for qualifying rows
      scanController = tc.openScan(
          ti.getIndexConglomerate(indexId),// conglomerate to open
          false,               // don't hold open across commit
          0,                 // for read
                  TransactionController.MODE_RECORD,
                  TransactionController.ISOLATION_REPEATABLE_READ,// RESOLVE: should be level 2
          (FormatableBitSet) null,                 // all fields as objects
View Full Code Here

   * the boot-up code.
   * @exception StandardException    Thrown on error
   */
  void clearSPSPlans() throws StandardException
  {
    TabInfo ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);
    faultInTabInfo(ti);

    TransactionController tc = getTransactionExecute();

    FormatableBitSet columnToReadSet = new FormatableBitSet(SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT);
    FormatableBitSet columnToUpdateSet = new FormatableBitSet(SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT);
    columnToUpdateSet.set(SYSSTATEMENTSRowFactory.SYSSTATEMENTS_VALID -1);
    columnToUpdateSet.set(SYSSTATEMENTSRowFactory.SYSSTATEMENTS_CONSTANTSTATE -1);

    DataValueDescriptor[] replaceRow =
            new DataValueDescriptor[SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COLUMN_COUNT];

    /* Set up a couple of row templates for fetching CHARS */

    replaceRow[SYSSTATEMENTSRowFactory.SYSSTATEMENTS_VALID - 1] =
            dvf.getDataValue(false);
    replaceRow[SYSSTATEMENTSRowFactory.SYSSTATEMENTS_CONSTANTSTATE - 1] =
            dvf.getDataValue((Object) null);

    /* Scan the entire heap */
    ScanController sc =
            tc.openScan(
                ti.getHeapConglomerate(),
                false,
                TransactionController.OPENMODE_FORUPDATE,
                TransactionController.MODE_TABLE,
                TransactionController.ISOLATION_REPEATABLE_READ,
                columnToReadSet,
View Full Code Here

    UUID           uuid,
    TransactionController  tc
  ) throws StandardException
  {
    DataValueDescriptor    stmtIdOrderable;
    TabInfo          ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);

    stmtIdOrderable = getValueAsDVD(uuid);

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

    ti.deleteRow( tc, keyRow, SYSSTATEMENTSRowFactory.SYSSTATEMENTS_INDEX1_ID );

    /* drop all columns in SYSCOLUMNS */ 
    dropAllColumnDescriptors(uuid, tc);
  }
View Full Code Here

   * @exception StandardException    Thrown on failure
   */
  public List getAllSPSDescriptors()
    throws StandardException
  {
    TabInfo          ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);

    List list = newSList();

    getDescriptorViaHeap(
            (ScanQualifier[][]) null,
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.