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

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


    DependencyManager dm = dd.getDependencyManager();
    TransactionController tc = lcc.getTransactionExecute();

    ColumnDescriptor columnDescriptor =
      td.getColumnDescriptor(columnInfo[ix].name);
    DataDescriptorGenerator ddg = dd.getDataDescriptorGenerator();
    int columnPosition = columnDescriptor.getPosition();

    // Clean up after the old default, if non-null
    if (columnDescriptor.hasNonNullDefault())
    {
View Full Code Here


    boolean          isEnabled;
    boolean          referencingOld;
    boolean          referencingNew;
    ReferencedColumns rcd;
    TriggerDescriptor    descriptor;
    DataDescriptorGenerator  ddg = dd.getDataDescriptorGenerator();

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(row.nColumns() == SYSTRIGGERS_COLUMN_COUNT,
                 "Wrong number of columns for a SYSTRIGGERS row");
View Full Code Here

          throws StandardException
  {
    if (SanityManager.DEBUG)
    SanityManager.ASSERT(row.nColumns() == SYSTABLES_COLUMN_COUNT, "Wrong number of columns for a SYSTABLES row");

    DataDescriptorGenerator ddg = dd.getDataDescriptorGenerator();

    String  tableUUIDString;
    String  schemaUUIDString;
    int    tableTypeEnum;
    String  lockGranularity;
    String  tableName, tableType;
    DataValueDescriptor  col;
    UUID    tableUUID;
    UUID    schemaUUID;
    SchemaDescriptor  schema;
    TableDescriptor    tabDesc;

    /* 1st column is TABLEID (UUID - char(36)) */
    col = row.getColumn(SYSTABLES_TABLEID);
    tableUUIDString = col.getString();
    tableUUID = getUUIDFactory().recreateUUID(tableUUIDString);


    /* 2nd column is TABLENAME (varchar(128)) */
    col = row.getColumn(SYSTABLES_TABLENAME);
    tableName = col.getString();

    /* 3rd column is TABLETYPE (char(1)) */
    col = row.getColumn(SYSTABLES_TABLETYPE);
    tableType = col.getString();
    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(tableType.length() == 1, "Fourth column type incorrect");
    }
    switch (tableType.charAt(0))
    {
      case 'T' :
        tableTypeEnum = TableDescriptor.BASE_TABLE_TYPE;
        break;
      case 'S' :
        tableTypeEnum = TableDescriptor.SYSTEM_TABLE_TYPE;
        break;
      case 'V' :
        tableTypeEnum = TableDescriptor.VIEW_TYPE;
        break;
      case 'A' :
        tableTypeEnum = TableDescriptor.SYNONYM_TYPE;
        break;
      default:
        if (SanityManager.DEBUG)
        SanityManager.THROWASSERT("Fourth column value invalid");
        tableTypeEnum = -1;
    }

    /* 4th column is SCHEMAID (UUID - char(36)) */
    col = row.getColumn(SYSTABLES_SCHEMAID);
    schemaUUIDString = col.getString();
    schemaUUID = getUUIDFactory().recreateUUID(schemaUUIDString);
   
    schema = dd.getSchemaDescriptor(schemaUUID, null);

    /* 5th column is LOCKGRANULARITY (char(1)) */
    col = row.getColumn(SYSTABLES_LOCKGRANULARITY);
    lockGranularity = col.getString();
    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(lockGranularity.length() == 1, "Fifth column type incorrect");
    }

    // RESOLVE - Deal with lock granularity
    tabDesc = ddg.newTableDescriptor(tableName, schema, tableTypeEnum, lockGranularity.charAt(0));
    tabDesc.setUUID(tableUUID);
    return tabDesc;
  }
View Full Code Here

    // indicate that we are in the process of booting
    booting = true;

    // set only if child class hasn't overriden this already
    if ( dataDescriptorGenerator == null )
    { dataDescriptorGenerator = new DataDescriptorGenerator( this ); }

    if (!create) {


      // SYSTABLES

      coreInfo[SYSTABLES_CORE_NUM].setHeapConglomerate(
          getBootParameter(startParams, CFG_SYSTABLES_ID, true));

      coreInfo[SYSTABLES_CORE_NUM].setIndexConglomerate(SYSTABLESRowFactory.SYSTABLES_INDEX1_ID,
          getBootParameter(startParams, CFG_SYSTABLES_INDEX1_ID, true));


      coreInfo[SYSTABLES_CORE_NUM].setIndexConglomerate(
          SYSTABLESRowFactory.SYSTABLES_INDEX2_ID,
          getBootParameter(startParams, CFG_SYSTABLES_INDEX2_ID, true));

      // SYSCOLUMNS

      coreInfo[SYSCOLUMNS_CORE_NUM].setHeapConglomerate(
          getBootParameter(startParams, CFG_SYSCOLUMNS_ID, true));


      coreInfo[SYSCOLUMNS_CORE_NUM].setIndexConglomerate(
          SYSCOLUMNSRowFactory.SYSCOLUMNS_INDEX1_ID,
          getBootParameter(startParams, CFG_SYSCOLUMNS_INDEX1_ID, true));
      // 2nd syscolumns index added in Xena, hence may not be there
      coreInfo[SYSCOLUMNS_CORE_NUM].setIndexConglomerate(
          SYSCOLUMNSRowFactory.SYSCOLUMNS_INDEX2_ID,
          getBootParameter(startParams, CFG_SYSCOLUMNS_INDEX2_ID, false));

      // SYSCONGLOMERATES

      coreInfo[SYSCONGLOMERATES_CORE_NUM].setHeapConglomerate(
          getBootParameter(startParams, CFG_SYSCONGLOMERATES_ID, true));


      coreInfo[SYSCONGLOMERATES_CORE_NUM].setIndexConglomerate(
          SYSCONGLOMERATESRowFactory.SYSCONGLOMERATES_INDEX1_ID,
          getBootParameter(startParams, CFG_SYSCONGLOMERATES_INDEX1_ID, true));


      coreInfo[SYSCONGLOMERATES_CORE_NUM].setIndexConglomerate(
          SYSCONGLOMERATESRowFactory.SYSCONGLOMERATES_INDEX2_ID,
          getBootParameter(startParams, CFG_SYSCONGLOMERATES_INDEX2_ID, true));

      coreInfo[SYSCONGLOMERATES_CORE_NUM].setIndexConglomerate(
          SYSCONGLOMERATESRowFactory.SYSCONGLOMERATES_INDEX3_ID,
          getBootParameter(startParams, CFG_SYSCONGLOMERATES_INDEX3_ID, true));


      // SYSSCHEMAS
      coreInfo[SYSSCHEMAS_CORE_NUM].setHeapConglomerate(
          getBootParameter(startParams, CFG_SYSSCHEMAS_ID, true));


      coreInfo[SYSSCHEMAS_CORE_NUM].setIndexConglomerate(
          SYSSCHEMASRowFactory.SYSSCHEMAS_INDEX1_ID,
          getBootParameter(startParams, CFG_SYSSCHEMAS_INDEX1_ID, true));

      coreInfo[SYSSCHEMAS_CORE_NUM].setIndexConglomerate(
          SYSSCHEMASRowFactory.SYSSCHEMAS_INDEX2_ID,
          getBootParameter(startParams, CFG_SYSSCHEMAS_INDEX2_ID, true));

    }



    String value = startParams.getProperty(Property.LANG_TD_CACHE_SIZE);
    tdCacheSize = PropertyUtil.intPropertyValue(Property.LANG_TD_CACHE_SIZE, value,
                     0, Integer.MAX_VALUE, Property.LANG_TD_CACHE_SIZE_DEFAULT);

   
    value = startParams.getProperty(Property.LANG_SPS_CACHE_SIZE);
    stmtCacheSize = PropertyUtil.intPropertyValue(Property.LANG_SPS_CACHE_SIZE, value,
                     0, Integer.MAX_VALUE, Property.LANG_SPS_CACHE_SIZE_DEFAULT);

    value = startParams.getProperty(Property.LANG_PERMISSIONS_CACHE_SIZE);
    permissionsCacheSize = PropertyUtil.intPropertyValue(Property.LANG_PERMISSIONS_CACHE_SIZE, value,
                     0, Integer.MAX_VALUE, Property.LANG_PERMISSIONS_CACHE_SIZE_DEFAULT);


    /*
     * data dictionary contexts are only associated with connections.
     * we have to look for the basic data dictionary, as there is
     * no connection, and thus no context stack yet.
     */

    /*
     * Get the table descriptor cache.
     */
    CacheFactory cf =
        (CacheFactory) Monitor.startSystemModule(org.apache.derby.iapi.reference.Module.CacheFactory);
    OIDTdCache =
      cf.newCacheManager(this,
        "TableDescriptorOIDCache",
        tdCacheSize,
        tdCacheSize);
    nameTdCache =
      cf.newCacheManager(this,
        "TableDescriptorNameCache",
        tdCacheSize,
        tdCacheSize);

    if (stmtCacheSize > 0)
    {
      spsNameCache =
        cf.newCacheManager(this,
          "SPSNameDescriptorCache",
          stmtCacheSize,
          stmtCacheSize);
      spsIdHash = new Hashtable(stmtCacheSize);
      // spsTextHash = new Hashtable(stmtCacheSize);
    }


    /* Get the object to coordinate cache transitions */
    cacheCoordinator = new ShExLockable();

    /* Get AccessFactory in order to transaction stuff */
    af = (AccessFactoryMonitor.findServiceModule(this, AccessFactory.MODULE);

    /* Get the lock factory */
    lockFactory = af.getLockFactory();

    /*
     * now we need to setup a context stack for the database creation work.
     * We assume the System boot process has created a context
     * manager already, but not that contexts we need are there.
     */
    ContextService csf = ContextService.getFactory();

    ContextManager cm = csf.getCurrentContextManager();
    if (SanityManager.DEBUG)
      SanityManager.ASSERT((cm != null), "Failed to get current ContextManager");

    // RESOLVE other non-StandardException errors.
    bootingTC = null;
    try
    {
      // Get a transaction controller. This has the side effect of
      // creating a transaction context if there isn't one already.
      bootingTC = af.getTransaction(cm);

      /*
        We need an execution context so that we can generate rows
        REMIND: maybe only for create case?
       */
      exFactory.newExecutionContext(cm);

      DataDescriptorGenerator ddg = getDataDescriptorGenerator();

      //We should set the user schema collation type here now because
      //later on, we are going to create user schema APP. By the time any
      //user schema gets created, we should have the correct collation
      //type set for such schemas to use. For this reason, don't remove
View Full Code Here

  public  void  makeCatalog( TabInfoImpl          ti,
                 SchemaDescriptor      sd,
                 TransactionController     tc )
          throws StandardException
  {
    DataDescriptorGenerator ddg = getDataDescriptorGenerator();

    Properties  heapProperties = ti.getCreateHeapProperties();
    ti.setHeapConglomerate(
      createConglomerate(
        ti.getTableName(),
View Full Code Here

    long          heapConglomerateNumber
    )
    throws StandardException
  {
    SchemaDescriptor    sd = getSystemSchemaDescriptor( );
    DataDescriptorGenerator ddg = getDataDescriptorGenerator();
    long          indexConglomerateNumber;

    ConglomerateDescriptor  conglomerateDescriptor = bootstrapOneIndex
      ( sd, tc, ddg, ti, indexNumber, heapConglomerateNumber );
View Full Code Here

  {
    int numIndexes = ti.getNumberOfIndexes();

    if (numIndexes > 0)
    {
      DataDescriptorGenerator ddg = getDataDescriptorGenerator();

      for (int indexCtr = 0; indexCtr < numIndexes; indexCtr++)
      {
        initSystemIndexVariables(ddg, ti, indexCtr)
      }
View Full Code Here

    boolean          isEnabled;
    boolean          referencingOld;
    boolean          referencingNew;
    ReferencedColumns rcd;
    TriggerDescriptor    descriptor;
    DataDescriptorGenerator  ddg = dd.getDataDescriptorGenerator();

    if (SanityManager.DEBUG)
    {
      SanityManager.ASSERT(row.nColumns() == SYSTRIGGERS_COLUMN_COUNT,
                 "Wrong number of columns for a SYSTRIGGERS row");
View Full Code Here

    // indicate that we are in the process of booting
    booting = true;

    // set only if child class hasn't overriden this already
    if ( dataDescriptorGenerator == null )
    { dataDescriptorGenerator = new DataDescriptorGenerator( this ); }

    if (!create) {


      // SYSTABLES

      coreInfo[SYSTABLES_CORE_NUM].setHeapConglomerate(
          getBootParameter(startParams, CFG_SYSTABLES_ID, true));

      coreInfo[SYSTABLES_CORE_NUM].setIndexConglomerate(SYSTABLESRowFactory.SYSTABLES_INDEX1_ID,
          getBootParameter(startParams, CFG_SYSTABLES_INDEX1_ID, true));


      coreInfo[SYSTABLES_CORE_NUM].setIndexConglomerate(
          SYSTABLESRowFactory.SYSTABLES_INDEX2_ID,
          getBootParameter(startParams, CFG_SYSTABLES_INDEX2_ID, true));

      // SYSCOLUMNS

      coreInfo[SYSCOLUMNS_CORE_NUM].setHeapConglomerate(
          getBootParameter(startParams, CFG_SYSCOLUMNS_ID, true));


      coreInfo[SYSCOLUMNS_CORE_NUM].setIndexConglomerate(
          SYSCOLUMNSRowFactory.SYSCOLUMNS_INDEX1_ID,
          getBootParameter(startParams, CFG_SYSCOLUMNS_INDEX1_ID, true));
      // 2nd syscolumns index added in Xena, hence may not be there
      coreInfo[SYSCOLUMNS_CORE_NUM].setIndexConglomerate(
          SYSCOLUMNSRowFactory.SYSCOLUMNS_INDEX2_ID,
          getBootParameter(startParams, CFG_SYSCOLUMNS_INDEX2_ID, false));

      // SYSCONGLOMERATES

      coreInfo[SYSCONGLOMERATES_CORE_NUM].setHeapConglomerate(
          getBootParameter(startParams, CFG_SYSCONGLOMERATES_ID, true));


      coreInfo[SYSCONGLOMERATES_CORE_NUM].setIndexConglomerate(
          SYSCONGLOMERATESRowFactory.SYSCONGLOMERATES_INDEX1_ID,
          getBootParameter(startParams, CFG_SYSCONGLOMERATES_INDEX1_ID, true));


      coreInfo[SYSCONGLOMERATES_CORE_NUM].setIndexConglomerate(
          SYSCONGLOMERATESRowFactory.SYSCONGLOMERATES_INDEX2_ID,
          getBootParameter(startParams, CFG_SYSCONGLOMERATES_INDEX2_ID, true));

      coreInfo[SYSCONGLOMERATES_CORE_NUM].setIndexConglomerate(
          SYSCONGLOMERATESRowFactory.SYSCONGLOMERATES_INDEX3_ID,
          getBootParameter(startParams, CFG_SYSCONGLOMERATES_INDEX3_ID, true));


      // SYSSCHEMAS
      coreInfo[SYSSCHEMAS_CORE_NUM].setHeapConglomerate(
          getBootParameter(startParams, CFG_SYSSCHEMAS_ID, true));


      coreInfo[SYSSCHEMAS_CORE_NUM].setIndexConglomerate(
          SYSSCHEMASRowFactory.SYSSCHEMAS_INDEX1_ID,
          getBootParameter(startParams, CFG_SYSSCHEMAS_INDEX1_ID, true));

      coreInfo[SYSSCHEMAS_CORE_NUM].setIndexConglomerate(
          SYSSCHEMASRowFactory.SYSSCHEMAS_INDEX2_ID,
          getBootParameter(startParams, CFG_SYSSCHEMAS_INDEX2_ID, true));

    }



    String value = startParams.getProperty(Property.LANG_TD_CACHE_SIZE);
    tdCacheSize = PropertyUtil.intPropertyValue(Property.LANG_TD_CACHE_SIZE, value,
                     0, Integer.MAX_VALUE, Property.LANG_TD_CACHE_SIZE_DEFAULT);

   
    value = startParams.getProperty(Property.LANG_SPS_CACHE_SIZE);
    stmtCacheSize = PropertyUtil.intPropertyValue(Property.LANG_SPS_CACHE_SIZE, value,
                     0, Integer.MAX_VALUE, Property.LANG_SPS_CACHE_SIZE_DEFAULT);

    value = startParams.getProperty(Property.LANG_SEQGEN_CACHE_SIZE);
    seqgenCacheSize = PropertyUtil.intPropertyValue(Property.LANG_SEQGEN_CACHE_SIZE, value,
                     0, Integer.MAX_VALUE, Property.LANG_SEQGEN_CACHE_SIZE_DEFAULT);

    value = startParams.getProperty(Property.LANG_PERMISSIONS_CACHE_SIZE);
    permissionsCacheSize = PropertyUtil.intPropertyValue(Property.LANG_PERMISSIONS_CACHE_SIZE, value,
                     0, Integer.MAX_VALUE, Property.LANG_PERMISSIONS_CACHE_SIZE_DEFAULT);


    /*
     * data dictionary contexts are only associated with connections.
     * we have to look for the basic data dictionary, as there is
     * no connection, and thus no context stack yet.
     */

    /*
     * Get the table descriptor cache.
     */
    CacheFactory cf =
        (CacheFactory) Monitor.startSystemModule(org.apache.derby.iapi.reference.Module.CacheFactory);
    OIDTdCache =
      cf.newCacheManager(this,
        "TableDescriptorOIDCache",
        tdCacheSize,
        tdCacheSize);
    nameTdCache =
      cf.newCacheManager(this,
        "TableDescriptorNameCache",
        tdCacheSize,
        tdCacheSize);

    if (stmtCacheSize > 0)
    {
      spsNameCache =
        cf.newCacheManager(this,
          "SPSNameDescriptorCache",
          stmtCacheSize,
          stmtCacheSize);
      spsIdHash = new Hashtable(stmtCacheSize);
      // spsTextHash = new Hashtable(stmtCacheSize);
    }

    sequenceGeneratorCache = cf.newCacheManager
            ( this, "SequenceGeneratorCache", seqgenCacheSize, seqgenCacheSize );

    /* Get the object to coordinate cache transitions */
    cacheCoordinator = new ShExLockable();

    /* Get AccessFactory in order to transaction stuff */
    af = (AccessFactoryMonitor.findServiceModule(this, AccessFactory.MODULE);

    /* Get the lock factory */
    lockFactory = af.getLockFactory();

    /*
     * now we need to setup a context stack for the database creation work.
     * We assume the System boot process has created a context
     * manager already, but not that contexts we need are there.
     */
    ContextService csf = ContextService.getFactory();

    ContextManager cm = csf.getCurrentContextManager();
    if (SanityManager.DEBUG)
      SanityManager.ASSERT((cm != null), "Failed to get current ContextManager");

    // RESOLVE other non-StandardException errors.
    bootingTC = null;
    try
    {
      // Get a transaction controller. This has the side effect of
      // creating a transaction context if there isn't one already.
      bootingTC = af.getTransaction(cm);

      /*
        We need an execution context so that we can generate rows
        REMIND: maybe only for create case?
       */
      exFactory.newExecutionContext(cm);

      DataDescriptorGenerator ddg = getDataDescriptorGenerator();

      //We should set the user schema collation type here now because
      //later on, we are going to create user schema APP. By the time any
      //user schema gets created, we should have the correct collation
      //type set for such schemas to use. For this reason, don't remove
View Full Code Here

  public  void  makeCatalog( TabInfoImpl          ti,
                 SchemaDescriptor      sd,
                 TransactionController     tc )
          throws StandardException
  {
    DataDescriptorGenerator ddg = getDataDescriptorGenerator();

    Properties  heapProperties = ti.getCreateHeapProperties();
    ti.setHeapConglomerate(
      createConglomerate(
        ti.getTableName(),
View Full Code Here

TOP

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

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.