From 62b40a2cbcb95d70f32fe50d1c879a8c0677e64f Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Tue, 3 Jun 2014 10:30:07 +0200 Subject: [PATCH] Fixed non-data nodes detection for them to be excluded in the Shard Allocation Dashboard Closes #263 --- .../transformers/nodesByIndices.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/kibana/panels/shard_allocation/transformers/nodesByIndices.js b/kibana/panels/shard_allocation/transformers/nodesByIndices.js index 9c9c662a7e96e..41b024d912f1e 100644 --- a/kibana/panels/shard_allocation/transformers/nodesByIndices.js +++ b/kibana/panels/shard_allocation/transformers/nodesByIndices.js @@ -1,30 +1,31 @@ define(function (require) { 'use strict'; var extractShards = require('lib/extractShards'); - var _ = require('lodash'); + var _ = require('lodash'); var filterHiddenIndices = require('../lib/filterHiddenIndices'); var hasPrimaryChildren = require('../lib/hasPrimaryChildren'); var extractIp = require('../lib/extractIp'); - + return function ($scope) { return function nodesByIndices (state) { var getNodeType = function (node) { - if (node.attributes.client === 'true' && node.attributes.data === 'false') { + if (node.attributes.client === 'true') { return 'client'; } - if (node.attributes.master === 'true' && node.attributes.data === 'false') { - return 'master'; + if (node.attributes.data === 'false') { + return node.attributes.master === 'true' ? 'master' : 'client'; } - if (node.attributes.data === 'true') { + if (node.attributes.master === 'false') { + // we know data is true here.. return 'data'; } return 'normal'; }; function createNode (obj, node, id) { - node.master = state.master_node === id; + node.master = state.master_node === id; node.details = extractIp(node); node.ip_port = extractIp(node); node.type = 'node'; @@ -54,7 +55,7 @@ define(function (require) { } var shards = extractShards(state); - if (!$scope.panel.show_hidden) { + if (!$scope.panel.show_hidden) { shards = shards.filter(filterHiddenIndices); }