Repository navigation
SOLR-16398: Add V2 JAX-RS APIs for GET replication restore status and commits. #5217
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
Open
jaykay12
wants to merge
12
commits into
apache:main
Choose a base branch
from
jaykay12:SOLR-16398-replication-phase2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+412
−45
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d1cc484
cl
jaykay12 341035b
initial changes
jaykay12 f7c4153
first changes
jaykay12 9e57151
tidying
jaykay12 dd945e7
licenses
jaykay12 db349f4
ref guides changes
jaykay12 407dc22
local agent review
jaykay12 1920616
few http tests
jaykay12 b1bfc9a
licenses
jaykay12 d1ce814
more clearer apis
jaykay12 1de34c8
minor sanity changes
jaykay12 6854c4c
Merge branch 'main' into SOLR-16398-replication-phase2
jaykay12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
changelog/unreleased/SOLR-16398-replication-restore-status-commits.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| title: Add V2 JAX-RS APIs for GET replication restore status and commits. | ||
| type: added | ||
| authors: | ||
| - name: Jalaz Kumar | ||
| nick: jaykay12 | ||
| links: | ||
| - name: SOLR-16398 | ||
| url: https://issues.apache.org/jira/browse/SOLR-16398 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
solr/api/src/java/org/apache/solr/client/api/model/CommitsResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.solr.client.api.model; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import java.util.List; | ||
| import org.apache.solr.client.api.util.ReflectWritable; | ||
|
|
||
| /** Response body for the `GET /api/cores/coreName/replication/commits` API */ | ||
| public class CommitsResponse extends SolrJerseyResponse { | ||
|
|
||
| @JsonProperty("commits") | ||
| @Schema(description = "Index commit points currently retained by the deletion policy") | ||
| public List<CommitDetails> commits; | ||
|
|
||
| @JsonProperty("status") | ||
| @Schema(description = "Request status, typically OK") | ||
| public String status; | ||
|
|
||
| /** Details of a single index commit point. */ | ||
| public static class CommitDetails implements ReflectWritable { | ||
| @JsonProperty("indexVersion") | ||
| public Long indexVersion; | ||
|
|
||
| @JsonProperty("generation") | ||
| public Long generation; | ||
|
|
||
| @JsonProperty("filelist") | ||
| public List<String> filelist; | ||
|
|
||
| public CommitDetails() {} | ||
|
|
||
| public CommitDetails(long indexVersion, long generation, List<String> filelist) { | ||
| this.indexVersion = indexVersion; | ||
| this.generation = generation; | ||
| this.filelist = filelist; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
solr/api/src/java/org/apache/solr/client/api/model/RestoreStatusResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.solr.client.api.model; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import com.fasterxml.jackson.annotation.JsonValue; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import org.apache.solr.client.api.util.ReflectWritable; | ||
|
|
||
| /** Response body for the `GET /api/cores/coreName/replication/restore` API */ | ||
| public class RestoreStatusResponse extends SolrJerseyResponse { | ||
|
|
||
| @JsonProperty("restorestatus") | ||
| @Schema(description = "State of the most recent restore operation") | ||
| public RestoreStatus restoreStatus; | ||
|
|
||
| @JsonProperty("status") | ||
| @Schema(description = "Request status, typically OK") | ||
| public String status; | ||
|
|
||
| /** State of a restore operation. */ | ||
| public static class RestoreStatus implements ReflectWritable { | ||
| @JsonProperty("snapshotName") | ||
| public String snapshotName; | ||
|
|
||
| @JsonProperty("status") | ||
| @Schema(description = "State of the restore operation") | ||
| public RestoreState status; | ||
|
|
||
| @JsonProperty("exception") | ||
| @Schema(description = "Failure message, present only when the restore failed with an exception") | ||
| public String exception; | ||
| } | ||
|
|
||
| /** State of a restore operation. */ | ||
| public enum RestoreState { | ||
| NOT_STARTED("No restore actions in progress"), | ||
| IN_PROGRESS("In Progress"), | ||
| SUCCESS("success"), | ||
| FAILED("failed"); | ||
|
|
||
| private final String key; | ||
|
|
||
| RestoreState(String key) { | ||
| this.key = key; | ||
| } | ||
|
|
||
| @JsonValue | ||
| public String getKey() { | ||
| return key; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
although V2 api sheet suggests GET /restore for this, but imo, GET /restore/status is more comprehensive.