DSRG.VSA
Class VSA

java.lang.Object
  |
  +--DSRG.VSA.VSA

public class VSA
extends java.lang.Object
implements java.io.Serializable

View Synchronization Algorithm of DSRG. It only handle the View Definition Evolution.

It includes following functions:

Add Attribute and Add Relation is the responsibility of MKB.

Assume VKB will only represents one Data warehouse. But, VSA can apply to all the data warehouses. Here, I make the VSA class static, it will just provide the algorithm or functions to evolve the VKB and MKB. In later, we maybe create a super class EVE which will contain the VKB and MKB objects.

VSA will give out two view definitions. VA (or View Evolver) will adapt the view from the two view definitions.

See Also:
Serialized Form

Field Summary
private  double cost_IO
          the tradeoff parameters for the costs (unit costs)
private  double cost_M
          the tradeoff parameters for the costs (unit costs)
private  double cost_T
          the tradeoff parameters for the costs (unit costs)
(package private)  MKB mkb
          The MKB this VSA working on.
private  double rho_attr
          the tradeoff parameter for the attributes (therefore also for the extent).
private  double rho_quality
          the tradeoff parameter for the quality (therefore also for the cost).
(package private)  VKB vkb
          The VKB this VSA working on.
 
Constructor Summary
VSA(MKB m, VKB v)
          Constructor of VSA module.
 
Method Summary
(package private)  java.util.Vector computeDerived(java.util.Vector rewritingsV)
          This function will generate all the derived view definitions including basic view definitions from the Vector of the basic view definitions.
(package private)  java.util.Vector createVector(java.util.Enumeration enum)
          Create a Vector from Enumeration
static java.util.Vector deepClone(java.util.Vector v)
          DeepClone a Vector;
(package private)  java.util.Vector dumbSort(java.util.Vector v)
          sorts a vector of Version objects by their QC-Values.
(package private)  java.util.Vector intersect(java.util.Vector vec1, java.util.Vector vec2)
          Intersect two Vectors
(package private)  java.util.Vector POC(View_Definition vd, Attribute att)
          Handle Schema Change: Delete Relation by using POC algorithm.
(package private)  java.util.Vector POC(View_Definition vd, Relation rel)
          Handle Schema Change: Delete Relation by using POC algorithm.
static boolean subset(java.util.Vector sbv, java.util.Vector fsv)
          Test if the first one it the subset of the second Vector
(package private)  java.util.Vector substract(java.util.Vector sdv, java.util.Vector sv)
          Substract one Vector from another Vector.
static java.util.Vector union(java.util.Vector v1, java.util.Vector v2)
          Return union of two EVEVectors of View_Definitions.
 void viewEvolution(Schema_Change chg)
          This method will be called when there is a Schema_Change collected by GISL.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

mkb

MKB mkb
The MKB this VSA working on. That's the place where VSA can get meta-knowledge.

vkb

VKB vkb
The VKB this VSA working on. That's the object VSA will modify. It stores view definitions in an internal format.

rho_attr

private double rho_attr
the tradeoff parameter for the attributes (therefore also for the extent). Used for creating QC-Objects

rho_quality

private double rho_quality
the tradeoff parameter for the quality (therefore also for the cost). Used for creating QC-Objects

cost_M

private double cost_M
the tradeoff parameters for the costs (unit costs)

cost_T

private double cost_T
the tradeoff parameters for the costs (unit costs)

cost_IO

private double cost_IO
the tradeoff parameters for the costs (unit costs)
Constructor Detail

VSA

public VSA(MKB m,
           VKB v)
Constructor of VSA module.
Method Detail

viewEvolution

public void viewEvolution(Schema_Change chg)
This method will be called when there is a Schema_Change collected by GISL. It will consume one schema evolution and evolve the view.

This method will give out two view definitions. One if orginal view definition, the other one is evolved view definition.

It will do three steps:

  1. Get Schema_Change from GISL
  2. Depends on Schema_Change, get affected View Definitions from VKB.
  3. for each View Definition, do VSA (delete , add, Schema_Change)(rel, attr)
Parameters:
chg - Schema_Change which comes from Global IS Layer (GISL), which will collect the update from IS and send them to VSA.

POC

java.util.Vector POC(View_Definition vd,
                     Attribute att)
Handle Schema Change: Delete Relation by using POC algorithm.
Parameters:
vd - View defintion which is going to be evolved.
rel - Relation in MKB which will be dropped.
Returns:
Basic Legal rewritings of vd. It cannot be null.

dumbSort

java.util.Vector dumbSort(java.util.Vector v)
sorts a vector of Version objects by their QC-Values. Uses simple simpleSort (n^2 complexity)

intersect

java.util.Vector intersect(java.util.Vector vec1,
                           java.util.Vector vec2)
Intersect two Vectors
Parameters:
vec1 - First Vector
vec2 - Second Vector
Returns:
An intersection of two vectors. If that is empty return empty vector.

createVector

java.util.Vector createVector(java.util.Enumeration enum)
Create a Vector from Enumeration
Parameters:
enum - Enumeration
Returns:
a Vector, if enum is null, return empty vector

substract

java.util.Vector substract(java.util.Vector sdv,
                           java.util.Vector sv)
Substract one Vector from another Vector.
Parameters:
sdv - Substracted Vector
sv - Substract Vector
Returns:
Vector of result. or an empty vector.

subset

public static boolean subset(java.util.Vector sbv,
                             java.util.Vector fsv)
Test if the first one it the subset of the second Vector
Parameters:
sbv - Subset Vector
fsv - FullsetVector
Returns:
if true, means sbv is subset of fsv.

POC

java.util.Vector POC(View_Definition vd,
                     Relation rel)
Handle Schema Change: Delete Relation by using POC algorithm.
Parameters:
vd - View defintion which is going to be evolved.
rel - Relation in MKB which will be dropped.
Returns:
Basic Legal rewritings of vd. It cannot be null.

computeDerived

java.util.Vector computeDerived(java.util.Vector rewritingsV)
This function will generate all the derived view definitions including basic view definitions from the Vector of the basic view definitions.
Parameters:
rewritingsV - basic legal rewritings of view definition.
Returns:
derived legal rewritings of view definition.

union

public static java.util.Vector union(java.util.Vector v1,
                                     java.util.Vector v2)
Return union of two EVEVectors of View_Definitions.

deepClone

public static java.util.Vector deepClone(java.util.Vector v)
DeepClone a Vector;