-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) Signed-off-by: Tianli Feng <[email protected]>
- Loading branch information
Tianli Feng
authored
Jun 20, 2022
1 parent
61cecff
commit 9d312d3
Showing
15 changed files
with
811 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
server/src/main/java/org/opensearch/action/support/master/AcknowledgedRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.action.support.master; | ||
|
||
import org.opensearch.action.support.clustermanager.ClusterManagerNodeRequest; | ||
import org.opensearch.common.io.stream.StreamInput; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Abstract class that allows to mark action requests that support acknowledgements. | ||
* Facilitates consistency across different api. | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public abstract class AcknowledgedRequest<Request extends ClusterManagerNodeRequest<Request>> extends | ||
org.opensearch.action.support.clustermanager.AcknowledgedRequest<Request> { | ||
|
||
protected AcknowledgedRequest() { | ||
super(); | ||
} | ||
|
||
protected AcknowledgedRequest(StreamInput in) throws IOException { | ||
super(in); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
server/src/main/java/org/opensearch/action/support/master/AcknowledgedRequestBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.action.support.master; | ||
|
||
import org.opensearch.action.ActionType; | ||
import org.opensearch.action.support.clustermanager.AcknowledgedRequest; | ||
import org.opensearch.action.support.clustermanager.AcknowledgedResponse; | ||
import org.opensearch.client.OpenSearchClient; | ||
|
||
/** | ||
* Base request builder for cluster-manager node operations that support acknowledgements | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public abstract class AcknowledgedRequestBuilder< | ||
Request extends AcknowledgedRequest<Request>, | ||
Response extends AcknowledgedResponse, | ||
RequestBuilder extends AcknowledgedRequestBuilder<Request, Response, RequestBuilder>> extends | ||
org.opensearch.action.support.clustermanager.AcknowledgedRequestBuilder<Request, Response, RequestBuilder> { | ||
|
||
protected AcknowledgedRequestBuilder(OpenSearchClient client, ActionType action, Request request) { | ||
super(client, action, request); | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
server/src/main/java/org/opensearch/action/support/master/AcknowledgedResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.action.support.master; | ||
|
||
import org.opensearch.common.io.stream.StreamInput; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* A response that indicates that a request has been acknowledged | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public class AcknowledgedResponse extends org.opensearch.action.support.clustermanager.AcknowledgedResponse { | ||
|
||
public AcknowledgedResponse(StreamInput in) throws IOException { | ||
super(in); | ||
} | ||
|
||
public AcknowledgedResponse(StreamInput in, boolean readAcknowledged) throws IOException { | ||
super(in, readAcknowledged); | ||
} | ||
|
||
public AcknowledgedResponse(boolean acknowledged) { | ||
super(acknowledged); | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
...src/main/java/org/opensearch/action/support/master/MasterNodeOperationRequestBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.action.support.master; | ||
|
||
import org.opensearch.action.ActionType; | ||
import org.opensearch.action.ActionResponse; | ||
import org.opensearch.action.support.clustermanager.ClusterManagerNodeOperationRequestBuilder; | ||
import org.opensearch.action.support.clustermanager.ClusterManagerNodeRequest; | ||
import org.opensearch.client.OpenSearchClient; | ||
|
||
/** | ||
* Base request builder for cluster-manager node operations | ||
* | ||
* @opensearch.internal | ||
* @deprecated As of 2.1, because supporting inclusive language, replaced by {@link ClusterManagerNodeOperationRequestBuilder} | ||
*/ | ||
@Deprecated | ||
public abstract class MasterNodeOperationRequestBuilder< | ||
Request extends ClusterManagerNodeRequest<Request>, | ||
Response extends ActionResponse, | ||
RequestBuilder extends MasterNodeOperationRequestBuilder<Request, Response, RequestBuilder>> extends | ||
ClusterManagerNodeOperationRequestBuilder<Request, Response, RequestBuilder> { | ||
|
||
protected MasterNodeOperationRequestBuilder(OpenSearchClient client, ActionType<Response> action, Request request) { | ||
super(client, action, request); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
...main/java/org/opensearch/action/support/master/MasterNodeReadOperationRequestBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.action.support.master; | ||
|
||
import org.opensearch.action.ActionType; | ||
import org.opensearch.action.ActionResponse; | ||
import org.opensearch.action.support.clustermanager.ClusterManagerNodeOperationRequestBuilder; | ||
import org.opensearch.action.support.clustermanager.ClusterManagerNodeReadOperationRequestBuilder; | ||
import org.opensearch.action.support.clustermanager.ClusterManagerNodeReadRequest; | ||
import org.opensearch.client.OpenSearchClient; | ||
|
||
/** | ||
* Base request builder for cluster-manager node read operations that can be executed on the local node as well | ||
* | ||
* @opensearch.internal | ||
* @deprecated As of 2.1, because supporting inclusive language, replaced by {@link ClusterManagerNodeReadOperationRequestBuilder} | ||
*/ | ||
@Deprecated | ||
public abstract class MasterNodeReadOperationRequestBuilder< | ||
Request extends ClusterManagerNodeReadRequest<Request>, | ||
Response extends ActionResponse, | ||
RequestBuilder extends ClusterManagerNodeReadOperationRequestBuilder<Request, Response, RequestBuilder>> extends | ||
ClusterManagerNodeOperationRequestBuilder<Request, Response, RequestBuilder> { | ||
|
||
protected MasterNodeReadOperationRequestBuilder(OpenSearchClient client, ActionType<Response> action, Request request) { | ||
super(client, action, request); | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
server/src/main/java/org/opensearch/action/support/master/MasterNodeReadRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.action.support.master; | ||
|
||
import org.opensearch.action.support.clustermanager.ClusterManagerNodeReadRequest; | ||
import org.opensearch.common.io.stream.StreamInput; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Base request for cluster-manager based read operations that allows to read the cluster state from the local node if needed | ||
* | ||
* @opensearch.internal | ||
* @deprecated As of 2.1, because supporting inclusive language, replaced by {@link ClusterManagerNodeReadRequest} | ||
*/ | ||
@Deprecated | ||
public abstract class MasterNodeReadRequest<Request extends MasterNodeReadRequest<Request>> extends ClusterManagerNodeReadRequest<Request> { | ||
protected MasterNodeReadRequest() {} | ||
|
||
protected MasterNodeReadRequest(StreamInput in) throws IOException { | ||
super(in); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
server/src/main/java/org/opensearch/action/support/master/MasterNodeRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.action.support.master; | ||
|
||
import org.opensearch.action.support.clustermanager.ClusterManagerNodeRequest; | ||
import org.opensearch.common.io.stream.StreamInput; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* A based request for cluster-manager based operation. | ||
* | ||
* @opensearch.internal | ||
* @deprecated As of 2.1, because supporting inclusive language, replaced by {@link ClusterManagerNodeRequest} | ||
*/ | ||
@Deprecated | ||
public abstract class MasterNodeRequest<Request extends MasterNodeRequest<Request>> extends ClusterManagerNodeRequest<Request> { | ||
|
||
protected MasterNodeRequest(StreamInput in) throws IOException { | ||
super(in); | ||
} | ||
} |
Oops, something went wrong.