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

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


    DataValueDescriptor[]   replaceRow
  )
    throws StandardException
  {
   
    TabInfo ti = (isCoreTable) ?  coreInfo[tableNum] :
                    getNonCoreTIByNumber(tableNum);

    if (!isCoreTable)
      faultInTabInfo(ti);

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


  {

    FormatableBitSet columnToUpdate = new
        FormatableBitSet(SYSCOLUMNSRowFactory.SYSCOLUMNS_COLUMN_COUNT);
      int columnNum = SYSCOLUMNSRowFactory.SYSCOLUMNS_AUTOINCREMENTVALUE;
    TabInfo ti = coreInfo[SYSCOLUMNS_CORE_NUM];
      ConglomerateController heapCC = null;
    SYSCOLUMNSRowFactory  rf = (SYSCOLUMNSRowFactory) ti.getCatalogRowFactory();
    ExecRow row = rf.makeEmptyRow();

      FormatableBitSet  columnToRead = new
        FormatableBitSet(SYSCOLUMNSRowFactory.SYSCOLUMNS_COLUMN_COUNT);
   
    // FormatableBitSet is 0 based.
      columnToRead.set(columnNum - 1); // current value.
    columnToRead.set(columnNum);     // start value.
    columnToRead.set(columnNum + 1); // increment value.

        try
        {
      /* if wait is true then we need to do a wait while trying to
         open/fetch from the conglomerate. note we use wait both to
         open as well as fetch from the conglomerate.
      */
            heapCC =
                tc.openConglomerate(
                    ti.getHeapConglomerate(),
                    false,
                    (TransactionController.OPENMODE_FORUPDATE |
                     ((wait) ? 0 : TransactionController.OPENMODE_LOCK_NOWAIT)),
                    TransactionController.MODE_RECORD,
                    TransactionController.ISOLATION_REPEATABLE_READ);
View Full Code Here

   */
  protected void populateSYSDUMMY1(
              TransactionController tc)
    throws StandardException
  {
    TabInfo            ti = getNonCoreTI(SYSDUMMY1_CATALOG_NUM);
    SYSDUMMY1RowFactory      rf = (SYSDUMMY1RowFactory) ti.getCatalogRowFactory();
    ExecRow row = ti.getCatalogRowFactory().makeRow(null, null);

    int insertRetCode = ti.insertRow(row, tc, true);
  }
View Full Code Here

     *
     * @exception StandardException    Thrown on error
    */
   public  TabInfo  getTabInfo( String tableName ) throws StandardException
   {
     TabInfo    tabinfo;
     for ( int ictr = 0; ictr < coreInfo.length; ictr++ )
     {
       tabinfo = coreInfo[ ictr ];
       if ( tabinfo.getTableName().equals( tableName ) ) { return tabinfo; }
     }
     // Non-core tables are not pre-loaded. Translate the name
     // to a number and look it up that way.
     for (int ictr = 0; ictr < nonCoreNames.length; ictr++)
View Full Code Here

   * @exception StandardException    Thrown on error
   */
  private TabInfo getNonCoreTI(int catalogNumber)
    throws StandardException
  {
    TabInfo  ti = getNonCoreTIByNumber(catalogNumber);

    faultInTabInfo( ti );

    return ti;
  }
View Full Code Here

    int nonCoreNum = catalogNumber - NUM_CORE;

    // Look up the TabInfo in the array. This does not have to be
    // synchronized, because getting a reference is atomic.

    TabInfo retval = noncoreInfo[nonCoreNum];

    if (retval == null)
    {
      // If we did not find the TabInfo, get the right one and
      // load it into the array. There is a small chance that
View Full Code Here

                    UUID tableUUID,
                    String columnName,
                    long aiValue, boolean incrementNeeded)
      throws StandardException             
  {
    TabInfo ti = coreInfo[SYSCOLUMNS_CORE_NUM];
    ExecIndexRow keyRow = null;

    keyRow = (ExecIndexRow)exFactory.getIndexableRow(2);
    keyRow.setColumn(1, dvf.getCharDataValue(tableUUID.toString()));
      keyRow.setColumn(2, dvf.getCharDataValue(columnName));
   
    SYSCOLUMNSRowFactory  rf = (SYSCOLUMNSRowFactory) ti.getCatalogRowFactory();
    ExecRow row = rf.makeEmptyRow();

    boolean[] bArray = new boolean[2];
    for (int index = 0; index < 2; index++)
    {
      bArray[index] = false;
    }
   
    int[] colsToUpdate = new int[1];
   
    colsToUpdate[0] = SYSCOLUMNSRowFactory.SYSCOLUMNS_AUTOINCREMENTVALUE;

    if (incrementNeeded)
    {
      ExecRow readRow = ti.getRow(tc, keyRow,
                  SYSCOLUMNSRowFactory.SYSCOLUMNS_INDEX1_ID);
      NumberDataValue increment =
        (NumberDataValue)readRow.getColumn(SYSCOLUMNSRowFactory.SYSCOLUMNS_AUTOINCREMENTINC);
      aiValue += increment.getLong();
    }
    row.setColumn(SYSCOLUMNSRowFactory.SYSCOLUMNS_AUTOINCREMENTVALUE,
            dvf.getDataValue(aiValue));

    ti.updateRow(keyRow, row,
           SYSCOLUMNSRowFactory.SYSCOLUMNS_INDEX1_ID,
           bArray,
           colsToUpdate,
           tc);
    return;
View Full Code Here

  private RowLocation computeRowLocation(TransactionController tc,
                      TableDescriptor td,
                      String columnName)
    throws StandardException                 
  {
    TabInfo ti = coreInfo[SYSCOLUMNS_CORE_NUM];
    ExecIndexRow keyRow = null;
    ExecRow row;
    UUID tableUUID = td.getUUID();

    keyRow = (ExecIndexRow)exFactory.getIndexableRow(2);
    keyRow.setColumn(1, dvf.getCharDataValue(tableUUID.toString()));
      keyRow.setColumn(2, dvf.getCharDataValue(columnName));
    return ti.getRowLocation(tc, keyRow,
                 SYSCOLUMNSRowFactory.SYSCOLUMNS_INDEX1_ID);
  }
View Full Code Here

  /** @see DataDictionary#dropStatisticsDescriptors */
  public void dropStatisticsDescriptors(UUID tableUUID, UUID referenceUUID,
                   TransactionController tc)
    throws StandardException
  {
    TabInfo          ti = getNonCoreTI(SYSSTATISTICS_CATALOG_NUM);
    DataValueDescriptor first, second;
    first = dvf.getCharDataValue(tableUUID.toString());

    ExecIndexRow keyRow;
    if (referenceUUID != null)
    {
      keyRow = exFactory.getIndexableRow(2);
      second = dvf.getCharDataValue(referenceUUID.toString());
      keyRow.setColumn(2, second);
    }
    else
    {
      keyRow = exFactory.getIndexableRow(1);
    }

    keyRow.setColumn(1, first);

    ti.deleteRow(tc, keyRow,
           SYSSTATISTICSRowFactory.SYSSTATISTICS_INDEX1_ID);
   
  }
View Full Code Here

      TransactionController tc)
    throws StandardException
  {
    ExecRow              row = null;
    int            type = descriptor.getConstraintType();
    TabInfo            ti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);
    SYSCONSTRAINTSRowFactory  rf = (SYSCONSTRAINTSRowFactory) ti.getCatalogRowFactory();
    int            insertRetCode;

    if (SanityManager.DEBUG)
    {
      if (!(type == DataDictionary.PRIMARYKEY_CONSTRAINT ||
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.