org.elasticsearch.action.admin.indices.upgrade.post.UpgradeRequest Java Examples

The following examples show how to use org.elasticsearch.action.admin.indices.upgrade.post.UpgradeRequest. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RestUpgradeAction.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
void handlePost(final RestRequest request, RestChannel channel, Client client) {
    UpgradeRequest upgradeReq = new UpgradeRequest(Strings.splitStringByCommaToArray(request.param("index")));
    upgradeReq.upgradeOnlyAncientSegments(request.paramAsBoolean("only_ancient_segments", false));
    client.admin().indices().upgrade(upgradeReq, new RestBuilderListener<UpgradeResponse>(channel) {
        @Override
        public RestResponse buildResponse(UpgradeResponse response, XContentBuilder builder) throws Exception {
            builder.startObject();
            buildBroadcastShardsHeader(builder, request, response);
            builder.startObject("upgraded_indices");
            for (Map.Entry<String, Tuple<Version, String>> entry : response.versions().entrySet()) {
                builder.startObject(entry.getKey(), XContentBuilder.FieldCaseConversion.NONE);
                builder.field("upgrade_version", entry.getValue().v1());
                builder.field("oldest_lucene_segment_version", entry.getValue().v2());
                builder.endObject();
            }
            builder.endObject();
            builder.endObject();
            return new BytesRestResponse(OK, builder);
        }
    });
}
 
Example #2
Source File: AbstractClient.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public ActionFuture<UpgradeResponse> upgrade(final UpgradeRequest request) {
    return execute(UpgradeAction.INSTANCE, request);
}
 
Example #3
Source File: AbstractClient.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void upgrade(final UpgradeRequest request, final ActionListener<UpgradeResponse> listener) {
    execute(UpgradeAction.INSTANCE, request, listener);
}
 
Example #4
Source File: AbstractClient.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public ActionFuture<UpgradeResponse> upgrade(final UpgradeRequest request) {
    return execute(UpgradeAction.INSTANCE, request);
}
 
Example #5
Source File: AbstractClient.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void upgrade(final UpgradeRequest request, final ActionListener<UpgradeResponse> listener) {
    execute(UpgradeAction.INSTANCE, request, listener);
}
 
Example #6
Source File: IndicesAdminClient.java    From Elasticsearch with Apache License 2.0 2 votes vote down vote up
/**
 * Explicitly upgrade one or more indices
 *
 * @param request The upgrade request
 * @return A result future
 * @see org.elasticsearch.client.Requests#upgradeRequest(String...)
 */
ActionFuture<UpgradeResponse> upgrade(UpgradeRequest request);
 
Example #7
Source File: IndicesAdminClient.java    From Elasticsearch with Apache License 2.0 2 votes vote down vote up
/**
 * Explicitly upgrade one or more indices
 *
 * @param request  The upgrade request
 * @param listener A listener to be notified with a result
 * @see org.elasticsearch.client.Requests#upgradeRequest(String...)
 */
void upgrade(UpgradeRequest request, ActionListener<UpgradeResponse> listener);
 
Example #8
Source File: Requests.java    From Elasticsearch with Apache License 2.0 2 votes vote down vote up
/**
 * Creates an upgrade request.
 *
 * @param indices The indices to upgrade. Use <tt>null</tt> or <tt>_all</tt> to execute against all indices
 * @return The upgrade request
 * @see org.elasticsearch.client.IndicesAdminClient#upgrade(UpgradeRequest)
 */
public static UpgradeRequest upgradeRequest(String... indices) {
    return new UpgradeRequest(indices);
}
 
Example #9
Source File: IndicesAdminClient.java    From crate with Apache License 2.0 2 votes vote down vote up
/**
 * Explicitly upgrade one or more indices
 *
 * @param request The upgrade request
 * @return A result future
 * @see org.elasticsearch.client.Requests#upgradeRequest(String...)
 */
ActionFuture<UpgradeResponse> upgrade(UpgradeRequest request);
 
Example #10
Source File: IndicesAdminClient.java    From crate with Apache License 2.0 2 votes vote down vote up
/**
 * Explicitly upgrade one or more indices
 *
 * @param request  The upgrade request
 * @param listener A listener to be notified with a result
 * @see org.elasticsearch.client.Requests#upgradeRequest(String...)
 */
void upgrade(UpgradeRequest request, ActionListener<UpgradeResponse> listener);
 
Example #11
Source File: Requests.java    From crate with Apache License 2.0 2 votes vote down vote up
/**
 * Creates an upgrade request.
 *
 * @param indices The indices to upgrade. Use {@code null} or {@code _all} to execute against all indices
 * @return The upgrade request
 * @see org.elasticsearch.client.IndicesAdminClient#upgrade(UpgradeRequest)
 */
public static UpgradeRequest upgradeRequest(String... indices) {
    return new UpgradeRequest(indices);
}