diff --git a/.gitignore b/.gitignore index b512c09..34977ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -node_modules \ No newline at end of file +node_modules +.idea \ No newline at end of file diff --git a/protos/config.proto b/protos/config.proto index 135832f..6eebc57 100644 --- a/protos/config.proto +++ b/protos/config.proto @@ -135,6 +135,29 @@ message GetClusterNodesInfoResponse { repeated NodeInfo nodes = 1; } +message MigrateNodeInfo { + + enum NodeState { + UNKNOWN = 0; + MIGRATABLE = 1; + NOT_MIGRATABLE = 2; + } + + string node_name = 1; + repeated string partitions = 2; + NodeState state = 3; + string cluster_name = 4; + repeated string migratable_clusters = 5; +} + +message GetClusterMigrateNodesInfoRequest { + +} + +message GetClusterMigrateNodesInfoResponse { + repeated MigrateNodeInfo nodes = 1; +} + message ListImplementedOptionalFeaturesRequest {} enum OptionalFeatures { @@ -163,6 +186,10 @@ service ConfigService { * description: get cluster nodes information */ rpc GetClusterNodesInfo(GetClusterNodesInfoRequest) returns (GetClusterNodesInfoResponse); + /* + * description: get cluster migrate nodes information + */ + rpc GetClusterMigrateNodesInfo(GetClusterMigrateNodesInfoRequest) returns (GetClusterMigrateNodesInfoResponse); /* * description: List optional features implemented by this scheduler adapter */ diff --git a/protos/node.proto b/protos/node.proto new file mode 100644 index 0000000..fbd78d0 --- /dev/null +++ b/protos/node.proto @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2022 Peking University and Peking University Institute for Computing and Digital Economy + * SCOW is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. +*/ + +syntax = "proto3"; + +package scow.scheduler_adapter; + +message MigrateNodeRequest { + string node_name = 1; + repeated string destination_partitions = 3; + string origin_cluster_name = 4; + string destination_cluster_name = 5; +} + +message MigrateNodeResponse { + +} + +service NodeService { + /* + * description: migrate node + * errors: + * - node not found + * NOT_FOUND, NODE_NOT_FOUND, {} + */ + rpc MigrateNode(MigrateNodeRequest) returns (MigrateNodeResponse); +} \ No newline at end of file