You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/02 10:02:53 UTC

[GitHub] [pulsar] asafm commented on a diff in pull request #15878: [fix][doc] Fixed binary protocol naming and descriptions

asafm commented on code in PR #15878:
URL: https://github.com/apache/pulsar/pull/15878#discussion_r887785670


##########
site2/docs/developing-binary-protocol.md:
##########
@@ -28,39 +28,39 @@ The Pulsar protocol allows for two types of commands:
 
 Simple (payload-free) commands have this basic structure:
 
-| Component     | Description                                                                             | Size (in bytes) |
-|:--------------|:----------------------------------------------------------------------------------------|:----------------|
-| `totalSize`   | The size of the frame, counting everything that comes after it (in bytes)               | 4               |
-| `commandSize` | The size of the protobuf-serialized command                                             | 4               |
-| `message`     | The protobuf message serialized in a raw binary format (rather than in protobuf format) |                 |
+| Component     | Description                                                               | Size (in bytes) |
+|:--------------|:--------------------------------------------------------------------------|:----------------|
+| `totalSize`   | The size of the frame, counting everything that comes after it (in bytes) | 4               |
+| `commandSize` | The size of the protobuf-serialized command                               | 4               |
+| `command`     | The protobuf serialized command                                           |                 |
 
-### Payload commands
+### Message commands
 
 Payload commands have this basic structure:
 
-| Component                          | Required or optional| Description                                                                                 | Size (in bytes) |
-|:-----------------------------------|:----------|:--------------------------------------------------------------------------------------------|:----------------|
-| `totalSize`                        | Required  | The size of the frame, counting everything that comes after it (in bytes)                   | 4               |
-| `commandSize`                      | Required  | The size of the protobuf-serialized command                                                 | 4               |
-| `message`                          | Required  | The protobuf message serialized in a raw binary format (rather than in protobuf format)     |                 |
-| `magicNumberOfBrokerEntryMetadata` | Optional  | A 2-byte byte array (`0x0e02`) identifying the broker entry metadata   <br /> **Note**: `magicNumberOfBrokerEntryMetadata` , `brokerEntryMetadataSize`, and `brokerEntryMetadata` should be used **together**.                     | 2               |
-| `brokerEntryMetadataSize`          | Optional  | The size of the broker entry metadata                                                       | 4               |
-| `brokerEntryMetadata`              | Optional  | The broker entry metadata stored as a binary protobuf message                               |                 |
-| `magicNumber`                      | Required  | A 2-byte byte array (`0x0e01`) identifying the current format                               | 2               |
-| `checksum`                         | Required  | A [CRC32-C checksum](http://www.evanjones.ca/crc32c.html) of everything that comes after it | 4               |
-| `metadataSize`                     | Required  | The size of the message [metadata](#message-metadata)                                       | 4               |
-| `metadata`                         | Required  | The message [metadata](#message-metadata) stored as a binary protobuf message               |                 |
-| `payload`                          | Required  | Anything left in the frame is considered the payload and can include any sequence of bytes  |                 |
+| Component                          | Required or optional | Description                                                                                                                                                                                                    | Size (in bytes) |
+|:-----------------------------------|:---------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------|
+| `totalSize`                        | Required             | The size of the frame, counting everything that comes after it (in bytes)                                                                                                                                      | 4               |
+| `commandSize`                      | Required             | The size of the protobuf-serialized command                                                                                                                                                                    | 4               |
+| `command`                          | Required             | The protobuf serialized command                                                                                                                                                                                |                 |
+| `magicNumberOfBrokerEntryMetadata` | Optional             | A 2-byte byte array (`0x0e02`) identifying the broker entry metadata   <br /> **Note**: `magicNumberOfBrokerEntryMetadata` , `brokerEntryMetadataSize`, and `brokerEntryMetadata` should be used **together**. | 2               |
+| `brokerEntryMetadataSize`          | Optional             | The size of the broker entry metadata                                                                                                                                                                          | 4               |
+| `brokerEntryMetadata`              | Optional             | The broker entry metadata stored as a binary protobuf message                                                                                                                                                  |                 |
+| `magicNumber`                      | Required             | A 2-byte byte array (`0x0e01`) identifying the current format                                                                                                                                                  | 2               |
+| `checksum`                         | Required             | A [CRC32-C checksum](http://www.evanjones.ca/crc32c.html) of everything that comes after it                                                                                                                    | 4               |
+| `metadataSize`                     | Required             | The size of the message [metadata](#message-metadata)                                                                                                                                                          | 4               |
+| `metadata`                         | Required             | The message [metadata](#message-metadata) stored as a binary protobuf message                                                                                                                                  |                 |
+| `payload`                          | Required             | Anything left in the frame is considered the payload and can include any sequence of bytes                                                                                                                     |                 |
 
 ## Broker entry metadata
 
 Broker entry metadata is stored alongside the message metadata as a serialized protobuf message.
 It is created by the broker when the message arrived at the broker and passed without changes to the consumer if configured.
 
-| Field              | Required or optional       | Description                                                                                                                   |
-|:-------------------|:----------------|:------------------------------------------------------------------------------------------------------------------------------|
-| `broker_timestamp` | Optional        | The timestamp when a message arrived at the broker (`id est` as the number of milliseconds since January 1st, 1970 in UTC)      |
-| `index`            | Optional        | The index of the message. It is assigned by the broker.
+| Field              | Required or optional | Description                                                                                                                |

Review Comment:
   ![image](https://user-images.githubusercontent.com/989425/171606395-a4fcfe6c-316e-4242-815f-862dc7b0b544.png)
   



##########
site2/docs/developing-binary-protocol.md:
##########
@@ -28,39 +28,39 @@ The Pulsar protocol allows for two types of commands:
 
 Simple (payload-free) commands have this basic structure:
 
-| Component     | Description                                                                             | Size (in bytes) |
-|:--------------|:----------------------------------------------------------------------------------------|:----------------|
-| `totalSize`   | The size of the frame, counting everything that comes after it (in bytes)               | 4               |
-| `commandSize` | The size of the protobuf-serialized command                                             | 4               |
-| `message`     | The protobuf message serialized in a raw binary format (rather than in protobuf format) |                 |
+| Component     | Description                                                               | Size (in bytes) |

Review Comment:
   ![image](https://user-images.githubusercontent.com/989425/171606287-a73cf0fd-e3ae-4396-8fc8-066723663090.png)
   



##########
site2/docs/developing-binary-protocol.md:
##########
@@ -28,39 +28,39 @@ The Pulsar protocol allows for two types of commands:
 
 Simple (payload-free) commands have this basic structure:
 
-| Component     | Description                                                                             | Size (in bytes) |
-|:--------------|:----------------------------------------------------------------------------------------|:----------------|
-| `totalSize`   | The size of the frame, counting everything that comes after it (in bytes)               | 4               |
-| `commandSize` | The size of the protobuf-serialized command                                             | 4               |
-| `message`     | The protobuf message serialized in a raw binary format (rather than in protobuf format) |                 |
+| Component     | Description                                                               | Size (in bytes) |
+|:--------------|:--------------------------------------------------------------------------|:----------------|
+| `totalSize`   | The size of the frame, counting everything that comes after it (in bytes) | 4               |
+| `commandSize` | The size of the protobuf-serialized command                               | 4               |
+| `command`     | The protobuf serialized command                                           |                 |
 
-### Payload commands
+### Message commands
 
 Payload commands have this basic structure:
 
-| Component                          | Required or optional| Description                                                                                 | Size (in bytes) |
-|:-----------------------------------|:----------|:--------------------------------------------------------------------------------------------|:----------------|
-| `totalSize`                        | Required  | The size of the frame, counting everything that comes after it (in bytes)                   | 4               |
-| `commandSize`                      | Required  | The size of the protobuf-serialized command                                                 | 4               |
-| `message`                          | Required  | The protobuf message serialized in a raw binary format (rather than in protobuf format)     |                 |
-| `magicNumberOfBrokerEntryMetadata` | Optional  | A 2-byte byte array (`0x0e02`) identifying the broker entry metadata   <br /> **Note**: `magicNumberOfBrokerEntryMetadata` , `brokerEntryMetadataSize`, and `brokerEntryMetadata` should be used **together**.                     | 2               |
-| `brokerEntryMetadataSize`          | Optional  | The size of the broker entry metadata                                                       | 4               |
-| `brokerEntryMetadata`              | Optional  | The broker entry metadata stored as a binary protobuf message                               |                 |
-| `magicNumber`                      | Required  | A 2-byte byte array (`0x0e01`) identifying the current format                               | 2               |
-| `checksum`                         | Required  | A [CRC32-C checksum](http://www.evanjones.ca/crc32c.html) of everything that comes after it | 4               |
-| `metadataSize`                     | Required  | The size of the message [metadata](#message-metadata)                                       | 4               |
-| `metadata`                         | Required  | The message [metadata](#message-metadata) stored as a binary protobuf message               |                 |
-| `payload`                          | Required  | Anything left in the frame is considered the payload and can include any sequence of bytes  |                 |
+| Component                          | Required or optional | Description                                                                                                                                                                                                    | Size (in bytes) |

Review Comment:
   ![image](https://user-images.githubusercontent.com/989425/171606333-fc5f0b6a-ed0b-4b85-974c-354f58961051.png)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org