Skip to content

Commit 64dee7a

Browse files
authored
Reorganise packages and classes in searchable snapshots plugin (#70814)
Searchable snapshots classes have been spread over multiple packages since the creation of the plugin's project (mea culpa). With the addition of the shared cache and other factorization of IndexInput's code it becomes less obvious to navigate the plugin codebase.
1 parent e6d3bbe commit 64dee7a

File tree

71 files changed

+265
-218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+265
-218
lines changed

x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/BaseSearchableSnapshotsIntegTestCase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
1818
import org.elasticsearch.action.index.IndexRequestBuilder;
19-
import org.elasticsearch.blobstore.cache.BlobStoreCacheService;
19+
import org.elasticsearch.xpack.searchablesnapshots.cache.blob.BlobStoreCacheService;
2020
import org.elasticsearch.common.Strings;
2121
import org.elasticsearch.common.settings.Settings;
2222
import org.elasticsearch.common.unit.ByteSizeUnit;
@@ -27,8 +27,8 @@
2727
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction;
2828
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest;
2929
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest.Storage;
30-
import org.elasticsearch.xpack.searchablesnapshots.cache.CacheService;
31-
import org.elasticsearch.xpack.searchablesnapshots.cache.FrozenCacheService;
30+
import org.elasticsearch.xpack.searchablesnapshots.cache.full.CacheService;
31+
import org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService;
3232
import org.junit.After;
3333

3434
import java.util.ArrayList;

x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCanMatchOnCoordinatorIntegTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
import org.elasticsearch.test.transport.MockTransportService;
3535
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction;
3636
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest;
37-
import org.elasticsearch.xpack.searchablesnapshots.cache.CacheService;
38-
import org.elasticsearch.xpack.searchablesnapshots.cache.FrozenCacheService;
37+
import org.elasticsearch.xpack.searchablesnapshots.cache.full.CacheService;
38+
import org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService;
3939

4040
import java.io.IOException;
4141
import java.time.Instant;

x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsAction;
7070
import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsRequest;
7171
import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsResponse;
72-
import org.elasticsearch.xpack.searchablesnapshots.cache.CacheService;
72+
import org.elasticsearch.xpack.searchablesnapshots.cache.full.CacheService;
7373

7474
import java.io.IOException;
7575
import java.nio.file.Files;
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* 2.0.
66
*/
77

8-
package org.elasticsearch.xpack.searchablesnapshots;
8+
package org.elasticsearch.xpack.searchablesnapshots.allocation;
99

1010
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
1111
import org.elasticsearch.common.Nullable;
@@ -16,6 +16,8 @@
1616
import org.elasticsearch.test.ESIntegTestCase;
1717
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction;
1818
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest;
19+
import org.elasticsearch.xpack.searchablesnapshots.BaseSearchableSnapshotsIntegTestCase;
20+
import org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots;
1921

2022
import java.util.List;
2123
import java.util.Locale;
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* 2.0.
66
*/
77

8-
package org.elasticsearch.xpack.searchablesnapshots;
8+
package org.elasticsearch.xpack.searchablesnapshots.allocation;
99

1010
import org.elasticsearch.cluster.ClusterState;
1111
import org.elasticsearch.cluster.metadata.IndexMetadata;
@@ -14,7 +14,8 @@
1414
import org.elasticsearch.common.unit.ByteSizeUnit;
1515
import org.elasticsearch.common.unit.ByteSizeValue;
1616
import org.elasticsearch.test.ESIntegTestCase;
17-
import org.elasticsearch.xpack.searchablesnapshots.cache.CacheService;
17+
import org.elasticsearch.xpack.searchablesnapshots.BaseSearchableSnapshotsIntegTestCase;
18+
import org.elasticsearch.xpack.searchablesnapshots.cache.full.CacheService;
1819

1920
import java.util.List;
2021
import java.util.Set;
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
* 2.0.
66
*/
77

8-
package org.elasticsearch.xpack.searchablesnapshots;
8+
package org.elasticsearch.xpack.searchablesnapshots.allocation;
99

1010
import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest;
1111
import org.elasticsearch.common.settings.Settings;
1212
import org.elasticsearch.test.ESIntegTestCase;
1313
import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider;
1414
import org.elasticsearch.xpack.core.DataTier;
1515
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest;
16+
import org.elasticsearch.xpack.searchablesnapshots.BaseSearchableSnapshotsIntegTestCase;
1617

1718
import java.util.Map;
1819

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* 2.0.
66
*/
77

8-
package org.elasticsearch.xpack.searchablesnapshots;
8+
package org.elasticsearch.xpack.searchablesnapshots.allocation;
99

1010
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
1111
import org.elasticsearch.client.Requests;
@@ -18,7 +18,9 @@
1818
import org.elasticsearch.snapshots.SnapshotId;
1919
import org.elasticsearch.snapshots.mockstore.MockRepository;
2020
import org.elasticsearch.test.ESIntegTestCase;
21-
import org.elasticsearch.xpack.searchablesnapshots.cache.CacheService;
21+
import org.elasticsearch.xpack.searchablesnapshots.BaseSearchableSnapshotsIntegTestCase;
22+
import org.elasticsearch.xpack.searchablesnapshots.allocation.decider.SearchableSnapshotEnableAllocationDecider;
23+
import org.elasticsearch.xpack.searchablesnapshots.cache.full.CacheService;
2224
import org.hamcrest.Matchers;
2325

2426
import java.util.ArrayList;
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* 2.0; you may not use this file except in compliance with the Elastic License
55
* 2.0.
66
*/
7-
package org.elasticsearch.xpack.searchablesnapshots;
7+
package org.elasticsearch.xpack.searchablesnapshots.allocation;
88

99
import org.elasticsearch.cluster.ClusterState;
1010
import org.elasticsearch.cluster.metadata.IndexMetadata;
@@ -18,6 +18,9 @@
1818
import org.elasticsearch.snapshots.mockstore.MockRepository;
1919
import org.elasticsearch.test.ESIntegTestCase;
2020
import org.elasticsearch.threadpool.ThreadPool;
21+
import org.elasticsearch.xpack.searchablesnapshots.BaseSearchableSnapshotsIntegTestCase;
22+
import org.elasticsearch.xpack.searchablesnapshots.LocalStateSearchableSnapshots;
23+
import org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshotsConstants;
2124
import org.hamcrest.Matchers;
2225

2326
import java.util.Collection;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* 2.0.
66
*/
77

8-
package org.elasticsearch.blobstore.cache;
8+
package org.elasticsearch.xpack.searchablesnapshots.cache.blob;
99

1010
import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeResponse;
1111
import org.elasticsearch.action.admin.indices.refresh.RefreshResponse;
@@ -44,8 +44,8 @@
4444
import org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshotsConstants;
4545
import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsAction;
4646
import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsRequest;
47-
import org.elasticsearch.xpack.searchablesnapshots.cache.CacheService;
48-
import org.elasticsearch.xpack.searchablesnapshots.cache.FrozenCacheService;
47+
import org.elasticsearch.xpack.searchablesnapshots.cache.full.CacheService;
48+
import org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService;
4949
import org.junit.AfterClass;
5050
import org.junit.BeforeClass;
5151

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* 2.0.
66
*/
77

8-
package org.elasticsearch.xpack.searchablesnapshots.cache;
8+
package org.elasticsearch.xpack.searchablesnapshots.cache.full;
99

1010
import org.apache.lucene.document.Document;
1111
import org.elasticsearch.cluster.metadata.IndexMetadata;
@@ -35,7 +35,7 @@
3535
import static org.elasticsearch.cluster.metadata.IndexMetadata.INDEX_ROUTING_REQUIRE_GROUP_PREFIX;
3636
import static org.elasticsearch.index.IndexSettings.INDEX_SOFT_DELETES_SETTING;
3737
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
38-
import static org.elasticsearch.xpack.searchablesnapshots.cache.PersistentCache.resolveCacheIndexFolder;
38+
import static org.elasticsearch.xpack.searchablesnapshots.cache.full.PersistentCache.resolveCacheIndexFolder;
3939
import static org.hamcrest.Matchers.equalTo;
4040
import static org.hamcrest.Matchers.greaterThan;
4141
import static org.hamcrest.Matchers.notNullValue;

0 commit comments

Comments
 (0)