JournalProtocol.proto 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. // This file contains protocol buffers that are used throughout HDFS -- i.e.
  19. // by the client, server, and data transfer protocols.
  20. option java_package = "org.apache.hadoop.hdfs.protocol.proto";
  21. option java_outer_classname = "JournalProtocolProtos";
  22. option java_generic_services = true;
  23. option java_generate_equals_and_hash = true;
  24. import "hdfs.proto";
  25. /**
  26. * Journal information used by the journal receiver to identify a journal.
  27. */
  28. message JournalInfoProto {
  29. required string clusterID = 1; // ID of the cluster
  30. optional uint32 layoutVersion = 2; // Layout version
  31. optional uint32 namespaceID = 3; // Namespace ID
  32. }
  33. /**
  34. * JournalInfo - the information about the journal
  35. * firstTxnId - the first txid in the journal records
  36. * numTxns - Number of transactions in editlog
  37. * records - bytes containing serialized journal records
  38. */
  39. message JournalRequestProto {
  40. required JournalInfoProto journalInfo = 1;
  41. required uint64 firstTxnId = 2;
  42. required uint32 numTxns = 3;
  43. required bytes records = 4;
  44. }
  45. /**
  46. * void response
  47. */
  48. message JournalResponseProto {
  49. }
  50. /**
  51. * JournalInfo - the information about the journal
  52. * txid - first txid in the new log
  53. */
  54. message StartLogSegmentRequestProto {
  55. required JournalInfoProto journalInfo = 1;
  56. required uint64 txid = 2;
  57. }
  58. /**
  59. * void response
  60. */
  61. message StartLogSegmentResponseProto {
  62. }
  63. /**
  64. * Protocol used to journal edits to a remote node. Currently,
  65. * this is used to publish edits from the NameNode to a BackupNode.
  66. *
  67. * See the request and response for details of rpc call.
  68. */
  69. service JournalProtocolService {
  70. /**
  71. * Request sent by active namenode to backup node via
  72. * EditLogBackupOutputStream to stream editlog records.
  73. */
  74. rpc journal(JournalRequestProto) returns (JournalResponseProto);
  75. /**
  76. * Request sent by active namenode to backup node to notify
  77. * that the NameNode has rolled its edit logs and is now writing a
  78. * new log segment.
  79. */
  80. rpc startLogSegment(StartLogSegmentRequestProto)
  81. returns (StartLogSegmentResponseProto);
  82. }