Ignore:
Timestamp:
2014-08-20T22:03:28+12:00 (10 years ago)
Author:
ak19
Message:

SOLR related. TEMPORARY changes for the GS3 workshop. Owing to the change to Solr 4.7.2, solr collections can't re-build despite activate if the GS3 server is running because there is a conflict with the jetty server launched by buildcol and jetty finds a lock on the index. The result is that one can't search the solr index after such a rebuild. Dr Bainbridge suggested a temporary measure: instead of commandline building solr collections, we will now build them in GLI. GLI will build solr collections with activate on but, for solr collections alone, it will stop the GS3 server before a build and start it again upon completion. In future, we will get rid of the solr jetty server and just have solr running over HTTP from tomcat. The Java GS3 runtime code will have to access Solr as a HTTPSolrServer rather than as an EmbeddedSolrServer at that point.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r26573 r29222  
    7979import org.w3c.dom.*;
    8080
     81import org.greenstone.gatherer.util.GS3ServerThread;
     82
    8183/** This class manages many aspects of the collection, from its creation via scripts, data access via methods and its importing and building into the final collection. It is also responsible for firing appropriate event when significant changes have occured within the collection, and for creating a new metadata set manager as necessary.
    8284 * @author John Thompson
     
    215217    command_parts_list.add("-language");
    216218    command_parts_list.add(Configuration.getLanguage());
     219
     220    // For now, for solr collections, we pass in -activate
     221    // but GLI won't do moving building to index
     222   
     223    if(CollectionManager.isSolrCollection()) {
     224        command_parts_list.add("-activate");
     225    }
    217226
    218227    if(Gatherer.GS3) {
     
    17341743           
    17351744        if ( CollectionDesignManager.buildcolWasFull() ) {
    1736             if(installCollection()) {
     1745
     1746        // No installCollection() for GS3 solr collection: activate will take care of that
     1747        // and no call to configGS3Server for solr collection
     1748        if(CollectionManager.isSolrCollection()) {
     1749       
     1750        DebugStream.println("Solr collection build complete: building already moved to index by activate.pl.");
     1751       
     1752        // Finished building,
     1753        // For now, for a GS3 solr collection, we'd have stopped the GS3 server before building
     1754        // and will now need to restart it.
     1755        GS3ServerThread thread = new GS3ServerThread(Configuration.gsdl3_src_path, "restart");
     1756        thread.start();
     1757
     1758        // sleep before returning and doing the configGS3Server: give the GS3 server time to restart   
     1759        try {
     1760            Thread.sleep(5000);
     1761        } catch(Exception e) {
     1762            e.printStackTrace();
     1763        }
     1764       
     1765        }
     1766       
     1767        else if(installCollection()) {
    17371768            // If we have a local library running then ask it to add our newly create collection
    17381769            if (LocalLibraryServer.isRunning() == true) {
     
    19872018    }
    19882019
     2020    public static String getBuildType() {
     2021    String buildType = (new CollectionMeta( CollectionDesignManager.collect_config.getBuildType() )).getValue(CollectionMeta.TEXT);
     2022    return buildType;
     2023    }
     2024
     2025    public static boolean isSolrCollection() {
     2026    return (Gatherer.GS3 && CollectionManager.getBuildType().equals("solr"));
     2027    }
     2028
    19892029
    19902030    /** Install collection by moving its files from building to index after a successful build.
     
    19992039    }
    20002040
    2001        
     2041    if(CollectionManager.isSolrCollection()) {
     2042        // No installCollection() for GS3 solr collection: activate will take care of that
     2043        DebugStream.println("Solr collection build complete: building already moved to index by activate.pl.");
     2044
     2045        // Finished building,
     2046        // For now, for a GS3 solr collection, we'd have stopped the GS3 server before building
     2047        // and will now need to restart it.
     2048        GS3ServerThread thread = new GS3ServerThread(Configuration.gsdl3_src_path, "restart");
     2049        thread.start();
     2050
     2051        return true;
     2052    }
     2053
     2054
    20022055    DebugStream.println("Build complete. Moving files.");
    20032056
Note: See TracChangeset for help on using the changeset viewer.