blob: 8fccbaf9761ae2ee4e88564b9a0a811e7d6d1bdc [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.
*/
//TajoWorker -> TajoMaster protocol
option java_package = "org.apache.tajo.ipc";
option java_outer_classname = "TajoMasterProtocol";
option java_generic_services = true;
option java_generate_equals_and_hash = true;
import "yarn_protos.proto";
import "tajo_protos.proto";
import "TajoIdProtos.proto";
import "CatalogProtos.proto";
import "PrimitiveProtos.proto";
message ServerStatusProto {
message System {
required int32 availableProcessors = 1;
required int32 freeMemoryMB = 2;
required int32 maxMemoryMB = 3;
required int32 totalMemoryMB = 4;
}
message Disk {
required string absolutePath = 1;
required int64 totalSpace = 2;
required int64 freeSpace = 3;
required int64 usableSpace = 4;
}
message JvmHeap {
required int64 maxHeap = 1;
required int64 totalHeap = 2;
required int64 freeHeap = 3;
}
required System system = 1;
required float diskSlots = 2;
required int32 memoryResourceMB = 3;
repeated Disk disk = 4;
required int32 runningTaskNum = 5;
required JvmHeap jvmHeap = 6;
required BoolProto queryMasterMode = 7;
required BoolProto taskRunnerMode = 8;
}
message TajoHeartbeat {
required string tajoWorkerHost = 1;
required int32 tajoQueryMasterPort = 2;
optional int32 tajoWorkerClientPort = 3;
optional QueryIdProto queryId = 4;
optional QueryState state = 5;
optional string statusMessage = 6;
optional float queryProgress = 7;
optional int64 queryFinishTime = 8;
}
message TajoHeartbeatResponse {
message ResponseCommand {
required string command = 1;
repeated string params = 2;
}
required BoolProto heartbeatResult = 1;
required ClusterResourceSummary clusterResourceSummary = 2;
optional ResponseCommand responseCommand = 3;
}
message ClusterResourceSummary {
required int32 numWorkers = 1;
required int32 totalDiskSlots = 2;
required int32 totalCpuCoreSlots = 3;
required int32 totalMemoryMB = 4;
required int32 totalAvailableDiskSlots = 5;
required int32 totalAvailableCpuCoreSlots = 6;
required int32 totalAvailableMemoryMB = 7;
}
enum ResourceRequestPriority {
MEMORY = 1;
DISK = 2;
}
message WorkerResourceAllocationRequest {
required QueryIdProto queryId = 1;
required ResourceRequestPriority resourceRequestPriority = 2;
required int32 numContainers = 3;
required int32 maxMemoryMBPerContainer = 4;
required int32 minMemoryMBPerContainer = 5;
required float maxDiskSlotPerContainer = 6;
required float minDiskSlotPerContainer = 7;
}
message WorkerResourceProto {
required string host = 1;
required int32 peerRpcPort = 2;
required int32 queryMasterPort = 3;
required int32 infoPort = 4;
required int32 memoryMB = 5 ;
required float diskSlots = 6;
}
message WorkerResourcesRequest {
repeated WorkerResourceProto workerResources = 1;
}
message WorkerResourceReleaseRequest {
required ExecutionBlockIdProto executionBlockId = 1;
repeated hadoop.yarn.ContainerIdProto containerIds = 2;
}
message WorkerAllocatedResource {
required hadoop.yarn.ContainerIdProto containerId = 1;
required string nodeId = 2;
required string workerHost = 3;
required int32 peerRpcPort = 4;
required int32 queryMasterPort = 5;
required int32 clientPort = 6;
required int32 workerPullServerPort = 7;
required int32 allocatedMemoryMB = 8;
required float allocatedDiskSlots = 9;
}
message WorkerResourceAllocationResponse {
required QueryIdProto queryId = 1;
repeated WorkerAllocatedResource workerAllocatedResource = 2;
}
service TajoMasterProtocolService {
rpc heartbeat(TajoHeartbeat) returns (TajoHeartbeatResponse);
rpc allocateWorkerResources(WorkerResourceAllocationRequest) returns (WorkerResourceAllocationResponse);
rpc releaseWorkerResource(WorkerResourceReleaseRequest) returns (BoolProto);
rpc stopQueryMaster(QueryIdProto) returns (BoolProto);
rpc getAllWorkerResource(NullProto) returns (WorkerResourcesRequest);
}