karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject [41/50] [abbrv] git commit: [KARAF-2317] Display only up and running nodes in cluster:group-list command and CellarGroupMBean
Date Wed, 18 Dec 2013 12:23:16 GMT
[KARAF-2317] Display only up and running nodes in cluster:group-list command and CellarGroupMBean

git-svn-id: https://svn.apache.org/repos/asf/karaf/cellar/trunk@1496397 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/karaf-cellar/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf-cellar/commit/2e00e51a
Tree: http://git-wip-us.apache.org/repos/asf/karaf-cellar/tree/2e00e51a
Diff: http://git-wip-us.apache.org/repos/asf/karaf-cellar/diff/2e00e51a

Branch: refs/heads/master
Commit: 2e00e51adffa5f0bcc901626da3e8190ad9abe78
Parents: ffad533
Author: jbonofre <jbonofre@13f79535-47bb-0310-9956-ffa450edef68>
Authored: Tue Jun 25 10:02:39 2013 +0000
Committer: jbonofre <jbonofre@13f79535-47bb-0310-9956-ffa450edef68>
Committed: Tue Jun 25 10:02:39 2013 +0000

----------------------------------------------------------------------
 .../management/internal/CellarGroupMBeanImpl.java      |  7 +++++--
 .../apache/karaf/cellar/shell/group/GroupSupport.java  | 13 ++++++++-----
 2 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/2e00e51a/management/src/main/java/org/apache/karaf/cellar/management/internal/CellarGroupMBeanImpl.java
----------------------------------------------------------------------
diff --git a/management/src/main/java/org/apache/karaf/cellar/management/internal/CellarGroupMBeanImpl.java
b/management/src/main/java/org/apache/karaf/cellar/management/internal/CellarGroupMBeanImpl.java
index bf1a255..5580c02 100644
--- a/management/src/main/java/org/apache/karaf/cellar/management/internal/CellarGroupMBeanImpl.java
+++ b/management/src/main/java/org/apache/karaf/cellar/management/internal/CellarGroupMBeanImpl.java
@@ -165,8 +165,11 @@ public class CellarGroupMBeanImpl extends StandardMBean implements CellarGroupMB
         for (Group group : allGroups) {
             StringBuffer members = new StringBuffer();
             for (Node node : group.getNodes()) {
-                members.append(node.getId());
-                members.append(" ");
+                // display only up and running nodes in the cluster
+                if (clusterManager.findNodeById(node.getId()) != null) {
+                    members.append(node.getId());
+                    members.append(" ");
+                }
             }
             CompositeData data = new CompositeDataSupport(groupType,
                     new String[]{ "name", "members" },

http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/2e00e51a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSupport.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSupport.java b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSupport.java
index 9392b19..dbe5cdb 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSupport.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSupport.java
@@ -95,12 +95,15 @@ public abstract class GroupSupport extends ClusterCommandSupport {
                             if (g.getNodes() != null && !g.getNodes().isEmpty())
{
                                 String mark = " ";
                                 for (Node member : g.getNodes()) {
-                                    buffer.append(member.getId());
-                                    if (member.equals(clusterManager.getNode())) {
-                                        mark = "*";
-                                        buffer.append(mark);
+                                    // display only up and running nodes in the cluster
+                                    if (clusterManager.findNodeById(member.getId()) != null)
{
+                                        buffer.append(member.getId());
+                                        if (member.equals(clusterManager.getNode())) {
+                                            mark = "*";
+                                            buffer.append(mark);
+                                        }
+                                        buffer.append(" ");
                                     }
-                                    buffer.append(" ");
                                 }
                                 System.out.println(String.format(OUTPUT_FORMAT, mark, g.getName(),
buffer.toString()));
                             } else System.out.println(String.format(OUTPUT_FORMAT, "", g.getName(),
""));


Mime
View raw message