Skip to content

Commit 223d472

Browse files
author
Tianli Feng
authored
Deprecate classes in org.opensearch.action.support.master (#3593)
Signed-off-by: Tianli Feng <ftianli@amazon.com>
1 parent 055a9fc commit 223d472

15 files changed

Lines changed: 811 additions & 0 deletions
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
/*
10+
* Licensed to Elasticsearch under one or more contributor
11+
* license agreements. See the NOTICE file distributed with
12+
* this work for additional information regarding copyright
13+
* ownership. Elasticsearch licenses this file to you under
14+
* the Apache License, Version 2.0 (the "License"); you may
15+
* not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing,
21+
* software distributed under the License is distributed on an
22+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+
* KIND, either express or implied. See the License for the
24+
* specific language governing permissions and limitations
25+
* under the License.
26+
*/
27+
/*
28+
* Modifications Copyright OpenSearch Contributors. See
29+
* GitHub history for details.
30+
*/
31+
32+
package org.opensearch.action.support.master;
33+
34+
import org.opensearch.action.support.clustermanager.ClusterManagerNodeRequest;
35+
import org.opensearch.common.io.stream.StreamInput;
36+
37+
import java.io.IOException;
38+
39+
/**
40+
* Abstract class that allows to mark action requests that support acknowledgements.
41+
* Facilitates consistency across different api.
42+
*
43+
* @opensearch.internal
44+
*/
45+
public abstract class AcknowledgedRequest<Request extends ClusterManagerNodeRequest<Request>> extends
46+
org.opensearch.action.support.clustermanager.AcknowledgedRequest<Request> {
47+
48+
protected AcknowledgedRequest() {
49+
super();
50+
}
51+
52+
protected AcknowledgedRequest(StreamInput in) throws IOException {
53+
super(in);
54+
}
55+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
/*
10+
* Licensed to Elasticsearch under one or more contributor
11+
* license agreements. See the NOTICE file distributed with
12+
* this work for additional information regarding copyright
13+
* ownership. Elasticsearch licenses this file to you under
14+
* the Apache License, Version 2.0 (the "License"); you may
15+
* not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing,
21+
* software distributed under the License is distributed on an
22+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+
* KIND, either express or implied. See the License for the
24+
* specific language governing permissions and limitations
25+
* under the License.
26+
*/
27+
/*
28+
* Modifications Copyright OpenSearch Contributors. See
29+
* GitHub history for details.
30+
*/
31+
32+
package org.opensearch.action.support.master;
33+
34+
import org.opensearch.action.ActionType;
35+
import org.opensearch.action.support.clustermanager.AcknowledgedRequest;
36+
import org.opensearch.action.support.clustermanager.AcknowledgedResponse;
37+
import org.opensearch.client.OpenSearchClient;
38+
39+
/**
40+
* Base request builder for cluster-manager node operations that support acknowledgements
41+
*
42+
* @opensearch.internal
43+
*/
44+
public abstract class AcknowledgedRequestBuilder<
45+
Request extends AcknowledgedRequest<Request>,
46+
Response extends AcknowledgedResponse,
47+
RequestBuilder extends AcknowledgedRequestBuilder<Request, Response, RequestBuilder>> extends
48+
org.opensearch.action.support.clustermanager.AcknowledgedRequestBuilder<Request, Response, RequestBuilder> {
49+
50+
protected AcknowledgedRequestBuilder(OpenSearchClient client, ActionType action, Request request) {
51+
super(client, action, request);
52+
}
53+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
/*
10+
* Licensed to Elasticsearch under one or more contributor
11+
* license agreements. See the NOTICE file distributed with
12+
* this work for additional information regarding copyright
13+
* ownership. Elasticsearch licenses this file to you under
14+
* the Apache License, Version 2.0 (the "License"); you may
15+
* not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing,
21+
* software distributed under the License is distributed on an
22+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+
* KIND, either express or implied. See the License for the
24+
* specific language governing permissions and limitations
25+
* under the License.
26+
*/
27+
/*
28+
* Modifications Copyright OpenSearch Contributors. See
29+
* GitHub history for details.
30+
*/
31+
32+
package org.opensearch.action.support.master;
33+
34+
import org.opensearch.common.io.stream.StreamInput;
35+
36+
import java.io.IOException;
37+
38+
/**
39+
* A response that indicates that a request has been acknowledged
40+
*
41+
* @opensearch.internal
42+
*/
43+
public class AcknowledgedResponse extends org.opensearch.action.support.clustermanager.AcknowledgedResponse {
44+
45+
public AcknowledgedResponse(StreamInput in) throws IOException {
46+
super(in);
47+
}
48+
49+
public AcknowledgedResponse(StreamInput in, boolean readAcknowledged) throws IOException {
50+
super(in, readAcknowledged);
51+
}
52+
53+
public AcknowledgedResponse(boolean acknowledged) {
54+
super(acknowledged);
55+
}
56+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
/*
10+
* Licensed to Elasticsearch under one or more contributor
11+
* license agreements. See the NOTICE file distributed with
12+
* this work for additional information regarding copyright
13+
* ownership. Elasticsearch licenses this file to you under
14+
* the Apache License, Version 2.0 (the "License"); you may
15+
* not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing,
21+
* software distributed under the License is distributed on an
22+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+
* KIND, either express or implied. See the License for the
24+
* specific language governing permissions and limitations
25+
* under the License.
26+
*/
27+
28+
/*
29+
* Modifications Copyright OpenSearch Contributors. See
30+
* GitHub history for details.
31+
*/
32+
33+
package org.opensearch.action.support.master;
34+
35+
import org.opensearch.action.ActionType;
36+
import org.opensearch.action.ActionResponse;
37+
import org.opensearch.action.support.clustermanager.ClusterManagerNodeOperationRequestBuilder;
38+
import org.opensearch.action.support.clustermanager.ClusterManagerNodeRequest;
39+
import org.opensearch.client.OpenSearchClient;
40+
41+
/**
42+
* Base request builder for cluster-manager node operations
43+
*
44+
* @opensearch.internal
45+
* @deprecated As of 2.1, because supporting inclusive language, replaced by {@link ClusterManagerNodeOperationRequestBuilder}
46+
*/
47+
@Deprecated
48+
public abstract class MasterNodeOperationRequestBuilder<
49+
Request extends ClusterManagerNodeRequest<Request>,
50+
Response extends ActionResponse,
51+
RequestBuilder extends MasterNodeOperationRequestBuilder<Request, Response, RequestBuilder>> extends
52+
ClusterManagerNodeOperationRequestBuilder<Request, Response, RequestBuilder> {
53+
54+
protected MasterNodeOperationRequestBuilder(OpenSearchClient client, ActionType<Response> action, Request request) {
55+
super(client, action, request);
56+
}
57+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
/*
10+
* Licensed to Elasticsearch under one or more contributor
11+
* license agreements. See the NOTICE file distributed with
12+
* this work for additional information regarding copyright
13+
* ownership. Elasticsearch licenses this file to you under
14+
* the Apache License, Version 2.0 (the "License"); you may
15+
* not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing,
21+
* software distributed under the License is distributed on an
22+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+
* KIND, either express or implied. See the License for the
24+
* specific language governing permissions and limitations
25+
* under the License.
26+
*/
27+
28+
/*
29+
* Modifications Copyright OpenSearch Contributors. See
30+
* GitHub history for details.
31+
*/
32+
33+
package org.opensearch.action.support.master;
34+
35+
import org.opensearch.action.ActionType;
36+
import org.opensearch.action.ActionResponse;
37+
import org.opensearch.action.support.clustermanager.ClusterManagerNodeOperationRequestBuilder;
38+
import org.opensearch.action.support.clustermanager.ClusterManagerNodeReadOperationRequestBuilder;
39+
import org.opensearch.action.support.clustermanager.ClusterManagerNodeReadRequest;
40+
import org.opensearch.client.OpenSearchClient;
41+
42+
/**
43+
* Base request builder for cluster-manager node read operations that can be executed on the local node as well
44+
*
45+
* @opensearch.internal
46+
* @deprecated As of 2.1, because supporting inclusive language, replaced by {@link ClusterManagerNodeReadOperationRequestBuilder}
47+
*/
48+
@Deprecated
49+
public abstract class MasterNodeReadOperationRequestBuilder<
50+
Request extends ClusterManagerNodeReadRequest<Request>,
51+
Response extends ActionResponse,
52+
RequestBuilder extends ClusterManagerNodeReadOperationRequestBuilder<Request, Response, RequestBuilder>> extends
53+
ClusterManagerNodeOperationRequestBuilder<Request, Response, RequestBuilder> {
54+
55+
protected MasterNodeReadOperationRequestBuilder(OpenSearchClient client, ActionType<Response> action, Request request) {
56+
super(client, action, request);
57+
}
58+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
/*
10+
* Licensed to Elasticsearch under one or more contributor
11+
* license agreements. See the NOTICE file distributed with
12+
* this work for additional information regarding copyright
13+
* ownership. Elasticsearch licenses this file to you under
14+
* the Apache License, Version 2.0 (the "License"); you may
15+
* not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing,
21+
* software distributed under the License is distributed on an
22+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+
* KIND, either express or implied. See the License for the
24+
* specific language governing permissions and limitations
25+
* under the License.
26+
*/
27+
28+
/*
29+
* Modifications Copyright OpenSearch Contributors. See
30+
* GitHub history for details.
31+
*/
32+
33+
package org.opensearch.action.support.master;
34+
35+
import org.opensearch.action.support.clustermanager.ClusterManagerNodeReadRequest;
36+
import org.opensearch.common.io.stream.StreamInput;
37+
38+
import java.io.IOException;
39+
40+
/**
41+
* Base request for cluster-manager based read operations that allows to read the cluster state from the local node if needed
42+
*
43+
* @opensearch.internal
44+
* @deprecated As of 2.1, because supporting inclusive language, replaced by {@link ClusterManagerNodeReadRequest}
45+
*/
46+
@Deprecated
47+
public abstract class MasterNodeReadRequest<Request extends MasterNodeReadRequest<Request>> extends ClusterManagerNodeReadRequest<Request> {
48+
protected MasterNodeReadRequest() {}
49+
50+
protected MasterNodeReadRequest(StreamInput in) throws IOException {
51+
super(in);
52+
}
53+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
/*
10+
* Licensed to Elasticsearch under one or more contributor
11+
* license agreements. See the NOTICE file distributed with
12+
* this work for additional information regarding copyright
13+
* ownership. Elasticsearch licenses this file to you under
14+
* the Apache License, Version 2.0 (the "License"); you may
15+
* not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing,
21+
* software distributed under the License is distributed on an
22+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+
* KIND, either express or implied. See the License for the
24+
* specific language governing permissions and limitations
25+
* under the License.
26+
*/
27+
28+
/*
29+
* Modifications Copyright OpenSearch Contributors. See
30+
* GitHub history for details.
31+
*/
32+
33+
package org.opensearch.action.support.master;
34+
35+
import org.opensearch.action.support.clustermanager.ClusterManagerNodeRequest;
36+
import org.opensearch.common.io.stream.StreamInput;
37+
38+
import java.io.IOException;
39+
40+
/**
41+
* A based request for cluster-manager based operation.
42+
*
43+
* @opensearch.internal
44+
* @deprecated As of 2.1, because supporting inclusive language, replaced by {@link ClusterManagerNodeRequest}
45+
*/
46+
@Deprecated
47+
public abstract class MasterNodeRequest<Request extends MasterNodeRequest<Request>> extends ClusterManagerNodeRequest<Request> {
48+
49+
protected MasterNodeRequest(StreamInput in) throws IOException {
50+
super(in);
51+
}
52+
}

0 commit comments

Comments
 (0)