blob: 8ea72b6cd178074a534a231380d195eed17f6d4a [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 ContainerRequestProto containerRequest = 6;
optional GetContainerRequestProto getContainerRequest = 7;
optional GetContainerWithPipelineRequestProto getContainerWithPipelineRequest = 8;
optional SCMListContainerRequestProto scmListContainerRequest = 9;
optional SCMDeleteContainerRequestProto scmDeleteContainerRequest = 10;
optional NodeQueryRequestProto nodeQueryRequest = 11;
optional ObjectStageChangeRequestProto objectStageChangeRequest = 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;
}
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 ObjectStageChangeResponseProto objectStageChangeResponse = 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;
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;
NotifyObjectStageChange = 7;
AllocatePipeline = 8;
ListPipelines = 9;
ActivatePipeline = 10;
DeactivatePipeline = 11;
ClosePipeline = 12;
GetScmInfo = 13;
InSafeMode = 14;
ForceExitSafeMode = 15;
StartReplicationManager = 16;
StopReplicationManager = 17;
GetReplicationManagerStatus = 18;
}
/**
* 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 SCMListContainerRequestProto {
required uint32 count = 1;
optional uint64 startContainerID = 2;
optional string traceID = 3;
}
message SCMListContainerResponseProto {
repeated ContainerInfoProto containers = 1;
}
message SCMDeleteContainerRequestProto {
required int64 containerID = 1;
optional string traceID = 2;
}
message SCMDeleteContainerResponseProto {
// Empty response
}
message ObjectStageChangeRequestProto {
enum Type {
container = 1;
pipeline = 2;
}
// delete/copy operation may be added later
enum Op {
create = 1;
close = 2;
}
enum Stage {
begin = 1;
complete = 2;
}
required int64 id = 1;
required Type type = 2;
required Op op= 3;
required Stage stage = 4;
optional string traceID = 5;
}
message ObjectStageChangeResponseProto {
// 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 {
required NodeState state = 1;
required QueryScope scope = 2;
optional string poolName = 3; // if scope is pool, then pool name is needed.
optional string traceID = 4;
}
message NodeQueryResponseProto {
repeated Node datanodes = 1;
}
/**
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 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);
}