celeborn/openapi/openapi-client
Wang, Fei 216152d038 [CELEBORN-1632] Support to apply ratis local raft_meta_conf command with RESTful api
### What changes were proposed in this pull request?
Sub-task of CELEBORN-1628.

Support to apply ratis local raft_meta_conf with RESTful api.

See https://celeborn.apache.org/docs/latest/celeborn_ratis_shell/#local-raftmetaconf
```
$ celeborn-ratis sh local raftMetaConf -peers <[P0_ID|]P0_HOST:P0_PORT,[P1_ID|]P1_HOST:P1_PORT,[P2_ID|]P2_HOST:P2_PORT> -path <PARENT_PATH_OF_RAFT_META_CONF>
```

The implementation is same with e96ed1a338/ratis-shell/src/main/java/org/apache/ratis/shell/cli/sh/local/RaftMetaConfCommand.java (L122-L133)

### Why are the changes needed?

We have implemented the RESTful implementation for all the others ratis-shell command.

<img width="1219" alt="image" src="https://github.com/user-attachments/assets/4367ddbd-3c55-449a-a1bc-75d6c18e8918">

| Ratis Shell               | RESTful api                        |
|----------------------|---------------------------------|
| election transfer    | `/ratis/election/transfer`      |
| election stepDown    | `/ratis/election/step_down`     |
| election pause       | `/ratis/election/pause`         |
| election resume      | `/ratis/election/resume`        |
| group info           | `/masters`                      |
| peer add             | `/ratis/peer/add`               |
| peer remove          | `/ratis/peer/remove`            |
| peer setPriority     | `/ratis/peer/set_priority`      |
| snapshot create      | `/ratis/snapshot/create`        |

And the local raftMetaConf command is the last one.

I closed the ticket CELEBORN-1632 before, I thought it is a local command and wonder whether it is necessary to implement it with RESTful api.

But we have implemented all the others, so I decide to implement it as well.

### Does this PR introduce _any_ user-facing change?

A new API.

The implementation is same with e96ed1a338/ratis-shell/src/main/java/org/apache/ratis/shell/cli/sh/local/RaftMetaConfCommand.java (L122-L133)

### How was this patch tested?
![image](https://github.com/user-attachments/assets/088d8523-e5f5-4546-9159-e12191fd8a29)
![image](https://github.com/user-attachments/assets/ce9c4284-fd61-45de-93e7-d38e3b6afac9)
<img width="960" alt="image" src="https://github.com/user-attachments/assets/b302a680-baea-4709-b77f-a2b1946b8dff">

<img width="1471" alt="image" src="https://github.com/user-attachments/assets/4bf090ba-c6f4-4f49-aa57-8dd2c897ff30">
<img width="871" alt="image" src="https://github.com/user-attachments/assets/9959072c-5e96-48f5-911e-546c05a0c443">

Closes #2829 from turboFei/local_raft_conf.

Authored-by: Wang, Fei <fwang12@ebay.com>
Signed-off-by: Shuang <lvshuang.xjs@alibaba-inc.com>
2024-10-24 16:09:18 +08:00
..
src/main [CELEBORN-1632] Support to apply ratis local raft_meta_conf command with RESTful api 2024-10-24 16:09:18 +08:00
pom.xml [CELEBORN-1607] Enable useEnumCaseInsensitive for openapi-generator 2024-09-23 20:43:04 +08:00
README.md [CELEBORN-1477] Using openapi-generator apache-httpclient library instead of jersey2 2024-07-31 15:02:41 +08:00

Celeborn OpenAPI Client

To update the OpenAPI specification

  • just update the specification under openapi/openapi-client/src/main/openapi3/ and keep the schema definitions consistent between master and worker.
  • Install JDK 11 or above by whatever mechanism is appropriate for your system, and set that version to be the default Java version (e.g., by setting env variable JAVA_HOME)
  • run the following:
    build/mvn -pl openapi/openapi-client clean package -Pgenerate
    
    or
    build/sbt "clean;celeborn-openapi-client/generate"
    
    This will regenerate the OpenAPI data models + APIs in the celeborn-openapi-client SDK.