Skip to content

Commit b46a46c

Browse files
committed
SOLR-18219: Rename the CoreAdmin UPGRADECOREINDEX action to UPGRADEINDEX for a cleaner API with reduced verbosity (#4387)
1 parent 4f130b8 commit b46a46c

6 files changed

Lines changed: 23 additions & 23 deletions

File tree

solr/core/src/java/org/apache/solr/handler/admin/CoreAdminOperation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.STATUS;
4141
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.SWAP;
4242
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.UNLOAD;
43-
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.UPGRADECOREINDEX;
43+
import static org.apache.solr.common.params.CoreAdminParams.CoreAdminAction.UPGRADEINDEX;
4444
import static org.apache.solr.common.params.CoreAdminParams.REPLICA;
4545
import static org.apache.solr.common.params.CoreAdminParams.REPLICA_TYPE;
4646
import static org.apache.solr.common.params.CoreAdminParams.SHARD;
@@ -297,7 +297,7 @@ public enum CoreAdminOperation implements CoreAdminOp {
297297

298298
V2ApiUtils.squashIntoSolrResponseWithoutHeader(it.rsp, response);
299299
}),
300-
UPGRADECOREINDEX_OP(UPGRADECOREINDEX, new UpgradeCoreIndexOp());
300+
UPGRADEINDEX_OP(UPGRADEINDEX, new UpgradeCoreIndexOp());
301301

302302
final CoreAdminParams.CoreAdminAction action;
303303
final CoreAdminOp fun;

solr/core/src/java/org/apache/solr/handler/admin/UpgradeCoreIndexOp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void execute(CoreAdminHandler.CallInfo it) throws Exception {
5454
if (it.handler.coreContainer.isZooKeeperAware()) {
5555
throw new SolrException(
5656
SolrException.ErrorCode.BAD_REQUEST,
57-
"action=UPGRADECOREINDEX is not supported in SolrCloud mode. As an alternative, in order to upgrade index, configure LatestVersionMergePolicyFactory in solrconfig.xml and reindex the data in your collection.");
57+
"action=UPGRADEINDEX is not supported in SolrCloud mode. As an alternative, in order to upgrade index, configure LatestVersionMergePolicyFactory in solrconfig.xml and reindex the data in your collection.");
5858
}
5959

6060
SolrParams params = it.req.getParams();

solr/core/src/java/org/apache/solr/handler/admin/api/UpgradeCoreIndex.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
import org.slf4j.LoggerFactory;
6969

7070
/**
71-
* Implements the UPGRADECOREINDEX CoreAdmin action, which upgrades an existing core's index
72-
* in-place by reindexing documents from segments belonging to older Lucene versions, so that they
73-
* get written into latest version segments.
71+
* Implements the UPGRADEINDEX CoreAdmin action, which upgrades an existing core's index in-place by
72+
* reindexing documents from segments belonging to older Lucene versions, so that they get written
73+
* into latest version segments.
7474
*
7575
* <p>The upgrade process:
7676
*
@@ -153,7 +153,7 @@ private UpgradeCoreIndexResponse performUpgradeImpl(
153153
if (indexContainsChildDocs(searcherRef.get())) {
154154
throw new SolrException(
155155
BAD_REQUEST,
156-
"UPGRADECOREINDEX does not support indexes containing child/nested documents. "
156+
"UPGRADEINDEX does not support indexes containing child/nested documents. "
157157
+ " Consider reindexing your data "
158158
+ "from the original source.");
159159
}

solr/core/src/test/org/apache/solr/handler/admin/UpgradeCoreIndexActionTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void testUpgradeCoreIndexSelectiveReindexDeletesOldSegments() throws Exce
8686
admin.handleRequestBody(
8787
req(
8888
CoreAdminParams.ACTION,
89-
CoreAdminParams.CoreAdminAction.UPGRADECOREINDEX.toString(),
89+
CoreAdminParams.CoreAdminAction.UPGRADEINDEX.toString(),
9090
CoreAdminParams.CORE,
9191
coreName),
9292
resp);
@@ -131,14 +131,14 @@ public void testUpgradeCoreIndexAsyncRequestStatusContainsOperationResponse() th
131131

132132
final Set<String> segmentsBeforeUpgrade = listSegmentNames(core);
133133

134-
final String requestId = "upgradecoreindex_async_1";
134+
final String requestId = "upgradeindex_async_1";
135135
CoreAdminHandler admin = new CoreAdminHandler(h.getCoreContainer());
136136
try {
137137
SolrQueryResponse submitResp = new SolrQueryResponse();
138138
admin.handleRequestBody(
139139
req(
140140
CoreAdminParams.ACTION,
141-
CoreAdminParams.CoreAdminAction.UPGRADECOREINDEX.toString(),
141+
CoreAdminParams.CoreAdminAction.UPGRADEINDEX.toString(),
142142
CoreAdminParams.CORE,
143143
coreName,
144144
CommonAdminParams.ASYNC,
@@ -212,7 +212,7 @@ public void testNoUpgradeNeededWhenAllSegmentsCurrent() throws Exception {
212212
admin.handleRequestBody(
213213
req(
214214
CoreAdminParams.ACTION,
215-
CoreAdminParams.CoreAdminAction.UPGRADECOREINDEX.toString(),
215+
CoreAdminParams.CoreAdminAction.UPGRADEINDEX.toString(),
216216
CoreAdminParams.CORE,
217217
coreName),
218218
resp);
@@ -375,7 +375,7 @@ public void testUpgradeCoreIndexFailsWithChildDocuments() throws Exception {
375375
admin.handleRequestBody(
376376
req(
377377
CoreAdminParams.ACTION,
378-
CoreAdminParams.CoreAdminAction.UPGRADECOREINDEX.toString(),
378+
CoreAdminParams.CoreAdminAction.UPGRADEINDEX.toString(),
379379
CoreAdminParams.CORE,
380380
coreName),
381381
resp));
@@ -401,7 +401,7 @@ public void testChildDocsDetection_noChildDocs() throws Exception {
401401
admin.handleRequestBody(
402402
req(
403403
CoreAdminParams.ACTION,
404-
CoreAdminParams.CoreAdminAction.UPGRADECOREINDEX.toString(),
404+
CoreAdminParams.CoreAdminAction.UPGRADEINDEX.toString(),
405405
CoreAdminParams.CORE,
406406
coreName),
407407
resp);
@@ -428,7 +428,7 @@ public void testChildDocsDetection_withChildDocs() throws Exception {
428428
admin.handleRequestBody(
429429
req(
430430
CoreAdminParams.ACTION,
431-
CoreAdminParams.CoreAdminAction.UPGRADECOREINDEX.toString(),
431+
CoreAdminParams.CoreAdminAction.UPGRADEINDEX.toString(),
432432
CoreAdminParams.CORE,
433433
coreName),
434434
resp));

solr/solr-ref-guide/modules/configuration-guide/pages/coreadmin-api.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -780,10 +780,10 @@ This command is used as part of SolrCloud's xref:deployment-guide:shard-manageme
780780
When used against a core in a user-managed cluster without `split.key` parameter, this action will split the source index and distribute its documents alternately so that each split piece contains an equal number of documents.
781781
If the `split.key` parameter is specified then only documents having the same route key will be split from the source index.
782782

783-
[[coreadmin-upgradecoreindex]]
784-
== UPGRADECOREINDEX
783+
[[coreadmin-upgradeindex]]
784+
== UPGRADEINDEX
785785

786-
The `UPGRADECOREINDEX` action upgrades an existing core's index in-place after a Solr major-version upgrade by reindexing documents from older-format segments.
786+
The `UPGRADEINDEX` action upgrades an existing core's index in-place after a Solr major-version upgrade by reindexing documents from older-format segments.
787787
If a core is upgraded by this action, it ensures index compatibility with the next Solr major version (upon a future Solr upgrade) without having to re-create the index from source.
788788

789789
This action is expensive and can take a while to complete on large indexes. Consider running with `async` option in such cases.
@@ -797,7 +797,7 @@ Fields that are neither stored nor docValues-backed will lose their data, unless
797797

798798
It is recommended to test on a copy and have a backup before running on production data.
799799

800-
=== UPGRADECOREINDEX Parameters
800+
=== UPGRADEINDEX Parameters
801801

802802
`core`::
803803
+
@@ -828,7 +828,7 @@ Use <<coreadmin-requeststatus,REQUESTSTATUS>> with the provided `requestid` to p
828828
The update processor chain to use for reindexing.
829829
If omitted, Solr uses the chain configured for the `/update` handler, or the default update chain for the core (in that order).
830830

831-
=== UPGRADECOREINDEX Response
831+
=== UPGRADEINDEX Response
832832

833833
On success, the response includes:
834834

@@ -845,20 +845,20 @@ The number of segments successfully processed.
845845
One of `UPGRADE_SUCCESSFUL` or `NO_UPGRADE_NEEDED`.
846846
On failure, an exception is thrown with error details.
847847

848-
=== UPGRADECOREINDEX Examples
848+
=== UPGRADEINDEX Examples
849849

850850
*Synchronous:*
851851

852852
[source,bash]
853853
----
854-
http://localhost:8983/solr/admin/cores?action=UPGRADECOREINDEX&core=techproducts
854+
http://localhost:8983/solr/admin/cores?action=UPGRADEINDEX&core=techproducts
855855
----
856856

857857
*Asynchronous (recommended for large cores):*
858858

859859
[source,bash]
860860
----
861-
http://localhost:8983/solr/admin/cores?action=UPGRADECOREINDEX&core=techproducts&async=upgrade_1
861+
http://localhost:8983/solr/admin/cores?action=UPGRADEINDEX&core=techproducts&async=upgrade_1
862862
----
863863

864864
Then poll status:

solr/solrj/src/java/org/apache/solr/common/params/CoreAdminParams.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public enum CoreAdminAction {
189189
CREATESNAPSHOT,
190190
DELETESNAPSHOT,
191191
LISTSNAPSHOTS,
192-
UPGRADECOREINDEX;
192+
UPGRADEINDEX;
193193

194194
public final boolean isRead;
195195

0 commit comments

Comments
 (0)