Project

General

Profile

« Previous | Next » 

Revision 8438

Added by Jing Tao almost 11 years ago

Add some log information.

View differences:

src/edu/ucsb/nceas/metacat/admin/upgrade/solr/SolrSchemaUpgrader.java
34 34
import org.apache.commons.io.filefilter.DirectoryFileFilter;
35 35
import org.apache.commons.io.filefilter.OrFileFilter;
36 36
import org.apache.commons.io.filefilter.WildcardFileFilter;
37
import org.apache.log4j.Logger;
37 38
import org.dataone.service.types.v1.Checksum;
38 39
import org.dataone.service.types.v1.util.ChecksumUtil;
39 40

  
......
61 62
 */
62 63
public class SolrSchemaUpgrader {
63 64
    
65
    private static Logger logMetacat = Logger.getLogger(SolrSchemaUpgrader.class);
64 66
    private static final String SCHEMAFILERELATIVEPATH = "/conf/schema.xml";
65 67
    private static final String MD5 = "MD5";
66 68
    private Vector<String> releasedSchemaHashList = new Vector<String>();
......
80 82
            hashString = 
81 83
                PropertyService.getProperty("index.schema.previous.hash");
82 84
            currentHash = PropertyService.getProperty("index.schema.current.hash");
83
            //System.out.println("the current hash is ================== "+currentHash);
85
            logMetacat.info("the current hash is ================== "+currentHash);
84 86
            solrHomePath = PropertyService.getProperty("solr.homeDir");
85 87
            String indexContext = PropertyService.getProperty("index.context");
86 88
            String metacatWebInf = ServiceService.getRealConfigDir();
......
90 92
                            + pnfe.getMessage());
91 93
        }
92 94
        releasedSchemaHashList = StringUtil.toVector(hashString, ';');
93
        //System.out.println("the released hash is ================== "+releasedSchemaHashList);
95
        logMetacat.info("the released hash is ================== "+releasedSchemaHashList);
94 96
    }
95 97
    
96 98
    /**
......
158 160
                                        solrHomePath+"/conf. You may click the OK button When you finish the merging. ";
159 161
                        if(checkSum != null) {
160 162
                            String checksumValue = checkSum.getValue();
161
                            //System.out.println("the existing schema.xml in the solr home has the checksum ================== "+checksumValue);
163
                            logMetacat.info("the existing schema.xml in the solr home has the checksum ================== "+checksumValue);
162 164
                            if(checksumValue != null) {
163 165
                                if(checksumValue.equals(currentHash)) {
164 166
                                    //it has the newest schema, do nothing
165
                                    //System.out.println("=====the existing schema.xml in the solr home has the same checksum as our current release, do nothing") ;
167
                                    logMetacat.info("=====the existing schema.xml in the solr home has the same checksum as our current release, do nothing") ;
166 168
                                } else {
167 169
                                    boolean found = false;
168 170
                                    for(String value : releasedSchemaHashList) {

Also available in: Unified diff