@Override public String toString() { StringBuilder message = new StringBuilder(); message.append("ES clear cache request"); if (request.indices().length > 0) { message.append(String.format(" on indices '%s'", StringUtils.join(request.indices(), ","))); } String[] fields = request.fields(); if (fields != null && fields.length > 0) { message.append(String.format(" on fields '%s'", StringUtils.join(fields, ","))); } if (request.queryCache()) { message.append(" with filter cache"); } if (request.fieldDataCache()) { message.append(" with field data cache"); } if (request.requestCache()) { message.append(" with request cache"); } return message.toString(); } }
public ClearIndicesCacheRequestBuilder setFields(String... fields) { request.fields(fields); return this; }
public static ClearIndicesCacheRequest fromRequest(final RestRequest request, ClearIndicesCacheRequest clearIndicesCacheRequest) { for (Map.Entry<String, String> entry : request.params().entrySet()) { if (Fields.QUERY.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) { clearIndicesCacheRequest.queryCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.queryCache())); } else if (Fields.REQUEST.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) { clearIndicesCacheRequest.requestCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.requestCache())); } else if (Fields.FIELDDATA.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) { clearIndicesCacheRequest.fieldDataCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.fieldDataCache())); } else if (Fields.FIELDS.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) { clearIndicesCacheRequest.fields(request.paramAsStringArray(entry.getKey(), clearIndicesCacheRequest.fields())); } } return clearIndicesCacheRequest; }
@Override protected EmptyResult shardOperation(ClearIndicesCacheRequest request, ShardRouting shardRouting) { indicesService.clearIndexShardCache(shardRouting.shardId(), request.queryCache(), request.fieldDataCache(), request.requestCache(), request.fields()); return EmptyResult.INSTANCE; }
public ClearIndicesCacheRequestBuilder setFields(String... fields) { request.fields(fields); return this; }
public ClearIndicesCacheRequestBuilder setFields(String... fields) { request.fields(fields); return this; }
public ClearCacheRequestBuilder<JsonInput, JsonOutput> fields(String... fields) { request.fields(fields); return this; }
public ClearIndicesCacheRequestBuilder setFields(String... fields) { request.fields(fields); return this; }
public ClearIndicesCacheRequestBuilder setFields(String... fields) { request.fields(fields); return this; }
@Override public String toString() { StringBuilder message = new StringBuilder(); message.append("ES clear cache request"); if (request.indices().length > 0) { message.append(String.format(" on indices '%s'", StringUtils.join(request.indices(), ","))); } String[] fields = request.fields(); if (fields != null && fields.length > 0) { message.append(String.format(" on fields '%s'", StringUtils.join(fields, ","))); } if (request.queryCache()) { message.append(" with filter cache"); } if (request.fieldDataCache()) { message.append(" with field data cache"); } if (request.requestCache()) { message.append(" with request cache"); } return message.toString(); } }
public static ClearIndicesCacheRequest fromRequest(final RestRequest request, ClearIndicesCacheRequest clearIndicesCacheRequest) { for (Map.Entry<String, String> entry : request.params().entrySet()) { if (Fields.QUERY.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) { clearIndicesCacheRequest.queryCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.queryCache())); } else if (Fields.REQUEST.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) { clearIndicesCacheRequest.requestCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.requestCache())); } else if (Fields.FIELDDATA.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) { clearIndicesCacheRequest.fieldDataCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.fieldDataCache())); } else if (Fields.FIELDS.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) { clearIndicesCacheRequest.fields(request.paramAsStringArray(entry.getKey(), clearIndicesCacheRequest.fields())); } } return clearIndicesCacheRequest; }
public static ClearIndicesCacheRequest fromRequest(final RestRequest request, ClearIndicesCacheRequest clearIndicesCacheRequest) { for (Map.Entry<String, String> entry : request.params().entrySet()) { if (Fields.QUERY.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) { clearIndicesCacheRequest.queryCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.queryCache())); } else if (Fields.REQUEST.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) { clearIndicesCacheRequest.requestCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.requestCache())); } else if (Fields.FIELDDATA.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) { clearIndicesCacheRequest.fieldDataCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.fieldDataCache())); } else if (Fields.FIELDS.match(entry.getKey(), LoggingDeprecationHandler.INSTANCE)) { clearIndicesCacheRequest.fields(request.paramAsStringArray(entry.getKey(), clearIndicesCacheRequest.fields())); } } return clearIndicesCacheRequest; }
public static ClearIndicesCacheRequest fromRequest(final RestRequest request, ClearIndicesCacheRequest clearIndicesCacheRequest, ParseFieldMatcher parseFieldMatcher) { for (Map.Entry<String, String> entry : request.params().entrySet()) { if (parseFieldMatcher.match(entry.getKey(), Fields.QUERY)) { clearIndicesCacheRequest.queryCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.queryCache())); } if (parseFieldMatcher.match(entry.getKey(), Fields.FIELD_DATA)) { clearIndicesCacheRequest.fieldDataCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.fieldDataCache())); } if (parseFieldMatcher.match(entry.getKey(), Fields.RECYCLER)) { clearIndicesCacheRequest.recycler(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.recycler())); } if (parseFieldMatcher.match(entry.getKey(), Fields.FIELDS)) { clearIndicesCacheRequest.fields(request.paramAsStringArray(entry.getKey(), clearIndicesCacheRequest.fields())); } } return clearIndicesCacheRequest; }
public static ClearIndicesCacheRequest fromRequest(final RestRequest request, ClearIndicesCacheRequest clearIndicesCacheRequest) { for (Map.Entry<String, String> entry : request.params().entrySet()) { if (Fields.QUERY.match(entry.getKey())) { clearIndicesCacheRequest.queryCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.queryCache())); } if (Fields.REQUEST.match(entry.getKey())) { clearIndicesCacheRequest.requestCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.requestCache())); } if (Fields.FIELD_DATA.match(entry.getKey())) { clearIndicesCacheRequest.fieldDataCache(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.fieldDataCache())); } if (Fields.RECYCLER.match(entry.getKey())) { clearIndicesCacheRequest.recycler(request.paramAsBoolean(entry.getKey(), clearIndicesCacheRequest.recycler())); } if (Fields.FIELDS.match(entry.getKey())) { clearIndicesCacheRequest.fields(request.paramAsStringArray(entry.getKey(), clearIndicesCacheRequest.fields())); } } return clearIndicesCacheRequest; }
@Override protected EmptyResult shardOperation(ClearIndicesCacheRequest request, ShardRouting shardRouting) { indicesService.clearIndexShardCache(shardRouting.shardId(), request.queryCache(), request.fieldDataCache(), request.requestCache(), request.fields()); return EmptyResult.INSTANCE; }
@Override protected EmptyResult shardOperation(ClearIndicesCacheRequest request, ShardRouting shardRouting) { indicesService.clearIndexShardCache(shardRouting.shardId(), request.queryCache(), request.fieldDataCache(), request.requestCache(), request.fields()); return EmptyResult.INSTANCE; }
static Request clearCache(ClearIndicesCacheRequest clearIndicesCacheRequest) { String[] indices = clearIndicesCacheRequest.indices() == null ? Strings.EMPTY_ARRAY :clearIndicesCacheRequest.indices(); Request request = new Request(HttpPost.METHOD_NAME, RequestConverters.endpoint(indices, "_cache/clear")); RequestConverters.Params parameters = new RequestConverters.Params(request); parameters.withIndicesOptions(clearIndicesCacheRequest.indicesOptions()); parameters.putParam("query", Boolean.toString(clearIndicesCacheRequest.queryCache())); parameters.putParam("fielddata", Boolean.toString(clearIndicesCacheRequest.fieldDataCache())); parameters.putParam("request", Boolean.toString(clearIndicesCacheRequest.requestCache())); parameters.putParam("fields", String.join(",", clearIndicesCacheRequest.fields())); return request; }
static Request clearCache(ClearIndicesCacheRequest clearIndicesCacheRequest) { String[] indices = clearIndicesCacheRequest.indices() == null ? Strings.EMPTY_ARRAY :clearIndicesCacheRequest.indices(); Request request = new Request(HttpPost.METHOD_NAME, RequestConverters.endpoint(indices, "_cache/clear")); RequestConverters.Params parameters = new RequestConverters.Params(request); parameters.withIndicesOptions(clearIndicesCacheRequest.indicesOptions()); parameters.putParam("query", Boolean.toString(clearIndicesCacheRequest.queryCache())); parameters.putParam("fielddata", Boolean.toString(clearIndicesCacheRequest.fieldDataCache())); parameters.putParam("request", Boolean.toString(clearIndicesCacheRequest.requestCache())); parameters.putParam("fields", String.join(",", clearIndicesCacheRequest.fields())); return request; }
if (request.fields() == null || request.fields().length == 0) { service.fieldData().clear(); } else { for (String field : request.fields()) { service.fieldData().clearField(field); if (request.fields() != null && request.fields().length > 0) { for (String field : request.fields()) { service.fieldData().clearField(field);
if (request.fields() == null || request.fields().length == 0) { service.fieldData().clear(); } else { for (String field : request.fields()) { service.fieldData().clearField(field); if (request.fields() != null && request.fields().length > 0) { for (String field : request.fields()) { service.fieldData().clearField(field);