Skip to content

Commit c3b80c5

Browse files
danhermannAdam Locke
authored andcommitted
Remove endpoint for freezing indices (elastic#78918)
1 parent 422d061 commit c3b80c5

File tree

35 files changed

+205
-770
lines changed

35 files changed

+205
-770
lines changed

client/rest-high-level/src/test/java/org/elasticsearch/client/IndicesClientIT.java

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import org.elasticsearch.action.support.WriteRequest;
4343
import org.elasticsearch.action.support.broadcast.BroadcastResponse;
4444
import org.elasticsearch.action.support.master.AcknowledgedResponse;
45-
import org.elasticsearch.client.core.ShardsAcknowledgedResponse;
4645
import org.elasticsearch.client.indices.AnalyzeRequest;
4746
import org.elasticsearch.client.indices.AnalyzeResponse;
4847
import org.elasticsearch.client.indices.CloseIndexRequest;
@@ -58,7 +57,6 @@
5857
import org.elasticsearch.client.indices.DeleteAliasRequest;
5958
import org.elasticsearch.client.indices.DeleteComposableIndexTemplateRequest;
6059
import org.elasticsearch.client.indices.DeleteDataStreamRequest;
61-
import org.elasticsearch.client.indices.FreezeIndexRequest;
6260
import org.elasticsearch.client.indices.GetComposableIndexTemplateRequest;
6361
import org.elasticsearch.client.indices.GetComposableIndexTemplatesResponse;
6462
import org.elasticsearch.client.indices.GetDataStreamRequest;
@@ -80,7 +78,6 @@
8078
import org.elasticsearch.client.indices.ReloadAnalyzersResponse;
8179
import org.elasticsearch.client.indices.SimulateIndexTemplateRequest;
8280
import org.elasticsearch.client.indices.SimulateIndexTemplateResponse;
83-
import org.elasticsearch.client.indices.UnfreezeIndexRequest;
8481
import org.elasticsearch.client.indices.rollover.RolloverRequest;
8582
import org.elasticsearch.client.indices.rollover.RolloverResponse;
8683
import org.elasticsearch.cluster.metadata.AliasMetadata;
@@ -95,16 +92,16 @@
9592
import org.elasticsearch.common.settings.Settings;
9693
import org.elasticsearch.common.unit.ByteSizeUnit;
9794
import org.elasticsearch.common.unit.ByteSizeValue;
98-
import org.elasticsearch.core.TimeValue;
99-
import org.elasticsearch.xcontent.XContentBuilder;
100-
import org.elasticsearch.xcontent.XContentType;
101-
import org.elasticsearch.xcontent.json.JsonXContent;
10295
import org.elasticsearch.common.xcontent.support.XContentMapValues;
96+
import org.elasticsearch.core.TimeValue;
10397
import org.elasticsearch.index.IndexSettings;
10498
import org.elasticsearch.index.query.QueryBuilder;
10599
import org.elasticsearch.index.query.QueryBuilders;
106100
import org.elasticsearch.rest.RestStatus;
107101
import org.elasticsearch.rest.action.admin.indices.RestPutIndexTemplateAction;
102+
import org.elasticsearch.xcontent.XContentBuilder;
103+
import org.elasticsearch.xcontent.XContentType;
104+
import org.elasticsearch.xcontent.json.JsonXContent;
108105

109106
import java.io.IOException;
110107
import java.util.Arrays;
@@ -1535,24 +1532,6 @@ public void testAnalyze() throws Exception {
15351532
assertNotNull(detailsResponse.detail());
15361533
}
15371534

1538-
public void testFreezeAndUnfreeze() throws IOException {
1539-
createIndex("test", Settings.EMPTY);
1540-
RestHighLevelClient client = highLevelClient();
1541-
1542-
final RequestOptions freezeIndexOptions = RequestOptions.DEFAULT.toBuilder()
1543-
.setWarningsHandler(warnings -> List.of(FROZEN_INDICES_DEPRECATION_WARNING).equals(warnings) == false).build();
1544-
1545-
ShardsAcknowledgedResponse freeze = execute(new FreezeIndexRequest("test"), client.indices()::freeze,
1546-
client.indices()::freezeAsync, freezeIndexOptions);
1547-
assertTrue(freeze.isShardsAcknowledged());
1548-
assertTrue(freeze.isAcknowledged());
1549-
1550-
ShardsAcknowledgedResponse unfreeze = execute(new UnfreezeIndexRequest("test"), client.indices()::unfreeze,
1551-
client.indices()::unfreezeAsync, freezeIndexOptions);
1552-
assertTrue(unfreeze.isShardsAcknowledged());
1553-
assertTrue(unfreeze.isAcknowledged());
1554-
}
1555-
15561535
public void testReloadAnalyzer() throws IOException {
15571536
createIndex("test", Settings.EMPTY);
15581537
RestHighLevelClient client = highLevelClient();

client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/IndicesClientDocumentationIT.java

Lines changed: 6 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,21 @@
5555
import org.elasticsearch.client.indices.DeleteAliasRequest;
5656
import org.elasticsearch.client.indices.DeleteComposableIndexTemplateRequest;
5757
import org.elasticsearch.client.indices.DetailAnalyzeResponse;
58-
import org.elasticsearch.client.indices.FreezeIndexRequest;
58+
import org.elasticsearch.client.indices.GetComposableIndexTemplateRequest;
59+
import org.elasticsearch.client.indices.GetComposableIndexTemplatesResponse;
5960
import org.elasticsearch.client.indices.GetFieldMappingsRequest;
6061
import org.elasticsearch.client.indices.GetFieldMappingsResponse;
6162
import org.elasticsearch.client.indices.GetIndexRequest;
6263
import org.elasticsearch.client.indices.GetIndexResponse;
63-
import org.elasticsearch.client.indices.GetComposableIndexTemplateRequest;
6464
import org.elasticsearch.client.indices.GetIndexTemplatesRequest;
6565
import org.elasticsearch.client.indices.GetIndexTemplatesResponse;
66-
import org.elasticsearch.client.indices.GetComposableIndexTemplatesResponse;
6766
import org.elasticsearch.client.indices.GetMappingsRequest;
6867
import org.elasticsearch.client.indices.GetMappingsResponse;
6968
import org.elasticsearch.client.indices.IndexTemplateMetadata;
7069
import org.elasticsearch.client.indices.IndexTemplatesExistRequest;
7170
import org.elasticsearch.client.indices.PutComponentTemplateRequest;
72-
import org.elasticsearch.client.indices.PutIndexTemplateRequest;
7371
import org.elasticsearch.client.indices.PutComposableIndexTemplateRequest;
72+
import org.elasticsearch.client.indices.PutIndexTemplateRequest;
7473
import org.elasticsearch.client.indices.PutMappingRequest;
7574
import org.elasticsearch.client.indices.ReloadAnalyzersRequest;
7675
import org.elasticsearch.client.indices.ReloadAnalyzersResponse;
@@ -90,13 +89,13 @@
9089
import org.elasticsearch.common.unit.ByteSizeUnit;
9190
import org.elasticsearch.common.unit.ByteSizeValue;
9291
import org.elasticsearch.core.TimeValue;
93-
import org.elasticsearch.xcontent.XContentBuilder;
94-
import org.elasticsearch.xcontent.XContentFactory;
95-
import org.elasticsearch.xcontent.XContentType;
9692
import org.elasticsearch.index.IndexSettings;
9793
import org.elasticsearch.index.query.QueryBuilder;
9894
import org.elasticsearch.index.query.QueryBuilders;
9995
import org.elasticsearch.rest.RestStatus;
96+
import org.elasticsearch.xcontent.XContentBuilder;
97+
import org.elasticsearch.xcontent.XContentFactory;
98+
import org.elasticsearch.xcontent.XContentType;
10099

101100
import java.io.IOException;
102101
import java.util.Collections;
@@ -108,7 +107,6 @@
108107
import java.util.concurrent.TimeUnit;
109108

110109
import static org.elasticsearch.client.IndicesClientIT.FROZEN_INDICES_DEPRECATION_WARNING;
111-
import static org.elasticsearch.client.IndicesClientIT.IGNORE_THROTTLED_DEPRECATION_WARNING;
112110
import static org.elasticsearch.client.IndicesClientIT.LEGACY_TEMPLATE_OPTIONS;
113111
import static org.hamcrest.Matchers.containsInAnyOrder;
114112
import static org.hamcrest.Matchers.equalTo;
@@ -2874,89 +2872,6 @@ public void onFailure(Exception e) {
28742872

28752873
}
28762874

2877-
public void testFreezeIndex() throws Exception {
2878-
RestHighLevelClient client = highLevelClient();
2879-
2880-
{
2881-
CreateIndexResponse createIndexResponse = client.indices().create(new CreateIndexRequest("index"), RequestOptions.DEFAULT);
2882-
assertTrue(createIndexResponse.isAcknowledged());
2883-
}
2884-
2885-
{
2886-
// tag::freeze-index-request
2887-
FreezeIndexRequest request = new FreezeIndexRequest("index"); // <1>
2888-
// end::freeze-index-request
2889-
2890-
// tag::freeze-index-request-timeout
2891-
request.setTimeout(TimeValue.timeValueMinutes(2)); // <1>
2892-
// end::freeze-index-request-timeout
2893-
// tag::freeze-index-request-masterTimeout
2894-
request.setMasterTimeout(TimeValue.timeValueMinutes(1)); // <1>
2895-
// end::freeze-index-request-masterTimeout
2896-
// tag::freeze-index-request-waitForActiveShards
2897-
request.setWaitForActiveShards(ActiveShardCount.DEFAULT); // <1>
2898-
// end::freeze-index-request-waitForActiveShards
2899-
2900-
// tag::freeze-index-request-indicesOptions
2901-
request.setIndicesOptions(IndicesOptions.strictExpandOpen()); // <1>
2902-
// end::freeze-index-request-indicesOptions
2903-
2904-
final RequestOptions freezeIndexOptions = RequestOptions.DEFAULT.toBuilder()
2905-
.setWarningsHandler(
2906-
warnings -> List.of(FROZEN_INDICES_DEPRECATION_WARNING, IGNORE_THROTTLED_DEPRECATION_WARNING).equals(warnings) == false
2907-
).build();
2908-
2909-
// tag::freeze-index-execute
2910-
ShardsAcknowledgedResponse openIndexResponse = client.indices().freeze(request, freezeIndexOptions);
2911-
// end::freeze-index-execute
2912-
2913-
// tag::freeze-index-response
2914-
boolean acknowledged = openIndexResponse.isAcknowledged(); // <1>
2915-
boolean shardsAcked = openIndexResponse.isShardsAcknowledged(); // <2>
2916-
// end::freeze-index-response
2917-
assertTrue(acknowledged);
2918-
assertTrue(shardsAcked);
2919-
2920-
// tag::freeze-index-execute-listener
2921-
ActionListener<ShardsAcknowledgedResponse> listener =
2922-
new ActionListener<ShardsAcknowledgedResponse>() {
2923-
@Override
2924-
public void onResponse(ShardsAcknowledgedResponse freezeIndexResponse) {
2925-
// <1>
2926-
}
2927-
2928-
@Override
2929-
public void onFailure(Exception e) {
2930-
// <2>
2931-
}
2932-
};
2933-
// end::freeze-index-execute-listener
2934-
2935-
// Replace the empty listener by a blocking listener in test
2936-
final CountDownLatch latch = new CountDownLatch(1);
2937-
listener = new LatchedActionListener<>(listener, latch);
2938-
2939-
// tag::freeze-index-execute-async
2940-
client.indices().freezeAsync(request, RequestOptions.DEFAULT, listener); // <1>
2941-
// end::freeze-index-execute-async
2942-
2943-
assertTrue(latch.await(30L, TimeUnit.SECONDS));
2944-
}
2945-
2946-
{
2947-
// tag::freeze-index-notfound
2948-
try {
2949-
FreezeIndexRequest request = new FreezeIndexRequest("does_not_exist");
2950-
client.indices().freeze(request, RequestOptions.DEFAULT);
2951-
} catch (ElasticsearchException exception) {
2952-
if (exception.status() == RestStatus.BAD_REQUEST) {
2953-
// <1>
2954-
}
2955-
}
2956-
// end::freeze-index-notfound
2957-
}
2958-
}
2959-
29602875
public void testUnfreezeIndex() throws Exception {
29612876
RestHighLevelClient client = highLevelClient();
29622877

docs/java-rest/redirects.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,11 @@ See <<java-rest-high-start-transform>>.
4747
=== Stop {transform} API
4848

4949
See <<java-rest-high-stop-transform>>.
50+
51+
[role="exclude",id="java-rest-high-freeze-index"]
52+
=== Freeze index API
53+
54+
The freeze index API was removed in 8.0. Frozen indices are no longer useful due
55+
to
56+
https://www.elastic.co/blog/significantly-decrease-your-elasticsearch-heap-memory-usage[recent
57+
improvements in heap memory usage].

docs/reference/data-streams/data-streams.asciidoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ such as:
6767

6868
* <<indices-clone-index,Clone>>
6969
* <<indices-delete-index,Delete>>
70-
* <<freeze-index-api,Freeze>>
7170
* <<indices-shrink-index,Shrink>>
7271
* <<indices-split-index,Split>>
7372

docs/reference/ilm/actions/ilm-freeze.asciidoc

Lines changed: 0 additions & 34 deletions
This file was deleted.

docs/reference/ilm/actions/ilm-searchable-snapshot.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ index>> to the frozen tier. In other phases, the action mounts a
1818
<<fully-mounted,fully mounted index>> to the corresponding data tier.
1919

2020
If the `searchable_snapshot` action is used in the hot phase the subsequent
21-
phases cannot include the `shrink`, `forcemerge`, or `freeze` actions.
21+
phases cannot include the `shrink` or `forcemerge` actions.
2222

2323
This action cannot be performed on a data stream's write index. Attempts to do
2424
so will fail. To convert the index to a searchable snapshot, first

docs/reference/ilm/ilm-actions.asciidoc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ Permanently remove the index.
1414
Reduce the number of index segments and purge deleted documents.
1515
Makes the index read-only.
1616

17-
<<ilm-freeze,Freeze>>::
18-
Freeze the index to minimize its memory footprint.
19-
2017
<<ilm-migrate,Migrate>>::
2118
Move the index shards to the <<data-tiers, data tier>> that corresponds
2219
to the current {ilm-init} phase.
@@ -49,7 +46,6 @@ Ensure that a snapshot exists before deleting the index.
4946
include::actions/ilm-allocate.asciidoc[]
5047
include::actions/ilm-delete.asciidoc[]
5148
include::actions/ilm-forcemerge.asciidoc[]
52-
include::actions/ilm-freeze.asciidoc[]
5349
include::actions/ilm-migrate.asciidoc[]
5450
include::actions/ilm-readonly.asciidoc[]
5551
include::actions/ilm-rollover.asciidoc[]

docs/reference/ilm/ilm-index-lifecycle.asciidoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ actions in the order listed.
106106
- <<ilm-searchable-snapshot, Searchable Snapshot>>
107107
- <<ilm-allocate,Allocate>>
108108
- <<ilm-migrate,Migrate>>
109-
- <<ilm-freeze,Freeze>>
110109
* Frozen
111110
- <<ilm-searchable-snapshot, Searchable Snapshot>>
112111
* Delete

docs/reference/ilm/ilm-overview.asciidoc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<titleabbrev>Overview</titleabbrev>
88
++++
99

10-
You can create and apply {ilm-cap} ({ilm-init}) policies to automatically manage your indices
11-
according to your performance, resiliency, and retention requirements.
10+
You can create and apply {ilm-cap} ({ilm-init}) policies to automatically manage your indices
11+
according to your performance, resiliency, and retention requirements.
1212

1313
Index lifecycle policies can trigger actions such as:
1414

@@ -17,7 +17,6 @@ size, number of docs, or age.
1717
* **Shrink**: Reduces the number of primary shards in an index.
1818
* **Force merge**: Triggers a <<indices-forcemerge,force merge>> to reduce the
1919
number of segments in an index's shards.
20-
* **Freeze**: <<freeze-index-api, Freezes>> an index and makes it read-only.
2120
* **Delete**: Permanently remove an index, including all of its data and
2221
metadata.
2322

@@ -48,9 +47,9 @@ hardware.
4847

4948
[IMPORTANT]
5049
===========================
51-
To use {ilm-init}, all nodes in a cluster must run the same version.
52-
Although it might be possible to create and apply policies in a mixed-version cluster,
50+
To use {ilm-init}, all nodes in a cluster must run the same version.
51+
Although it might be possible to create and apply policies in a mixed-version cluster,
5352
there is no guarantee they will work as intended.
5453
Attempting to use a policy that contains actions that aren't
55-
supported on all nodes in a cluster will cause errors.
54+
supported on all nodes in a cluster will cause errors.
5655
===========================

docs/reference/indices.asciidoc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ index settings, aliases, mappings, and index templates.
1818
* <<indices-split-index>>
1919
* <<indices-clone-index>>
2020
* <<indices-rollover-index>>
21-
* <<freeze-index-api>>
2221
* <<unfreeze-index-api>>
2322
* <<indices-resolve-index-api>>
2423

@@ -53,9 +52,9 @@ index settings, aliases, mappings, and index templates.
5352
=== Index templates:
5453

5554
Index templates automatically apply settings, mappings, and aliases to new indices.
56-
They are most often used to configure rolling indices for time series data to
57-
ensure that each new index has the same configuration as the previous one.
58-
The index template associated with a data stream configures its backing indices.
55+
They are most often used to configure rolling indices for time series data to
56+
ensure that each new index has the same configuration as the previous one.
57+
The index template associated with a data stream configures its backing indices.
5958
For more information, see <<index-templates, Index Templates>>.
6059

6160
* <<indices-put-template>>
@@ -113,7 +112,6 @@ include::indices/indices-exists.asciidoc[]
113112
include::indices/field-usage-stats.asciidoc[]
114113
include::indices/flush.asciidoc[]
115114
include::indices/forcemerge.asciidoc[]
116-
include::indices/apis/freeze.asciidoc[]
117115
include::indices/get-alias.asciidoc[]
118116
include::indices/get-component-template.asciidoc[]
119117
include::indices/get-field-mapping.asciidoc[]

0 commit comments

Comments
 (0)