hcg-struct-migration.ppt

Document Sample
hcg-struct-migration.ppt Powered By Docstoc
					                 Migration Strategy
               (hcg_* to TT->TS<-VW)
   Proposed 96s523 chgen project
   Hcg-structs used by chgen and pr-util.a
   Difficult to understand and maintain
   Reverse-engineer --> equiv. data model
   Add to schema.h and pr_loaded view
   Update, continuously track hcg_structs
   Specify and check runtime invariants
   Incrementally convert each client
   Maintain duality during coexistence
   At 100% cut-over, can eliminate hcg_*.

     UML CS Dept. 95f523 hcg-struct-migration.ppt - 1 RJL pre-981107
           Current hcg- Structures
hcg_ts-list: Array [0.HXCG_NUM_TABLES] of ts_list_type:
  ts_list_type: Array[0 ..MAXVERSIONS- 1] of ts_list_elt_type]:
    ts_list_elt_type:
       maxrow // largest row number[or pkey?] value in version
       rcount // total number of table rows in version


hcg_view_list_type: // holds version# of each table in each named view
{ int num_views        // at most MAXVIEWS (= 10)
   Array[0..MAXVIEWS] of view_elt_type
     viewname[30] char // runtime value - must search by name
     mode              char // r=read; w=write; a=append
     version_list: Array[0..HCG_NUM_TABLES-1] of version_list_elt:
           version_list_elt: char //unsigned int [0..MAXVERSION <=255]
}hcg_view_list 95f523
     UML CS Dept.       hcg-struct-migration.ppt - 2 RJL pre-981107
                   hcg_table hierarchy
              Views and table versions for each table
              hcg_ts_list                    hcg_view_list                root level
                                               num_views I2               (one row
                                                                           in each)
                     1:HCG_NUM_TABLES
                                                          1:MAXVIEWS
 (one row       ts_list                       view_element_type
 per table)                                                               (one row
                                       _
                                       _        viewname c30              per view)
                                                mode       c1
                    1:MAXVERSIONS
           ts_type
                                   1:HCG_NUM_TABLES
             maxrow                                                       (one row
(per table   rcount                           version_list_elt            per view
version in                                      versionNo      c1         name and
loaded views?)                                                            table
                                                                          version)
     Proposal: Merge top tables; merge bottom tables.
        UML CS Dept. 95f523 hcg-struct-migration.ppt - 3 RJL pre-981107
             Hcg-equivalent Data Model
                              SV Schema Version                            This model
                               schemaName c30                              adds tables
                               schemaVersion i2                            VV and TS
                               num_tables     i2                           to the genv9
                               ...                                         schema
                                                                           SV-->TT-->TA
           VV ViewVersion                       TT Table Type
            viewName c30                          ttabbrev c4
            mode       c1                         maxver i2
            num_tables i2                         rcount i2
Tables VV, TS and VS
contain the same attributes                                TA Table Attribute
that chgen now declares     TS TableStats
and maintains as the hcg_*   versionNo i2                  ...
structures in schemaname.h.  maxrow i2                     ... (as in chgen v9)
(Exception: version rcount   vrcount i2                    ...
 becomes vrcount.)
         UML CS Dept. 95f523 hcg-struct-migration.ppt - 4 RJL pre-981107
       Path Extensions to MetaSchema
                                                                      SV
   Schema tables TT andTA do not
    capture the schema topology.
   Network paths are defined by fkeys                                TT
    and connect tables.
   Fkey (FK) is a sub-class of TA.
                                                             TA                  PA
   Path (PA) is a sequence of fkeys.
   Many PAths share fkeys.
   Table IK (Intermediate fKey)
    associates FK’s and PAths.                                       FK
   From table PA, access macros can
    be defined.
   Each path has an orientation; IK
    identifies path’s first or last fkey.                                   IK

          UML CS Dept. 95f523 hcg-struct-migration.ppt - 5 RJL pre-981107
         Alternate Path Data Model (2)
   Paths are either direct (one fkey) or
    composite (multi-fkey)                                            SV
   Each PAth has exactly one fkey
    (FK) component.
   PAths are linear sequences, with a                                 TT
    ‘head’ fkey and a ‘tail’ composite
    path or sub-path.
                                                              TA                       PA
   This leads to a cyclic schema: PA--
    >FK:CP-->PA...->FK.                                                          1:1     1:1

   Eventually the PA shrinks to an fkey                                   1:1         0:1
    and CP vanishes (mincard = 0).                                    FK                     SP
   Chgen cannot handle alternate
    paths, only unique ones.


         UML CS Dept. 95f523 hcg-struct-migration.ppt - 6 RJL pre-981107
       Alternate Path Data Model (3)
                                                                       SV
   Paths are either direct (one fkey)
    or composite (multi-fkey)
   Each PAth has exactly one fkey                   TT
    (FK) component.
   PAths are linear sequences, with a
    ‘head’ fkey and a ‘tail’ composite TA                    rest-of
    path or sub-path.                          bottom        -path
                                                  -link
   Upward paths branch out at each
    table with In-degree >1.                   FK
   Fkeys become part of more than      alternate
    one PAth; therefore, FK--->PA is    upward
    1:1::1:M.                             paths         PA
                                                   pathLength
   The dashed TT-->PA relation is                  1:1 1:1
    redundant.                                          0:1 1:M
                                                  PT (PathTail)
     UML CS Dept. 95f523 hcg-struct-migration.ppt - 7 RJL pre-981107

				
DOCUMENT INFO
Shared By:
Categories:
Stats:
views:3
posted:10/1/2011
language:English
pages:7