dsmiley commented on code in PR #5384:
URL: https://github.com/apache/solr/pull/5384#discussion_r4687817629


##########
solr/core/src/java/org/apache/solr/core/ConfigSetService.java:
##########
@@ -79,6 +79,7 @@ public static boolean isFileForbiddenInConfigSets(String 
filePath) {
 
   public static ConfigSetService createConfigSetService(CoreContainer 
coreContainer) {
     ConfigSetService configSetService = instantiate(coreContainer);
+    configSetService.zkController = coreContainer.getZkController();

Review Comment:
   I suppose this line should move into instantiate; it's debatable



##########
solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java:
##########
@@ -137,7 +137,10 @@ public void handleRequestBody(SolrQueryRequest req, 
SolrQueryResponse rsp)
       throws InterruptedException, KeeperException, IOException {
 
     CoreContainer coreContainer = req.getCoreContainer();
-    if (coreContainer.isZooKeeperAware()) {
+    // TODO use ConfigSetService API instead of coding two implementations 
here.

Review Comment:
   don't want to scope-creep this further now!



##########
solr/solr-ref-guide/modules/deployment-guide/pages/cli/commons-cli-reference.adoc:
##########
@@ -606,7 +606,7 @@ Name of the collection or core to create.
 +
 The configuration directory.

Review Comment:
   should probably use the word "configset"



##########
solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc:
##########


Review Comment:
   The wording here was updating to use "configset", in addition to what this 
PR tries to convey.



##########
solr/core/src/java/org/apache/solr/core/ConfigSetService.java:
##########
@@ -253,8 +264,22 @@ public final ConfigSet loadConfigSet(CoreDescriptor dcore) 
{
     }
   }
 
+  /**
+   * For a SolrCloud core lacking a configSet name, sets it to its 
collection's configName. Not
+   * persisted; re-resolved on each load (e.g. reload).
+   */
+  private void resolveCloudConfigSetName(CoreDescriptor cd) {
+    if (cd.getConfigSet() == null && cd.getCloudDescriptor() != null && 
zkController != null) {
+      cd.setConfigSet(
+          
zkController.getClusterState().getCollection(cd.getCollectionName()).getConfigName());
+    }
+  }
+
   protected final SolrResourceLoader parentLoader;
 
+  /** Set by {@link #createConfigSetService(CoreContainer)}; null when not in 
SolrCloud mode. */

Review Comment:
   I don't love this field TBH but if we don't have this then we have 
CoreContainer field that we otherwise don't have and it'd be there purely for 
calling `getZkController()`...



##########
solr/core/src/java/org/apache/solr/handler/admin/ShowFileRequestHandler.java:
##########
@@ -172,12 +175,8 @@ private void showFromZooKeeper(
         List<String> fchildren = zkClient.getChildren(adminFile + "/" + f, 
null);
         if (fchildren.size() > 0) {
           fileInfo.add("directory", true);
-        } else {
-          // TODO? content type
-          fileInfo.add("size", f.length());

Review Comment:
   this was the length of the file name!  *wrong*.
   Nobody was using something so broken.  Isn't displayed in the UI (when I 
looked anyway).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to