lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r1519779 - in /lucene/dev/branches/branch_4x: ./ dev-tools/ lucene/ lucene/analysis/ lucene/analysis/icu/src/java/org/apache/lucene/collation/ lucene/backwards/ lucene/benchmark/ lucene/classification/ lucene/classification/src/ lucene/code...
Date Tue, 03 Sep 2013 18:13:25 GMT
Author: hossman
Date: Tue Sep  3 18:13:23 2013
New Revision: 1519779

URL: http://svn.apache.org/r1519779
Log:
SOLR-3852: Fixed ZookeeperInfoServlet so that the SolrCloud Admin UI pages will work even
if ZK contains nodes with data which are not utf8 text (merge r1519763)

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/dev-tools/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/BUILD.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/CHANGES.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/JRE_VERSION_MIGRATION.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/LICENSE.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/MIGRATE.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/README.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/SYSTEM_REQUIREMENTS.txt   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/icu/src/java/org/apache/lucene/collation/ICUCollationKeyFilterFactory.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/backwards/   (props changed)
    lucene/dev/branches/branch_4x/lucene/benchmark/   (props changed)
    lucene/dev/branches/branch_4x/lucene/build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/classification/   (props changed)
    lucene/dev/branches/branch_4x/lucene/classification/build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/classification/ivy.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/classification/src/   (props changed)
    lucene/dev/branches/branch_4x/lucene/codecs/   (props changed)
    lucene/dev/branches/branch_4x/lucene/common-build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.cfs.zip
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.nocfs.zip
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.optimized.cfs.zip
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/index/index.40.optimized.nocfs.zip
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestSort.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestSortDocValues.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestSortRandom.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/search/TestTotalHitCountCollector.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/demo/   (props changed)
    lucene/dev/branches/branch_4x/lucene/facet/   (props changed)
    lucene/dev/branches/branch_4x/lucene/grouping/   (props changed)
    lucene/dev/branches/branch_4x/lucene/highlighter/   (props changed)
    lucene/dev/branches/branch_4x/lucene/ivy-settings.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/join/   (props changed)
    lucene/dev/branches/branch_4x/lucene/licenses/   (props changed)
    lucene/dev/branches/branch_4x/lucene/memory/   (props changed)
    lucene/dev/branches/branch_4x/lucene/misc/   (props changed)
    lucene/dev/branches/branch_4x/lucene/module-build.xml   (props changed)
    lucene/dev/branches/branch_4x/lucene/queries/   (props changed)
    lucene/dev/branches/branch_4x/lucene/queries/src/test/org/apache/lucene/queries/function/TestFunctionQuerySort.java
  (props changed)
    lucene/dev/branches/branch_4x/lucene/queryparser/   (props changed)
    lucene/dev/branches/branch_4x/lucene/replicator/   (props changed)
    lucene/dev/branches/branch_4x/lucene/sandbox/   (props changed)
    lucene/dev/branches/branch_4x/lucene/site/   (props changed)
    lucene/dev/branches/branch_4x/lucene/spatial/   (props changed)
    lucene/dev/branches/branch_4x/lucene/suggest/   (props changed)
    lucene/dev/branches/branch_4x/lucene/test-framework/   (props changed)
    lucene/dev/branches/branch_4x/lucene/tools/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_4x/solr/LICENSE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/README.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/SYSTEM_REQUIREMENTS.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/build.xml   (props changed)
    lucene/dev/branches/branch_4x/solr/cloud-dev/   (props changed)
    lucene/dev/branches/branch_4x/solr/common-build.xml   (props changed)
    lucene/dev/branches/branch_4x/solr/contrib/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/   (props changed)
    lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/servlet/ZookeeperInfoServlet.java
    lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/core/TestConfig.java
  (props changed)
    lucene/dev/branches/branch_4x/solr/example/   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpclient-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpclient-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpcore-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpcore-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpmime-LICENSE-ASL.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/licenses/httpmime-NOTICE.txt   (props changed)
    lucene/dev/branches/branch_4x/solr/scripts/   (props changed)
    lucene/dev/branches/branch_4x/solr/site/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/   (props changed)
    lucene/dev/branches/branch_4x/solr/test-framework/   (props changed)
    lucene/dev/branches/branch_4x/solr/webapp/   (props changed)
    lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/cloud.js

Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1519779&r1=1519778&r2=1519779&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Tue Sep  3 18:13:23 2013
@@ -144,6 +144,9 @@ Bug Fixes
 * SOLR-5190: SolrEntityProcessor substitutes variables only once in child entities
   (Harsh Chawla, shalin)
 
+* SOLR-3852: Fixed ZookeeperInfoServlet so that the SolrCloud Admin UI pages will 
+  work even if ZK contains nodes with data which are not utf8 text. (hossman)
+
 Optimizations
 ----------------------
 

Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/servlet/ZookeeperInfoServlet.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/servlet/ZookeeperInfoServlet.java?rev=1519779&r1=1519778&r2=1519779&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/servlet/ZookeeperInfoServlet.java
(original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/servlet/ZookeeperInfoServlet.java
Tue Sep  3 18:13:23 2013
@@ -290,21 +290,6 @@ public final class ZookeeperInfoServlet 
           printZnode(json, path);
         }
 
-        /*
-        if (stat.getNumChildren() != 0)
-        {
-          writeKeyValue(json, "children_count",  stat.getNumChildren(), false );
-          out.println(", \"children_count\" : \"" + stat.getNumChildren() + "\"");
-        }
-        */
-
-        //if (stat.getDataLength() != 0)
-        if (data != null) {
-          String str = new BytesRef(data).utf8ToString();
-          //?? writeKeyValue(json, "content", str, false );
-          // Does nothing now, but on the assumption this will be used later we'll leave
it in. If it comes out
-          // the catches below need to be restructured.
-        }
       } catch (IllegalArgumentException e) {
         // path doesn't exist (must have been removed)
         writeKeyValue(json, "warning", "(path gone)", false);
@@ -381,6 +366,16 @@ public final class ZookeeperInfoServlet 
         // Trickily, the call to zkClient.getData fills in the stat variable
         byte[] data = zkClient.getData(path, null, stat, true);
 
+        String dataStr = null;
+        String dataStrErr = null;
+        if (null != data) {
+          try {
+            dataStr = (new BytesRef(data)).utf8ToString();
+          } catch (Exception e) {
+            dataStrErr = "data is not parsable as a utf8 String: " + e.toString();
+          }
+        }
+
         json.writeString("znode");
         json.writeNameSeparator();
         json.startObject();
@@ -397,15 +392,18 @@ public final class ZookeeperInfoServlet 
         writeKeyValue(json, "ctime", time(stat.getCtime()), false);
         writeKeyValue(json, "cversion", stat.getCversion(), false);
         writeKeyValue(json, "czxid", stat.getCzxid(), false);
-        writeKeyValue(json, "dataLength", stat.getDataLength(), false);
         writeKeyValue(json, "ephemeralOwner", stat.getEphemeralOwner(), false);
         writeKeyValue(json, "mtime", time(stat.getMtime()), false);
         writeKeyValue(json, "mzxid", stat.getMzxid(), false);
         writeKeyValue(json, "pzxid", stat.getPzxid(), false);
+        writeKeyValue(json, "dataLength", stat.getDataLength(), false);
+        if (null != dataStrErr) {
+          writeKeyValue(json, "dataNote", dataStrErr, false);
+        }
         json.endObject();
 
-        if (data != null) {
-          writeKeyValue(json, "data", new BytesRef(data).utf8ToString(), false);
+        if (null != dataStr) {
+          writeKeyValue(json, "data", dataStr, false);
         }
         json.endObject();
       } catch (KeeperException e) {

Modified: lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/cloud.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/cloud.js?rev=1519779&r1=1519778&r2=1519779&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/cloud.js (original)
+++ lucene/dev/branches/branch_4x/solr/webapp/web/js/scripts/cloud.js Tue Sep  3 18:13:23
2013
@@ -612,7 +612,7 @@ var init_tree = function( tree_element )
                     var data_element = $( '#data', this );
 
                     var highlight = false;
-                    var data = '<em>File "' + response.znode.path + '" has no Content</em>';
+                    var data = '<em>Node "' + response.znode.path + '" has no utf8
Content</em>';
 
                     if( response.znode.data )
                     {



Mime
View raw message