DSRG.VKB
Class Version

java.lang.Object
  |
  +--DSRG.VKB.Version

public class Version
extends java.lang.Object

this class is needed to support the QC-Model. It contains a view definition, and a vector of suggestions for its rewriting after a certain schema change. Those suggestions are not materialized, but they have "QC-Values", which are objects of another new class, called "QC".


Field Summary
private static boolean DEBUG
           
private  View_Definition definition
           
private  MKB myMKB
           
private  View_Definition oldDefinition
           
private  QC qcValues
           
private  double w_nonrepl
          the tradeoff parameters for replaceable and non-replaceable attributes, this will not be in the QC-class.
private  double w_repl
          the tradeoff parameters for replaceable and non-replaceable attributes, this will not be in the QC-class.
 
Constructor Summary
Version(View_Definition myOldDefinition, View_Definition myDefinition, QC myQCValues, MKB theMKB)
          the constructor creates a version of a view.
 
Method Summary
private  long computeCF_IO()
          compute number of I/O-operations.
private  long computeCF_M()
          compute number of messages.
private  long computeCF_T()
          Compute number of transferred bytes.
We need to compute how many bytes are transferred between view site and ISs.
private  double computeDDattr()
          compute DDattr from the View Definition
private  double computeDDext()
          compute DDext from the ViewDefinitions.
private  double computeQV(View_Definition vd)
          compute Q(V) --- the intermediate value needed to compute DD_attr
 java.lang.String getDefinition()
          returns the (SQL-)definition of this version
 View_Definition getDefinitionAsObject()
          returns the View_Definition object of this version
 View_Definition getOldDefinitionAsObject()
          returns the View_Definition object of the old VD of this version
 QC getQC()
          returns the QC-Object of this version
private  long viewSizeEstimate(View_Definition def)
          private method to compute the number of tuples in a view (by multiplying selectivities and relation sizes
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG

oldDefinition

private View_Definition oldDefinition

definition

private View_Definition definition

qcValues

private QC qcValues

w_repl

private double w_repl
the tradeoff parameters for replaceable and non-replaceable attributes, this will not be in the QC-class. not sure if that's good (ask Xin and Elke)

w_nonrepl

private double w_nonrepl
the tradeoff parameters for replaceable and non-replaceable attributes, this will not be in the QC-class. not sure if that's good (ask Xin and Elke)

myMKB

private MKB myMKB
Constructor Detail

Version

public Version(View_Definition myOldDefinition,
               View_Definition myDefinition,
               QC myQCValues,
               MKB theMKB)
the constructor creates a version of a view.
Method Detail

computeDDattr

private double computeDDattr()
compute DDattr from the View Definition
Returns:
DDattr-value

computeQV

private double computeQV(View_Definition vd)
compute Q(V) --- the intermediate value needed to compute DD_attr

computeDDext

private double computeDDext()
compute DDext from the ViewDefinitions. For POC without approximate PC-constraints, it is sufficient to count the smaller of the two views as overlap. That's all we need. So we'll just get a size of the view before and after view synchronization. For the latter, we use the same algo as for CF_T (for current_no_of_tuples) :)

viewSizeEstimate

private long viewSizeEstimate(View_Definition def)
private method to compute the number of tuples in a view (by multiplying selectivities and relation sizes

computeCF_M

private long computeCF_M()
compute number of messages. Simplified over the paper (the case of no other relations in the updated IS is not covered, i.e., we always have twice as many messages as information sources. The error should be minimal. Maybe I'll fix that later.

computeCF_T

private long computeCF_T()
Compute number of transferred bytes.
We need to compute how many bytes are transferred between view site and ISs. So we take an update in relation R1, send it to the site of Relation R2, get the result, and so on. We have to somehow take into account that several relations can reside in the same IS.
As a simplification, I won't take into account where the update came from. I will just assume the cost for a complete recomputation of one tuple of the leftmost relation in the view. Will be extended later.

computeCF_IO

private long computeCF_IO()
compute number of I/O-operations. As a first hack, this is the number of total bytes divided by the blocking factor :)

getDefinitionAsObject

public View_Definition getDefinitionAsObject()
returns the View_Definition object of this version

getOldDefinitionAsObject

public View_Definition getOldDefinitionAsObject()
returns the View_Definition object of the old VD of this version

getDefinition

public java.lang.String getDefinition()
returns the (SQL-)definition of this version

getQC

public QC getQC()
returns the QC-Object of this version