Skip to content

Commit cbcc8dd

Browse files
tlrxywelsch
authored andcommitted
[7.12] Reorganise packages and classes in searchable snapshots plugin (#70850)
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. Backport of #70814 for 7.12
1 parent 822db8c commit cbcc8dd

File tree

69 files changed

+259
-215
lines changed

Some content is hidden

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

69 files changed

+259
-215
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;
@@ -28,8 +28,8 @@
2828
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction;
2929
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest;
3030
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest.Storage;
31-
import org.elasticsearch.xpack.searchablesnapshots.cache.CacheService;
32-
import org.elasticsearch.xpack.searchablesnapshots.cache.FrozenCacheService;
31+
import org.elasticsearch.xpack.searchablesnapshots.cache.full.CacheService;
32+
import org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService;
3333
import org.junit.After;
3434

3535
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
@@ -35,8 +35,8 @@
3535
import org.elasticsearch.test.transport.MockTransportService;
3636
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction;
3737
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest;
38-
import org.elasticsearch.xpack.searchablesnapshots.cache.CacheService;
39-
import org.elasticsearch.xpack.searchablesnapshots.cache.FrozenCacheService;
38+
import org.elasticsearch.xpack.searchablesnapshots.cache.full.CacheService;
39+
import org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheService;
4040

4141
import java.io.IOException;
4242
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
@@ -70,7 +70,7 @@
7070
import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsAction;
7171
import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsRequest;
7272
import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsResponse;
73-
import org.elasticsearch.xpack.searchablesnapshots.cache.CacheService;
73+
import org.elasticsearch.xpack.searchablesnapshots.cache.full.CacheService;
7474

7575
import java.io.IOException;
7676
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;
@@ -15,7 +15,8 @@
1515
import org.elasticsearch.common.unit.ByteSizeValue;
1616
import org.elasticsearch.common.util.set.Sets;
1717
import org.elasticsearch.test.ESIntegTestCase;
18-
import org.elasticsearch.xpack.searchablesnapshots.cache.CacheService;
18+
import org.elasticsearch.xpack.searchablesnapshots.BaseSearchableSnapshotsIntegTestCase;
19+
import org.elasticsearch.xpack.searchablesnapshots.cache.full.CacheService;
1920

2021
import java.util.Collections;
2122
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
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST)
1819
public class SearchableSnapshotDataTierIntegTests extends BaseSearchableSnapshotsIntegTestCase {
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)