Skip to content

Commit e1bc5fd

Browse files
committed
feat: 增加节点可迁移的接口
1 parent 692d977 commit e1bc5fd

File tree

3 files changed

+64
-1
lines changed

3 files changed

+64
-1
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
node_modules
2+
.idea

protos/config.proto

+26
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,28 @@ message GetClusterNodesInfoResponse {
135135
repeated NodeInfo nodes = 1;
136136
}
137137

138+
message MigrateNodeInfo {
139+
140+
enum NodeState {
141+
UNKNOWN = 0;
142+
MIGRATABLE = 1;
143+
NOT_MIGRATABLE = 2;
144+
}
145+
146+
string node_name = 1;
147+
repeated string partitions = 2;
148+
NodeState state = 3;
149+
string cluster_name = 4;
150+
}
151+
152+
message GetClusterMigrateNodesInfoRequest {
153+
154+
}
155+
156+
message GetClusterMigrateNodesInfoResponse {
157+
repeated MigrateNodeInfo nodes = 1;
158+
}
159+
138160
message ListImplementedOptionalFeaturesRequest {}
139161

140162
enum OptionalFeatures {
@@ -163,6 +185,10 @@ service ConfigService {
163185
* description: get cluster nodes information
164186
*/
165187
rpc GetClusterNodesInfo(GetClusterNodesInfoRequest) returns (GetClusterNodesInfoResponse);
188+
/*
189+
* description: get cluster migrate nodes information
190+
*/
191+
rpc GetClusterMigrateNodesInfo(GetClusterMigrateNodesInfoRequest) returns (GetClusterMigrateNodesInfoResponse);
166192
/*
167193
* description: List optional features implemented by this scheduler adapter
168194
*/

protos/node.proto

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Copyright (c) 2022 Peking University and Peking University Institute for Computing and Digital Economy
3+
* SCOW is licensed under Mulan PSL v2.
4+
* You can use this software according to the terms and conditions of the Mulan PSL v2.
5+
* You may obtain a copy of Mulan PSL v2 at:
6+
* http://license.coscl.org.cn/MulanPSL2
7+
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
8+
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
9+
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10+
* See the Mulan PSL v2 for more details.
11+
*/
12+
13+
syntax = "proto3";
14+
15+
package scow.scheduler_adapter;
16+
17+
message MigrateNodeRequest {
18+
string node_name = 1;
19+
repeated string destination_partitions = 3;
20+
string origin_cluster_name = 4;
21+
string destination_cluster_name = 5;
22+
}
23+
24+
message MigrateNodeResponse {
25+
26+
}
27+
28+
service NodeService {
29+
/*
30+
* description: migrate node
31+
* errors:
32+
* - node not found
33+
* NOT_FOUND, NODE_NOT_FOUND, {}
34+
*/
35+
rpc MigrateNode(MigrateNodeRequest) returns (MigrateNodeResponse);
36+
}

0 commit comments

Comments
 (0)