Skip to content

Commit d697f01

Browse files
committed
Fix up o.e.snapshots split package in xpack-core (#74056)
Moves the classes related to source-only snapshots to `o.e.s.sourceonly` to avoid splitting the snapshots package across modules.
1 parent 5483bf2 commit d697f01

File tree

9 files changed

+32
-30
lines changed

9 files changed

+32
-30
lines changed

x-pack/plugin/core/build.gradle

+1-6
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,5 @@ tasks.named("testingConventions").configure { enabled = false }
159159
tasks.named('splitPackagesAudit').configure {
160160
// engine is owned by server, these should be renamed
161161
ignoreClasses 'org.elasticsearch.index.engine.FrozenEngine',
162-
'org.elasticsearch.index.engine.RewriteCachingDirectoryReader',
163-
164-
// snapshots are part of server, these should be renamed
165-
'org.elasticsearch.snapshots.SeqIdGeneratingFilterReader',
166-
'org.elasticsearch.snapshots.SourceOnlySnapshot',
167-
'org.elasticsearch.snapshots.SourceOnlySnapshotRepository'
162+
'org.elasticsearch.index.engine.RewriteCachingDirectoryReader'
168163
}

x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/snapshots/SourceOnlySnapshotIT.java renamed to x-pack/plugin/core/src/internalClusterTest/java/org/elasticsearch/snapshots/sourceonly/SourceOnlySnapshotIT.java

+2-1
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.snapshots;
7+
package org.elasticsearch.snapshots.sourceonly;
88

99
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotResponse;
1010
import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder;
@@ -39,6 +39,7 @@
3939
import org.elasticsearch.search.SearchHits;
4040
import org.elasticsearch.search.slice.SliceBuilder;
4141
import org.elasticsearch.search.sort.SortOrder;
42+
import org.elasticsearch.snapshots.AbstractSnapshotIntegTestCase;
4243
import org.elasticsearch.test.ESIntegTestCase;
4344
import org.hamcrest.Matchers;
4445

x-pack/plugin/core/src/main/java/org/elasticsearch/snapshots/SeqIdGeneratingFilterReader.java renamed to x-pack/plugin/core/src/main/java/org/elasticsearch/snapshots/sourceonly/SeqIdGeneratingFilterReader.java

+1-1
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.snapshots;
7+
package org.elasticsearch.snapshots.sourceonly;
88

99
import org.apache.lucene.codecs.StoredFieldsReader;
1010
import org.apache.lucene.index.DirectoryReader;

x-pack/plugin/core/src/main/java/org/elasticsearch/snapshots/SourceOnlySnapshot.java renamed to x-pack/plugin/core/src/main/java/org/elasticsearch/snapshots/sourceonly/SourceOnlySnapshot.java

+1-1
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.snapshots;
7+
package org.elasticsearch.snapshots.sourceonly;
88

99
import org.apache.lucene.codecs.Codec;
1010
import org.apache.lucene.index.CheckIndex;

x-pack/plugin/core/src/main/java/org/elasticsearch/snapshots/SourceOnlySnapshotRepository.java renamed to x-pack/plugin/core/src/main/java/org/elasticsearch/snapshots/sourceonly/SourceOnlySnapshotRepository.java

+3-1
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.snapshots;
7+
package org.elasticsearch.snapshots.sourceonly;
88

99
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
1010
import org.apache.logging.log4j.LogManager;
@@ -47,6 +47,8 @@
4747
import org.elasticsearch.repositories.RepositoryData;
4848
import org.elasticsearch.repositories.ShardGenerations;
4949
import org.elasticsearch.repositories.SnapshotShardContext;
50+
import org.elasticsearch.snapshots.SnapshotId;
51+
import org.elasticsearch.snapshots.SnapshotInfo;
5052

5153
import java.io.Closeable;
5254
import java.io.IOException;

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/XPackPlugin.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
import org.elasticsearch.rest.RestController;
6060
import org.elasticsearch.rest.RestHandler;
6161
import org.elasticsearch.script.ScriptService;
62-
import org.elasticsearch.snapshots.SourceOnlySnapshotRepository;
62+
import org.elasticsearch.snapshots.sourceonly.SourceOnlySnapshotRepository;
6363
import org.elasticsearch.threadpool.ThreadPool;
6464
import org.elasticsearch.watcher.ResourceWatcherService;
6565
import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider;

x-pack/plugin/core/src/test/java/org/elasticsearch/snapshots/SourceOnlySnapshotShardTests.java renamed to x-pack/plugin/core/src/test/java/org/elasticsearch/snapshots/sourceonly/SourceOnlySnapshotShardTests.java

+4-1
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.snapshots;
7+
package org.elasticsearch.snapshots.sourceonly;
88

99
import org.apache.lucene.document.Document;
1010
import org.apache.lucene.index.DirectoryReader;
@@ -72,6 +72,9 @@
7272
import org.elasticsearch.repositories.blobstore.BlobStoreTestUtil;
7373
import org.elasticsearch.repositories.blobstore.ESBlobStoreRepositoryIntegTestCase;
7474
import org.elasticsearch.repositories.fs.FsRepository;
75+
import org.elasticsearch.snapshots.Snapshot;
76+
import org.elasticsearch.snapshots.SnapshotId;
77+
import org.elasticsearch.snapshots.SnapshotInfo;
7578
import org.elasticsearch.threadpool.ThreadPool;
7679
import org.hamcrest.Matchers;
7780

x-pack/plugin/core/src/test/java/org/elasticsearch/snapshots/SourceOnlySnapshotTests.java renamed to x-pack/plugin/core/src/test/java/org/elasticsearch/snapshots/sourceonly/SourceOnlySnapshotTests.java

+1-1
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.snapshots;
7+
package org.elasticsearch.snapshots.sourceonly;
88

99
import org.apache.lucene.document.Document;
1010
import org.apache.lucene.document.Field;

x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java

+18-17
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,36 @@
1212
import org.elasticsearch.action.ActionListener;
1313
import org.elasticsearch.action.ActionRequest;
1414
import org.elasticsearch.action.ActionResponse;
15+
import org.elasticsearch.client.Client;
1516
import org.elasticsearch.cluster.ClusterChangedEvent;
1617
import org.elasticsearch.cluster.ClusterStateListener;
17-
import org.elasticsearch.cluster.metadata.RepositoriesMetadata;
18-
import org.elasticsearch.cluster.metadata.RepositoryMetadata;
19-
import org.elasticsearch.cluster.routing.RerouteService;
20-
import org.elasticsearch.common.Priority;
21-
import org.elasticsearch.common.util.concurrent.EsExecutors;
22-
import org.elasticsearch.repositories.RepositoryData;
23-
import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants;
24-
import org.elasticsearch.xpack.searchablesnapshots.action.cache.TransportSearchableSnapshotsNodeCachesStatsAction;
25-
import org.elasticsearch.xpack.searchablesnapshots.allocation.decider.DedicatedFrozenNodeAllocationDecider;
26-
import org.elasticsearch.xpack.searchablesnapshots.allocation.decider.SearchableSnapshotRepositoryExistsAllocationDecider;
27-
import org.elasticsearch.xpack.searchablesnapshots.cache.blob.BlobStoreCacheService;
28-
import org.elasticsearch.client.Client;
2918
import org.elasticsearch.cluster.metadata.IndexMetadata;
3019
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
20+
import org.elasticsearch.cluster.metadata.RepositoriesMetadata;
21+
import org.elasticsearch.cluster.metadata.RepositoryMetadata;
3122
import org.elasticsearch.cluster.node.DiscoveryNode;
3223
import org.elasticsearch.cluster.node.DiscoveryNodes;
24+
import org.elasticsearch.cluster.routing.RerouteService;
3325
import org.elasticsearch.cluster.routing.allocation.ExistingShardsAllocator;
3426
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider;
3527
import org.elasticsearch.cluster.service.ClusterService;
3628
import org.elasticsearch.core.Nullable;
3729
import org.elasticsearch.common.inject.Module;
30+
import org.elasticsearch.common.Priority;
3831
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
39-
import org.elasticsearch.core.Releasables;
4032
import org.elasticsearch.common.settings.ClusterSettings;
4133
import org.elasticsearch.common.settings.IndexScopedSettings;
4234
import org.elasticsearch.common.settings.Setting;
4335
import org.elasticsearch.common.settings.Settings;
4436
import org.elasticsearch.common.settings.SettingsFilter;
4537
import org.elasticsearch.common.unit.ByteSizeUnit;
4638
import org.elasticsearch.common.unit.ByteSizeValue;
47-
import org.elasticsearch.core.TimeValue;
39+
import org.elasticsearch.common.util.concurrent.EsExecutors;
4840
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
4941
import org.elasticsearch.common.xcontent.XContentBuilder;
42+
import org.elasticsearch.core.Nullable;
43+
import org.elasticsearch.core.Releasables;
44+
import org.elasticsearch.core.TimeValue;
5045
import org.elasticsearch.env.Environment;
5146
import org.elasticsearch.env.NodeEnvironment;
5247
import org.elasticsearch.index.IndexModule;
@@ -55,8 +50,6 @@
5550
import org.elasticsearch.index.engine.EngineFactory;
5651
import org.elasticsearch.index.engine.FrozenEngine;
5752
import org.elasticsearch.index.engine.ReadOnlyEngine;
58-
import org.elasticsearch.xpack.searchablesnapshots.rest.RestSearchableSnapshotsNodeCachesStatsAction;
59-
import org.elasticsearch.xpack.searchablesnapshots.store.SearchableSnapshotDirectory;
6053
import org.elasticsearch.index.store.Store;
6154
import org.elasticsearch.index.translog.Translog;
6255
import org.elasticsearch.index.translog.TranslogStats;
@@ -71,11 +64,12 @@
7164
import org.elasticsearch.plugins.SystemIndexPlugin;
7265
import org.elasticsearch.repositories.RepositoriesService;
7366
import org.elasticsearch.repositories.Repository;
67+
import org.elasticsearch.repositories.RepositoryData;
7468
import org.elasticsearch.repositories.blobstore.BlobStoreRepository;
7569
import org.elasticsearch.rest.RestController;
7670
import org.elasticsearch.rest.RestHandler;
7771
import org.elasticsearch.script.ScriptService;
78-
import org.elasticsearch.snapshots.SourceOnlySnapshotRepository;
72+
import org.elasticsearch.snapshots.sourceonly.SourceOnlySnapshotRepository;
7973
import org.elasticsearch.threadpool.ExecutorBuilder;
8074
import org.elasticsearch.threadpool.ScalingExecutorBuilder;
8175
import org.elasticsearch.threadpool.ThreadPool;
@@ -86,6 +80,7 @@
8680
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction;
8781
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest;
8882
import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsFeatureSet;
83+
import org.elasticsearch.xpack.core.searchablesnapshots.SearchableSnapshotsConstants;
8984
import org.elasticsearch.xpack.searchablesnapshots.action.ClearSearchableSnapshotsCacheAction;
9085
import org.elasticsearch.xpack.searchablesnapshots.action.RepositoryStatsAction;
9186
import org.elasticsearch.xpack.searchablesnapshots.action.SearchableSnapshotsStatsAction;
@@ -96,13 +91,17 @@
9691
import org.elasticsearch.xpack.searchablesnapshots.action.cache.FrozenCacheInfoAction;
9792
import org.elasticsearch.xpack.searchablesnapshots.action.cache.FrozenCacheInfoNodeAction;
9893
import org.elasticsearch.xpack.searchablesnapshots.action.cache.TransportSearchableSnapshotCacheStoresAction;
94+
import org.elasticsearch.xpack.searchablesnapshots.action.cache.TransportSearchableSnapshotsNodeCachesStatsAction;
9995
import org.elasticsearch.xpack.searchablesnapshots.allocation.FailShardsOnInvalidLicenseClusterListener;
10096
import org.elasticsearch.xpack.searchablesnapshots.allocation.SearchableSnapshotAllocator;
10197
import org.elasticsearch.xpack.searchablesnapshots.allocation.SearchableSnapshotIndexEventListener;
10298
import org.elasticsearch.xpack.searchablesnapshots.allocation.SearchableSnapshotIndexFoldersDeletionListener;
99+
import org.elasticsearch.xpack.searchablesnapshots.allocation.decider.DedicatedFrozenNodeAllocationDecider;
103100
import org.elasticsearch.xpack.searchablesnapshots.allocation.decider.HasFrozenCacheAllocationDecider;
104101
import org.elasticsearch.xpack.searchablesnapshots.allocation.decider.SearchableSnapshotAllocationDecider;
105102
import org.elasticsearch.xpack.searchablesnapshots.allocation.decider.SearchableSnapshotEnableAllocationDecider;
103+
import org.elasticsearch.xpack.searchablesnapshots.allocation.decider.SearchableSnapshotRepositoryExistsAllocationDecider;
104+
import org.elasticsearch.xpack.searchablesnapshots.cache.blob.BlobStoreCacheService;
106105
import org.elasticsearch.xpack.searchablesnapshots.cache.full.CacheService;
107106
import org.elasticsearch.xpack.searchablesnapshots.cache.full.PersistentCache;
108107
import org.elasticsearch.xpack.searchablesnapshots.cache.shared.FrozenCacheInfoService;
@@ -111,7 +110,9 @@
111110
import org.elasticsearch.xpack.searchablesnapshots.rest.RestClearSearchableSnapshotsCacheAction;
112111
import org.elasticsearch.xpack.searchablesnapshots.rest.RestMountSearchableSnapshotAction;
113112
import org.elasticsearch.xpack.searchablesnapshots.rest.RestRepositoryStatsAction;
113+
import org.elasticsearch.xpack.searchablesnapshots.rest.RestSearchableSnapshotsNodeCachesStatsAction;
114114
import org.elasticsearch.xpack.searchablesnapshots.rest.RestSearchableSnapshotsStatsAction;
115+
import org.elasticsearch.xpack.searchablesnapshots.store.SearchableSnapshotDirectory;
115116
import org.elasticsearch.xpack.searchablesnapshots.upgrade.SearchableSnapshotIndexMetadataUpgrader;
116117

117118
import java.io.IOException;

0 commit comments

Comments
 (0)