@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(); } }
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; }
public ClearCacheRequestBuilder<JsonInput, JsonOutput> indices(String... indices) { request.indices(indices); 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(); } }