Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganise packages and classes in searchable snapshots plugin #70814

Merged
merged 3 commits into from
Mar 25, 2021

Conversation

tlrx
Copy link
Member

@tlrx tlrx commented Mar 24, 2021

Note: I'm opening this PR as a suggestion, I'm fine with closing it straight away or hold it as long as more important changes required to be merged.

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 (at least for me).

This pull request reorganizes the classes to be structured like this:

.
└── org
    └── elasticsearch
        └── xpack
            └── searchablesnapshots
                ├── SearchableSnapshots.java
                ├── action
                │   ├── cache
                │   │   ├── FrozenCacheInfoAction.java
                │   │   ├── FrozenCacheInfoNodeAction.java
                │   │   ├── FrozenCacheInfoResponse.java
                │   │   └── TransportSearchableSnapshotCacheStoresAction.java
                │   ├── AbstractTransportSearchableSnapshotsAction.java
                │   ├── ClearSearchableSnapshotsCacheAction.java
                │   ├── ClearSearchableSnapshotsCacheRequest.java
                │   ├── ClearSearchableSnapshotsCacheResponse.java
                │   ├── SearchableSnapshotsInfoTransportAction.java
                │   ├── SearchableSnapshotsStatsAction.java
                │   ├── SearchableSnapshotsStatsRequest.java
                │   ├── SearchableSnapshotsStatsResponse.java
                │   ├── SearchableSnapshotsUsageTransportAction.java
                │   ├── TransportClearSearchableSnapshotsCacheAction.java
                │   ├── TransportMountSearchableSnapshotAction.java
                │   └── TransportSearchableSnapshotsStatsAction.java
                ├── allocation
                │   ├── decider
                │   │   ├── HasFrozenCacheAllocationDecider.java
                │   │   ├── SearchableSnapshotAllocationDecider.java
                │   │   └── SearchableSnapshotEnableAllocationDecider.java
                │   ├── FailShardsOnInvalidLicenseClusterListener.java
                │   ├── SearchableSnapshotAllocator.java
                │   ├── SearchableSnapshotIndexEventListener.java
                │   └── SearchableSnapshotIndexFoldersDeletionListener.java
                ├── cache
                │   ├── blob
                │   │   ├── BlobStoreCacheService.java
                │   │   └── CachedBlob.java
                │   ├── common
                │   │   ├── ByteRange.java
                │   │   ├── CacheFile.java
                │   │   ├── CacheKey.java
                │   │   ├── ProgressListenableActionFuture.java
                │   │   └── SparseFileTracker.java
                │   ├── full
                │   │   ├── CacheService.java
                │   │   └── PersistentCache.java
                │   └── shared
                │       ├── FrozenCacheInfoService.java
                │       ├── FrozenCacheService.java
                │       └── SharedBytes.java
                ├── recovery
                │   └── SearchableSnapshotRecoveryState.java
                ├── rest
                │   ├── RestClearSearchableSnapshotsCacheAction.java
                │   ├── RestMountSearchableSnapshotAction.java
                │   └── RestSearchableSnapshotsStatsAction.java
                └── store
                    ├── IndexInputStats.java
                    ├── InMemoryNoOpCommitDirectory.java
                    ├── input
                    │   ├── BaseSearchableSnapshotIndexInput.java
                    │   ├── CachedBlobContainerIndexInput.java
                    │   ├── ChecksumBlobContainerIndexInput.java
                    │   ├── DirectBlobContainerIndexInput.java
                    │   ├── FrozenIndexInput.java
                    │   └── MetadataCachingIndexInput.java
                    └── SearchableSnapshotDirectory.java

Files are only moved (not renamed), and only few methods and interfaces in CacheFile and TestUtils were made public. Unit and integration tests have been reorganized to follow the same package hierarchy.

@elasticmachine elasticmachine added the Team:Distributed Meta label for distributed team (obsolete) label Mar 24, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

tlrx added a commit to tlrx/elasticsearch that referenced this pull request Mar 25, 2021
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 elastic#70814 for 7.x
tlrx added a commit to tlrx/elasticsearch that referenced this pull request Mar 25, 2021
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 elastic#70814 for 7.12
@tlrx tlrx merged commit 64dee7a into elastic:master Mar 25, 2021
tlrx added a commit that referenced this pull request Mar 25, 2021
…70851)

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.x
tlrx added a commit that referenced this pull request Mar 25, 2021
…#70852)

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
@tlrx tlrx deleted the reorganise-searchable-snapshots-plugin branch March 25, 2021 09:54
ywelsch pushed a commit to ywelsch/elasticsearch that referenced this pull request Mar 26, 2021
…lastic#70851)

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 elastic#70814 for 7.x
ywelsch pushed a commit that referenced this pull request Mar 26, 2021
…#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >non-issue Team:Distributed Meta label for distributed team (obsolete) v7.12.1 v7.13.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants