blob: 66b6d6fdb16983a672bebff11abbfe9c5c56a6ca [file] [log] [blame]
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF 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.
*/
/**
* These .proto interfaces are private and unstable.
* Please see http://wiki.apache.org/hadoop/Compatibility
* for what changes are allowed for a *unstable* .proto interface.
*/
option java_package = "org.apache.hadoop.hdds.protocol.proto";
option java_outer_classname = "StorageContainerLocationProtocolProtos";
option java_generic_services = true;
option java_generate_equals_and_hash = true;
package hadoop.hdds.container;
import "hdds.proto";
/**
All functions are dispatched as Request/Response under Ozone.
if you add newe functions, please add them using same pattern.
*/
message ScmContainerLocationRequest {
required Type cmdType = 1; // Type of the command
// A string that identifies this command, we generate Trace ID in Ozone
// frontend and this allows us to trace that command all over ozone.
optional string traceID = 2;
optional uint32 version = 3;
optional ContainerRequestProto containerRequest = 6;
optional GetContainerRequestProto getContainerRequest = 7;
optional GetContainerWithPipelineRequestProto getContainerWithPipelineRequest = 8;
optional SCMListContainerRequestProto scmListContainerRequest = 9;
optional SCMDeleteContainerRequestProto scmDeleteContainerRequest = 10;
optional NodeQueryRequestProto nodeQueryRequest = 11;
optional SCMCloseContainerRequestProto scmCloseContainerRequest = 12;
optional PipelineRequestProto pipelineRequest = 13;
optional ListPipelineRequestProto listPipelineRequest = 14;
optional ActivatePipelineRequestProto activatePipelineRequest = 15;
optional DeactivatePipelineRequestProto deactivatePipelineRequest = 16;
optional ClosePipelineRequestProto closePipelineRequest = 17;
optional GetScmInfoRequestProto getScmInfoRequest = 18;
optional InSafeModeRequestProto inSafeModeRequest = 19;
optional ForceExitSafeModeRequestProto forceExitSafeModeRequest = 20;
optional StartReplicationManagerRequestProto startReplicationManagerRequest = 21;
optional StopReplicationManagerRequestProto stopReplicationManagerRequest = 22;
optional ReplicationManagerStatusRequestProto seplicationManagerStatusRequest = 23;
optional GetPipelineRequestProto getPipelineRequest = 24;
optional GetContainerWithPipelineBatchRequestProto getContainerWithPipelineBatchRequest = 25;
optional GetSafeModeRuleStatusesRequestProto getSafeModeRuleStatusesRequest = 26;
optional DecommissionNodesRequestProto decommissionNodesRequest = 27;
optional RecommissionNodesRequestProto recommissionNodesRequest = 28;
optional StartMaintenanceNodesRequestProto startMaintenanceNodesRequest = 29;
optional DatanodeUsageInfoRequestProto DatanodeUsageInfoRequest = 30;
}
message ScmContainerLocationResponse {
required Type cmdType = 1; // Type of the command
optional string traceID = 2;
optional bool success = 3 [default = true];
optional string message = 4;
required Status status = 5;
optional ContainerResponseProto containerResponse = 6;
optional GetContainerResponseProto getContainerResponse = 7;
optional GetContainerWithPipelineResponseProto getContainerWithPipelineResponse = 8;
optional SCMListContainerResponseProto scmListContainerResponse = 9;
optional SCMDeleteContainerResponseProto scmDeleteContainerResponse = 10;
optional NodeQueryResponseProto nodeQueryResponse = 11;
optional SCMCloseContainerResponseProto scmCloseContainerResponse = 12;
optional PipelineResponseProto pipelineResponse = 13;
optional ListPipelineResponseProto listPipelineResponse = 14;
optional ActivatePipelineResponseProto activatePipelineResponse = 15;
optional DeactivatePipelineResponseProto deactivatePipelineResponse = 16;
optional ClosePipelineResponseProto closePipelineResponse = 17;
optional GetScmInfoResponseProto getScmInfoResponse = 18;
optional InSafeModeResponseProto inSafeModeResponse = 19;
optional ForceExitSafeModeResponseProto forceExitSafeModeResponse = 20;
optional StartReplicationManagerResponseProto startReplicationManagerResponse = 21;
optional StopReplicationManagerResponseProto stopReplicationManagerResponse = 22;
optional ReplicationManagerStatusResponseProto replicationManagerStatusResponse = 23;
optional GetPipelineResponseProto getPipelineResponse = 24;
optional GetContainerWithPipelineBatchResponseProto getContainerWithPipelineBatchResponse = 25;
optional GetSafeModeRuleStatusesResponseProto getSafeModeRuleStatusesResponse = 26;
optional DecommissionNodesResponseProto decommissionNodesResponse = 27;
optional RecommissionNodesResponseProto recommissionNodesResponse = 28;
optional StartMaintenanceNodesResponseProto startMaintenanceNodesResponse = 29;
optional DatanodeUsageInfoResponseProto DatanodeUsageInfoResponse = 30;
enum Status {
OK = 1;
CONTAINER_ALREADY_EXISTS = 2;
CONTAINER_IS_MISSING = 3;
}
}
enum Type {
AllocateContainer = 1;
GetContainer = 2;
GetContainerWithPipeline = 3;
ListContainer = 4;
DeleteContainer = 5;
QueryNode = 6;
CloseContainer = 7;
AllocatePipeline = 8;
ListPipelines = 9;
ActivatePipeline = 10;
DeactivatePipeline = 11;
ClosePipeline = 12;
GetScmInfo = 13;
InSafeMode = 14;
ForceExitSafeMode = 15;
StartReplicationManager = 16;
StopReplicationManager = 17;
GetReplicationManagerStatus = 18;
GetPipeline = 19;
GetContainerWithPipelineBatch = 20;
GetSafeModeRuleStatuses = 21;
DecommissionNodes = 22;
RecommissionNodes = 23;
StartMaintenanceNodes = 24;
DatanodeUsageInfo = 25;
}
/**
* Request send to SCM asking where the container should be created.
*/
message ContainerRequestProto {
// Ozone only support replication of either 1 or 3.
required ReplicationFactor replicationFactor = 2;
required ReplicationType replicationType = 3;
required string owner = 4;
optional string traceID = 5;
}
/**
* Reply from SCM indicating that the container.
*/
message ContainerResponseProto {
enum Error {
success = 1;
errorContainerAlreadyExists = 2;
errorContainerMissing = 3;
}
required Error errorCode = 1;
required ContainerWithPipeline containerWithPipeline = 2;
optional string errorMessage = 3;
}
message GetContainerRequestProto {
required int64 containerID = 1;
optional string traceID = 2;
}
message GetContainerResponseProto {
required ContainerInfoProto containerInfo = 1;
}
message GetContainerWithPipelineRequestProto {
required int64 containerID = 1;
optional string traceID = 2;
}
message GetContainerWithPipelineResponseProto {
required ContainerWithPipeline containerWithPipeline = 1;
}
message GetContainerWithPipelineBatchRequestProto {
repeated int64 containerIDs = 1;
optional string traceID = 2;
}
message GetSafeModeRuleStatusesRequestProto {
}
message SafeModeRuleStatusProto {
required string ruleName = 1;
required bool validate = 2;
required string statusText = 3;
}
message GetSafeModeRuleStatusesResponseProto {
repeated SafeModeRuleStatusProto safeModeRuleStatusesProto = 1;
}
message GetContainerWithPipelineBatchResponseProto {
repeated ContainerWithPipeline containerWithPipelines = 1;
}
message SCMListContainerRequestProto {
required uint32 count = 1;
optional uint64 startContainerID = 2;
optional string traceID = 3;
optional LifeCycleState state = 4;
}
message SCMListContainerResponseProto {
repeated ContainerInfoProto containers = 1;
}
message SCMDeleteContainerRequestProto {
required int64 containerID = 1;
optional string traceID = 2;
}
message SCMDeleteContainerResponseProto {
// Empty response
}
message SCMCloseContainerRequestProto {
required int64 containerID = 1;
optional string traceID = 2;
}
message SCMCloseContainerResponseProto {
// Empty response
}
/*
NodeQueryRequest sends a request to SCM asking to send a list of nodes that
match the NodeState that we are requesting.
*/
message NodeQueryRequestProto {
optional NodeState state = 1;
required QueryScope scope = 2;
optional string poolName = 3; // if scope is pool, then pool name is needed.
optional string traceID = 4;
optional NodeOperationalState opState = 5;
}
message NodeQueryResponseProto {
repeated Node datanodes = 1;
}
/*
Datanode usage info request message.
*/
message DatanodeUsageInfoRequestProto {
optional string ipaddress = 1;
optional string uuid = 2;
optional bool mostUsed = 3;
optional uint32 count = 4;
}
message DatanodeUsageInfoResponseProto {
repeated DatanodeUsageInfoProto info = 1;
}
/*
Decommission a list of hosts
*/
message DecommissionNodesRequestProto {
repeated string hosts = 1;
}
message DecommissionNodesResponseProto {
// empty response
}
/*
Recommission a list of hosts in maintenance or decommission states
*/
message RecommissionNodesRequestProto {
repeated string hosts = 1;
}
message RecommissionNodesResponseProto {
// empty response
}
/*
Place a list of hosts into maintenance mode
*/
message StartMaintenanceNodesRequestProto {
repeated string hosts = 1;
optional int64 endInHours = 2;
}
message StartMaintenanceNodesResponseProto {
// empty response
}
/**
Request to create a replication pipeline.
*/
message PipelineRequestProto {
required ReplicationType replicationType = 1;
required ReplicationFactor replicationFactor = 2;
// if datanodes are specified then pipelines are created using those
// datanodes.
optional NodePool nodePool = 3;
optional string pipelineID = 4;
optional string traceID = 5;
}
message PipelineResponseProto {
enum Error {
success = 1;
errorPipelineAlreadyExists = 2;
}
required Error errorCode = 1;
optional Pipeline pipeline = 2;
optional string errorMessage = 3;
}
message ListPipelineRequestProto {
optional string traceID = 1;
}
message ListPipelineResponseProto {
repeated Pipeline pipelines = 1;
}
message GetPipelineRequestProto {
required PipelineID pipelineID = 1;
optional string traceID = 2;
}
message GetPipelineResponseProto {
required Pipeline pipeline = 1;
}
message ActivatePipelineRequestProto {
required PipelineID pipelineID = 1;
optional string traceID = 2;
}
message ActivatePipelineResponseProto {
}
message DeactivatePipelineRequestProto {
required PipelineID pipelineID = 1;
optional string traceID = 2;
}
message DeactivatePipelineResponseProto {
}
message ClosePipelineRequestProto {
required PipelineID pipelineID = 1;
optional string traceID = 2;
}
message ClosePipelineResponseProto {
}
message InSafeModeRequestProto {
optional string traceID = 1;
}
message InSafeModeResponseProto {
required bool inSafeMode = 1;
}
message ForceExitSafeModeRequestProto {
optional string traceID = 1;
}
message ForceExitSafeModeResponseProto {
required bool exitedSafeMode = 1;
}
message StartReplicationManagerRequestProto {
optional string traceID = 1;
}
message StartReplicationManagerResponseProto {
}
message StopReplicationManagerRequestProto {
optional string traceID = 1;
}
message StopReplicationManagerResponseProto {
}
message ReplicationManagerStatusRequestProto {
optional string traceID = 1;
}
message ReplicationManagerStatusResponseProto {
required bool isRunning = 1;
}
/**
* Protocol used from an HDFS node to StorageContainerManager. See the request
* and response messages for details of the RPC calls.
*/
service StorageContainerLocationProtocolService {
rpc submitRequest (ScmContainerLocationRequest) returns (ScmContainerLocationResponse);
}