From 324fd4dc364935ae92afe3f81e0a659399d145de Mon Sep 17 00:00:00 2001 From: Aditya Jindal Date: Wed, 29 Jul 2020 16:36:56 -0700 Subject: [PATCH] Making the queue cache collector in sync with the latest UT changes Co-authored-by: Aditya Jindal --- .../deciders/QueueHealthDeciderTest.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/decisionmaker/deciders/QueueHealthDeciderTest.java b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/decisionmaker/deciders/QueueHealthDeciderTest.java index 3c7ba4520..7a7418f81 100644 --- a/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/decisionmaker/deciders/QueueHealthDeciderTest.java +++ b/src/test/java/com/amazon/opendistro/elasticsearch/performanceanalyzer/decisionmaker/deciders/QueueHealthDeciderTest.java @@ -29,6 +29,7 @@ import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.api.Resources; import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.api.summaries.HotNodeSummary; import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.api.summaries.ResourceUtil; +import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.framework.util.InstanceDetails; import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.store.rca.cluster.NodeKey; import com.amazon.opendistro.elasticsearch.performanceanalyzer.rca.store.rca.cluster.QueueRejectionClusterRca; import com.amazon.opendistro.elasticsearch.performanceanalyzer.reader.ClusterDetailsEventProcessor; @@ -83,14 +84,15 @@ public void testHighRejectionRemediation() { RcaTestHelper.generateFlowUnit("node3", "127.0.0.3", Resources.State.UNHEALTHY, ResourceUtil.SEARCH_QUEUE_REJECTION), RcaTestHelper.generateFlowUnit("node4", "127.0.0.4", Resources.State.HEALTHY) ); - appContext.getNodeConfigCache().put(new NodeKey("node1", "127.0.0.1"), - SEARCH_QUEUE_CAPACITY,5000); - appContext.getNodeConfigCache().put(new NodeKey("node1", "127.0.0.1"), - WRITE_QUEUE_CAPACITY,5000); - appContext.getNodeConfigCache().put(new NodeKey("node2", "127.0.0.2"), - WRITE_QUEUE_CAPACITY,5000); - appContext.getNodeConfigCache().put(new NodeKey("node3", "127.0.0.3"), - SEARCH_QUEUE_CAPACITY,5000); + + appContext.getNodeConfigCache().put(new NodeKey(new InstanceDetails.Id("node1"), + new InstanceDetails.Ip("127.0.0.1")), SEARCH_QUEUE_CAPACITY,5000); + appContext.getNodeConfigCache().put(new NodeKey(new InstanceDetails.Id("node1"), + new InstanceDetails.Ip("127.0.0.1")), WRITE_QUEUE_CAPACITY,5000); + appContext.getNodeConfigCache().put(new NodeKey(new InstanceDetails.Id("node2"), + new InstanceDetails.Ip("127.0.0.2")), WRITE_QUEUE_CAPACITY,5000); + appContext.getNodeConfigCache().put(new NodeKey(new InstanceDetails.Id("node3"), + new InstanceDetails.Ip("127.0.0.3")), SEARCH_QUEUE_CAPACITY,5000); QueueRejectionClusterRca queueClusterRca = new QueueRejectionClusterRca(1, nodeRca); queueClusterRca.setAppContext(appContext);