@@ -87,14 +87,14 @@ public TransportRunAnalyticsAction(ThreadPool threadPool, TransportService trans
87
87
@ Override
88
88
protected void doExecute (Task task , RunAnalyticsAction .Request request , ActionListener <AcknowledgedResponse > listener ) {
89
89
DiscoveryNode localNode = clusterService .localNode ();
90
- if (isMlNode (localNode )) {
90
+ if (MachineLearning . isMlNode (localNode )) {
91
91
reindexDataframeAndStartAnalysis (request .getIndex (), listener );
92
92
return ;
93
93
}
94
94
95
95
ClusterState clusterState = clusterService .state ();
96
96
for (DiscoveryNode node : clusterState .getNodes ()) {
97
- if (isMlNode (node )) {
97
+ if (MachineLearning . isMlNode (node )) {
98
98
transportService .sendRequest (node , actionName , request ,
99
99
new ActionListenerResponseHandler <>(listener , inputStream -> {
100
100
AcknowledgedResponse response = new AcknowledgedResponse ();
@@ -107,12 +107,6 @@ protected void doExecute(Task task, RunAnalyticsAction.Request request, ActionLi
107
107
listener .onFailure (ExceptionsHelper .badRequestException ("No ML node to run on" ));
108
108
}
109
109
110
- private boolean isMlNode (DiscoveryNode node ) {
111
- Map <String , String > nodeAttributes = node .getAttributes ();
112
- String enabled = nodeAttributes .get (MachineLearning .ML_ENABLED_NODE_ATTR );
113
- return Boolean .valueOf (enabled );
114
- }
115
-
116
110
private void reindexDataframeAndStartAnalysis (String index , ActionListener <AcknowledgedResponse > listener ) {
117
111
final String destinationIndex = index + "_copy" ;
118
112
0 commit comments