Changeset 6350


Ignore:
Timestamp:
2004-01-06T11:46:46+13:00 (20 years ago)
Author:
cs025
Message:

Added index configuration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/collection/GS2CollectionCfg.java

    r6239 r6350  
    1414import org.greenstone.gsdl3.gs3build.classifier.ClassifierManager;
    1515
     16import org.greenstone.gsdl3.gs3build.indexers.*;
     17
    1618import org.greenstone.gsdl3.gs3build.BuildManager;
    1719
     
    1921{
    2022  BuildManager buildManager;
     23  IndexerInterface indexer;
    2124
    2225  class GS2CollectCfgHandler extends GS2TextFileHandler
     
    7073        configurator.addClassifier(classifier);
    7174      }
     75      System.out.println(Runtime.getRuntime().freeMemory());
     76    }
     77    else if (lineType.equals("buildtype")) {
     78      if (this.hasMore()) {
     79        String type = this.getEntry(true);
     80        if (type != null) {
     81          configurator.setBuildType(type);       
     82        }
     83      }
     84    }
     85    else if (lineType.equals("indexes")) {
     86      while (this.hasMore()) {
     87        String index = this.getEntry(true);
     88        if (index != null) {
     89          System.out.println("Adding index " + index);
     90          configurator.addIndex(index);
     91        }
     92      }
    7293    }
    7394      }
     
    98119  }
    99120
     121  void addIndex(String index)
     122  {
     123    if (this.indexer == null) {
     124      this.setBuildType("mg");
     125    }
     126    this.indexer.configure(IndexerInterface.GS2_INDEX_LABEL, index);
     127    System.out.println(Runtime.getRuntime().freeMemory());
     128  }
     129
     130  void setBuildType(String type)
     131  { if (type.equals("mgpp")) {
     132      this.indexer = new MGPPIndexer();
     133    }
     134    else {
     135      this.indexer = new MGIndexer();
     136    }
     137    this.buildManager.addIndexer(this.indexer);
     138  }
     139
    100140  public static GS2CollectionCfg getGS2CollectionCfg(BuildManager manager, File cfgFile)
    101141  { GS2CollectionCfg configurator = new GS2CollectionCfg(manager, cfgFile);
Note: See TracChangeset for help on using the changeset viewer.