@@ -57,6 +57,9 @@ public List<CommandStatusJson> getAllCommands(String projectName, String nodeNam
57
57
String file = parentDir + "/" + dir + Constants .JSON_COMMAND_FILE_NAME ;
58
58
try {
59
59
CommandExecutionStatusInfo j = gson .fromJson (TextFileUtils .getContents (file ), CommandExecutionStatusInfo .class );
60
+ if (!shouldShowByNode (j , nodeName )){
61
+ continue ;
62
+ }
60
63
int size = j .nodes_list ().size ();
61
64
int successSize = j .success_list ().size ();
62
65
int failSize = j .fail_list ().size ();
@@ -78,6 +81,23 @@ public int compare(CommandStatusJson o1, CommandStatusJson o2) {
78
81
return $ ;
79
82
}
80
83
84
+ private boolean shouldShowByNode (CommandExecutionStatusInfo j , String nodeName ) {
85
+ List <NodeWithPeerInfo > nodes_list = j .nodes_list ();
86
+ return shouldShowByNode (nodeName , nodes_list );
87
+ }
88
+
89
+ private boolean shouldShowByNode (String nodeName , List <NodeWithPeerInfo > nodes_list ) {
90
+ if (nodeName == null ) {
91
+ return true ;
92
+ }
93
+ for (NodeWithPeerInfo node : nodes_list ) {
94
+ if (node .name ().equals (nodeName )) {
95
+ return true ;
96
+ }
97
+ }
98
+ return false ;
99
+ }
100
+
81
101
private boolean contains (List <CommandStatusJson > $ , String dir ) {
82
102
for (CommandStatusJson commandStatusJson : $ ) {
83
103
if (String .valueOf (commandStatusJson .id ()).equals (dir )){
@@ -98,15 +118,8 @@ public boolean apply(AllNodesCommandExecuter c){
98
118
return getActive (filter );
99
119
}
100
120
private boolean shouldShowByNode (AllNodesCommandExecuter c , String nodeName ) {
101
- if (nodeName == null ) {
102
- return true ;
103
- }
104
- for (NodeWithPeerInfo node : c .nodesList ()) {
105
- if (node .name ().equals (nodeName )) {
106
- return true ;
107
- }
108
- }
109
- return false ;
121
+ List <NodeWithPeerInfo > nodes_list = c .nodesList ();
122
+ return shouldShowByNode (nodeName , nodes_list );
110
123
}
111
124
112
125
public List <CommandStatusJson > getActive (Predicate <AllNodesCommandExecuter > filter ) {
0 commit comments