Skip to content

Commit

Permalink
Adjust format by spotlessApply task
Browse files Browse the repository at this point in the history
Signed-off-by: Tianli Feng <ftianli@amazon.com>
  • Loading branch information
Tianli Feng committed Apr 15, 2022
1 parent 5f5bcba commit e9f775d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,10 @@ public static void addWarning(String message, Object... params) {
// package scope for testing
static void addWarning(Set<ThreadContext> threadContexts, String message, Object... params) {
final Iterator<ThreadContext> iterator = threadContexts.iterator();
/*
/*
* As of 2.0, to support inclusive language, the REST API request parameter 'master_timeout' is deprecated.
* However, the specific deprecation warning message will not be added to HTTP response header.
* In Low Level REST Client, parameter 'master_timeout' is added to every applicable REST API call,
* In Low Level REST Client, parameter 'master_timeout' is added to every applicable REST API call,
* see org.opensearch.client.RequestConverters.Params.withMasterTimeout(TimeValue).
* To keep the compatibility of Rest Client 2.x with server 1.x, the parameter 'master_timeout' is preserved.
* The deprecated parameter is not actively used by the user, so skip adding the warning message to HTTP header.
Expand Down
4 changes: 2 additions & 2 deletions server/src/main/java/org/opensearch/rest/BaseRestHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ protected Set<String> responseParams() {
}

public static final String MASTER_TIMEOUT_DEPRECATED_MESSAGE =
"Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead.";
"Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead.";
protected static final String DUPLICATE_PARAMETER_ERROR_MESSAGE =
"Please only use one of the request parameters [master_timeout, cluster_manager_timeout].";
"Please only use one of the request parameters [master_timeout, cluster_manager_timeout].";

/**
* Parse the deprecated request parameter 'master_timeout', and add deprecated log if the parameter is used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public void testMasterTimeoutDeprecationWarningNotAddToHttpHeader() {
final Map<String, List<String>> responseHeaders = threadContext.getResponseHeaders();
assertThat(responseHeaders.get("Warning"), nullValue());
}

private String range(int lowerInclusive, int upperInclusive) {
return IntStream.range(lowerInclusive, upperInclusive + 1)
.collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append)
Expand Down

0 comments on commit e9f775d

Please sign in to comment.