lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r890076 - in /lucene/solr/branches/cloud/src/java/org/apache/solr/core: CoreContainer.java SolrCore.java
Date Sun, 13 Dec 2009 17:07:03 GMT
Author: markrmiller
Date: Sun Dec 13 17:07:03 2009
New Revision: 890076

URL: http://svn.apache.org/viewvc?rev=890076&view=rev
Log:
remove unnecessary overloaded constructor from SolrCore

Modified:
    lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java
    lucene/solr/branches/cloud/src/java/org/apache/solr/core/SolrCore.java

Modified: lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java?rev=890076&r1=890075&r2=890076&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java (original)
+++ lucene/solr/branches/cloud/src/java/org/apache/solr/core/CoreContainer.java Sun Dec 13
17:07:03 2009
@@ -105,7 +105,6 @@
     
     private ZooKeeperController zooKeeperController;
     private String zookeeperHost;
-    private String zookeeperSolrPath;
 
     public boolean isAbortOnConfigurationError() {
       return abortOnConfigurationError;
@@ -190,7 +189,7 @@
           schema = zooKeeperController.getSchema(IndexSchema.DEFAULT_SCHEMA_FILE, cfg, resourceLoader);
         }
         
-        SolrCore singlecore = new SolrCore(null, dataDir, cfg, schema, dcore, zooKeeperController);
+        SolrCore singlecore = new SolrCore(null, dataDir, cfg, schema, dcore);
         abortOnConfigurationError = cfg.getBool(
                 "abortOnConfigurationError", abortOnConfigurationError);
         cores.register("", singlecore, false);
@@ -513,7 +512,7 @@
         schema = new IndexSchema(config, dcore.getSchemaName(), null);
       }
     }
-    SolrCore core = new SolrCore(dcore.getName(), null, config, schema, dcore, zooKeeperController);
+    SolrCore core = new SolrCore(dcore.getName(), null, config, schema, dcore);
     return core;
   }
     
@@ -912,4 +911,9 @@
   public boolean isZooKeeperAware() {
     return zooKeeperController != null;
   }
+  
+  // may return null
+  public ZooKeeperController getZooKeeperController() {
+    return zooKeeperController;
+  }
 }

Modified: lucene/solr/branches/cloud/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/java/org/apache/solr/core/SolrCore.java?rev=890076&r1=890075&r2=890076&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/solr/branches/cloud/src/java/org/apache/solr/core/SolrCore.java Sun Dec 13 17:07:03
2009
@@ -94,7 +94,7 @@
   private DirectoryFactory directoryFactory;
   private IndexReaderFactory indexReaderFactory;
   
-  // null if not in use
+  // null if not in use - nocommit:here for convenience - consider
   private ZooKeeperController zooKeeperController;
 
   public long getStartTime() { return startTime; }
@@ -504,7 +504,7 @@
   public SolrCore(String dataDir, IndexSchema schema) throws ParserConfigurationException,
IOException, SAXException {
     this(null, dataDir, new SolrConfig(), schema, null );
   }
-  
+
   /**
    * Creates a new core and register it in the list of cores.
    * If a core with the same name already exists, it will be stopped and replaced by this
one.
@@ -518,23 +518,7 @@
    * @since solr 1.3
    */
   public SolrCore(String name, String dataDir, SolrConfig config, IndexSchema schema, CoreDescriptor
cd) {
-    this(name, dataDir, config, schema, cd, null);
-  }
-  
-
-  /**
-   * Creates a new core and register it in the list of cores.
-   * If a core with the same name already exists, it will be stopped and replaced by this
one.
-   * 
-   * @param name name of the core
-   * @param dataDir the index directory
-   * @param config a solr config instance
-   * @param schema a solr schema instance
-   * @param cd descriptor for this core
-   * @param zooKeeperController zooKeeperController for core to use or null
-   */
-  public SolrCore(String name, String dataDir, SolrConfig config, IndexSchema schema, CoreDescriptor
cd, ZooKeeperController zooKeeperController) {
-    this.zooKeeperController = zooKeeperController;
+    this.zooKeeperController = cd.getCoreContainer().getZooKeeperController();
     coreDescriptor = cd;
     this.setName( name );
     resourceLoader = config.getResourceLoader();



Mime
View raw message