Re: Database comments

From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Mon May 22 2000 - 07:13:00 EDT

  • Next message: Peter H. L. Christiansen: "BrTrackFollowFinder updates"

    Hi Flemming et al, 
    
    On Sun, 21 May 2000 14:33:33 -0400 "videbaek" <videbaek@sgs1.hirg.bnl.gov> wrote:
    >   a.. Should the revision or better the parameter object not know
    > number of entries expected. Otherwise we could easily come into a
    > situation where the DB gets filled with a wrong number of entries
    > (e.g. BBL is 44 while BBR is 35). The type is known though the char*
    > fTypeName. Are there anywhere some utility methods (static) that  
    
    I thought of this originally, but dismissed the though, since I
    thought there might be situations where you didn't want to put in a
    full array, or the schema whould change. Ofcourse that would still be
    possible having the size in in the Parameter table, but then the size
    could be misconcieved as the _actually_ number in there. There _is_
    field with called "entries" in the Revision table, which describes how
    many numbers are in the binary array. However, if you think it
    important, I can put it in there. 
    
    >   b.. To make life easier for people we needed some simpler wrapper
    > classes for storing standard revisions . One such prototype is in my
    > BBCalibFill program in my ~root_app/calib directory. I will like to
    > let Yury work with such a simplified version in order he be able to
    > write analysis Module for the beam-beam counter that can write
    > pedestal and pedestalWidth into the DB (even a preliminary). This
    > would also serve as a general prototype. 
    
    Your example pii3:~videbaek/root_app/calib/BBCalibFill.cxx is to the
    point. However, I think that the "void  FillAndCommit(...)" could be a
    method of "BrParameterData", called "void Commit(void)", looking
    something like:
    
      void
      BrParameterData::Commit(BrCalibrationsDb* calibDb) {
        // If revision type exist, nothing is done, except copy in memory
        // is updated with proper values of the ID 
        calibDb->AddRevisionType(fRevisionType); 
    					     
        // Maske sure the right ID's are ion the revision. 
        fRevision->SetTypeID(fRevisionType->GetDBID()); 
        fRevision->SetParameterID(fParameter->GetDBID()); 
    
        // Commit to database
        calibDb->AddRevision(fRevision); 
      }
    
    This method could be called from "BrParameterElement" via a method
    like:
    
      BrParameterElement::Commit(const Char_t* parameterList) 
      {
        TString* list = new TString(parameterList);
        TIter next(fParameterDataList); 
        BrParameterData* data = 0;
      
        while((data = (BrParameterData*)next())) {
          if (list->Contains(data->fParameterName)) 
            data->Commit(fCalibDb);
        }
      }
    
    Ofcourse all this would look like:
    
      BrCalibrationsDb* calibDb = mainDb->ConnectToCalib();
      BrCalibrationParamsBB* bblpar = 
         static_cast<BrCalibrationParamsBB*> 
           (manager->Register("BrCalibrationParamsBB","BBL"));
      // Do something. 
    
      bblpar->GetPedestal()->GetRevision()->SetComment("fubar");
      bblpar->GetPedestal()->GetRevision()->SetArray(someArray);
      // .. and so on. 
    
      bblpar->Commit("pedestal,pedestalwidth"); 
      // .. and so on. 
    
    > c.. I do also think we should (soon) start a beta-version database
    > for people in general to use. We can have it initial on pii3, but
    > would like it to move to a RCF machine. We should decide on what
    > machine. Does it have to be on a linux box, or can it also be on
    > Solaris ? For a start we could use of the the rcas0001/2 machines
    > which has 35 GB worth of disk, and then assign a dedicated machine
    > later. 
    
    I'm ok with a Beta database now. However, I'd like to have the schema
    down; that is, changes like suggested in "a.." above should probably
    be done first. Hence, I'd like for everyone to give things like that
    some thought, and I you want something more/less, tell me, and I'll do
    what has to be done, and a beta database could be up and running in no
    time. 
     
    > d.. We should also establish backup, logging procedure, recovery.
    
    One can start the MySQL server with some switch so that it logs every
    query to ASCII file. That file, ofcourse, will be huge. As to backup:
    a simple "tar" should surfice, but I believe several tools are
    avaliable for more fancy backups. I'll browse around, and maybe Betty
    and Konstantin could figure out what is do-able on the pii's. 
    
    Cheers, 
    
    Christian  -----------------------------------------------------------
    Holm Christensen                             Phone:  (+45) 35 35 96 91 
      Sankt Hansgade 23, 1. th.                  Office: (+45) 353  25 305 
      DK-2200 Copenhagen N                       Web:    www.nbi.dk/~cholm    
      Denmark                                    Email:       cholm@nbi.dk
    



    This archive was generated by hypermail 2b29 : Mon May 22 2000 - 07:16:40 EDT