From ac16fa5e0fa629ca272183c5c4bab8428fa184b6 Mon Sep 17 00:00:00 2001 From: Kaituo Li Date: Fri, 28 Apr 2023 09:53:28 -0700 Subject: [PATCH] Code Refactoring for CommonName (#867) In this pull request, I have refactored the code related to shared names in both AD and forecasting modules to CommonNames. Additionally, the previously used CommonName has been renamed to ADCommonName. For the Forecasting module, I have introduced new names in ForecastCommonNames. Testing done: * gradle build Signed-off-by: Kaituo Li --- src/test/java/org/opensearch/ad/TestHelpers.java | 2 +- .../org/opensearch/ad/feature/SearchFeatureDaoParamTests.java | 1 - .../org/opensearch/ad/transport/DeleteAnomalyDetectorTests.java | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/opensearch/ad/TestHelpers.java b/src/test/java/org/opensearch/ad/TestHelpers.java index 66c3cd647..e4f283750 100644 --- a/src/test/java/org/opensearch/ad/TestHelpers.java +++ b/src/test/java/org/opensearch/ad/TestHelpers.java @@ -1516,7 +1516,7 @@ public static ClusterState createClusterState() { mappings .put( - CommonName.JOB_INDEX, + CommonName.JOB_INDEX, IndexMetadata .builder("test") .settings( diff --git a/src/test/java/org/opensearch/ad/feature/SearchFeatureDaoParamTests.java b/src/test/java/org/opensearch/ad/feature/SearchFeatureDaoParamTests.java index cfacfbfa6..a6380b8cf 100644 --- a/src/test/java/org/opensearch/ad/feature/SearchFeatureDaoParamTests.java +++ b/src/test/java/org/opensearch/ad/feature/SearchFeatureDaoParamTests.java @@ -55,7 +55,6 @@ import org.opensearch.ad.AnomalyDetectorPlugin; import org.opensearch.ad.NodeStateManager; import org.opensearch.ad.constant.ADCommonName; -import org.opensearch.ad.constant.CommonName; import org.opensearch.ad.dataprocessor.Interpolator; import org.opensearch.ad.dataprocessor.LinearUniformInterpolator; import org.opensearch.ad.dataprocessor.SingleFeatureLinearUniformInterpolator; diff --git a/src/test/java/org/opensearch/ad/transport/DeleteAnomalyDetectorTests.java b/src/test/java/org/opensearch/ad/transport/DeleteAnomalyDetectorTests.java index 6c5fbb14a..b77ef0e31 100644 --- a/src/test/java/org/opensearch/ad/transport/DeleteAnomalyDetectorTests.java +++ b/src/test/java/org/opensearch/ad/transport/DeleteAnomalyDetectorTests.java @@ -200,7 +200,7 @@ private ClusterState createClusterState() { Map immutableOpenMap = new HashMap<>(); immutableOpenMap .put( - CommonName.JOB_INDEX, + CommonName.JOB_INDEX, IndexMetadata .builder("test") .settings(