Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Fixed non-data nodes detection for them to be excluded in the Shard A…
Browse files Browse the repository at this point in the history
…llocation Dashboard

Closes elastic#263
  • Loading branch information
bleskes committed Jun 3, 2014
1 parent 4873924 commit 62b40a2
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions kibana/panels/shard_allocation/transformers/nodesByIndices.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 62b40a2

Please sign in to comment.