1

创建类时输出的最后两个字节(包装记录的一部分,一个不是)的含义是什么?

我发出了命令“CREATE CLASS Foo EXTENDS V”。这是输出(用我对协议的理解进行注释):

Writing byte (1 byte): 0 [OChannelBinaryServer] # success
Writing int (4 bytes): 43 [OChannelBinaryServer] # session id 43
Writing byte (1 byte): 119 [OChannelBinaryServer] # w - this is a wrapped record
Writing short (2 bytes): 0 [OChannelBinaryServer] # this is a full record
Writing byte (1 byte): 100 [OChannelBinaryServer] # d - record is a document
Writing short (2 bytes): -1 [OChannelBinaryServer] # cluster id null
Writing long (8 bytes): -1 [OChannelBinaryServer] # cluster position null
Writing int (4 bytes): 0 [OChannelBinaryServer] # version 0
Writing bytes (4+16=20 bytes): [0, 0, 12, 114, 101, 115, 117, 108, 116, 0, 0, 0,
  15, 1, 0, 84] [OChannelBinaryServer] # the record, what is 84?
Writing byte (1 byte): 0 [OChannelBinaryServer] # what is this?

记录本身解码为名为“结果”的字段。result 的值是一个整数,编码为 varint 84,解码为 42。然后有一个尾随字节 0。

结果值 42 是什么意思?后面的 0 是什么意思?

请注意,我使用的是协议版本 36。

谢谢!

4

1 回答 1

0

从 CREATE CLASS 返回的数字是数据库中的类数。至于最后的0,我不知道。

斯科特

于 2016-08-09T13:15:01.597 回答