123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364 |
- /**
- * 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.
- */
- // 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 = "HdfsProtos";
- option java_generate_equals_and_hash = true;
- /**
- * Extended block idenfies a block
- */
- message ExtendedBlockProto {
- required string poolId = 1; // Block pool id - gloablly unique across clusters
- required uint64 blockId = 2; // the local id within a pool
- required uint64 generationStamp = 3;
- optional uint64 numBytes = 4 [default = 0]; // len does not belong in ebid
- // here for historical reasons
- }
- /**
- * Block Token
- */
- message BlockTokenIdentifierProto {
- required bytes identifier = 1;
- required bytes password = 2;
- required string kind = 3;
- required string service = 4;
- }
- /**
- * Identifies a Datanode
- */
- message DatanodeIDProto {
- required string ipAddr = 1; // IP address
- required string hostName = 2; // hostname
- required string storageID = 3; // unique storage id
- required uint32 xferPort = 4; // data streaming port
- required uint32 infoPort = 5; // info server port
- required uint32 ipcPort = 6; // ipc server port
- }
- /**
- * DatanodeInfo array
- */
- message DatanodeInfosProto {
- repeated DatanodeInfoProto datanodes = 1;
- }
- /**
- * The status of a Datanode
- */
- message DatanodeInfoProto {
- required DatanodeIDProto id = 1;
- optional uint64 capacity = 2 [default = 0];
- optional uint64 dfsUsed = 3 [default = 0];
- optional uint64 remaining = 4 [default = 0];
- optional uint64 blockPoolUsed = 5 [default = 0];
- optional uint64 lastUpdate = 6 [default = 0];
- optional uint32 xceiverCount = 7 [default = 0];
- optional string location = 8;
- enum AdminState {
- NORMAL = 0;
- DECOMMISSION_INPROGRESS = 1;
- DECOMMISSIONED = 2;
- }
- optional AdminState adminState = 10 [default = NORMAL];
- }
- /**
- * Summary of a file or directory
- */
- message ContentSummaryProto {
- required uint64 length = 1;
- required uint64 fileCount = 2;
- required uint64 directoryCount = 3;
- required uint64 quota = 4;
- required uint64 spaceConsumed = 5;
- required uint64 spaceQuota = 6;
- }
- /**
- * Contains a list of paths corresponding to corrupt files and a cookie
- * used for iterative calls to NameNode.listCorruptFileBlocks.
- *
- */
- message CorruptFileBlocksProto {
- repeated string files = 1;
- required string cookie = 2;
- }
- /**
- * File or Directory permision - same spec as posix
- */
- message FsPermissionProto {
- required uint32 perm = 1; // Actually a short - only 16bits used
- }
- /**
- * A LocatedBlock gives information about a block and its location.
- */
- message LocatedBlockProto {
- required ExtendedBlockProto b = 1;
- required uint64 offset = 2; // offset of first byte of block in the file
- repeated DatanodeInfoProto locs = 3; // Locations ordered by proximity to client ip
- required bool corrupt = 4; // true if all replicas of a block are corrupt, else false
- // If block has few corrupt replicas, they are filtered and
- // their locations are not part of this object
- required BlockTokenIdentifierProto blockToken = 5;
- }
- /**
- * A set of file blocks and their locations.
- */
- message LocatedBlocksProto {
- required uint64 fileLength = 1;
- repeated LocatedBlockProto blocks = 2;
- required bool underConstruction = 3;
- optional LocatedBlockProto lastBlock = 4;
- required bool isLastBlockComplete = 5;
- }
- /**
- * Status of a file, directory or symlink
- * Optionally includes a file's block locations if requested by client on the rpc call.
- */
- message HdfsFileStatusProto {
- enum FileType {
- IS_DIR = 1;
- IS_FILE = 2;
- IS_SYMLINK = 3;
- }
- required FileType fileType = 1;
- required bytes path = 2; // local name of inode encoded java UTF8
- required uint64 length = 3;
- required FsPermissionProto permission = 4;
- required string owner = 5;
- required string group = 6;
- required uint64 modification_time = 7;
- required uint64 access_time = 8;
- // Optional fields for symlink
- optional bytes symlink = 9; // if symlink, target encoded java UTF8
- // Optional fields for file
- optional uint32 block_replication = 10 [default = 0]; // only 16bits used
- optional uint64 blocksize = 11 [default = 0];
- optional LocatedBlocksProto locations = 12; // suppled only if asked by client
- }
- /**
- * HDFS Server Defaults
- */
- message FsServerDefaultsProto {
- required uint64 blockSize = 1;
- required uint32 bytesPerChecksum = 2;
- required uint32 writePacketSize = 3;
- required uint32 replication = 4; // Actually a short - only 16 bits used
- required uint32 fileBufferSize = 5;
- }
- /**
- * Directory listing
- */
- message DirectoryListingProto {
- repeated HdfsFileStatusProto partialListing = 1;
- required uint32 remainingEntries = 2;
- }
- /**
- * Status of current cluster upgrade from one version to another
- */
- message UpgradeStatusReportProto {
- required uint32 version = 1;;
- required uint32 upgradeStatus = 2; // % completed in range 0 & 100
- required bool finalized = 3;
- }
- /**
- * Common node information shared by all the nodes in the cluster
- */
- message StorageInfoProto {
- required uint32 layoutVersion = 1; // Layout version of the file system
- required uint32 namespceID = 2; // File system namespace ID
- required string clusterID = 3; // ID of the cluster
- required uint64 cTime = 4; // File system creation time
- }
- /**
- * Information sent by a namenode to identify itself to the primary namenode.
- */
- message NamenodeRegistrationProto {
- required string rpcAddress = 1; // host:port of the namenode RPC address
- required string httpAddress = 2; // host:port of the namenode http server
- enum NamenodeRoleProto {
- NAMENODE = 1;
- BACKUP = 2;
- CHECKPOINT = 3;
- }
- required StorageInfoProto storageInfo = 3; // Node information
- optional NamenodeRoleProto role = 4 [default = NAMENODE]; // Namenode role
- }
- /**
- * Unique signature to identify checkpoint transactions.
- */
- message CheckpointSignatureProto {
- required string blockPoolId = 1;
- required uint64 mostRecentCheckpointTxId = 2;
- required uint64 curSegmentTxId = 3;
- required StorageInfoProto storageInfo = 4;
- }
- /**
- * Command sent from one namenode to another namenode.
- */
- message NamenodeCommandProto {
- enum Type {
- NamenodeCommand = 0; // Base command
- CheckPointCommand = 1; // Check point command
- }
- required uint32 action = 1;
- required Type type = 2;
- optional CheckpointCommandProto checkpointCmd = 3;
- }
- /**
- * Command returned from primary to checkpointing namenode.
- * This command has checkpoint signature that identifies
- * checkpoint transaction and is needed for further
- * communication related to checkpointing.
- */
- message CheckpointCommandProto {
- // Unique signature to identify checkpoint transation
- required CheckpointSignatureProto signature = 1;
- // If true, return transfer image to primary upon the completion of checkpoint
- required bool needToReturnImage = 2;
- }
- /**
- * Block information
- */
- message BlockProto {
- required uint64 blockId = 1;
- required uint64 genStamp = 2;
- optional uint64 numBytes = 3 [default = 0];
- }
- /**
- * Block and datanodes where is it located
- */
- message BlockWithLocationsProto {
- required BlockProto block = 1; // Block
- repeated string storageIDs = 2; // Datanodes with replicas of the block
- }
- /**
- * List of block with locations
- */
- message BlocksWithLocationsProto {
- repeated BlockWithLocationsProto blocks = 1;
- }
- /**
- * Editlog information with available transactions
- */
- message RemoteEditLogProto {
- required uint64 startTxId = 1; // Starting available edit log transaction
- required uint64 endTxId = 2; // Ending available edit log transaction
- }
- /**
- * Enumeration of editlogs available on a remote namenode
- */
- message RemoteEditLogManifestProto {
- repeated RemoteEditLogProto logs = 1;
- }
- /**
- * Namespace information that describes namespace on a namenode
- */
- message NamespaceInfoProto {
- required string buildVersion = 1; // Software revision version (e.g. an svn or git revision)
- required uint32 distUpgradeVersion = 2; // Distributed upgrade version
- required string blockPoolID = 3; // block pool used by the namespace
- required StorageInfoProto storageInfo = 4;// Node information
- required string softwareVersion = 5; // Software version number (e.g. 2.0.0)
- }
- /**
- * Block access token information
- */
- message BlockKeyProto {
- required uint32 keyId = 1; // Key identifier
- required uint64 expiryDate = 2; // Expiry time in milliseconds
- optional bytes keyBytes = 3; // Key secret
- }
- /**
- * Current key and set of block keys at the namenode.
- */
- message ExportedBlockKeysProto {
- required bool isBlockTokenEnabled = 1;
- required uint64 keyUpdateInterval = 2;
- required uint64 tokenLifeTime = 3;
- required BlockKeyProto currentKey = 4;
- repeated BlockKeyProto allKeys = 5;
- }
- /**
- * State of a block replica at a datanode
- */
- enum ReplicaStateProto {
- FINALIZED = 0; // State of a replica when it is not modified
- RBW = 1; // State of replica that is being written to
- RWR = 2; // State of replica that is waiting to be recovered
- RUR = 3; // State of replica that is under recovery
- TEMPORARY = 4; // State of replica that is created for replication
- }
- /**
- * Block that needs to be recovered with at a given location
- */
- message RecoveringBlockProto {
- required uint64 newGenStamp = 1; // New genstamp post recovery
- required LocatedBlockProto block = 2; // Block to be recovered
- }
- /**
- * void request
- */
- message VersionRequestProto {
- }
- /**
- * Version response from namenode.
- */
- message VersionResponseProto {
- required NamespaceInfoProto info = 1;
- }
|