Skip to content

Commit ec0c988

Browse files
SOLR-18072: Refactor CollectionApiCommands to add expandable context (#4046)
1 parent 5d1149e commit ec0c988

File tree

109 files changed

+2414
-2028
lines changed

Some content is hidden

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

109 files changed

+2414
-2028
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc
2+
title: Refactor CollectionApiCommands to add easily expandable AdminCmdContext argument
3+
type: other # added, changed, fixed, deprecated, removed, dependency_update, security, other
4+
authors:
5+
- name: Houston Putman
6+
nick: HoustonPutman
7+
- name: David Smiley
8+
- name: Jason Gerlowski
9+
links:
10+
- name: SOLR-18072
11+
url: https://issues.apache.org/jira/browse/SOLR-18072

gradle/validation/validate-source-patterns.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class ValidateSourcePatternsTask extends DefaultTask {
209209
}
210210

211211
def checkMockitoAssume = {f, text ->
212-
if (text.contains("mockito") && !text.contains("assumeWorkingMockito()")) {
212+
if (text.contains("mockito") && !(text.contains("assumeWorkingMockito()") || text.contains("extends MockV2APITest"))) {
213213
reportViolation(f, 'File uses Mockito but has no assumeWorkingMockito() call')
214214
}
215215
}

solr/api/src/java/org/apache/solr/client/api/endpoint/AliasPropertyApis.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import jakarta.ws.rs.PUT;
2525
import jakarta.ws.rs.Path;
2626
import jakarta.ws.rs.PathParam;
27+
import org.apache.solr.client.api.model.AsyncJerseyResponse;
2728
import org.apache.solr.client.api.model.GetAliasPropertyResponse;
2829
import org.apache.solr.client.api.model.GetAllAliasPropertiesResponse;
2930
import org.apache.solr.client.api.model.SolrJerseyResponse;
@@ -56,7 +57,7 @@ GetAliasPropertyResponse getAliasProperty(
5657
@Operation(
5758
summary = "Update properties for a collection alias.",
5859
tags = {"alias-properties"})
59-
SolrJerseyResponse updateAliasProperties(
60+
AsyncJerseyResponse updateAliasProperties(
6061
@Parameter(description = "Alias Name") @PathParam("aliasName") String aliasName,
6162
@RequestBody(description = "Properties that need to be updated", required = true)
6263
UpdateAliasPropertiesRequestBody requestBody)

solr/api/src/java/org/apache/solr/client/api/endpoint/BalanceReplicasApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
import jakarta.ws.rs.POST;
2222
import jakarta.ws.rs.Path;
2323
import org.apache.solr.client.api.model.BalanceReplicasRequestBody;
24-
import org.apache.solr.client.api.model.SolrJerseyResponse;
24+
import org.apache.solr.client.api.model.SubResponseAccumulatingJerseyResponse;
2525

2626
@Path("cluster/replicas/balance")
2727
public interface BalanceReplicasApi {
2828
@POST
2929
@Operation(
3030
summary = "Balance Replicas across the given set of Nodes.",
3131
tags = {"cluster"})
32-
SolrJerseyResponse balanceReplicas(
32+
SubResponseAccumulatingJerseyResponse balanceReplicas(
3333
@RequestBody(description = "Contains user provided parameters")
3434
BalanceReplicasRequestBody requestBody)
3535
throws Exception;

solr/api/src/java/org/apache/solr/client/api/endpoint/CreateAliasApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
import io.swagger.v3.oas.annotations.Operation;
2020
import jakarta.ws.rs.POST;
2121
import jakarta.ws.rs.Path;
22+
import org.apache.solr.client.api.model.AsyncJerseyResponse;
2223
import org.apache.solr.client.api.model.CreateAliasRequestBody;
23-
import org.apache.solr.client.api.model.SolrJerseyResponse;
2424

2525
@Path("/aliases")
2626
public interface CreateAliasApi {
2727
@POST
2828
@Operation(
2929
summary = "Create a traditional or 'routed' alias",
3030
tags = {"aliases"})
31-
SolrJerseyResponse createAlias(CreateAliasRequestBody requestBody) throws Exception;
31+
AsyncJerseyResponse createAlias(CreateAliasRequestBody requestBody) throws Exception;
3232
}

solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteAliasApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import jakarta.ws.rs.Path;
2424
import jakarta.ws.rs.PathParam;
2525
import jakarta.ws.rs.QueryParam;
26-
import org.apache.solr.client.api.model.SolrJerseyResponse;
26+
import org.apache.solr.client.api.model.AsyncJerseyResponse;
2727

2828
@Path("/aliases/{aliasName}")
2929
public interface DeleteAliasApi {
@@ -32,7 +32,7 @@ public interface DeleteAliasApi {
3232
@Operation(
3333
summary = "Deletes an alias by its name",
3434
tags = {"aliases"})
35-
SolrJerseyResponse deleteAlias(
35+
AsyncJerseyResponse deleteAlias(
3636
@Parameter(description = "The name of the alias to delete", required = true)
3737
@PathParam("aliasName")
3838
String aliasName,

solr/api/src/java/org/apache/solr/client/api/endpoint/DeleteNodeApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import jakarta.ws.rs.Path;
2525
import jakarta.ws.rs.PathParam;
2626
import org.apache.solr.client.api.model.DeleteNodeRequestBody;
27-
import org.apache.solr.client.api.model.SolrJerseyResponse;
27+
import org.apache.solr.client.api.model.SubResponseAccumulatingJerseyResponse;
2828

2929
@Path("cluster/nodes/{nodeName}/clear/")
3030
public interface DeleteNodeApi {
@@ -33,7 +33,7 @@ public interface DeleteNodeApi {
3333
@Operation(
3434
summary = "Delete all replicas off of the specified SolrCloud node",
3535
tags = {"node"})
36-
SolrJerseyResponse deleteNode(
36+
SubResponseAccumulatingJerseyResponse deleteNode(
3737
@Parameter(
3838
description =
3939
"The name of the node to be cleared. Usually of the form 'host:1234_solr'.",

solr/api/src/java/org/apache/solr/client/api/endpoint/InstallShardDataApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import jakarta.ws.rs.Path;
2222
import jakarta.ws.rs.PathParam;
2323
import org.apache.solr.client.api.model.InstallShardDataRequestBody;
24-
import org.apache.solr.client.api.model.SolrJerseyResponse;
24+
import org.apache.solr.client.api.model.SubResponseAccumulatingJerseyResponse;
2525

2626
/** V2 API definition allowing users to import offline-constructed index into a shard. */
2727
@Path("/collections/{collName}/shards/{shardName}/install")
@@ -30,7 +30,7 @@ public interface InstallShardDataApi {
3030
@Operation(
3131
summary = "Install offline index into an existing shard",
3232
tags = {"shards"})
33-
SolrJerseyResponse installShardData(
33+
SubResponseAccumulatingJerseyResponse installShardData(
3434
@PathParam("collName") String collName,
3535
@PathParam("shardName") String shardName,
3636
InstallShardDataRequestBody requestBody)

solr/api/src/java/org/apache/solr/client/api/endpoint/MigrateReplicasApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import jakarta.ws.rs.POST;
2222
import jakarta.ws.rs.Path;
2323
import org.apache.solr.client.api.model.MigrateReplicasRequestBody;
24-
import org.apache.solr.client.api.model.SolrJerseyResponse;
24+
import org.apache.solr.client.api.model.SubResponseAccumulatingJerseyResponse;
2525

2626
/** V2 API definition for migrating replicas from a set of nodes to another set of nodes. */
2727
@Path("cluster/replicas/migrate")
@@ -30,7 +30,7 @@ public interface MigrateReplicasApi {
3030
@Operation(
3131
summary = "Migrate Replicas from a given set of nodes.",
3232
tags = {"cluster"})
33-
SolrJerseyResponse migrateReplicas(
33+
SubResponseAccumulatingJerseyResponse migrateReplicas(
3434
@RequestBody(description = "Contains user provided parameters", required = true)
3535
MigrateReplicasRequestBody requestBody)
3636
throws Exception;

solr/api/src/java/org/apache/solr/client/api/endpoint/ReplaceNodeApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import jakarta.ws.rs.Path;
2424
import jakarta.ws.rs.PathParam;
2525
import org.apache.solr.client.api.model.ReplaceNodeRequestBody;
26-
import org.apache.solr.client.api.model.SolrJerseyResponse;
26+
import org.apache.solr.client.api.model.SubResponseAccumulatingJerseyResponse;
2727

2828
/**
2929
* V2 API definition for recreating replicas in one node (the source) on another node(s) (the
@@ -35,7 +35,7 @@ public interface ReplaceNodeApi {
3535
@Operation(
3636
summary = "'Replace' a specified node by moving all replicas elsewhere",
3737
tags = {"node"})
38-
SolrJerseyResponse replaceNode(
38+
SubResponseAccumulatingJerseyResponse replaceNode(
3939
@Parameter(description = "The name of the node to be replaced.", required = true)
4040
@PathParam("sourceNodeName")
4141
String sourceNodeName,

0 commit comments

Comments
 (0)