From a45760f00a2b1ce4fe6e4e831626f2c6f3bf0540 Mon Sep 17 00:00:00 2001 From: Heemin Kim Date: Mon, 26 Jun 2023 13:59:56 -0700 Subject: [PATCH] Refactoring of code (#342) 1. Changed class name from Ip2GeoCache to Ip2GeoCachedDao 2. Moved the Ip2GeoCachedDao from cache to dao package Signed-off-by: Heemin Kim --- .../Ip2GeoCachedDao.java} | 10 ++-- .../ip2geo/processor/Ip2GeoProcessor.java | 26 +++++----- .../geospatial/plugin/GeospatialPlugin.java | 12 ++--- .../geospatial/ip2geo/Ip2GeoTestCase.java | 6 +-- .../Ip2GeoCachedDaoTests.java} | 48 +++++++++---------- .../processor/Ip2GeoProcessorTests.java | 28 +++++------ .../plugin/GeospatialPluginTests.java | 4 +- 7 files changed, 68 insertions(+), 66 deletions(-) rename src/main/java/org/opensearch/geospatial/ip2geo/{cache/Ip2GeoCache.java => dao/Ip2GeoCachedDao.java} (93%) rename src/test/java/org/opensearch/geospatial/ip2geo/{cache/Ip2GeoCacheTests.java => dao/Ip2GeoCachedDaoTests.java} (76%) diff --git a/src/main/java/org/opensearch/geospatial/ip2geo/cache/Ip2GeoCache.java b/src/main/java/org/opensearch/geospatial/ip2geo/dao/Ip2GeoCachedDao.java similarity index 93% rename from src/main/java/org/opensearch/geospatial/ip2geo/cache/Ip2GeoCache.java rename to src/main/java/org/opensearch/geospatial/ip2geo/dao/Ip2GeoCachedDao.java index 1249655b..cd645cd1 100644 --- a/src/main/java/org/opensearch/geospatial/ip2geo/cache/Ip2GeoCache.java +++ b/src/main/java/org/opensearch/geospatial/ip2geo/dao/Ip2GeoCachedDao.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package org.opensearch.geospatial.ip2geo.cache; +package org.opensearch.geospatial.ip2geo.dao; import java.io.IOException; import java.time.Instant; @@ -18,18 +18,20 @@ import org.opensearch.core.xcontent.NamedXContentRegistry; import org.opensearch.core.xcontent.XContentParser; import org.opensearch.geospatial.ip2geo.common.DatasourceState; -import org.opensearch.geospatial.ip2geo.dao.DatasourceDao; import org.opensearch.geospatial.ip2geo.jobscheduler.Datasource; import org.opensearch.index.engine.Engine; import org.opensearch.index.shard.IndexingOperationListener; import org.opensearch.index.shard.ShardId; +/** + * Data access object for Datasource and GeoIP data with added caching layer + */ @Log4j2 -public class Ip2GeoCache implements IndexingOperationListener { +public class Ip2GeoCachedDao implements IndexingOperationListener { private final DatasourceDao datasourceDao; private Map data; - public Ip2GeoCache(final DatasourceDao datasourceDao) { + public Ip2GeoCachedDao(final DatasourceDao datasourceDao) { this.datasourceDao = datasourceDao; } diff --git a/src/main/java/org/opensearch/geospatial/ip2geo/processor/Ip2GeoProcessor.java b/src/main/java/org/opensearch/geospatial/ip2geo/processor/Ip2GeoProcessor.java index 4c8f404b..356869fe 100644 --- a/src/main/java/org/opensearch/geospatial/ip2geo/processor/Ip2GeoProcessor.java +++ b/src/main/java/org/opensearch/geospatial/ip2geo/processor/Ip2GeoProcessor.java @@ -24,10 +24,10 @@ import org.opensearch.action.ActionListener; import org.opensearch.common.settings.ClusterSettings; import org.opensearch.geospatial.annotation.VisibleForTesting; -import org.opensearch.geospatial.ip2geo.cache.Ip2GeoCache; import org.opensearch.geospatial.ip2geo.common.DatasourceState; import org.opensearch.geospatial.ip2geo.dao.DatasourceDao; import org.opensearch.geospatial.ip2geo.dao.GeoIpDataDao; +import org.opensearch.geospatial.ip2geo.dao.Ip2GeoCachedDao; import org.opensearch.ingest.AbstractProcessor; import org.opensearch.ingest.IngestDocument; import org.opensearch.ingest.IngestService; @@ -57,7 +57,7 @@ public final class Ip2GeoProcessor extends AbstractProcessor { private final ClusterSettings clusterSettings; private final DatasourceDao datasourceDao; private final GeoIpDataDao geoIpDataDao; - private final Ip2GeoCache ip2GeoCache; + private final Ip2GeoCachedDao ip2GeoCachedDao; /** * Ip2Geo processor type @@ -76,7 +76,7 @@ public final class Ip2GeoProcessor extends AbstractProcessor { * @param clusterSettings the cluster settings * @param datasourceDao the datasource facade * @param geoIpDataDao the geoip data facade - * @param ip2GeoCache the cache + * @param ip2GeoCachedDao the cache */ public Ip2GeoProcessor( final String tag, @@ -89,7 +89,7 @@ public Ip2GeoProcessor( final ClusterSettings clusterSettings, final DatasourceDao datasourceDao, final GeoIpDataDao geoIpDataDao, - final Ip2GeoCache ip2GeoCache + final Ip2GeoCachedDao ip2GeoCachedDao ) { super(tag, description); this.field = field; @@ -100,7 +100,7 @@ public Ip2GeoProcessor( this.clusterSettings = clusterSettings; this.datasourceDao = datasourceDao; this.geoIpDataDao = geoIpDataDao; - this.ip2GeoCache = ip2GeoCache; + this.ip2GeoCachedDao = ip2GeoCachedDao; } /** @@ -154,8 +154,8 @@ protected void executeInternal( final String ip ) { validateDatasourceIsInAvailableState(datasourceName); - String indexName = ip2GeoCache.getIndexName(datasourceName); - if (ip2GeoCache.isExpired(datasourceName) || indexName == null) { + String indexName = ip2GeoCachedDao.getIndexName(datasourceName); + if (ip2GeoCachedDao.isExpired(datasourceName) || indexName == null) { handleExpiredData(ingestDocument, handler); return; } @@ -209,11 +209,11 @@ private List> filteredGeoData(final List } private void validateDatasourceIsInAvailableState(final String datasourceName) { - if (ip2GeoCache.has(datasourceName) == false) { + if (ip2GeoCachedDao.has(datasourceName) == false) { throw new IllegalStateException("datasource does not exist"); } - if (DatasourceState.AVAILABLE.equals(ip2GeoCache.getState(datasourceName)) == false) { + if (DatasourceState.AVAILABLE.equals(ip2GeoCachedDao.getState(datasourceName)) == false) { throw new IllegalStateException("datasource is not in an available state"); } } @@ -243,8 +243,8 @@ protected void executeInternal( } validateDatasourceIsInAvailableState(datasourceName); - String indexName = ip2GeoCache.getIndexName(datasourceName); - if (ip2GeoCache.isExpired(datasourceName) || indexName == null) { + String indexName = ip2GeoCachedDao.getIndexName(datasourceName); + if (ip2GeoCachedDao.isExpired(datasourceName) || indexName == null) { handleExpiredData(ingestDocument, handler); return; } @@ -290,7 +290,7 @@ public static final class Factory implements Processor.Factory { private final IngestService ingestService; private final DatasourceDao datasourceDao; private final GeoIpDataDao geoIpDataDao; - private final Ip2GeoCache ip2GeoCache; + private final Ip2GeoCachedDao ip2GeoCachedDao; /** * Within this method, blocking request cannot be called because this method is executed in a transport thread. @@ -320,7 +320,7 @@ public Ip2GeoProcessor create( ingestService.getClusterService().getClusterSettings(), datasourceDao, geoIpDataDao, - ip2GeoCache + ip2GeoCachedDao ); } } diff --git a/src/main/java/org/opensearch/geospatial/plugin/GeospatialPlugin.java b/src/main/java/org/opensearch/geospatial/plugin/GeospatialPlugin.java index a5653ad8..0eca5df7 100644 --- a/src/main/java/org/opensearch/geospatial/plugin/GeospatialPlugin.java +++ b/src/main/java/org/opensearch/geospatial/plugin/GeospatialPlugin.java @@ -51,12 +51,12 @@ import org.opensearch.geospatial.ip2geo.action.RestUpdateDatasourceHandler; import org.opensearch.geospatial.ip2geo.action.UpdateDatasourceAction; import org.opensearch.geospatial.ip2geo.action.UpdateDatasourceTransportAction; -import org.opensearch.geospatial.ip2geo.cache.Ip2GeoCache; import org.opensearch.geospatial.ip2geo.common.Ip2GeoExecutor; import org.opensearch.geospatial.ip2geo.common.Ip2GeoLockService; import org.opensearch.geospatial.ip2geo.common.Ip2GeoSettings; import org.opensearch.geospatial.ip2geo.dao.DatasourceDao; import org.opensearch.geospatial.ip2geo.dao.GeoIpDataDao; +import org.opensearch.geospatial.ip2geo.dao.Ip2GeoCachedDao; import org.opensearch.geospatial.ip2geo.jobscheduler.DatasourceExtension; import org.opensearch.geospatial.ip2geo.jobscheduler.DatasourceRunner; import org.opensearch.geospatial.ip2geo.jobscheduler.DatasourceUpdateService; @@ -94,7 +94,7 @@ */ @Log4j2 public class GeospatialPlugin extends Plugin implements IngestPlugin, ActionPlugin, MapperPlugin, SearchPlugin, SystemIndexPlugin { - private Ip2GeoCache ip2GeoCache; + private Ip2GeoCachedDao ip2GeoCachedDao; private DatasourceDao datasourceDao; private GeoIpDataDao geoIpDataDao; @@ -107,17 +107,17 @@ public Collection getSystemIndexDescriptors(Settings sett public Map getProcessors(Processor.Parameters parameters) { this.datasourceDao = new DatasourceDao(parameters.client, parameters.ingestService.getClusterService()); this.geoIpDataDao = new GeoIpDataDao(parameters.ingestService.getClusterService(), parameters.client); - this.ip2GeoCache = new Ip2GeoCache(datasourceDao); + this.ip2GeoCachedDao = new Ip2GeoCachedDao(datasourceDao); return MapBuilder.newMapBuilder() .put(FeatureProcessor.TYPE, new FeatureProcessor.Factory()) - .put(Ip2GeoProcessor.TYPE, new Ip2GeoProcessor.Factory(parameters.ingestService, datasourceDao, geoIpDataDao, ip2GeoCache)) + .put(Ip2GeoProcessor.TYPE, new Ip2GeoProcessor.Factory(parameters.ingestService, datasourceDao, geoIpDataDao, ip2GeoCachedDao)) .immutableMap(); } @Override public void onIndexModule(IndexModule indexModule) { if (DatasourceExtension.JOB_INDEX_NAME.equals(indexModule.getIndex().getName())) { - indexModule.addIndexOperationListener(ip2GeoCache); + indexModule.addIndexOperationListener(ip2GeoCachedDao); log.info("Ip2GeoListener started listening to operations on index {}", DatasourceExtension.JOB_INDEX_NAME); } } @@ -170,7 +170,7 @@ public Collection createComponents( ip2GeoExecutor, geoIpDataDao, ip2GeoLockService, - ip2GeoCache + ip2GeoCachedDao ); } diff --git a/src/test/java/org/opensearch/geospatial/ip2geo/Ip2GeoTestCase.java b/src/test/java/org/opensearch/geospatial/ip2geo/Ip2GeoTestCase.java index cb641d49..e59e2c35 100644 --- a/src/test/java/org/opensearch/geospatial/ip2geo/Ip2GeoTestCase.java +++ b/src/test/java/org/opensearch/geospatial/ip2geo/Ip2GeoTestCase.java @@ -43,13 +43,13 @@ import org.opensearch.common.settings.Settings; import org.opensearch.common.util.concurrent.OpenSearchExecutors; import org.opensearch.geospatial.GeospatialTestHelper; -import org.opensearch.geospatial.ip2geo.cache.Ip2GeoCache; import org.opensearch.geospatial.ip2geo.common.DatasourceState; import org.opensearch.geospatial.ip2geo.common.Ip2GeoExecutor; import org.opensearch.geospatial.ip2geo.common.Ip2GeoLockService; import org.opensearch.geospatial.ip2geo.common.Ip2GeoSettings; import org.opensearch.geospatial.ip2geo.dao.DatasourceDao; import org.opensearch.geospatial.ip2geo.dao.GeoIpDataDao; +import org.opensearch.geospatial.ip2geo.dao.Ip2GeoCachedDao; import org.opensearch.geospatial.ip2geo.dao.Ip2GeoProcessorDao; import org.opensearch.geospatial.ip2geo.jobscheduler.Datasource; import org.opensearch.geospatial.ip2geo.jobscheduler.DatasourceTask; @@ -79,7 +79,7 @@ public abstract class Ip2GeoTestCase extends RestActionTestCase { @Mock protected GeoIpDataDao geoIpDataDao; @Mock - protected Ip2GeoCache ip2GeoCache; + protected Ip2GeoCachedDao ip2GeoCachedDao; @Mock protected ClusterState clusterState; @Mock @@ -266,7 +266,7 @@ protected Ip2GeoProcessor randomIp2GeoProcessor(String datasourceName) { clusterSettings, datasourceDao, geoIpDataDao, - ip2GeoCache + ip2GeoCachedDao ); return ip2GeoProcessor; } diff --git a/src/test/java/org/opensearch/geospatial/ip2geo/cache/Ip2GeoCacheTests.java b/src/test/java/org/opensearch/geospatial/ip2geo/dao/Ip2GeoCachedDaoTests.java similarity index 76% rename from src/test/java/org/opensearch/geospatial/ip2geo/cache/Ip2GeoCacheTests.java rename to src/test/java/org/opensearch/geospatial/ip2geo/dao/Ip2GeoCachedDaoTests.java index 28549905..5aba0f62 100644 --- a/src/test/java/org/opensearch/geospatial/ip2geo/cache/Ip2GeoCacheTests.java +++ b/src/test/java/org/opensearch/geospatial/ip2geo/dao/Ip2GeoCachedDaoTests.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package org.opensearch.geospatial.ip2geo.cache; +package org.opensearch.geospatial.ip2geo.dao; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -23,12 +23,12 @@ import org.opensearch.index.engine.Engine; import org.opensearch.index.shard.ShardId; -public class Ip2GeoCacheTests extends Ip2GeoTestCase { - private Ip2GeoCache ip2GeoCache; +public class Ip2GeoCachedDaoTests extends Ip2GeoTestCase { + private Ip2GeoCachedDao ip2GeoCachedDao; @Before public void init() { - ip2GeoCache = new Ip2GeoCache(datasourceDao); + ip2GeoCachedDao = new Ip2GeoCachedDao(datasourceDao); } public void testGetIndexName_whenCalled_thenReturnIndexName() { @@ -36,7 +36,7 @@ public void testGetIndexName_whenCalled_thenReturnIndexName() { when(datasourceDao.getAllDatasources()).thenReturn(Arrays.asList(datasource)); // Run - String indexName = ip2GeoCache.getIndexName(datasource.getName()); + String indexName = ip2GeoCachedDao.getIndexName(datasource.getName()); // Verify assertEquals(datasource.currentIndexName(), indexName); @@ -49,7 +49,7 @@ public void testIsExpired_whenExpired_thenReturnTrue() { when(datasourceDao.getAllDatasources()).thenReturn(Arrays.asList(datasource)); // Run - boolean isExpired = ip2GeoCache.isExpired(datasource.getName()); + boolean isExpired = ip2GeoCachedDao.isExpired(datasource.getName()); // Verify assertTrue(isExpired); @@ -62,7 +62,7 @@ public void testIsExpired_whenNotExpired_thenReturnFalse() { when(datasourceDao.getAllDatasources()).thenReturn(Arrays.asList(datasource)); // Run - boolean isExpired = ip2GeoCache.isExpired(datasource.getName()); + boolean isExpired = ip2GeoCachedDao.isExpired(datasource.getName()); // Verify assertFalse(isExpired); @@ -73,7 +73,7 @@ public void testHas_whenHasDatasource_thenReturnTrue() { when(datasourceDao.getAllDatasources()).thenReturn(Arrays.asList(datasource)); // Run - boolean hasDatasource = ip2GeoCache.has(datasource.getName()); + boolean hasDatasource = ip2GeoCachedDao.has(datasource.getName()); // Verify assertTrue(hasDatasource); @@ -85,7 +85,7 @@ public void testHas_whenNoDatasource_thenReturnFalse() { String datasourceName = GeospatialTestHelper.randomLowerCaseString(); // Run - boolean hasDatasource = ip2GeoCache.has(datasourceName); + boolean hasDatasource = ip2GeoCachedDao.has(datasourceName); // Verify assertFalse(hasDatasource); @@ -96,7 +96,7 @@ public void testGetState_whenCalled_thenReturnState() { when(datasourceDao.getAllDatasources()).thenReturn(Arrays.asList(datasource)); // Run - DatasourceState state = ip2GeoCache.getState(datasource.getName()); + DatasourceState state = ip2GeoCachedDao.getState(datasource.getName()); // Verify assertEquals(datasource.getState(), state); @@ -115,13 +115,13 @@ public void testPostIndex_whenFailed_thenNoUpdate() { when(result.getResultType()).thenReturn(Engine.Result.Type.FAILURE); // Run - ip2GeoCache.postIndex(shardId, index, result); + ip2GeoCachedDao.postIndex(shardId, index, result); // Verify - assertFalse(ip2GeoCache.has(datasource.getName())); - assertTrue(ip2GeoCache.isExpired(datasource.getName())); - assertNull(ip2GeoCache.getIndexName(datasource.getName())); - assertNull(ip2GeoCache.getState(datasource.getName())); + assertFalse(ip2GeoCachedDao.has(datasource.getName())); + assertTrue(ip2GeoCachedDao.isExpired(datasource.getName())); + assertNull(ip2GeoCachedDao.getIndexName(datasource.getName())); + assertNull(ip2GeoCachedDao.getState(datasource.getName())); } @SneakyThrows @@ -137,13 +137,13 @@ public void testPostIndex_whenSucceed_thenUpdate() { when(result.getResultType()).thenReturn(Engine.Result.Type.SUCCESS); // Run - ip2GeoCache.postIndex(shardId, index, result); + ip2GeoCachedDao.postIndex(shardId, index, result); // Verify - assertTrue(ip2GeoCache.has(datasource.getName())); - assertFalse(ip2GeoCache.isExpired(datasource.getName())); - assertEquals(datasource.currentIndexName(), ip2GeoCache.getIndexName(datasource.getName())); - assertEquals(datasource.getState(), ip2GeoCache.getState(datasource.getName())); + assertTrue(ip2GeoCachedDao.has(datasource.getName())); + assertFalse(ip2GeoCachedDao.isExpired(datasource.getName())); + assertEquals(datasource.currentIndexName(), ip2GeoCachedDao.getIndexName(datasource.getName())); + assertEquals(datasource.getState(), ip2GeoCachedDao.getState(datasource.getName())); } public void testPostDelete_whenFailed_thenNoUpdate() { @@ -156,10 +156,10 @@ public void testPostDelete_whenFailed_thenNoUpdate() { when(result.getResultType()).thenReturn(Engine.Result.Type.FAILURE); // Run - ip2GeoCache.postDelete(shardId, index, result); + ip2GeoCachedDao.postDelete(shardId, index, result); // Verify - assertTrue(ip2GeoCache.has(datasource.getName())); + assertTrue(ip2GeoCachedDao.has(datasource.getName())); } public void testPostDelete_whenSucceed_thenUpdate() { @@ -173,9 +173,9 @@ public void testPostDelete_whenSucceed_thenUpdate() { when(result.getResultType()).thenReturn(Engine.Result.Type.SUCCESS); // Run - ip2GeoCache.postDelete(shardId, index, result); + ip2GeoCachedDao.postDelete(shardId, index, result); // Verify - assertFalse(ip2GeoCache.has(datasource.getName())); + assertFalse(ip2GeoCachedDao.has(datasource.getName())); } } diff --git a/src/test/java/org/opensearch/geospatial/ip2geo/processor/Ip2GeoProcessorTests.java b/src/test/java/org/opensearch/geospatial/ip2geo/processor/Ip2GeoProcessorTests.java index aa3b52aa..700fe56b 100644 --- a/src/test/java/org/opensearch/geospatial/ip2geo/processor/Ip2GeoProcessorTests.java +++ b/src/test/java/org/opensearch/geospatial/ip2geo/processor/Ip2GeoProcessorTests.java @@ -41,7 +41,7 @@ public class Ip2GeoProcessorTests extends Ip2GeoTestCase { @Before public void init() { - factory = new Ip2GeoProcessor.Factory(ingestService, datasourceDao, geoIpDataDao, ip2GeoCache); + factory = new Ip2GeoProcessor.Factory(ingestService, datasourceDao, geoIpDataDao, ip2GeoCachedDao); } public void testExecuteWithNoIpAndIgnoreMissing() throws Exception { @@ -96,7 +96,7 @@ public void testExecute_whenNoDatasource_thenNotExistError() { source.put("ip", ip); IngestDocument document = new IngestDocument(source, new HashMap<>()); - when(ip2GeoCache.has(datasourceName)).thenReturn(false); + when(ip2GeoCachedDao.has(datasourceName)).thenReturn(false); BiConsumer handler = mock(BiConsumer.class); // Run @@ -119,10 +119,10 @@ public void testExecute_whenExpired_thenExpiredMsg() { IngestDocument document = new IngestDocument(source, new HashMap<>()); String index = GeospatialTestHelper.randomLowerCaseString(); - when(ip2GeoCache.getIndexName(datasourceName)).thenReturn(index); - when(ip2GeoCache.has(datasourceName)).thenReturn(true); - when(ip2GeoCache.isExpired(datasourceName)).thenReturn(true); - when(ip2GeoCache.getState(datasourceName)).thenReturn(DatasourceState.AVAILABLE); + when(ip2GeoCachedDao.getIndexName(datasourceName)).thenReturn(index); + when(ip2GeoCachedDao.has(datasourceName)).thenReturn(true); + when(ip2GeoCachedDao.isExpired(datasourceName)).thenReturn(true); + when(ip2GeoCachedDao.getState(datasourceName)).thenReturn(DatasourceState.AVAILABLE); BiConsumer handler = mock(BiConsumer.class); @@ -145,10 +145,10 @@ public void testExecuteInternal_whenSingleIp_thenGetDatasourceIsCalled() { BiConsumer handler = mock(BiConsumer.class); String indexName = GeospatialTestHelper.randomLowerCaseString(); - when(ip2GeoCache.getIndexName(datasourceName)).thenReturn(indexName); - when(ip2GeoCache.has(datasourceName)).thenReturn(true); - when(ip2GeoCache.getState(datasourceName)).thenReturn(DatasourceState.AVAILABLE); - when(ip2GeoCache.isExpired(datasourceName)).thenReturn(false); + when(ip2GeoCachedDao.getIndexName(datasourceName)).thenReturn(indexName); + when(ip2GeoCachedDao.has(datasourceName)).thenReturn(true); + when(ip2GeoCachedDao.getState(datasourceName)).thenReturn(DatasourceState.AVAILABLE); + when(ip2GeoCachedDao.isExpired(datasourceName)).thenReturn(false); // Run processor.executeInternal(document, handler, ip); @@ -273,10 +273,10 @@ public void testExecuteInternal_whenMultiIps_thenGetDatasourceIsCalled() { List ips = Arrays.asList(randomIpAddress(), randomIpAddress()); String indexName = GeospatialTestHelper.randomLowerCaseString(); - when(ip2GeoCache.getIndexName(datasourceName)).thenReturn(indexName); - when(ip2GeoCache.has(datasourceName)).thenReturn(true); - when(ip2GeoCache.getState(datasourceName)).thenReturn(DatasourceState.AVAILABLE); - when(ip2GeoCache.isExpired(datasourceName)).thenReturn(false); + when(ip2GeoCachedDao.getIndexName(datasourceName)).thenReturn(indexName); + when(ip2GeoCachedDao.has(datasourceName)).thenReturn(true); + when(ip2GeoCachedDao.getState(datasourceName)).thenReturn(DatasourceState.AVAILABLE); + when(ip2GeoCachedDao.isExpired(datasourceName)).thenReturn(false); // Run processor.executeInternal(document, handler, ips); diff --git a/src/test/java/org/opensearch/geospatial/plugin/GeospatialPluginTests.java b/src/test/java/org/opensearch/geospatial/plugin/GeospatialPluginTests.java index 92e5b63a..d4d5db55 100644 --- a/src/test/java/org/opensearch/geospatial/plugin/GeospatialPluginTests.java +++ b/src/test/java/org/opensearch/geospatial/plugin/GeospatialPluginTests.java @@ -37,12 +37,12 @@ import org.opensearch.geospatial.ip2geo.action.RestGetDatasourceHandler; import org.opensearch.geospatial.ip2geo.action.RestPutDatasourceHandler; import org.opensearch.geospatial.ip2geo.action.RestUpdateDatasourceHandler; -import org.opensearch.geospatial.ip2geo.cache.Ip2GeoCache; import org.opensearch.geospatial.ip2geo.common.Ip2GeoExecutor; import org.opensearch.geospatial.ip2geo.common.Ip2GeoLockService; import org.opensearch.geospatial.ip2geo.common.Ip2GeoSettings; import org.opensearch.geospatial.ip2geo.dao.DatasourceDao; import org.opensearch.geospatial.ip2geo.dao.GeoIpDataDao; +import org.opensearch.geospatial.ip2geo.dao.Ip2GeoCachedDao; import org.opensearch.geospatial.ip2geo.jobscheduler.DatasourceUpdateService; import org.opensearch.geospatial.ip2geo.listener.Ip2GeoListener; import org.opensearch.geospatial.processor.FeatureProcessor; @@ -81,7 +81,7 @@ public class GeospatialPluginTests extends OpenSearchTestCase { Ip2GeoExecutor.class, GeoIpDataDao.class, Ip2GeoLockService.class, - Ip2GeoCache.class + Ip2GeoCachedDao.class ); @Mock