From 90eae6bce3c44a0c8f40a3222088ecd411e4ce55 Mon Sep 17 00:00:00 2001 From: Gordon Brown Date: Wed, 16 Oct 2019 07:59:18 -0600 Subject: [PATCH 1/2] Fix ILM HLRC Javadoc->Documentation links (#48083) Several links from the ILM HLRC Javadoc to the online documentation were not updated when the ILM HLRC documentation was written. This commit fixes those links. --- .../client/IndexLifecycleClient.java | 122 ++++++++++++------ 1 file changed, 82 insertions(+), 40 deletions(-) diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/IndexLifecycleClient.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/IndexLifecycleClient.java index 0450ae6a9d467..748b65d872e12 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/IndexLifecycleClient.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/IndexLifecycleClient.java @@ -112,8 +112,11 @@ public void putLifecyclePolicyAsync(PutLifecyclePolicyRequest request, RequestOp /** * Delete a lifecycle definition - * See - * the docs for more. + * See
+     *  https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/
+     *  java-rest-high-ilm-ilm-delete-lifecycle-policy.html
+     * 
+ * for more. * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @return the response @@ -127,8 +130,11 @@ public AcknowledgedResponse deleteLifecyclePolicy(DeleteLifecyclePolicyRequest r /** * Asynchronously delete a lifecycle definition - * See - * the docs for more. + * See
+     *  https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/
+     *  java-rest-high-ilm-ilm-delete-lifecycle-policy.html
+     * 
+ * for more. * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @param listener the listener to be notified upon request completion @@ -141,8 +147,11 @@ public void deleteLifecyclePolicyAsync(DeleteLifecyclePolicyRequest request, Req /** * Remove the index lifecycle policy for an index - * See - * the docs for more. + * See
+     *  https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/
+     *  java-rest-high-ilm-ilm-remove-lifecycle-policy-from-index.html
+     * 
+ * for more. * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @return the response @@ -156,8 +165,11 @@ public RemoveIndexLifecyclePolicyResponse removeIndexLifecyclePolicy(RemoveIndex /** * Asynchronously remove the index lifecycle policy for an index - * See - * the docs for more. + * See
+     *  https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/
+     *  java-rest-high-ilm-ilm-remove-lifecycle-policy-from-index.html
+     * 
+ * for more. * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @param listener the listener to be notified upon request completion @@ -170,8 +182,11 @@ public void removeIndexLifecyclePolicyAsync(RemoveIndexLifecyclePolicyRequest re /** * Start the Index Lifecycle Management feature. - * See - * the docs for more. + * See
+     *  https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/
+     *  java-rest-high-ilm-ilm-start-ilm.html
+     * 
+ * for more. * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @return the response @@ -184,8 +199,11 @@ public AcknowledgedResponse startILM(StartILMRequest request, RequestOptions opt /** * Asynchronously start the Index Lifecycle Management feature. - * See - * the docs for more. + * See
+     *  https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/
+     *  java-rest-high-ilm-ilm-start-ilm.html
+     * 
+ * for more. * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @param listener the listener to be notified upon request completion @@ -197,8 +215,11 @@ public void startILMAsync(StartILMRequest request, RequestOptions options, Actio /** * Stop the Index Lifecycle Management feature. - * See - * the docs for more. + * See
+     *  https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/
+     *  java-rest-high-ilm-ilm-stop-ilm.html
+     * 
+ * for more. * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @return the response @@ -209,10 +230,30 @@ public AcknowledgedResponse stopILM(StopILMRequest request, RequestOptions optio AcknowledgedResponse::fromXContent, emptySet()); } + /** + * Asynchronously stop the Index Lifecycle Management feature. + * See
+     *  https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/
+     *  java-rest-high-ilm-ilm-stop-ilm.html
+     * 
+ * for more. + * @param request the request + * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized + * @param listener the listener to be notified upon request completion + * @return cancellable that may be used to cancel the request + */ + public Cancellable stopILMAsync(StopILMRequest request, RequestOptions options, ActionListener listener) { + return restHighLevelClient.performRequestAsyncAndParseEntity(request, IndexLifecycleRequestConverters::stopILM, options, + AcknowledgedResponse::fromXContent, listener, emptySet()); + } + /** * Get the status of index lifecycle management - * See - * the docs for more. + * See
+     *  https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/
+     *  java-rest-high-ilm-ilm-status.html
+     * 
+ * for more. * * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized @@ -225,9 +266,11 @@ public LifecycleManagementStatusResponse lifecycleManagementStatus(LifecycleMana /** * Asynchronously get the status of index lifecycle management - * See - * the docs for more. - * + * See
+     *  https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/
+     *  java-rest-high-ilm-ilm-status.html
+     * 
+ * for more. * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @param listener the listener to be notified upon request completion @@ -238,23 +281,13 @@ public void lifecycleManagementStatusAsync(LifecycleManagementStatusRequest requ LifecycleManagementStatusResponse::fromXContent, listener, emptySet()); } - /** - * Asynchronously stop the Index Lifecycle Management feature. - * See - * the docs for more. - * @param request the request - * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized - * @param listener the listener to be notified upon request completion - */ - public void stopILMAsync(StopILMRequest request, RequestOptions options, ActionListener listener) { - restHighLevelClient.performRequestAsyncAndParseEntity(request, IndexLifecycleRequestConverters::stopILM, options, - AcknowledgedResponse::fromXContent, listener, emptySet()); - } - /** * Explain the lifecycle state for an index - * See - * the docs for more. + * See
+     *  https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/
+     *  java-rest-high-ilm-ilm-explain-lifecycle.html
+     * 
+ * for more. * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @return the response @@ -267,8 +300,11 @@ public ExplainLifecycleResponse explainLifecycle(ExplainLifecycleRequest request /** * Asynchronously explain the lifecycle state for an index - * See - * the docs for more. + * See
+     *  https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/
+     *  java-rest-high-ilm-ilm-explain-lifecycle.html
+     * 
+ * for more. * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @param listener the listener to be notified upon request completion @@ -281,8 +317,11 @@ public void explainLifecycleAsync(ExplainLifecycleRequest request, RequestOption /** * Retry lifecycle step for given indices - * See - * the docs for more. + * See
+     *  https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/
+     *  java-rest-high-ilm-ilm-retry-lifecycle-policy.html
+     * 
+ * for more. * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @return the response @@ -295,8 +334,11 @@ public AcknowledgedResponse retryLifecyclePolicy(RetryLifecyclePolicyRequest req /** * Asynchronously retry the lifecycle step for given indices - * See - * the docs for more. + * See
+     *  https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/
+     *  java-rest-high-ilm-ilm-retry-lifecycle-policy.html
+     * 
+ * for more. * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @param listener the listener to be notified upon request completion From bc19d643c7c42a89eeb2074e4ec9bae46bc9357a Mon Sep 17 00:00:00 2001 From: Gordon Brown Date: Wed, 16 Oct 2019 08:07:41 -0600 Subject: [PATCH 2/2] Remove Cancellable that doesn't exist in 7.4 --- .../java/org/elasticsearch/client/IndexLifecycleClient.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/rest-high-level/src/main/java/org/elasticsearch/client/IndexLifecycleClient.java b/client/rest-high-level/src/main/java/org/elasticsearch/client/IndexLifecycleClient.java index 748b65d872e12..3f846e044fd0a 100644 --- a/client/rest-high-level/src/main/java/org/elasticsearch/client/IndexLifecycleClient.java +++ b/client/rest-high-level/src/main/java/org/elasticsearch/client/IndexLifecycleClient.java @@ -240,10 +240,9 @@ public AcknowledgedResponse stopILM(StopILMRequest request, RequestOptions optio * @param request the request * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized * @param listener the listener to be notified upon request completion - * @return cancellable that may be used to cancel the request */ - public Cancellable stopILMAsync(StopILMRequest request, RequestOptions options, ActionListener listener) { - return restHighLevelClient.performRequestAsyncAndParseEntity(request, IndexLifecycleRequestConverters::stopILM, options, + public void stopILMAsync(StopILMRequest request, RequestOptions options, ActionListener listener) { + restHighLevelClient.performRequestAsyncAndParseEntity(request, IndexLifecycleRequestConverters::stopILM, options, AcknowledgedResponse::fromXContent, listener, emptySet()); }