|
37 | 37 | import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
|
38 | 38 | import org.elasticsearch.action.admin.indices.stats.CommonStatsFlags;
|
39 | 39 | import org.elasticsearch.action.admin.indices.stats.CommonStatsFlags.Flag;
|
40 |
| -import org.elasticsearch.cluster.coordination.NoMasterBlockService; |
41 |
| -import org.elasticsearch.index.IndexingPressure; |
42 | 40 | import org.elasticsearch.action.support.replication.TransportReplicationAction;
|
43 | 41 | import org.elasticsearch.client.Client;
|
44 | 42 | import org.elasticsearch.client.transport.TransportClient;
|
45 | 43 | import org.elasticsearch.cluster.ClusterName;
|
46 | 44 | import org.elasticsearch.cluster.ClusterState;
|
47 | 45 | import org.elasticsearch.cluster.action.index.MappingUpdatedAction;
|
48 | 46 | import org.elasticsearch.cluster.coordination.ClusterBootstrapService;
|
| 47 | +import org.elasticsearch.cluster.coordination.NoMasterBlockService; |
49 | 48 | import org.elasticsearch.cluster.metadata.IndexMetadata;
|
50 | 49 | import org.elasticsearch.cluster.node.DiscoveryNode;
|
51 | 50 | import org.elasticsearch.cluster.node.DiscoveryNodeRole;
|
|
88 | 87 | import org.elasticsearch.http.HttpServerTransport;
|
89 | 88 | import org.elasticsearch.index.Index;
|
90 | 89 | import org.elasticsearch.index.IndexService;
|
| 90 | +import org.elasticsearch.index.IndexingPressure; |
91 | 91 | import org.elasticsearch.index.engine.CommitStats;
|
92 | 92 | import org.elasticsearch.index.engine.DocIdSeqNoAndSource;
|
93 | 93 | import org.elasticsearch.index.engine.Engine;
|
|
105 | 105 | import org.elasticsearch.indices.recovery.RecoverySettings;
|
106 | 106 | import org.elasticsearch.node.MockNode;
|
107 | 107 | import org.elasticsearch.node.Node;
|
| 108 | +import org.elasticsearch.node.NodeRoleSettings; |
108 | 109 | import org.elasticsearch.node.NodeService;
|
109 | 110 | import org.elasticsearch.node.NodeValidationException;
|
110 | 111 | import org.elasticsearch.plugins.Plugin;
|
@@ -1145,7 +1146,13 @@ public Client client(Node node, String clusterName) {
|
1145 | 1146 | } else {
|
1146 | 1147 | builder.put(NetworkModule.TRANSPORT_TYPE_SETTING.getKey(), getTestTransportType());
|
1147 | 1148 | }
|
1148 |
| - TransportClient client = new MockTransportClient(builder.build(), plugins); |
| 1149 | + /* |
| 1150 | + * The node.roles setting does not make sense for the transport client, filter it. If the transport client were not deprecated |
| 1151 | + * we would probably want to invest in infrastructure to mark a setting as not applicable to the transport client and then |
| 1152 | + * filter all such settings here. |
| 1153 | + */ |
| 1154 | + final Settings finalSettings = builder.build().filter(k -> k.equals(NodeRoleSettings.NODE_ROLES_SETTING.getKey()) == false); |
| 1155 | + TransportClient client = new MockTransportClient(finalSettings, plugins); |
1149 | 1156 | client.addTransportAddress(addr);
|
1150 | 1157 | return client;
|
1151 | 1158 | }
|
|
0 commit comments