2011-11-21 21:10:04 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2013-06-21 19:53:21 +00:00
|
|
|
/**
|
|
|
|
* These .proto interfaces are private and stable.
|
|
|
|
* Please see http://wiki.apache.org/hadoop/Compatibility
|
|
|
|
* for what changes are allowed for a *stable* .proto interface.
|
|
|
|
*/
|
|
|
|
|
2011-11-21 21:10:04 +00:00
|
|
|
// This file contains protocol buffers that are used throughout HDFS -- i.e.
|
|
|
|
// by the client, server, and data transfer protocols.
|
|
|
|
|
|
|
|
option java_package = "org.apache.hadoop.hdfs.protocol.proto";
|
|
|
|
option java_outer_classname = "NamenodeProtocolProtos";
|
|
|
|
option java_generic_services = true;
|
|
|
|
option java_generate_equals_and_hash = true;
|
2014-04-16 22:58:40 +00:00
|
|
|
package hadoop.hdfs.namenode;
|
2011-11-21 21:10:04 +00:00
|
|
|
|
|
|
|
import "hdfs.proto";
|
2015-09-23 03:57:05 +00:00
|
|
|
import "HdfsServer.proto";
|
2011-11-21 21:10:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get list of blocks for a given datanode with the total length
|
|
|
|
* of adding up to given size
|
|
|
|
* datanode - Datanode ID to get list of block from
|
|
|
|
* size - size to which the block lengths must add up to
|
|
|
|
*/
|
|
|
|
message GetBlocksRequestProto {
|
|
|
|
required DatanodeIDProto datanode = 1; // Datanode ID
|
|
|
|
required uint64 size = 2; // Size in bytes
|
2018-04-23 23:09:01 +00:00
|
|
|
// Minimum Block Size in bytes, adding default value to 10MB, as this might
|
|
|
|
// cause problem during rolling upgrade, when balancers are upgraded later.
|
|
|
|
// For more info refer HDFS-13356
|
|
|
|
optional uint64 minBlockSize = 3 [default = 10485760];
|
2011-11-21 21:10:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* blocks - List of returned blocks
|
|
|
|
*/
|
|
|
|
message GetBlocksResponseProto {
|
2011-12-06 00:25:25 +00:00
|
|
|
required BlocksWithLocationsProto blocks = 1; // List of blocks
|
2011-11-21 21:10:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* void request
|
|
|
|
*/
|
|
|
|
message GetBlockKeysRequestProto {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* keys - Information about block keys at the active namenode
|
|
|
|
*/
|
|
|
|
message GetBlockKeysResponseProto {
|
2013-01-14 23:13:27 +00:00
|
|
|
optional ExportedBlockKeysProto keys = 1;
|
2011-11-21 21:10:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* void request
|
|
|
|
*/
|
|
|
|
message GetTransactionIdRequestProto {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* txId - Transaction ID of the most recently persisted edit log record
|
|
|
|
*/
|
|
|
|
message GetTransactionIdResponseProto {
|
|
|
|
required uint64 txId = 1; // Transaction ID
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* void request
|
|
|
|
*/
|
|
|
|
message RollEditLogRequestProto {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* signature - A unique token to identify checkpoint transaction
|
|
|
|
*/
|
|
|
|
message RollEditLogResponseProto {
|
|
|
|
required CheckpointSignatureProto signature = 1;
|
|
|
|
}
|
|
|
|
|
2012-05-19 05:13:38 +00:00
|
|
|
/**
|
|
|
|
* void request
|
|
|
|
*/
|
|
|
|
message GetMostRecentCheckpointTxIdRequestProto {
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetMostRecentCheckpointTxIdResponseProto{
|
|
|
|
required uint64 txId = 1;
|
|
|
|
}
|
|
|
|
|
2011-12-06 00:25:25 +00:00
|
|
|
/**
|
|
|
|
* registration - Namenode reporting the error
|
2011-11-21 21:10:04 +00:00
|
|
|
* errorCode - error code indicating the error
|
|
|
|
* msg - Free text description of the error
|
|
|
|
*/
|
|
|
|
message ErrorReportRequestProto {
|
2011-12-06 00:25:25 +00:00
|
|
|
required NamenodeRegistrationProto registration = 1; // Registration info
|
2011-11-21 21:10:04 +00:00
|
|
|
required uint32 errorCode = 2; // Error code
|
|
|
|
required string msg = 3; // Error message
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* void response
|
|
|
|
*/
|
|
|
|
message ErrorReportResponseProto {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* registration - Information of the namenode registering with primary namenode
|
|
|
|
*/
|
|
|
|
message RegisterRequestProto {
|
|
|
|
required NamenodeRegistrationProto registration = 1; // Registration info
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* registration - Updated registration information of the newly registered
|
|
|
|
* datanode.
|
|
|
|
*/
|
|
|
|
message RegisterResponseProto {
|
|
|
|
required NamenodeRegistrationProto registration = 1; // Registration info
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start checkpoint request
|
|
|
|
* registration - Namenode that is starting the checkpoint
|
|
|
|
*/
|
|
|
|
message StartCheckpointRequestProto {
|
|
|
|
required NamenodeRegistrationProto registration = 1; // Registration info
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* command - Command returned by the active namenode to be
|
|
|
|
* be handled by the caller.
|
|
|
|
*/
|
|
|
|
message StartCheckpointResponseProto {
|
|
|
|
required NamenodeCommandProto command = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* End or finalize the previously started checkpoint
|
|
|
|
* registration - Namenode that is ending the checkpoint
|
|
|
|
* signature - unique token to identify checkpoint transaction,
|
|
|
|
* that was received when checkpoint was started.
|
|
|
|
*/
|
|
|
|
message EndCheckpointRequestProto {
|
|
|
|
required NamenodeRegistrationProto registration = 1; // Registration info
|
|
|
|
required CheckpointSignatureProto signature = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* void response
|
|
|
|
*/
|
|
|
|
message EndCheckpointResponseProto {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* sinceTxId - return the editlog information for transactions >= sinceTxId
|
|
|
|
*/
|
|
|
|
message GetEditLogManifestRequestProto {
|
|
|
|
required uint64 sinceTxId = 1; // Transaction ID
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* manifest - Enumeration of editlogs from namenode for
|
|
|
|
* logs >= sinceTxId in the request
|
|
|
|
*/
|
|
|
|
message GetEditLogManifestResponseProto {
|
|
|
|
required RemoteEditLogManifestProto manifest = 1;
|
|
|
|
}
|
|
|
|
|
2015-04-14 22:05:23 +00:00
|
|
|
/**
|
|
|
|
* void request
|
|
|
|
*/
|
|
|
|
message IsUpgradeFinalizedRequestProto {
|
|
|
|
}
|
|
|
|
|
|
|
|
message IsUpgradeFinalizedResponseProto {
|
|
|
|
required bool isUpgradeFinalized = 1;
|
|
|
|
}
|
|
|
|
|
2017-01-17 22:33:26 +00:00
|
|
|
/**
|
|
|
|
* void request
|
|
|
|
*/
|
|
|
|
message IsRollingUpgradeRequestProto {
|
|
|
|
}
|
|
|
|
|
|
|
|
message IsRollingUpgradeResponseProto {
|
|
|
|
required bool isRollingUpgrade = 1;
|
|
|
|
}
|
|
|
|
|
2018-01-28 15:16:56 +00:00
|
|
|
message GetFilePathRequestProto {
|
|
|
|
required uint64 fileId = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetFilePathResponseProto {
|
|
|
|
required string srcPath = 1;
|
|
|
|
}
|
|
|
|
|
2018-02-16 11:31:38 +00:00
|
|
|
message GetNextSPSPathRequestProto {
|
2018-01-28 15:16:56 +00:00
|
|
|
}
|
|
|
|
|
2018-02-16 11:31:38 +00:00
|
|
|
message GetNextSPSPathResponseProto {
|
|
|
|
optional string spsPath = 1;
|
2018-01-28 15:16:56 +00:00
|
|
|
}
|
|
|
|
|
2011-11-21 21:10:04 +00:00
|
|
|
/**
|
|
|
|
* Protocol used by the sub-ordinate namenode to send requests
|
|
|
|
* the active/primary namenode.
|
|
|
|
*
|
|
|
|
* See the request and response for details of rpc call.
|
|
|
|
*/
|
|
|
|
service NamenodeProtocolService {
|
|
|
|
/**
|
|
|
|
* Get list of blocks for a given datanode with length
|
|
|
|
* of blocks adding up to given size.
|
|
|
|
*/
|
|
|
|
rpc getBlocks(GetBlocksRequestProto) returns(GetBlocksResponseProto);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the current block keys
|
|
|
|
*/
|
|
|
|
rpc getBlockKeys(GetBlockKeysRequestProto) returns(GetBlockKeysResponseProto);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the transaction ID of the most recently persisted editlog record
|
|
|
|
*/
|
2012-01-11 02:54:48 +00:00
|
|
|
rpc getTransactionId(GetTransactionIdRequestProto)
|
2011-11-21 21:10:04 +00:00
|
|
|
returns(GetTransactionIdResponseProto);
|
|
|
|
|
2012-05-19 05:13:38 +00:00
|
|
|
/**
|
|
|
|
* Get the transaction ID of the most recently persisted editlog record
|
|
|
|
*/
|
|
|
|
rpc getMostRecentCheckpointTxId(GetMostRecentCheckpointTxIdRequestProto)
|
|
|
|
returns(GetMostRecentCheckpointTxIdResponseProto);
|
|
|
|
|
2011-11-21 21:10:04 +00:00
|
|
|
/**
|
|
|
|
* Close the current editlog and open a new one for checkpointing purposes
|
|
|
|
*/
|
|
|
|
rpc rollEditLog(RollEditLogRequestProto) returns(RollEditLogResponseProto);
|
|
|
|
|
2011-12-06 00:25:25 +00:00
|
|
|
/**
|
2012-05-19 05:13:38 +00:00
|
|
|
* Request info about the version running on this NameNode
|
2011-12-06 00:25:25 +00:00
|
|
|
*/
|
|
|
|
rpc versionRequest(VersionRequestProto) returns(VersionResponseProto);
|
|
|
|
|
2011-11-21 21:10:04 +00:00
|
|
|
/**
|
|
|
|
* Report from a sub-ordinate namenode of an error to the active namenode.
|
|
|
|
* Active namenode may decide to unregister the reporting namenode
|
|
|
|
* depending on the error.
|
|
|
|
*/
|
|
|
|
rpc errorReport(ErrorReportRequestProto) returns(ErrorReportResponseProto);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request to register a sub-ordinate namenode
|
|
|
|
*/
|
2013-06-15 03:52:40 +00:00
|
|
|
rpc registerSubordinateNamenode(RegisterRequestProto) returns(RegisterResponseProto);
|
2011-11-21 21:10:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Request to start a checkpoint.
|
|
|
|
*/
|
|
|
|
rpc startCheckpoint(StartCheckpointRequestProto)
|
|
|
|
returns(StartCheckpointResponseProto);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* End of finalize the previously started checkpoint
|
|
|
|
*/
|
|
|
|
rpc endCheckpoint(EndCheckpointRequestProto)
|
|
|
|
returns(EndCheckpointResponseProto);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get editlog manifests from the active namenode for all the editlogs
|
|
|
|
*/
|
|
|
|
rpc getEditLogManifest(GetEditLogManifestRequestProto)
|
|
|
|
returns(GetEditLogManifestResponseProto);
|
2015-04-14 22:05:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return whether the NameNode is in upgrade state (false) or not (true)
|
|
|
|
*/
|
|
|
|
rpc isUpgradeFinalized(IsUpgradeFinalizedRequestProto)
|
|
|
|
returns (IsUpgradeFinalizedResponseProto);
|
2017-01-17 22:33:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return whether the NameNode is in rolling upgrade (true) or not (false).
|
|
|
|
*/
|
|
|
|
rpc isRollingUpgrade(IsRollingUpgradeRequestProto)
|
|
|
|
returns (IsRollingUpgradeResponseProto);
|
2018-01-28 15:16:56 +00:00
|
|
|
|
|
|
|
/**
|
2018-02-16 11:31:38 +00:00
|
|
|
* Return the sps path from namenode
|
2018-01-28 15:16:56 +00:00
|
|
|
*/
|
2018-02-16 11:31:38 +00:00
|
|
|
rpc getNextSPSPath(GetNextSPSPathRequestProto)
|
|
|
|
returns (GetNextSPSPathResponseProto);
|
2011-11-21 21:10:04 +00:00
|
|
|
}
|