diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerAction.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerAction.java index 6c544050a67..9c3e4a001a0 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerAction.java @@ -23,6 +23,7 @@ import org.elasticsearch.action.admin.indices.IndicesAction; import org.elasticsearch.client.IndicesAdminClient; /** + * Action for the admin/warmers/delete API. */ public class DeleteWarmerAction extends IndicesAction { diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerRequest.java index abe5230b23b..bd01c10a5cb 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerRequest.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerRequest.java @@ -33,7 +33,8 @@ import java.io.IOException; import static org.elasticsearch.action.ValidateActions.addValidationError; /** - * A request to delete an index warmer. + * A request that deletes a index warmer (name, {@link org.elasticsearch.action.search.SearchRequest}) + * tuple from the clusters metadata. */ public class DeleteWarmerRequest extends AcknowledgedRequest implements IndicesRequest { diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerRequestBuilder.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerRequestBuilder.java index bf40e9a0ab5..3b8a707373f 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerRequestBuilder.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerRequestBuilder.java @@ -25,7 +25,8 @@ import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder; import org.elasticsearch.client.IndicesAdminClient; /** - * + * A builder for the {@link DeleteWarmerRequest} + * @see DeleteWarmerRequest for details */ public class DeleteWarmerRequestBuilder extends AcknowledgedRequestBuilder { diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerResponse.java index 22b5f390834..6e5235f78b2 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerResponse.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/DeleteWarmerResponse.java @@ -25,7 +25,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import java.io.IOException; /** - * A response for a delete warmer. + * An acknowledged response of delete warmer operation. */ public class DeleteWarmerResponse extends AcknowledgedResponse { diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/TransportDeleteWarmerAction.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/TransportDeleteWarmerAction.java index a47ea3ec565..86229582037 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/TransportDeleteWarmerAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/delete/TransportDeleteWarmerAction.java @@ -44,7 +44,9 @@ import java.util.Arrays; import java.util.List; /** - * Delete index warmer. + * Internal Actions executed on the master deleting the warmer from the cluster state metadata. + * + * Note: this is an internal API and should not be used / called by any client code. */ public class TransportDeleteWarmerAction extends TransportMasterNodeOperationAction { diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersAction.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersAction.java index e16b4ada778..4170509b904 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersAction.java @@ -23,6 +23,7 @@ import org.elasticsearch.action.admin.indices.IndicesAction; import org.elasticsearch.client.IndicesAdminClient; /** + * Action for the admin/warmers/get API. */ public class GetWarmersAction extends IndicesAction { diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersRequest.java index cb31dfc4307..25d82a1bbb6 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersRequest.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersRequest.java @@ -28,6 +28,8 @@ import org.elasticsearch.common.io.stream.StreamOutput; import java.io.IOException; /** + * An {@ClusterInfoRequest} that fetches {@link org.elasticsearch.search.warmer.IndexWarmersMetaData} for + * a list or all existing index warmers in the cluster-state */ public class GetWarmersRequest extends ClusterInfoRequest { diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersRequestBuilder.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersRequestBuilder.java index 98daa9d6f3d..13a6ce22162 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersRequestBuilder.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersRequestBuilder.java @@ -25,6 +25,9 @@ import org.elasticsearch.action.support.master.info.ClusterInfoRequestBuilder; import org.elasticsearch.client.IndicesAdminClient; /** + * Builder for {@link GetWarmersRequest} + * + * @see GetWarmersRequest for details */ public class GetWarmersRequestBuilder extends ClusterInfoRequestBuilder { diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersResponse.java index c8e48cc8aa5..42271c996fd 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersResponse.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/GetWarmersResponse.java @@ -32,6 +32,9 @@ import org.elasticsearch.search.warmer.IndexWarmersMetaData; import java.io.IOException; /** + * Holds a warmer-name to a list of {@link IndexWarmersMetaData} mapping for each warmer specified + * in the {@link GetWarmersRequest}. This information is fetched from the current master since the metadata + * is contained inside the cluster-state */ public class GetWarmersResponse extends ActionResponse { diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/TransportGetWarmersAction.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/TransportGetWarmersAction.java index 049882a594f..1480c7ceeed 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/TransportGetWarmersAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/get/TransportGetWarmersAction.java @@ -34,6 +34,9 @@ import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; /** + * Internal Actions executed on the master fetching the warmer from the cluster state metadata. + * + * Note: this is an internal API and should not be used / called by any client code. */ public class TransportGetWarmersAction extends TransportClusterInfoAction { diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/package-info.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/package-info.java new file mode 100644 index 00000000000..69dad430ad9 --- /dev/null +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/package-info.java @@ -0,0 +1,30 @@ +/* + * Licensed to Elasticsearch under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch 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. + */ + +/** + * Index / Search Warmer Administrative Actions + *

+ * Index warming allows to run registered search requests to warm up the index before it is available for search. + * With the near real time aspect of search, cold data (segments) will be warmed up before they become available for + * search. This includes things such as the filter cache, filesystem cache, and loading field data for fields. + *

+ * + * @see the reference guide for more detailed information about the Indices / Search Warmer + */ +package org.elasticsearch.action.admin.indices.warmer; \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerAction.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerAction.java index 726bb29687c..4b295286de3 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerAction.java @@ -23,6 +23,7 @@ import org.elasticsearch.action.admin.indices.IndicesAction; import org.elasticsearch.client.IndicesAdminClient; /** + * Action for the admin/warmers/put API. */ public class PutWarmerAction extends IndicesAction { diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerRequest.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerRequest.java index 10a79c3a021..da7fd9d05f2 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerRequest.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerRequest.java @@ -33,7 +33,10 @@ import java.io.IOException; import static org.elasticsearch.action.ValidateActions.addValidationError; /** - * A request to put a search warmer. + * A request that associates a {@link SearchRequest} with a name in the cluster that is + * in-turn used to warm up indices before they are available for search. + * + * Note: neither the search request nor the name must be null */ public class PutWarmerRequest extends AcknowledgedRequest implements IndicesRequest { diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerRequestBuilder.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerRequestBuilder.java index e4c88cdb568..ddb0f8fd552 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerRequestBuilder.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerRequestBuilder.java @@ -26,14 +26,22 @@ import org.elasticsearch.action.support.master.AcknowledgedRequestBuilder; import org.elasticsearch.client.IndicesAdminClient; /** - * + * Builder for {@link PutWarmerRequest} + * @see PutWarmerRequest for details */ public class PutWarmerRequestBuilder extends AcknowledgedRequestBuilder { + /** + * Creates a new {@link PutWarmerRequestBuilder} with a given name. + */ public PutWarmerRequestBuilder(IndicesAdminClient indicesClient, String name) { super(indicesClient, new PutWarmerRequest().name(name)); } + /** + * Creates a new {@link PutWarmerRequestBuilder} + * Note: {@link #setName(String)} must be called with a non-null value before this request is executed. + */ public PutWarmerRequestBuilder(IndicesAdminClient indicesClient) { super(indicesClient, new PutWarmerRequest()); } diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerResponse.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerResponse.java index d656761edfa..008b239920c 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerResponse.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/PutWarmerResponse.java @@ -26,7 +26,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import java.io.IOException; /** - * The response of put warmer operation. + * An acknowledged response of put warmer operation. */ public class PutWarmerResponse extends AcknowledgedResponse { diff --git a/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/TransportPutWarmerAction.java b/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/TransportPutWarmerAction.java index 5b5806f42a6..758b898f80d 100644 --- a/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/TransportPutWarmerAction.java +++ b/src/main/java/org/elasticsearch/action/admin/indices/warmer/put/TransportPutWarmerAction.java @@ -46,7 +46,9 @@ import java.util.Arrays; import java.util.List; /** - * Put warmer action. + * Internal Actions executed on the master associating a warmer with a name in the cluster state metadata. + * + * Note: this is an internal API and should not be used / called by any client code. */ public class TransportPutWarmerAction extends TransportMasterNodeOperationAction { diff --git a/src/main/java/org/elasticsearch/client/ClusterAdminClient.java b/src/main/java/org/elasticsearch/client/ClusterAdminClient.java index 27f714fb89e..66ab892e3b4 100644 --- a/src/main/java/org/elasticsearch/client/ClusterAdminClient.java +++ b/src/main/java/org/elasticsearch/client/ClusterAdminClient.java @@ -20,7 +20,6 @@ package org.elasticsearch.client; import org.elasticsearch.action.*; -import org.elasticsearch.action.admin.cluster.ClusterAction; import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest; import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequestBuilder; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; @@ -81,7 +80,6 @@ import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse; import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksRequest; import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksRequestBuilder; import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksResponse; -import org.elasticsearch.threadpool.ThreadPool; /** * Administrative actions/operations against indices. @@ -232,10 +230,22 @@ public interface ClusterAdminClient extends ElasticsearchClient nodesHotThreads(NodesHotThreadsRequest request); + /** + * Returns top N hot-threads samples per node. The hot-threads are only sampled + * for the node ids specified in the request. + */ void nodesHotThreads(NodesHotThreadsRequest request, ActionListener listener); + /** + * Returns a request builder to fetch top N hot-threads samples per node. The hot-threads are only sampled + * for the node ids provided. Note: Use * to fetch samples for all nodes + */ NodesHotThreadsRequestBuilder prepareNodesHotThreads(String... nodesIds); /** diff --git a/src/main/java/org/elasticsearch/client/IndicesAdminClient.java b/src/main/java/org/elasticsearch/client/IndicesAdminClient.java index 0f9ee9773a0..b720c918fc4 100644 --- a/src/main/java/org/elasticsearch/client/IndicesAdminClient.java +++ b/src/main/java/org/elasticsearch/client/IndicesAdminClient.java @@ -691,15 +691,38 @@ public interface IndicesAdminClient extends ElasticsearchClient listener); + /** + * Returns a map of index warmers for the given get request. + */ ActionFuture getWarmers(GetWarmersRequest request); + /** + * Returns a new builder to fetch index warmer metadata for the given indices. + */ GetWarmersRequestBuilder prepareGetWarmers(String... indices); + /** + * Executed a per index settings get request and returns the settings for the indices specified. + * Note: this is a per index request and will not include settings that are set on the cluster + * level. This request is not exhaustive, it will not return default values for setting. + */ void getSettings(GetSettingsRequest request, ActionListener listener); + /** + * Executed a per index settings get request. + * @see #getSettings(org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest) + */ ActionFuture getSettings(GetSettingsRequest request); + /** + * Returns a builder for a per index settings get request. + * @param indices the indices to fetch the setting for. + * @see #getSettings(org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest) + */ GetSettingsRequestBuilder prepareGetSettings(String... indices); }