You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2018/08/13 10:47:06 UTC

lucene-solr:master: SOLR-8207: Nodes view support for shard_1_1_1 format and replica1, replica_1 format. Show core state in label if not 'active'

Repository: lucene-solr
Updated Branches:
  refs/heads/master 69b2af33f -> 767223ddd


SOLR-8207: Nodes view support for shard_1_1_1 format and replica1, replica_1 format. Show core state in label if not 'active'


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

Branch: refs/heads/master
Commit: 767223ddd3726e0e7463b27aa1a50713ac696c06
Parents: 69b2af3
Author: Jan Høydahl <ja...@apache.org>
Authored: Mon Aug 13 12:38:19 2018 +0200
Committer: Jan Høydahl <ja...@apache.org>
Committed: Mon Aug 13 12:38:19 2018 +0200

----------------------------------------------------------------------
 solr/webapp/web/js/angular/controllers/cloud.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/767223dd/solr/webapp/web/js/angular/controllers/cloud.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/angular/controllers/cloud.js b/solr/webapp/web/js/angular/controllers/cloud.js
index 8c65037..59c4825 100644
--- a/solr/webapp/web/js/angular/controllers/cloud.js
+++ b/solr/webapp/web/js/angular/controllers/cloud.js
@@ -407,13 +407,18 @@ var nodesSubController = function($scope, Collections, System, Metrics) {
               if (cores) {
                 for (coreId in cores) {
                   var core = cores[coreId];
-                  var keyName = "solr.core." + core['core'].replace(/(.*?)_(shard\d+)_(replica_.\d+)/, '\$1.\$2.\$3');
+                  var keyName = "solr.core." + core['core'].replace(/(.*?)_(shard(\d+_?)+)_(replica_?[ntp]?\d+)/, '\$1.\$2.\$4');
                   var nodeMetric = m.metrics[keyName];
                   var size = nodeMetric['INDEX.sizeInBytes'];
                   size = (typeof size !== 'undefined') ? size : 0;
                   core['sizeInBytes'] = size;
                   core['size'] = bytesToSize(size);
-                  core['label'] = core['core'].replace(/(.*?)_shard(\d+)_replica_.(\d+)/, '\$1_s\$2r\$3');
+                  core['label'] = core['core'].replace(/(.*?)_shard((\d+_?)+)_replica_?[ntp]?(\d+)/, '\$1_s\$2r\$4');
+                  if (core['shard_state'] !== 'active' || core['state'] !== 'active') {
+                    // If core state is not active, display the real state, or if shard is inactive, display that
+                    var labelState = (core['state'] !== 'active') ? core['state'] : core['shard_state'];
+                    core['label'] += "_(" + labelState + ")";
+                  }
                   indexSizeTotal += size;
                   var numDocs = nodeMetric['SEARCHER.searcher.numDocs'];
                   numDocs = (typeof numDocs !== 'undefined') ? numDocs : 0;