19
19
20
20
package org .elasticsearch .discovery .azure ;
21
21
22
- import org .elasticsearch .Version ;
23
- import org .elasticsearch .cloud .azure .AzureComputeService ;
24
22
import org .elasticsearch .cluster .ClusterName ;
25
23
import org .elasticsearch .cluster .ClusterService ;
26
24
import org .elasticsearch .cluster .node .DiscoveryNodeService ;
27
25
import org .elasticsearch .cluster .settings .DynamicSettings ;
28
- import org .elasticsearch .common .collect .ImmutableList ;
29
26
import org .elasticsearch .common .inject .Inject ;
30
- import org .elasticsearch .common .network .NetworkService ;
31
27
import org .elasticsearch .common .settings .Settings ;
32
28
import org .elasticsearch .discovery .DiscoverySettings ;
33
29
import org .elasticsearch .discovery .zen .ZenDiscovery ;
34
30
import org .elasticsearch .discovery .zen .elect .ElectMasterService ;
35
- import org .elasticsearch .discovery .zen .ping .ZenPing ;
36
31
import org .elasticsearch .discovery .zen .ping .ZenPingService ;
37
- import org .elasticsearch .discovery .zen .ping .unicast .UnicastZenPing ;
38
32
import org .elasticsearch .node .settings .NodeSettingsService ;
39
33
import org .elasticsearch .threadpool .ThreadPool ;
40
34
import org .elasticsearch .transport .TransportService ;
@@ -49,29 +43,9 @@ public class AzureDiscovery extends ZenDiscovery {
49
43
@ Inject
50
44
public AzureDiscovery (Settings settings , ClusterName clusterName , ThreadPool threadPool , TransportService transportService ,
51
45
ClusterService clusterService , NodeSettingsService nodeSettingsService , ZenPingService pingService ,
52
- DiscoveryNodeService discoveryNodeService , AzureComputeService azureService , NetworkService networkService ,
53
- DiscoverySettings discoverySettings , ElectMasterService electMasterService , DynamicSettings dynamicSettings ,
54
- Version version ) {
46
+ DiscoveryNodeService discoveryNodeService ,
47
+ DiscoverySettings discoverySettings , ElectMasterService electMasterService , DynamicSettings dynamicSettings ) {
55
48
super (settings , clusterName , threadPool , transportService , clusterService , nodeSettingsService ,
56
49
discoveryNodeService , pingService , electMasterService , discoverySettings , dynamicSettings );
57
- if (settings .getAsBoolean ("cloud.enabled" , true )) {
58
- ImmutableList <? extends ZenPing > zenPings = pingService .zenPings ();
59
- UnicastZenPing unicastZenPing = null ;
60
- for (ZenPing zenPing : zenPings ) {
61
- if (zenPing instanceof UnicastZenPing ) {
62
- unicastZenPing = (UnicastZenPing ) zenPing ;
63
- break ;
64
- }
65
- }
66
-
67
- if (unicastZenPing != null ) {
68
- // update the unicast zen ping to add cloud hosts provider
69
- // and, while we are at it, use only it and not the multicast for example
70
- unicastZenPing .addHostsProvider (new AzureUnicastHostsProvider (settings , azureService , transportService , networkService , version ));
71
- pingService .zenPings (ImmutableList .of (unicastZenPing ));
72
- } else {
73
- logger .warn ("failed to apply azure unicast discovery, no unicast ping found" );
74
- }
75
- }
76
50
}
77
51
}
0 commit comments