lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sha...@apache.org
Subject [35/50] [abbrv] lucene-solr:feature/autoscaling: SOLR-11198: downconfig downloads empty file as folder, test failures possible fix and logging
Date Tue, 08 Aug 2017 12:14:48 GMT
SOLR-11198: downconfig downloads empty file as folder, test failures possible fix and logging


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/e053e229
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e053e229
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e053e229

Branch: refs/heads/feature/autoscaling
Commit: e053e2298fb2a6c67e3ccc244413b98648c249cb
Parents: 44de7b2
Author: Erick Erickson <erick@apache.org>
Authored: Sun Aug 6 18:21:48 2017 -0700
Committer: Erick Erickson <erick@apache.org>
Committed: Sun Aug 6 18:21:48 2017 -0700

----------------------------------------------------------------------
 .../org/apache/solr/cloud/SolrCLIZkUtilsTest.java | 18 ++++++++++++++----
 .../solr/common/cloud/ZkMaintenanceUtils.java     |  5 +++++
 2 files changed, 19 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e053e229/solr/core/src/test/org/apache/solr/cloud/SolrCLIZkUtilsTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/SolrCLIZkUtilsTest.java b/solr/core/src/test/org/apache/solr/cloud/SolrCLIZkUtilsTest.java
index 579e93d..9152ce4 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SolrCLIZkUtilsTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SolrCLIZkUtilsTest.java
@@ -21,6 +21,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.PrintStream;
+import java.lang.invoke.MethodHandles;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.FileVisitResult;
@@ -40,9 +41,13 @@ import org.apache.zookeeper.data.Stat;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
 
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
   @BeforeClass
   public static void setupCluster() throws Exception {
     configureCluster(1)
@@ -401,7 +406,7 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
 
     args = new String[]{
         "-src", "file:" + emptyFile.toAbsolutePath().toString(),
-        "-dst", "zk:/cp7/conf/stopwords/emptyFile",
+        "-dst", "zk:/cp7/conf/stopwords/emptyfile",
         "-recurse", "false",
         "-zkHost", zkAddr,
     };
@@ -410,9 +415,9 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
     assertEquals("Copy should have succeeded.", 0, res);
 
     Path tmp2 = createTempDir("cp9");
-    Path emptyDest = Paths.get(tmp2.toAbsolutePath().toString(), "emptyFile");
+    Path emptyDest = Paths.get(tmp2.toAbsolutePath().toString(), "emptyfile");
     args = new String[]{
-        "-src", "zk:/cp7/conf/stopwords/emptyFile",
+        "-src", "zk:/cp7/conf/stopwords/emptyfile",
         "-dst", "file:" + emptyDest.toAbsolutePath().toString(),
         "-recurse", "false",
         "-zkHost", zkAddr,
@@ -445,7 +450,12 @@ public class SolrCLIZkUtilsTest extends SolrCloudTestCase {
     res = cpTool.runTool(SolrCLI.processCommandLineArgs(SolrCLI.joinCommonAndToolOptions(cpTool.getOptions()),
args));
     assertEquals("Copy should have succeeded.", 0, res);
 
-    Path locEmpty = Paths.get(tmp2.toAbsolutePath().toString(), "stopwords", "emptyFile");
+    Path locEmpty = Paths.get(tmp2.toAbsolutePath().toString(), "stopwords", "emptyfile");
+    log.info("EOE Checking file at (var1) " + locEmpty.toAbsolutePath().toString()); // TODO:
remove me EOE
+    log.info("EOE Checking file at (var2) " + locEmpty.toFile().getAbsolutePath()); // TODO:
remove me EOE
+    log.info("EOE Checking file exists: " + Boolean.toString(locEmpty.toFile().exists()));
+    log.info("EOE Checking isFile: " + Boolean.toString(locEmpty.toFile().isFile()));
+    log.info("EOE Checking isDirectory: " + Boolean.toString(locEmpty.toFile().isDirectory()));
//TODO: remove me EOE to here.
     assertTrue("Empty files should NOT be copied down as directories", locEmpty.toFile().isFile());
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e053e229/solr/solrj/src/java/org/apache/solr/common/cloud/ZkMaintenanceUtils.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkMaintenanceUtils.java b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkMaintenanceUtils.java
index 6843480..28c37fa 100644
--- a/solr/solrj/src/java/org/apache/solr/common/cloud/ZkMaintenanceUtils.java
+++ b/solr/solrj/src/java/org/apache/solr/common/cloud/ZkMaintenanceUtils.java
@@ -314,7 +314,12 @@ public class ZkMaintenanceUtils {
         // If we didn't copy data down, then we also didn't create the file. But we still
need a marker on the local
         // disk so create an empty file.
         if (copyDataDown(zkClient, zkPath, file.toFile()) == 0) {
+          log.info("EOE Creating  file at (var 1)" + file.toAbsolutePath().toString()); //
TODO remove me EOE
+          log.info("EOE Creating  file at (var2) " + file.toFile().getAbsolutePath()); //
TODO remove me EOE
           Files.createFile(file);
+          log.info("EOE Creating file exists: " + Boolean.toString(file.toFile().exists()));
+          log.info("EOE Creating isFile: " + Boolean.toString(file.toFile().isFile()));
+          log.info("EOE Creating isDirectory: " + Boolean.toString(file.toFile().isDirectory()));
//TODO: remove me EOE to here.
         }
       } else {
         Files.createDirectories(file); // Make parent dir.


Mime
View raw message