-
Notifications
You must be signed in to change notification settings - Fork 52
CASSSIDECAR-268 Adds endpoint to perform repair for a given keyspace … #231
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
arjunashok
wants to merge
18
commits into
apache:trunk
Choose a base branch
from
arjunashok:CASSSIDECAR-268
base: trunk
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.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
7bfc4bb
CASSSIDECAR-268 Adds endpoint to perform repair for a given keyspace …
arjunashok 5bc7db4
Fix repair config
arjunashok 94495c0
Tagging repair integ tests as heavy
arjunashok 22a4ad3
Fix test
arjunashok f120dec
Bump up no rows written to simulate long-running repair
arjunashok c4898c2
Minor cleanup
arjunashok cd91585
Addressing PR comments
arjunashok e998ca0
Address PR comments
arjunashok af91c2a
Improved empty status handling before repair starts
arjunashok 3f5dead
Update to only perform retries until a valid repair status is receive…
arjunashok cfdd1e0
Fix checkstyle
arjunashok d0a4097
Addressed comments
arjunashok 3c21d56
Addressed comments
arjunashok 076cb7d
Fix config test
arjunashok b98df42
Rebase and address PR comments
arjunashok 864a888
Fix test
arjunashok bf773b0
Address comments
arjunashok 0b859eb
Fix integ tests
arjunashok 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
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
79 changes: 79 additions & 0 deletions
79
...adapters-base/src/main/java/org/apache/cassandra/sidecar/adapters/base/RepairOptions.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,79 @@ | ||
| /* | ||
| * 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.cassandra.sidecar.adapters.base; | ||
|
|
||
| /** | ||
| * Enum representing the repair options supported. | ||
| * This class mimics the options supported by the repair operation in Apache Cassandra | ||
| * as defined in org.apache.cassandra.repair.messages.RepairOption | ||
| * (<a href="https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/repair/messages/RepairOption.java">...</a>) | ||
| */ | ||
| public enum RepairOptions | ||
| { | ||
| /** | ||
| * Whether to repair only the primary range of the node (true/false) | ||
| */ | ||
| PRIMARY_RANGE("primaryRange"), | ||
| /** | ||
| * Whether to perform an incremental repair (true/false) | ||
| * If false, a full repair is performed | ||
| */ | ||
| INCREMENTAL("incremental"), | ||
| /** | ||
| * Specific token ranges to repair | ||
| */ | ||
| RANGES("ranges"), | ||
| /** | ||
| * List of column families (tables) to repair (comma-separated) | ||
| */ | ||
| COLUMNFAMILIES("columnFamilies"), | ||
arjunashok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /** | ||
| * Restrict repair to specific data centers (comma-separated) | ||
| */ | ||
| DATACENTERS("dataCenters"), | ||
arjunashok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /** | ||
| * Restrict repair to specific hosts (comma-separated IPs or hostnames) | ||
| */ | ||
| HOSTS("hosts"), | ||
| /** | ||
| * Force the repair operation | ||
| */ | ||
| FORCE_REPAIR("forceRepair"), | ||
| /** | ||
| * Type of preview repair to run before actual repair | ||
| * Options: "none", "auto", "running", "full" | ||
| * Mainly used to assess data consistency without actually repairing | ||
| */ | ||
| PREVIEW("previewKind"); | ||
|
|
||
| private final String value; | ||
|
|
||
| RepairOptions(String value) | ||
| { | ||
| this.value = value; | ||
| } | ||
|
|
||
| /** | ||
| * @return Name corresponding to the repair option | ||
| */ | ||
| public String optionName() | ||
| { | ||
| return value; | ||
| } | ||
| } | ||
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
63 changes: 63 additions & 0 deletions
63
client-common/src/main/java/org/apache/cassandra/sidecar/common/request/RepairRequest.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,63 @@ | ||
| /* | ||
| * 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.cassandra.sidecar.common.request; | ||
|
|
||
| import io.netty.handler.codec.http.HttpMethod; | ||
| import org.apache.cassandra.sidecar.common.ApiEndpointsV1; | ||
| import org.apache.cassandra.sidecar.common.request.data.RepairPayload; | ||
| import org.apache.cassandra.sidecar.common.response.OperationalJobResponse; | ||
|
|
||
| /** | ||
| * Class representing the repair API request | ||
| */ | ||
| public class RepairRequest extends JsonRequest<OperationalJobResponse> | ||
| { | ||
| private final RepairPayload repairRequestPayload; | ||
|
|
||
|
|
||
| /** | ||
| * Constructs a Sidecar repair request with the given parameters. | ||
| * | ||
| * @param keyspace name of the keyspace in the cluster | ||
| * @param repairRequestPayload request payload | ||
| */ | ||
| public RepairRequest(String keyspace, RepairPayload repairRequestPayload) | ||
arjunashok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| super(requestURI(keyspace)); | ||
| this.repairRequestPayload = repairRequestPayload; | ||
| } | ||
|
|
||
| @Override | ||
| public HttpMethod method() | ||
| { | ||
| return HttpMethod.PUT; | ||
| } | ||
|
|
||
| @Override | ||
| public Object requestBody() | ||
| { | ||
| return repairRequestPayload; | ||
| } | ||
|
|
||
| static String requestURI(String keyspace) | ||
| { | ||
| return ApiEndpointsV1.REPAIR_ROUTE | ||
| .replaceAll(ApiEndpointsV1.KEYSPACE_PATH_PARAM, keyspace); | ||
| } | ||
| } | ||
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.
Add
@OverrideCI should fail w/o the annotation.