hdfs.proto 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. /**
  19. * These .proto interfaces are private and stable.
  20. * Please see http://wiki.apache.org/hadoop/Compatibility
  21. * for what changes are allowed for a *stable* .proto interface.
  22. */
  23. syntax="proto2";
  24. // This file contains protocol buffers that are used throughout HDFS -- i.e.
  25. // by the client, server, and data transfer protocols.
  26. option java_package = "org.apache.hadoop.hdfs.protocol.proto";
  27. option java_outer_classname = "HdfsProtos";
  28. option java_generate_equals_and_hash = true;
  29. package hadoop.hdfs;
  30. import "Security.proto";
  31. import "acl.proto";
  32. /**
  33. * Extended block idenfies a block
  34. */
  35. message ExtendedBlockProto {
  36. required string poolId = 1; // Block pool id - globally unique across clusters
  37. required uint64 blockId = 2; // the local id within a pool
  38. required uint64 generationStamp = 3;
  39. optional uint64 numBytes = 4 [default = 0]; // len does not belong in ebid
  40. // here for historical reasons
  41. }
  42. /**
  43. * ProvidedStorageLocation will contain the exact location in the provided
  44. storage. The path, offset and length will result in ranged read. The nonce
  45. is there to verify that you receive what you expect.
  46. */
  47. message ProvidedStorageLocationProto {
  48. required string path = 1;
  49. required int64 offset = 2;
  50. required int64 length = 3;
  51. required bytes nonce = 4;
  52. }
  53. /**
  54. * Identifies a Datanode
  55. */
  56. message DatanodeIDProto {
  57. required string ipAddr = 1; // IP address
  58. required string hostName = 2; // hostname
  59. required string datanodeUuid = 3; // UUID assigned to the Datanode. For
  60. // upgraded clusters this is the same
  61. // as the original StorageID of the
  62. // Datanode.
  63. required uint32 xferPort = 4; // data streaming port
  64. required uint32 infoPort = 5; // datanode http port
  65. required uint32 ipcPort = 6; // ipc server port
  66. optional uint32 infoSecurePort = 7 [default = 0]; // datanode https port
  67. }
  68. /**
  69. * Datanode local information
  70. */
  71. message DatanodeLocalInfoProto {
  72. required string softwareVersion = 1;
  73. required string configVersion = 2;
  74. required uint64 uptime = 3;
  75. }
  76. /**
  77. * Datanode volume information
  78. */
  79. message DatanodeVolumeInfoProto {
  80. required string path = 1;
  81. required StorageTypeProto storageType = 2;
  82. required uint64 usedSpace = 3;
  83. required uint64 freeSpace = 4;
  84. required uint64 reservedSpace = 5;
  85. required uint64 reservedSpaceForReplicas = 6;
  86. required uint64 numBlocks = 7;
  87. }
  88. /**
  89. * DatanodeInfo array
  90. */
  91. message DatanodeInfosProto {
  92. repeated DatanodeInfoProto datanodes = 1;
  93. }
  94. /**
  95. * The status of a Datanode
  96. */
  97. message DatanodeInfoProto {
  98. required DatanodeIDProto id = 1;
  99. optional uint64 capacity = 2 [default = 0];
  100. optional uint64 dfsUsed = 3 [default = 0];
  101. optional uint64 remaining = 4 [default = 0];
  102. optional uint64 blockPoolUsed = 5 [default = 0];
  103. optional uint64 lastUpdate = 6 [default = 0];
  104. optional uint32 xceiverCount = 7 [default = 0];
  105. optional string location = 8;
  106. optional uint64 nonDfsUsed = 9;
  107. enum AdminState {
  108. NORMAL = 0;
  109. DECOMMISSION_INPROGRESS = 1;
  110. DECOMMISSIONED = 2;
  111. ENTERING_MAINTENANCE = 3;
  112. IN_MAINTENANCE = 4;
  113. }
  114. optional AdminState adminState = 10 [default = NORMAL];
  115. optional uint64 cacheCapacity = 11 [default = 0];
  116. optional uint64 cacheUsed = 12 [default = 0];
  117. optional uint64 lastUpdateMonotonic = 13 [default = 0];
  118. optional string upgradeDomain = 14;
  119. optional uint64 lastBlockReportTime = 15 [default = 0];
  120. optional uint64 lastBlockReportMonotonic = 16 [default = 0];
  121. optional uint32 numBlocks = 17 [default = 0];
  122. }
  123. /**
  124. * Represents a storage available on the datanode
  125. */
  126. message DatanodeStorageProto {
  127. enum StorageState {
  128. NORMAL = 0;
  129. READ_ONLY_SHARED = 1;
  130. }
  131. required string storageUuid = 1;
  132. optional StorageState state = 2 [default = NORMAL];
  133. optional StorageTypeProto storageType = 3 [default = DISK];
  134. }
  135. message StorageReportProto {
  136. required string storageUuid = 1 [ deprecated = true ];
  137. optional bool failed = 2 [ default = false ];
  138. optional uint64 capacity = 3 [ default = 0 ];
  139. optional uint64 dfsUsed = 4 [ default = 0 ];
  140. optional uint64 remaining = 5 [ default = 0 ];
  141. optional uint64 blockPoolUsed = 6 [ default = 0 ];
  142. optional DatanodeStorageProto storage = 7; // supersedes StorageUuid
  143. optional uint64 nonDfsUsed = 8;
  144. }
  145. /**
  146. * Summary of a file or directory
  147. */
  148. message ContentSummaryProto {
  149. required uint64 length = 1;
  150. required uint64 fileCount = 2;
  151. required uint64 directoryCount = 3;
  152. required uint64 quota = 4;
  153. required uint64 spaceConsumed = 5;
  154. required uint64 spaceQuota = 6;
  155. optional StorageTypeQuotaInfosProto typeQuotaInfos = 7;
  156. optional uint64 snapshotLength = 8;
  157. optional uint64 snapshotFileCount = 9;
  158. optional uint64 snapshotDirectoryCount = 10;
  159. optional uint64 snapshotSpaceConsumed = 11;
  160. optional string erasureCodingPolicy = 12;
  161. }
  162. /**
  163. * Summary of quota usage of a directory
  164. */
  165. message QuotaUsageProto {
  166. required uint64 fileAndDirectoryCount = 1;
  167. required uint64 quota = 2;
  168. required uint64 spaceConsumed = 3;
  169. required uint64 spaceQuota = 4;
  170. optional StorageTypeQuotaInfosProto typeQuotaInfos = 5;
  171. }
  172. /**
  173. * Storage type quota and usage information of a file or directory
  174. */
  175. message StorageTypeQuotaInfosProto {
  176. repeated StorageTypeQuotaInfoProto typeQuotaInfo = 1;
  177. }
  178. message StorageTypeQuotaInfoProto {
  179. required StorageTypeProto type = 1;
  180. required uint64 quota = 2;
  181. required uint64 consumed = 3;
  182. }
  183. /**
  184. * Contains a list of paths corresponding to corrupt files and a cookie
  185. * used for iterative calls to NameNode.listCorruptFileBlocks.
  186. *
  187. */
  188. message CorruptFileBlocksProto {
  189. repeated string files = 1;
  190. required string cookie = 2;
  191. }
  192. /**
  193. * Types of recognized storage media.
  194. */
  195. enum StorageTypeProto {
  196. DISK = 1;
  197. SSD = 2;
  198. ARCHIVE = 3;
  199. RAM_DISK = 4;
  200. PROVIDED = 5;
  201. }
  202. /**
  203. * Types of recognized blocks.
  204. */
  205. enum BlockTypeProto {
  206. CONTIGUOUS = 0;
  207. STRIPED = 1;
  208. }
  209. /**
  210. * A list of storage types.
  211. */
  212. message StorageTypesProto {
  213. repeated StorageTypeProto storageTypes = 1;
  214. }
  215. /**
  216. * Block replica storage policy.
  217. */
  218. message BlockStoragePolicyProto {
  219. required uint32 policyId = 1;
  220. required string name = 2;
  221. // a list of storage types for storing the block replicas when creating a
  222. // block.
  223. required StorageTypesProto creationPolicy = 3;
  224. // A list of storage types for creation fallback storage.
  225. optional StorageTypesProto creationFallbackPolicy = 4;
  226. optional StorageTypesProto replicationFallbackPolicy = 5;
  227. }
  228. /**
  229. * A LocatedBlock gives information about a block and its location.
  230. */
  231. message LocatedBlockProto {
  232. required ExtendedBlockProto b = 1;
  233. required uint64 offset = 2; // offset of first byte of block in the file
  234. repeated DatanodeInfoProto locs = 3; // Locations ordered by proximity to client ip
  235. required bool corrupt = 4; // true if all replicas of a block are corrupt, else false
  236. // If block has few corrupt replicas, they are filtered and
  237. // their locations are not part of this object
  238. required hadoop.common.TokenProto blockToken = 5;
  239. repeated bool isCached = 6 [packed=true]; // if a location in locs is cached
  240. repeated StorageTypeProto storageTypes = 7;
  241. repeated string storageIDs = 8;
  242. // striped block related fields
  243. optional bytes blockIndices = 9; // used for striped block to indicate block index for each storage
  244. repeated hadoop.common.TokenProto blockTokens = 10; // each internal block has a block token
  245. }
  246. message BatchedListingKeyProto {
  247. required bytes checksum = 1;
  248. required uint32 pathIndex = 2;
  249. required bytes startAfter = 3;
  250. }
  251. message DataEncryptionKeyProto {
  252. required uint32 keyId = 1;
  253. required string blockPoolId = 2;
  254. required bytes nonce = 3;
  255. required bytes encryptionKey = 4;
  256. required uint64 expiryDate = 5;
  257. optional string encryptionAlgorithm = 6;
  258. }
  259. /**
  260. * Cipher suite.
  261. */
  262. enum CipherSuiteProto {
  263. UNKNOWN = 1;
  264. AES_CTR_NOPADDING = 2;
  265. }
  266. /**
  267. * Crypto protocol version used to access encrypted files.
  268. */
  269. enum CryptoProtocolVersionProto {
  270. UNKNOWN_PROTOCOL_VERSION = 1;
  271. ENCRYPTION_ZONES = 2;
  272. }
  273. /**
  274. * Encryption information for a file.
  275. */
  276. message FileEncryptionInfoProto {
  277. required CipherSuiteProto suite = 1;
  278. required CryptoProtocolVersionProto cryptoProtocolVersion = 2;
  279. required bytes key = 3;
  280. required bytes iv = 4;
  281. required string keyName = 5;
  282. required string ezKeyVersionName = 6;
  283. }
  284. /**
  285. * Encryption information for an individual
  286. * file within an encryption zone
  287. */
  288. message PerFileEncryptionInfoProto {
  289. required bytes key = 1;
  290. required bytes iv = 2;
  291. required string ezKeyVersionName = 3;
  292. }
  293. /**
  294. * Encryption information for an encryption
  295. * zone
  296. */
  297. message ZoneEncryptionInfoProto {
  298. required CipherSuiteProto suite = 1;
  299. required CryptoProtocolVersionProto cryptoProtocolVersion = 2;
  300. required string keyName = 3;
  301. optional ReencryptionInfoProto reencryptionProto = 4;
  302. }
  303. /**
  304. * Re-encryption information for an encryption zone
  305. */
  306. message ReencryptionInfoProto {
  307. required string ezKeyVersionName = 1;
  308. required uint64 submissionTime = 2;
  309. required bool canceled = 3;
  310. required int64 numReencrypted = 4;
  311. required int64 numFailures = 5;
  312. optional uint64 completionTime = 6;
  313. optional string lastFile = 7;
  314. }
  315. /**
  316. * Cipher option
  317. */
  318. message CipherOptionProto {
  319. required CipherSuiteProto suite = 1;
  320. optional bytes inKey = 2;
  321. optional bytes inIv = 3;
  322. optional bytes outKey = 4;
  323. optional bytes outIv = 5;
  324. }
  325. /**
  326. * A set of file blocks and their locations.
  327. */
  328. message LocatedBlocksProto {
  329. required uint64 fileLength = 1;
  330. repeated LocatedBlockProto blocks = 2;
  331. required bool underConstruction = 3;
  332. optional LocatedBlockProto lastBlock = 4;
  333. required bool isLastBlockComplete = 5;
  334. optional FileEncryptionInfoProto fileEncryptionInfo = 6;
  335. // Optional field for erasure coding
  336. optional ErasureCodingPolicyProto ecPolicy = 7;
  337. }
  338. /**
  339. * ECSchema options entry
  340. */
  341. message ECSchemaOptionEntryProto {
  342. required string key = 1;
  343. required string value = 2;
  344. }
  345. /**
  346. * ECSchema for erasurecoding
  347. */
  348. message ECSchemaProto {
  349. required string codecName = 1;
  350. required uint32 dataUnits = 2;
  351. required uint32 parityUnits = 3;
  352. repeated ECSchemaOptionEntryProto options = 4;
  353. }
  354. /**
  355. * EC policy state.
  356. */
  357. enum ErasureCodingPolicyState {
  358. DISABLED = 1;
  359. ENABLED = 2;
  360. REMOVED = 3;
  361. }
  362. message ErasureCodingPolicyProto {
  363. optional string name = 1;
  364. optional ECSchemaProto schema = 2;
  365. optional uint32 cellSize = 3;
  366. required uint32 id = 4; // Actually a byte - only 8 bits used
  367. optional ErasureCodingPolicyState state = 5 [default = ENABLED];
  368. }
  369. message AddErasureCodingPolicyResponseProto {
  370. required ErasureCodingPolicyProto policy = 1;
  371. required bool succeed = 2;
  372. optional string errorMsg = 3;
  373. }
  374. /**
  375. * Placeholder type for consistent HDFS operations.
  376. */
  377. message HdfsPathHandleProto {
  378. optional uint64 inodeId = 1;
  379. optional uint64 mtime = 2;
  380. optional string path = 3;
  381. }
  382. /**
  383. * Status of a file, directory or symlink
  384. * Optionally includes a file's block locations if requested by client on the rpc call.
  385. */
  386. message HdfsFileStatusProto {
  387. enum FileType {
  388. IS_DIR = 1;
  389. IS_FILE = 2;
  390. IS_SYMLINK = 3;
  391. }
  392. enum Flags {
  393. HAS_ACL = 0x01; // has ACLs
  394. HAS_CRYPT = 0x02; // encrypted
  395. HAS_EC = 0x04; // erasure coded
  396. SNAPSHOT_ENABLED = 0x08; // SNAPSHOT ENABLED
  397. }
  398. required FileType fileType = 1;
  399. required bytes path = 2; // local name of inode encoded java UTF8
  400. required uint64 length = 3;
  401. required FsPermissionProto permission = 4;
  402. required string owner = 5;
  403. required string group = 6;
  404. required uint64 modification_time = 7;
  405. required uint64 access_time = 8;
  406. // Optional fields for symlink
  407. optional bytes symlink = 9; // if symlink, target encoded java UTF8
  408. // Optional fields for file
  409. optional uint32 block_replication = 10 [default = 0]; // only 16bits used
  410. optional uint64 blocksize = 11 [default = 0];
  411. optional LocatedBlocksProto locations = 12; // suppled only if asked by client
  412. // Optional field for fileId
  413. optional uint64 fileId = 13 [default = 0]; // default as an invalid id
  414. optional int32 childrenNum = 14 [default = -1];
  415. // Optional field for file encryption
  416. optional FileEncryptionInfoProto fileEncryptionInfo = 15;
  417. optional uint32 storagePolicy = 16 [default = 0]; // block storage policy id
  418. // Optional field for erasure coding
  419. optional ErasureCodingPolicyProto ecPolicy = 17;
  420. // Set of flags
  421. optional uint32 flags = 18 [default = 0];
  422. }
  423. /**
  424. * Checksum algorithms/types used in HDFS
  425. * Make sure this enum's integer values match enum values' id properties defined
  426. * in org.apache.hadoop.util.DataChecksum.Type
  427. */
  428. enum ChecksumTypeProto {
  429. CHECKSUM_NULL = 0;
  430. CHECKSUM_CRC32 = 1;
  431. CHECKSUM_CRC32C = 2;
  432. }
  433. enum BlockChecksumTypeProto {
  434. MD5CRC = 1; // BlockChecksum obtained by taking the MD5 digest of chunk CRCs
  435. COMPOSITE_CRC = 2; // Chunk-independent CRC, optionally striped
  436. }
  437. /**
  438. * Algorithms/types denoting how block-level checksums are computed using
  439. * lower-level chunk checksums/CRCs.
  440. * These options should be kept in sync with
  441. * org.apache.hadoop.hdfs.protocol.BlockChecksumOptions.
  442. */
  443. message BlockChecksumOptionsProto {
  444. optional BlockChecksumTypeProto blockChecksumType = 1 [default = MD5CRC];
  445. // Only used if blockChecksumType specifies a striped format, such as
  446. // COMPOSITE_CRC. If so, then the blockChecksum in the response is expected
  447. // to be the concatenation of N crcs, where
  448. // N == ((requestedLength - 1) / stripedLength) + 1
  449. optional uint64 stripeLength = 2;
  450. }
  451. /**
  452. * HDFS Server Defaults
  453. */
  454. message FsServerDefaultsProto {
  455. required uint64 blockSize = 1;
  456. required uint32 bytesPerChecksum = 2;
  457. required uint32 writePacketSize = 3;
  458. required uint32 replication = 4; // Actually a short - only 16 bits used
  459. required uint32 fileBufferSize = 5;
  460. optional bool encryptDataTransfer = 6 [default = false];
  461. optional uint64 trashInterval = 7 [default = 0];
  462. optional ChecksumTypeProto checksumType = 8 [default = CHECKSUM_CRC32];
  463. optional string keyProviderUri = 9;
  464. optional uint32 policyId = 10 [default = 0];
  465. }
  466. /**
  467. * Directory listing
  468. */
  469. message DirectoryListingProto {
  470. repeated HdfsFileStatusProto partialListing = 1;
  471. required uint32 remainingEntries = 2;
  472. }
  473. message RemoteExceptionProto {
  474. required string className = 1;
  475. optional string message = 2;
  476. }
  477. // Directory listing result for a batched listing call.
  478. message BatchedDirectoryListingProto {
  479. repeated HdfsFileStatusProto partialListing = 1;
  480. required uint32 parentIdx = 2;
  481. optional RemoteExceptionProto exception = 3;
  482. }
  483. /**
  484. * Status of a snapshottable directory: besides the normal information for
  485. * a directory status, also include snapshot quota, number of snapshots, and
  486. * the full path of the parent directory.
  487. */
  488. message SnapshottableDirectoryStatusProto {
  489. required HdfsFileStatusProto dirStatus = 1;
  490. // Fields specific for snapshottable directory
  491. required uint32 snapshot_quota = 2;
  492. required uint32 snapshot_number = 3;
  493. required bytes parent_fullpath = 4;
  494. }
  495. /**
  496. * Snapshottable directory listing
  497. */
  498. message SnapshottableDirectoryListingProto {
  499. repeated SnapshottableDirectoryStatusProto snapshottableDirListing = 1;
  500. }
  501. /**
  502. * Snapshot diff report entry
  503. */
  504. message SnapshotDiffReportEntryProto {
  505. required bytes fullpath = 1;
  506. required string modificationLabel = 2;
  507. optional bytes targetPath = 3;
  508. }
  509. /**
  510. * Snapshot diff report
  511. */
  512. message SnapshotDiffReportProto {
  513. // full path of the directory where snapshots were taken
  514. required string snapshotRoot = 1;
  515. required string fromSnapshot = 2;
  516. required string toSnapshot = 3;
  517. repeated SnapshotDiffReportEntryProto diffReportEntries = 4;
  518. }
  519. /**
  520. * Snapshot diff report listing entry
  521. */
  522. message SnapshotDiffReportListingEntryProto {
  523. required bytes fullpath = 1;
  524. required uint64 dirId = 2;
  525. required bool isReference = 3;
  526. optional bytes targetPath = 4;
  527. optional uint64 fileId = 5;
  528. }
  529. message SnapshotDiffReportCursorProto {
  530. required bytes startPath = 1;
  531. required int32 index = 2 [default = -1];
  532. }
  533. /**
  534. * Snapshot diff report listing
  535. */
  536. message SnapshotDiffReportListingProto {
  537. // full path of the directory where snapshots were taken
  538. repeated SnapshotDiffReportListingEntryProto modifiedEntries = 1;
  539. repeated SnapshotDiffReportListingEntryProto createdEntries = 2;
  540. repeated SnapshotDiffReportListingEntryProto deletedEntries = 3;
  541. required bool isFromEarlier = 4;
  542. optional SnapshotDiffReportCursorProto cursor = 5;
  543. }
  544. /**
  545. * Block information
  546. *
  547. * Please be wary of adding additional fields here, since INodeFiles
  548. * need to fit in PB's default max message size of 64MB.
  549. * We restrict the max # of blocks per file
  550. * (dfs.namenode.fs-limits.max-blocks-per-file), but it's better
  551. * to avoid changing this.
  552. */
  553. message BlockProto {
  554. required uint64 blockId = 1;
  555. required uint64 genStamp = 2;
  556. optional uint64 numBytes = 3 [default = 0];
  557. }
  558. /**
  559. * Information related to a snapshot
  560. * TODO: add more information
  561. */
  562. message SnapshotInfoProto {
  563. required string snapshotName = 1;
  564. required string snapshotRoot = 2;
  565. required FsPermissionProto permission = 3;
  566. required string owner = 4;
  567. required string group = 5;
  568. required string createTime = 6;
  569. // TODO: do we need access time?
  570. }
  571. /**
  572. * Rolling upgrade status
  573. */
  574. message RollingUpgradeStatusProto {
  575. required string blockPoolId = 1;
  576. optional bool finalized = 2 [default = false];
  577. }
  578. /**
  579. * A list of storage IDs.
  580. */
  581. message StorageUuidsProto {
  582. repeated string storageUuids = 1;
  583. }
  584. /**
  585. * File access permissions mode.
  586. */
  587. enum AccessModeProto {
  588. READ = 1;
  589. WRITE = 2;
  590. COPY = 3;
  591. REPLACE = 4;
  592. }
  593. /**
  594. * Secret information for the BlockKeyProto. This is not sent on the wire as
  595. * such but is used to pack a byte array and encrypted and put in
  596. * BlockKeyProto.bytes
  597. * When adding further fields, make sure they are optional as they would
  598. * otherwise not be backwards compatible.
  599. *
  600. * Note: As part of the migration from WritableUtils based tokens (aka "legacy")
  601. * to Protocol Buffers, we use the first byte to determine the type. If the
  602. * first byte is <=0 then it is a legacy token. This means that when using
  603. * protobuf tokens, the the first field sent must have a `field_number` less
  604. * than 16 to make sure that the first byte is positive. Otherwise it could be
  605. * parsed as a legacy token. See HDFS-11026 for more discussion.
  606. */
  607. message BlockTokenSecretProto {
  608. optional uint64 expiryDate = 1;
  609. optional uint32 keyId = 2;
  610. optional string userId = 3;
  611. optional string blockPoolId = 4;
  612. optional uint64 blockId = 5;
  613. repeated AccessModeProto modes = 6;
  614. repeated StorageTypeProto storageTypes = 7;
  615. repeated string storageIds = 8;
  616. optional bytes handshakeSecret = 9;
  617. }