Changeset 3532


Ignore:
Timestamp:
Jun 27, 2007, 4:35:33 PM (14 years ago)
Author:
Martin Svensson
Message:

Fixes #358 Better info from migration tool

Location:
trunk
Files:
40 edited

Legend:

Unmodified
Added
Removed
  • trunk/config/dist/log4j.properties

    r3529 r3532  
    44log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    55log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
    6 log4j.appender.stdout.Threshold=ERROR
    76
    87### direct messages to file hibernate.log ###
     
    5352# -----------------
    5453#log4j.logger.net.sf.basedb.clients.migrate=warn
    55 log4j.logger.net.sf.basedb.clients.migrate=debug, migfile
     54log4j.logger.net.sf.basedb.clients.migrate=warn, migfile
    5655
    5756# -----------------
  • trunk/doc/src/docbook/appendix/other_config.xml

    r3334 r3532  
    3838    <title>log4.properties</title>
    3939    <para>TODO</para>
     40    <sect2 id="appendix.otherconfig.log4j.migration">
     41      <title>Migration logger</title>
     42      <para>
     43        The migration logger is by default set to <constant>warn</constant> and
     44        the output will be put in a file called <filename>migration.log</filename>, located
     45        in the same directory as the migration is executed from (normaly
     46        <filename class="directory">base2root/bin/</filename>).
     47      </para>
     48      <para>
     49        The common logger for the migration is called
     50        <classname>log4j.logger.net.sf.basedb.clients.migrate</classname>
     51        and sets general properties for the whole migration logging, but each class/item
     52        transfer can also have separate levels of logging. Logging for a separate class is set by
     53        defining the level for the class logger to use. Setting the level for a sublogger
     54        is done like this:
     55        <classname>
     56          log4j.logger.net.sf.basedb.clients.migrate.<replaceable>Classname</replaceable>
     57        </classname>
     58        =
     59        <replaceable>level</replaceable>
     60      </para>
     61    </sect2>
    4062  </sect1>
    4163
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/AnnotationTransfer.java

    r3531 r3532  
    9191    int count = getInt("countSampleAnnotations");
    9292    initIdMap(count);
    93     startProgress(count);
     93    startProgress(count, "Annotations");
    9494    runUnBatched(
    9595        prepareStatementFromFile("selectSampleAnnotations"), 0, getBatchSize());
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/AnnotationTypeTransfer.java

    r3531 r3532  
    7979    int count = getInt("countSampleAnnotationTypes");
    8080    initIdMap(count);
    81     startProgress(count);
     81    startProgress(count, "AnnotationTypes");
    8282    run(prepareStatementFromFile("selectSampleAnnotationTypes"));
    8383    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ArrayBatchTransfer.java

    r3529 r3532  
    111111    int count = getInt("countArrayBatches");
    112112    initIdMap(count);
    113     startProgress(count);
     113    startProgress(count, "ArrayBatches");
    114114    runUnBatched(prepareStatementFromFile("selectArrayBatches"), 0, getBatchSize());
    115115    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ArrayBlockTransfer.java

    r3531 r3532  
    9696  {
    9797    log.info("Transfering ArrayBlocks...");
    98     startProgress(getInt("countFeatures"));
     98    startProgress(getInt("countFeatures"), "ArrayBlocks");
    9999    DbControl dc = null;
    100100    for (Map.Entry<Integer, Integer> entry : arrayTypeT.getIdMap().entrySet())
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ArraySlideTransfer.java

    r3531 r3532  
    8989    int count = getInt("countArraySlides");
    9090    initIdMap(count);
    91     startProgress(count);
     91    startProgress(count, "ArraySlides");
    9292    run(prepareStatementFromFile("selectArraySlides"));
    9393    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ArrayTypePlateTransfer.java

    r3531 r3532  
    8585  {
    8686    log.info("Transfering ArrayTypePlates...");
    87     startProgress(arrayTypeT.getCount());
     87    startProgress(arrayTypeT.getCount(), "ArrayTypePlates");
    8888    DbControl dc = newDbControl();
    8989    for (Map.Entry<Integer, Integer> entry : arrayTypeT.getIdMap().entrySet())
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ArrayTypeTransfer.java

    r3531 r3532  
    7878    int count = getInt("countArrayTypes");
    7979    initIdMap(count);
    80     startProgress(count);
     80    startProgress(count, "ArrayTypes");
    8181    PreparedStatement ps = prepareStatementFromFile("selectArrayTypes");
    8282    runUnBatched(ps, 0, getBatchSize());
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ExperimentTransfer.java

    r3531 r3532  
    8989    int count = getInt("countExperiments");
    9090    initIdMap(count);
    91     startProgress(count);
     91    startProgress(count, "Experiments");
    9292    run(prepareStatementFromFile("selectExperiments"));
    9393    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ExtractTransfer.java

    r3531 r3532  
    8080    int count = getInt("countExtracts");
    8181    initIdMap(count);
    82     startProgress(count);
     82    startProgress(count, "Extracts");
    8383    run(prepareStatementFromFile("selectExtracts"));
    8484    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/GroupTransfer.java

    r3531 r3532  
    101101      int count = getInt("countGroups");
    102102      initIdMap(count);
    103       startProgress(count);
     103      startProgress(count, "Groups");
    104104      run(prepareStatementFromFile("selectGroups"));
    105105      done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/HardwareTransfer.java

    r3531 r3532  
    8282    int count = getInt("countHardware");
    8383    initIdMap(count);
    84     startProgress(count);
     84    startProgress(count, "Hardwares");
    8585    run(prepareStatementFromFile("selectHardware"));
    8686    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/HybridizationTransfer.java

    r3531 r3532  
    9999    int count = getInt("countHybridizations");
    100100    initIdMap(count);
    101     startProgress(count);
     101    startProgress(count, "Hybridizations");
    102102    run(prepareStatementFromFile("selectHybridizations"), 0, getBatchSize());
    103103    done();
     
    119119      throws BaseException, SQLException
    120120  {   
    121     log.debug("transfer Hybridization:" + rs.getInt(6) + " with id " + rs.getInt(1) + " from BASE1");
     121    log.debug("transfer Hybridization:" + rs.getString(6) + " with id " + rs.getInt(1) + " from BASE1");
    122122    Hybridization hybridization = Hybridization.getNew(dc);
    123123    setCommonItemData(dc, (CommonItem) hybridization, rs);
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ImageFileTransfer.java

    r3531 r3532  
    9898    initIdMap(count);
    9999    // Initiate imageChannels
    100     startProgress(count);
     100    startProgress(count, "ImageFiles");
    101101    runUnBatched(prepareStatementFromFile("selectImages"), 0, getBatchSize());
    102102    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/LabelTransfer.java

    r3529 r3532  
    8181    int count = getInt("countLabels");
    8282    initIdMap(count);
    83     startProgress(count);
     83    startProgress(count, "Labels");
    8484    run(prepareStatementFromFile("selectLabels"), 0, getBatchSize());
    8585    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/LabeledExtractTransfer.java

    r3531 r3532  
    9494    int count = getInt("countLabeledExtracts");
    9595    initIdMap(count);
    96     startProgress(count);
     96    startProgress(count, "LabeledExtracts");
    9797    run(prepareStatementFromFile("selectLabeledExtracts"), 0, 1000);
    9898    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/MappedPlateTransfer.java

    r3531 r3532  
    115115  {
    116116    log.info("Transfering MappedPlates...");
    117     startProgress(getInt("countDistinctPlateParents"));
     117    startProgress(getInt("countDistinctPlateParents"), "MappedPlates");
    118118    log.info("Create plate mappings");
    119119    createPlateMappings();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/NewsTransfer.java

    r3529 r3532  
    7474    int count = getInt("countNews");
    7575    initIdMap(count);
    76     startProgress(count);
     76    startProgress(count, "News");
    7777    run(prepareStatementFromFile("selectNews"));
    7878    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/PlateEventTransfer.java

    r3531 r3532  
    8888    int count = getInt("countPlateEvents");
    8989    initIdMap(count);
    90     startProgress(count);
     90    startProgress(count, "PlateEvents");
    9191    run(prepareStatementFromFile("selectPlateEvents"));
    9292    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/PlateEventTypeTransfer.java

    r3531 r3532  
    8484    int count = getInt("countPlateEventTypes");
    8585    initIdMap(count);
    86     startProgress(count);
     86    startProgress(count, "PlateEventTypes");
    8787    run(prepareStatementFromFile("selectPlateEventTypes"));
    8888    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/PlateTypeTransfer.java

    r3531 r3532  
    8989      stop();
    9090    }
    91     startProgress(count);
     91    startProgress(count, "PlateTypes");
    9292    run(prepareStatementFromFile("selectPlateTypes"), 0, getBatchSize());
    9393    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/PluginTransfer.java

    r3531 r3532  
    8181    int count = getInt("countPlugins");
    8282    initIdMap(count);
    83     startProgress(count);
     83    startProgress(count, "Plugins");
    8484   
    8585    DbControl dc = newDbControl();
     
    109109  public void createItem(ResultSet rs)
    110110  {
     111    String base1Properties = null;
    111112    DbControl dc = newDbControl();
    112113    try
    113     {   
     114    {
     115      base1Properties = rs.getInt(ID) + ":" + rs.getString(NAME);
    114116      if(log.isDebugEnabled())
    115117      {
     
    179181    catch (BaseException e)
    180182    {
    181       log.warn("Couldn't create configuration file for BASE 1 plugin");
     183      log.warn("Couldn't create configuration file[" + base1Properties + "] for BASE 1 plugin");
    182184      if (log.isDebugEnabled()) log.debug("\t" + e);
    183185    }
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ProgressThread.java

    r3410 r3532  
    7474   */
    7575  Thread progress = null;
     76  /**
     77   The itemType that is transfered
     78   */
     79  private String itemType;
    7680
    7781  /**
    7882  @param endCount Total number of items that will be transfered
    7983   */
    80   ProgressThread(int endCount)
     84  ProgressThread(int endCount, String itemType)
    8185  {
    8286    this.endCount = endCount;
     87    this.itemType = itemType;
    8388    progress = new Thread(this);
    8489  }
     
    9196    if (unused)
    9297    {
     98      if (itemType != null)
     99      {
     100        printDate();
     101        System.out.println(itemType);
     102      }
    93103      printDate();
    94104      System.out.printf(
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ProtocolTransfer.java

    r3531 r3532  
    9393      int count = getInt("countProtocols");
    9494      initIdMap(count);
    95       startProgress(count);
     95      startProgress(count, "Protocols");
    9696      run(prepareStatementFromFile("selectProtocols"), 0, getBatchSize());
    9797      done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ProtocolTypeTransfer.java

    r3531 r3532  
    7373      }
    7474      b2c.close();
    75       startProgress(count);
     75      startProgress(count, "ProtocolTypes");
    7676      run(prepareStatementFromFile("selectProtocolTypes"), 0, getBatchSize());
    7777      done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/RawBioAssayDataTransfer.java

    r3531 r3532  
    100100    log.info("Transfering RawBioAssayData...");
    101101    int count = getInt("countRawBioAssayData");
    102     startProgress(count);
     102    startProgress(count, "RawBioAssaysData");
    103103    runUnBatched(
    104104        prepareStatementFromFile("selectRawBioAssaysWithSpotData"), 0,
     
    233233        rd.setX(rs.getFloat(6));
    234234        rd.setY(rs.getFloat(7));
     235        log.info(QUICK_TRANSFER ? "QUICK_TRANSFER set - extended propteries will not be transfered" : "transfering extended properties");
    235236        if (!QUICK_TRANSFER)
    236237        {
    237238          int colIndex = 8; // Extended properties start at the 8:th
    238239                    // column
    239           log.info("...transfering extended properties");
    240240          for (String property : floatProperties)
    241241          {
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/RawBioAssayTransfer.java

    r3531 r3532  
    9696    int count = getInt("countRawBioAssays");
    9797    initIdMap(count);
    98     startProgress(count);
     98    startProgress(count, "RawBioAssay");
    9999    run(prepareStatementFromFile("selectRawBioAssays"), 0, getBatchSize());
    100100    done();
     
    132132    else
    133133    {
    134       log.warn("RawBioAssay " + rs.getInt(1) + " doesn't have an ArrayDesign");
     134      log.info("RawBioAssay " + rs.getInt(1) + " doesn't have an ArrayDesign");
    135135    }
    136136    String fileHeader = rs.getString(22);
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ReporterTransfer.java

    r3531 r3532  
    9797   
    9898    int count = getInt("countReporters");
    99     startProgress(count*2); // First pass creates reporters, second one reads in the new ID:s
     99    startProgress(count*2, "Reporters"); // First pass creates reporters, second one reads in the new ID:s
    100100    PreparedStatement ps = QUICK_TRANSFER ? prepareStatementFromFile("selectMinimumReporters")
    101101        : prepareStatementFromFile("selectReporters");
     
    139139  protected void run(PreparedStatement ps, int from, int size)
    140140  {
     141    String base1Properties = null;
    141142    cleanUpMemory();
    142143    try
     
    148149      while (rs.next())
    149150      {
     151        base1Properties = rs.getInt(1) + ":" + rs.getString(2);
    150152        rowCount++;
    151153        ReporterData item = createDataItem(rs);
     
    172174    catch (BaseException e)
    173175    {
    174       log.error("FAILED when transfering reporter", e);
     176      log.error("FAILED when transfering reporter[" + base1Properties + "]", e);
    175177      stop();
    176178    }
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/RoleTransfer.java

    r3529 r3532  
    108108    log.info("Transfering roles...");
    109109    // The number of roles created is static
    110     startProgress(21);
     110    startProgress(21, "Roles");
    111111    log.debug("Administrator has mask " + ADMINISTRATOR);
    112112    log.debug("Supervisor has mask " + SUPERVISOR);   
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/SampleTissueTransfer.java

    r3529 r3532  
    6363    int count = getInt("countSampleTissues");
    6464    initIdMap(count);
    65     startProgress(count);
     65    startProgress(count, "SampleTissues");
    6666    run(prepareStatementFromFile("selectSampleTissues"), 0, getBatchSize());
    6767    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/SampleTransfer.java

    r3531 r3532  
    103103      stop();
    104104    }
    105     startProgress(count);
     105    startProgress(count, "Samples");
    106106    run(prepareStatementFromFile("selectSamples"), 0, getBatchSize());
    107107    done();
     
    123123      throws BaseException, SQLException
    124124  {
     125    if (log.isDebugEnabled()) log.debug("Transfering Sample:" + rs.getString(6) + "BASE1 id(" + rs.getInt(1) + ")");
    125126    Sample sample = Sample.getNew(b2c);
    126127    setMeasuredBioMaterialData(b2c, (MeasuredBioMaterial) sample, rs);
     
    145146       
    146147      if (sampleTissue != null) log.debug("SampleTissue " + sampleTissue + " is included in the sample's description");
    147       log.debug("Transfered Sample: " + sample.getName() + "\tBASE1 id(" + rs.getInt(1));
     148      log.debug("Transfered Sample: " + sample.getName() + "\tBASE1 id(" + rs.getInt(1) + ")");
    148149      log.debug("--------------------------------------------------------------------------");
    149150    }
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ScanTransfer.java

    r3531 r3532  
    7979    int count = getInt("countScans");
    8080    initIdMap(count);
    81     startProgress(count);
     81    startProgress(count, "Scans");
    8282    run(prepareStatementFromFile("selectScans"), 0, getBatchSize());
    8383    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/SoftwareTransfer.java

    r3531 r3532  
    6666    int count = getInt("countSoftware");
    6767    initIdMap(count);
    68     startProgress(count);
     68    startProgress(count, "Softwares");
    6969    run(prepareStatementFromFile("selectSoftware"), 0, getBatchSize());
    7070    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/Transfer.java

    r3531 r3532  
    257257  Creates a new progress if needed and starts it.
    258258   */
    259   protected void startProgress(int items)
     259  protected void startProgress(int items, String itemType)
    260260  {
    261261    if (progress == null)
    262262    {
    263       progress = new ProgressThread(items);
     263      progress = new ProgressThread(items, itemType);
    264264      progress.start();
    265265    }
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/UnmappedPlateTransfer.java

    r3531 r3532  
    9090    initIdMap(count);
    9191    destroyedPlates = new HashMap<Integer, Boolean>(count);
    92     startProgress(count);
     92    startProgress(count, "UnmappedPlates");
    9393    runUnBatched(prepareStatementFromFile("selectUnmappedPlates"), 0, getBatchSize());
    9494    done();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/UploadFileTransfer.java

    r3531 r3532  
    132132    int rows = getInt("countUploads") + getInt("countProtocols")
    133133        + getInt("countImages") + getInt("countRawBioAssays");
    134     startProgress(rows);
     134    startProgress(rows, "Uploaded files");
    135135    transferUploads(prepareStatementFromFile("selectUploads"));
    136136    transferProtocolFiles(prepareStatementFromFile("selectProtocolFiles"));
     
    298298      else
    299299      {
    300         log.warn(fileName + "missing");       
     300        log.debug("Couldn't get md5 for file: " + fileName + ":" + rs.getString(ID));
     301        log.warn("File:" + fileName + " with Base1Id:" + rs.getString(ID) + " will not be uploaded to BASE2");
    301302      }
    302303    }
    303304    else
    304305    {
    305       log.warn("User with id " + rs.getInt(1) + " doesn't exist.");
     306      log.warn("User with id " + rs.getInt(2) + " doesn't exist.");
    306307    }
    307308    if (dc.isConnected())
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/UserTransfer.java

    r3531 r3532  
    128128      int count = getInt("countUsers");
    129129      initIdMap(count);
    130       startProgress(count);
     130      startProgress(count, "Users");
    131131      groupUserAccessMap = new HashMap<Integer, Integer>(count);
    132132      base1FileQuota = new HashMap<Integer, Long>(count);
     
    156156        // Create home directories for transferred users
    157157        log.info("Creating home directories for transfered users");
    158         ProgressThread progress = new ProgressThread(users.size());
     158        ProgressThread progress = new ProgressThread(users.size(), "Home directories");
    159159        progress.start();
    160160        for (User user : users)
     
    296296  public void finalizeQuota()
    297297  {
    298     startProgress(base1FileQuota.size());
     298    startProgress(base1FileQuota.size(), "FinalizeQuota");
    299299    DbControl dc = newDbControl();
    300300    log.info("Adjusting Quota in BASE2");
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/WellTransfer.java

    r3531 r3532  
    102102    commentAT = getAnnotationTypeByName(dc, "Comment");
    103103    dc.close();
    104     startProgress(countPlates());
     104    startProgress(countPlates(), "Wells");
    105105    annotateWellsForEachPlate();
    106106    progress.stop();
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/WizzzardTransfer.java

    r3531 r3532  
    7575    int count = getInt("countWizzzards");
    7676    initIdMap(count);
    77     startProgress(count);
     77    startProgress(count, "Wizzzards");
    7878    runUnBatched(prepareStatementFromFile("selectWizzzards"), 0, getBatchSize());
    7979    done();
     
    8383  {
    8484    DbControl dc = newDbControl();
     85    String base1Properties = null;
    8586    try
    8687    {
    87       log.debug("Transfering Base1 name=" + rs.getString(NAME) + "; id="+rs.getInt(ID));
     88      base1Properties = rs.getInt(ID) + ":" + rs.getString(NAME);
     89      log.debug("Transfering Wizzard: " + base1Properties);
    8890      String formatType = rs.getString(9);
    8991      PluginDefinition pluginDefinition = getPluginDefinition(
     
    315317    catch (BaseException e)
    316318    {
    317       log.warn("The transfer of wizzzard was interrupted");
     319      log.warn("The wizzard [" + base1Properties + "] could not be transfered");
    318320      if (log.isDebugEnabled()) log.debug("\t" + e);
    319321    }
Note: See TracChangeset for help on using the changeset viewer.