Updating with array changed to list.
Original commit: elastic/x-pack-elasticsearch@552227458f
This commit is contained in:
parent
ec0a4646ea
commit
080000a595
|
@ -20,6 +20,7 @@ import org.elasticsearch.xpack.XPackPlugin;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static org.elasticsearch.shield.authc.support.UsernamePasswordToken.basicAuthHeaderValue;
|
||||
|
@ -104,10 +105,10 @@ public class ShieldTransportClientIT extends ESIntegTestCase {
|
|||
|
||||
TransportClient transportClient(Settings extraSettings) {
|
||||
NodesInfoResponse nodeInfos = client().admin().cluster().prepareNodesInfo().get();
|
||||
NodeInfo[] nodes = nodeInfos.getNodes();
|
||||
assertTrue(nodes.length > 0);
|
||||
List<NodeInfo> nodes = nodeInfos.getNodes();
|
||||
assertTrue(nodes.isEmpty() == false);
|
||||
TransportAddress publishAddress = randomFrom(nodes).getTransport().address().publishAddress();
|
||||
String clusterName = nodeInfos.getClusterNameAsString();
|
||||
String clusterName = nodeInfos.getClusterName().value();
|
||||
|
||||
Settings settings = Settings.builder()
|
||||
.put(extraSettings)
|
||||
|
|
|
@ -21,6 +21,7 @@ import org.elasticsearch.xpack.XPackPlugin;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.hamcrest.Matchers.is;
|
||||
|
||||
|
@ -58,10 +59,10 @@ public class CustomRealmIT extends ESIntegTestCase {
|
|||
|
||||
public void testTransportClient() throws Exception {
|
||||
NodesInfoResponse nodeInfos = client().admin().cluster().prepareNodesInfo().get();
|
||||
NodeInfo[] nodes = nodeInfos.getNodes();
|
||||
assertTrue(nodes.length > 0);
|
||||
List<NodeInfo> nodes = nodeInfos.getNodes();
|
||||
assertTrue(nodes.isEmpty() == false);
|
||||
TransportAddress publishAddress = randomFrom(nodes).getTransport().address().publishAddress();
|
||||
String clusterName = nodeInfos.getClusterNameAsString();
|
||||
String clusterName = nodeInfos.getClusterName().value();
|
||||
|
||||
Settings settings = Settings.builder()
|
||||
.put("cluster.name", clusterName)
|
||||
|
@ -78,10 +79,10 @@ public class CustomRealmIT extends ESIntegTestCase {
|
|||
|
||||
public void testTransportClientWrongAuthentication() throws Exception {
|
||||
NodesInfoResponse nodeInfos = client().admin().cluster().prepareNodesInfo().get();
|
||||
NodeInfo[] nodes = nodeInfos.getNodes();
|
||||
assertTrue(nodes.length > 0);
|
||||
List<NodeInfo> nodes = nodeInfos.getNodes();
|
||||
assertTrue(nodes.isEmpty() == false);
|
||||
TransportAddress publishAddress = randomFrom(nodes).getTransport().address().publishAddress();
|
||||
String clusterName = nodeInfos.getClusterNameAsString();
|
||||
String clusterName = nodeInfos.getClusterName().value();
|
||||
|
||||
Settings settings = Settings.builder()
|
||||
.put("cluster.name", clusterName)
|
||||
|
|
|
@ -28,6 +28,7 @@ import java.nio.file.Files;
|
|||
import java.nio.file.Path;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
|
@ -117,12 +118,12 @@ public class SmokeTestMonitoringWithShieldIT extends ESIntegTestCase {
|
|||
}
|
||||
|
||||
private InetSocketAddress[] httpAddresses() {
|
||||
NodeInfo[] nodes = client().admin().cluster().prepareNodesInfo().clear().setHttp(true).get().getNodes();
|
||||
assertThat(nodes.length, greaterThan(0));
|
||||
List<NodeInfo> nodes = client().admin().cluster().prepareNodesInfo().clear().setHttp(true).get().getNodes();
|
||||
assertThat(nodes.size(), greaterThan(0));
|
||||
|
||||
InetSocketAddress[] httpAddresses = new InetSocketAddress[nodes.length];
|
||||
for (int i = 0; i < nodes.length; i++) {
|
||||
httpAddresses[i] = ((InetSocketTransportAddress) nodes[i].getHttp().address().publishAddress()).address();
|
||||
InetSocketAddress[] httpAddresses = new InetSocketAddress[nodes.size()];
|
||||
for (int i = 0; i < nodes.size(); i++) {
|
||||
httpAddresses[i] = ((InetSocketTransportAddress) nodes.get(i).getHttp().address().publishAddress()).address();
|
||||
}
|
||||
return httpAddresses;
|
||||
}
|
||||
|
|
|
@ -76,10 +76,10 @@ public class NodeStatsCollector extends AbstractCollector<NodeStatsCollector> {
|
|||
|
||||
// if there's a failure, then we failed to work with the _local node (guaranteed a single exception)
|
||||
if (response.hasFailures()) {
|
||||
throw response.failures()[0];
|
||||
throw response.failures().get(0);
|
||||
}
|
||||
|
||||
NodeStats nodeStats = response.getAt(0);
|
||||
NodeStats nodeStats = response.getNodes().get(0);
|
||||
|
||||
// Here we are calling directly the DiskThresholdDecider to retrieve the high watermark value
|
||||
// It would be nicer to use a settings API like documented in #6732
|
||||
|
|
|
@ -72,7 +72,7 @@ public class MarvelPluginTests extends MarvelIntegTestCase {
|
|||
|
||||
private void assertPluginIsLoaded() {
|
||||
NodesInfoResponse response = client().admin().cluster().prepareNodesInfo().setPlugins(true).get();
|
||||
for (NodeInfo nodeInfo : response) {
|
||||
for (NodeInfo nodeInfo : response.getNodes()) {
|
||||
assertNotNull(nodeInfo.getPlugins());
|
||||
|
||||
boolean found = false;
|
||||
|
@ -103,7 +103,7 @@ public class MarvelPluginTests extends MarvelIntegTestCase {
|
|||
internalCluster().getDataNodeInstance(klass);
|
||||
fail("should have thrown an exception about missing implementation");
|
||||
} catch (Exception ce) {
|
||||
assertThat("message contains error about missing implemention: " + ce.getMessage(),
|
||||
assertThat("message contains error about missing implementation: " + ce.getMessage(),
|
||||
ce.getMessage().contains("No implementation"), equalTo(true));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public class ClusterStatsCollectorTests extends AbstractCollectorTestCase {
|
|||
assertThat(clusterInfoMarvelDoc.getClusterName(),
|
||||
equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getClusterName().value()));
|
||||
assertThat(clusterInfoMarvelDoc.getVersion(),
|
||||
equalTo(client().admin().cluster().prepareNodesInfo().get().getNodes()[0].getVersion().toString()));
|
||||
equalTo(client().admin().cluster().prepareNodesInfo().get().getNodes().get(0).getVersion().toString()));
|
||||
|
||||
assertThat(clusterInfoMarvelDoc.getLicense(), notNullValue());
|
||||
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
package org.elasticsearch.marvel.agent.resolver.cluster;
|
||||
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.admin.cluster.stats.ClusterStatsNodeResponse;
|
||||
import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
|
@ -19,6 +17,7 @@ import org.elasticsearch.marvel.agent.collector.cluster.ClusterInfoMonitoringDoc
|
|||
import org.elasticsearch.marvel.agent.exporter.MarvelTemplateUtils;
|
||||
import org.elasticsearch.marvel.agent.resolver.MonitoringIndexNameResolverTestCase;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
||||
import static java.util.Collections.emptyMap;
|
||||
|
@ -47,7 +46,7 @@ public class ClusterInfoResolverTests extends MonitoringIndexNameResolverTestCas
|
|||
doc.setLicense(licenseBuilder.build());
|
||||
doc.setClusterName(randomAsciiOfLength(5));
|
||||
doc.setClusterStats(new ClusterStatsResponse(Math.abs(randomLong()), ClusterName.DEFAULT,
|
||||
randomAsciiOfLength(5), new ClusterStatsNodeResponse[]{}, new FailedNodeException[0]));
|
||||
randomAsciiOfLength(5), Collections.emptyList(), Collections.emptyList()));
|
||||
return doc;
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException("Failed to generated random ClusterInfoMarvelDoc", e);
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
package org.elasticsearch.marvel.agent.resolver.cluster;
|
||||
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
|
||||
import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules;
|
||||
import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
|
||||
|
@ -93,13 +92,13 @@ public class ClusterStatsResolverTests extends MonitoringIndexNameResolverTestCa
|
|||
* @return a testing {@link ClusterStatsResponse} used to resolve a marvel document.
|
||||
*/
|
||||
private ClusterStatsResponse randomClusterStats() {
|
||||
ClusterStatsNodeResponse[] responses = {
|
||||
List<ClusterStatsNodeResponse> responses = Collections.singletonList(
|
||||
new ClusterStatsNodeResponse(new DiscoveryNode("node_0", DummyTransportAddress.INSTANCE,
|
||||
emptyMap(), emptySet(), Version.CURRENT),
|
||||
ClusterHealthStatus.GREEN, randomNodeInfo(), randomNodeStats(), randomShardStats())
|
||||
};
|
||||
return new ClusterStatsResponse(Math.abs(randomLong()), ClusterName.DEFAULT, UUID.randomUUID().toString(), responses,
|
||||
new FailedNodeException[0]);
|
||||
);
|
||||
return new ClusterStatsResponse(Math.abs(randomLong()), ClusterName.DEFAULT, UUID.randomUUID().toString(),
|
||||
responses, Collections.emptyList());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,6 +17,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
|||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -26,28 +27,26 @@ public class ClearRealmCacheResponse extends BaseNodesResponse<ClearRealmCacheRe
|
|||
public ClearRealmCacheResponse() {
|
||||
}
|
||||
|
||||
public ClearRealmCacheResponse(ClusterName clusterName, Node[] nodes, FailedNodeException[] failures) {
|
||||
public ClearRealmCacheResponse(ClusterName clusterName, List<Node> nodes, List<FailedNodeException> failures) {
|
||||
super(clusterName, nodes, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
nodes = in.readArray(Node[]::new, Node::readNodeResponse);
|
||||
nodes = in.readList(Node::readNodeResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
out.writeArray(nodes);
|
||||
out.writeStreamableList(nodes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
super.toInnerXContent(builder, params);
|
||||
|
||||
builder.startObject("nodes");
|
||||
for (ClearRealmCacheResponse.Node node: getNodes()) {
|
||||
for (ClearRealmCacheResponse.Node node : getNodes()) {
|
||||
builder.startObject(node.getNode().getId());
|
||||
builder.field("name", node.getNode().getName());
|
||||
builder.endObject();
|
||||
|
|
|
@ -20,6 +20,8 @@ import org.elasticsearch.shield.authc.support.CachingRealm;
|
|||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -41,7 +43,7 @@ public class TransportClearRealmCacheAction extends TransportNodesAction<ClearRe
|
|||
|
||||
@Override
|
||||
protected ClearRealmCacheResponse newResponse(ClearRealmCacheRequest request,
|
||||
ClearRealmCacheResponse.Node[] responses, FailedNodeException[] failures) {
|
||||
List<ClearRealmCacheResponse.Node> responses, List<FailedNodeException> failures) {
|
||||
return new ClearRealmCacheResponse(clusterName, responses, failures);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
|
|||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The response object that will be returned when clearing the cache of native roles
|
||||
|
@ -26,26 +27,24 @@ public class ClearRolesCacheResponse extends BaseNodesResponse<ClearRolesCacheRe
|
|||
public ClearRolesCacheResponse() {
|
||||
}
|
||||
|
||||
public ClearRolesCacheResponse(ClusterName clusterName, Node[] nodes, FailedNodeException[] failures) {
|
||||
public ClearRolesCacheResponse(ClusterName clusterName, List<Node> nodes, List<FailedNodeException> failures) {
|
||||
super(clusterName, nodes, failures);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
nodes = in.readArray(Node[]::new, Node::readNodeResponse);
|
||||
nodes = in.readList(Node::readNodeResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
out.writeArray(nodes);
|
||||
out.writeStreamableList(nodes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
||||
super.toInnerXContent(builder, params);
|
||||
|
||||
builder.startObject("nodes");
|
||||
for (ClearRolesCacheResponse.Node node: getNodes()) {
|
||||
builder.startObject(node.getNode().getId());
|
||||
|
|
|
@ -17,6 +17,8 @@ import org.elasticsearch.shield.authz.store.NativeRolesStore;
|
|||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -37,7 +39,7 @@ public class TransportClearRolesCacheAction extends TransportNodesAction<ClearRo
|
|||
|
||||
@Override
|
||||
protected ClearRolesCacheResponse newResponse(ClearRolesCacheRequest request,
|
||||
ClearRolesCacheResponse.Node[] responses, FailedNodeException[] failures) {
|
||||
List<ClearRolesCacheResponse.Node> responses, List<FailedNodeException> failures) {
|
||||
return new ClearRolesCacheResponse(clusterName, responses, failures);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,18 +8,12 @@ package org.elasticsearch.shield.rest.action.realm;
|
|||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
import org.elasticsearch.rest.RestChannel;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.RestResponse;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.rest.action.support.RestBuilderListener;
|
||||
import org.elasticsearch.rest.action.support.RestActions.NodesResponseRestListener;
|
||||
import org.elasticsearch.shield.action.realm.ClearRealmCacheRequest;
|
||||
import org.elasticsearch.shield.action.realm.ClearRealmCacheResponse;
|
||||
import org.elasticsearch.shield.client.SecurityClient;
|
||||
|
||||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
@ -41,16 +35,7 @@ public class RestClearRealmCacheAction extends BaseRestHandler {
|
|||
|
||||
ClearRealmCacheRequest req = new ClearRealmCacheRequest().realms(realms).usernames(usernames);
|
||||
|
||||
new SecurityClient(client).clearRealmCache(req, new RestBuilderListener<ClearRealmCacheResponse>(channel) {
|
||||
@Override
|
||||
public RestResponse buildResponse(ClearRealmCacheResponse response, XContentBuilder builder) throws Exception {
|
||||
builder.startObject();
|
||||
response.toXContent(builder, ToXContent.EMPTY_PARAMS);
|
||||
builder.endObject();
|
||||
|
||||
return new BytesRestResponse(RestStatus.OK, builder);
|
||||
}
|
||||
});
|
||||
new SecurityClient(client).clearRealmCache(req, new NodesResponseRestListener<>(channel));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,18 +8,12 @@ package org.elasticsearch.shield.rest.action.role;
|
|||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.rest.BaseRestHandler;
|
||||
import org.elasticsearch.rest.BytesRestResponse;
|
||||
import org.elasticsearch.rest.RestChannel;
|
||||
import org.elasticsearch.rest.RestController;
|
||||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.RestResponse;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.rest.action.support.RestBuilderListener;
|
||||
import org.elasticsearch.rest.action.support.RestActions.NodesResponseRestListener;
|
||||
import org.elasticsearch.shield.action.role.ClearRolesCacheRequest;
|
||||
import org.elasticsearch.shield.action.role.ClearRolesCacheResponse;
|
||||
import org.elasticsearch.shield.client.SecurityClient;
|
||||
|
||||
import static org.elasticsearch.rest.RestRequest.Method.POST;
|
||||
|
@ -42,15 +36,6 @@ public class RestClearRolesCacheAction extends BaseRestHandler {
|
|||
|
||||
ClearRolesCacheRequest req = new ClearRolesCacheRequest().names(roles);
|
||||
|
||||
new SecurityClient(client).clearRolesCache(req, new RestBuilderListener<ClearRolesCacheResponse>(channel) {
|
||||
@Override
|
||||
public RestResponse buildResponse(ClearRolesCacheResponse response, XContentBuilder builder) throws Exception {
|
||||
builder.startObject();
|
||||
response.toXContent(builder, ToXContent.EMPTY_PARAMS);
|
||||
builder.endObject();
|
||||
|
||||
return new BytesRestResponse(RestStatus.OK, builder);
|
||||
}
|
||||
});
|
||||
new SecurityClient(client).clearRolesCache(req, new NodesResponseRestListener<>(channel));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ public class ClearRealmsCacheTests extends ShieldIntegTestCase {
|
|||
securityClient.clearRealmCache(request, new ActionListener<ClearRealmCacheResponse>() {
|
||||
@Override
|
||||
public void onResponse(ClearRealmCacheResponse response) {
|
||||
assertThat(response.getNodes().length, equalTo(internalCluster().getNodeNames().length));
|
||||
assertThat(response.getNodes().size(), equalTo(internalCluster().getNodeNames().length));
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ public class RemoteIndexAuditTrailStartingTests extends ShieldIntegTestCase {
|
|||
final List<String> addresses = new ArrayList<>();
|
||||
// get addresses for current cluster
|
||||
NodesInfoResponse response = client().admin().cluster().prepareNodesInfo().execute().actionGet();
|
||||
final String clusterName = response.getClusterNameAsString();
|
||||
final String clusterName = response.getClusterName().value();
|
||||
for (NodeInfo nodeInfo : response.getNodes()) {
|
||||
InetSocketTransportAddress address = (InetSocketTransportAddress) nodeInfo.getTransport().address().publishAddress();
|
||||
addresses.add(address.address().getHostString() + ":" + address.address().getPort());
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.elasticsearch.xpack.XPackPlugin;
|
|||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
|
@ -207,10 +208,10 @@ public class RunAsIntegTests extends ShieldIntegTestCase {
|
|||
// build our own here to better mimic an actual client...
|
||||
TransportClient getTransportClient(Settings extraSettings) {
|
||||
NodesInfoResponse nodeInfos = client().admin().cluster().prepareNodesInfo().get();
|
||||
NodeInfo[] nodes = nodeInfos.getNodes();
|
||||
assertTrue(nodes.length > 0);
|
||||
List<NodeInfo> nodes = nodeInfos.getNodes();
|
||||
assertTrue(nodes.isEmpty() == false);
|
||||
TransportAddress publishAddress = randomFrom(nodes).getTransport().address().publishAddress();
|
||||
String clusterName = nodeInfos.getClusterNameAsString();
|
||||
String clusterName = nodeInfos.getClusterName().value();
|
||||
|
||||
Settings settings = Settings.builder()
|
||||
.put(extraSettings)
|
||||
|
|
|
@ -140,7 +140,7 @@ public abstract class ShieldIntegTestCase extends ESIntegTestCase {
|
|||
//before methods from the superclass are run before this, which means that the current cluster is ready to go
|
||||
public void assertShieldIsInstalled() {
|
||||
NodesInfoResponse nodeInfos = client().admin().cluster().prepareNodesInfo().clear().setPlugins(true).get();
|
||||
for (NodeInfo nodeInfo : nodeInfos) {
|
||||
for (NodeInfo nodeInfo : nodeInfos.getNodes()) {
|
||||
// TODO: disable this assertion for now, due to random runs with mock plugins. perhaps run without mock plugins?
|
||||
// assertThat(nodeInfo.getPlugins().getInfos(), hasSize(2));
|
||||
Collection<String> pluginNames =
|
||||
|
|
|
@ -81,7 +81,7 @@ public class WatcherPluginDisableTests extends ESIntegTestCase {
|
|||
|
||||
public void testThreadPools() throws Exception {
|
||||
NodesInfoResponse nodesInfo = client().admin().cluster().prepareNodesInfo().setThreadPool(true).get();
|
||||
for (NodeInfo nodeInfo : nodesInfo) {
|
||||
for (NodeInfo nodeInfo : nodesInfo.getNodes()) {
|
||||
ThreadPoolInfo threadPoolInfo = nodeInfo.getThreadPool();
|
||||
for (ThreadPool.Info info : threadPoolInfo) {
|
||||
assertThat(info.getName(), not(is(InternalWatchExecutor.THREAD_POOL_NAME)));
|
||||
|
|
|
@ -165,7 +165,7 @@ public class WatcherScheduleEngineBenchmark {
|
|||
try {
|
||||
while (start.get()) {
|
||||
NodesStatsResponse response = client.admin().cluster().prepareNodesStats("_master").setJvm(true).get();
|
||||
ByteSizeValue heapUsed = response.getNodes()[0].getJvm().getMem().getHeapUsed();
|
||||
ByteSizeValue heapUsed = response.getNodes().get(0).getJvm().getMem().getHeapUsed();
|
||||
jvmUsedHeapSpace.inc(heapUsed.bytes());
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ public class WatcherScheduleEngineBenchmark {
|
|||
sampleThread.join();
|
||||
|
||||
NodesStatsResponse response = client.admin().cluster().prepareNodesStats().setThreadPool(true).get();
|
||||
for (NodeStats nodeStats : response) {
|
||||
for (NodeStats nodeStats : response.getNodes()) {
|
||||
for (ThreadPoolStats.Stats threadPoolStats : nodeStats.getThreadPool()) {
|
||||
if ("watcher".equals(threadPoolStats.getName())) {
|
||||
stats.setWatcherThreadPoolStats(threadPoolStats);
|
||||
|
|
Loading…
Reference in New Issue