[DOCS] Added JavaDocs for ClusterAdminClient, IndicesAdminClient and Warmer API

This commit is contained in:
Simon Willnauer 2014-08-29 11:27:14 +02:00
parent 1687c5ad51
commit c10ef110ae
18 changed files with 104 additions and 10 deletions

View File

@ -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<DeleteWarmerRequest, DeleteWarmerResponse, DeleteWarmerRequestBuilder> {

View File

@ -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<DeleteWarmerRequest> implements IndicesRequest {

View File

@ -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<DeleteWarmerRequest, DeleteWarmerResponse, DeleteWarmerRequestBuilder, IndicesAdminClient> {

View File

@ -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 {

View File

@ -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<DeleteWarmerRequest, DeleteWarmerResponse> {

View File

@ -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<GetWarmersRequest, GetWarmersResponse, GetWarmersRequestBuilder> {

View File

@ -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<GetWarmersRequest> {

View File

@ -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<GetWarmersRequest, GetWarmersResponse, GetWarmersRequestBuilder> {

View File

@ -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 {

View File

@ -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<GetWarmersRequest, GetWarmersResponse> {

View File

@ -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
* <p>
* 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.
* </p>
*
* @see the reference guide for more detailed information about the Indices / Search Warmer
*/
package org.elasticsearch.action.admin.indices.warmer;

View File

@ -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<PutWarmerRequest, PutWarmerResponse, PutWarmerRequestBuilder> {

View File

@ -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 <code>null</code>
*/
public class PutWarmerRequest extends AcknowledgedRequest<PutWarmerRequest> implements IndicesRequest {

View File

@ -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<PutWarmerRequest, PutWarmerResponse, PutWarmerRequestBuilder, IndicesAdminClient> {
/**
* 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());
}

View File

@ -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 {

View File

@ -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<PutWarmerRequest, PutWarmerResponse> {

View File

@ -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<ClusterAdminClie
*/
NodesStatsRequestBuilder prepareNodesStats(String... nodesIds);
/**
* Returns top N hot-threads samples per node. The hot-threads are only sampled
* for the node ids specified in the request.
*/
ActionFuture<NodesHotThreadsResponse> 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<NodesHotThreadsResponse> 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 <tt>*</tt> to fetch samples for all nodes
*/
NodesHotThreadsRequestBuilder prepareNodesHotThreads(String... nodesIds);
/**

View File

@ -691,15 +691,38 @@ public interface IndicesAdminClient extends ElasticsearchClient<IndicesAdminClie
*/
DeleteWarmerRequestBuilder prepareDeleteWarmer();
/**
* Returns a map of index warmers for the given get request.
*/
void getWarmers(GetWarmersRequest request, ActionListener<GetWarmersResponse> listener);
/**
* Returns a map of index warmers for the given get request.
*/
ActionFuture<GetWarmersResponse> 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<GetSettingsResponse> listener);
/**
* Executed a per index settings get request.
* @see #getSettings(org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest)
*/
ActionFuture<GetSettingsResponse> 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);
}