2016-08-08 47 views
1

當創建一個類時,輸出的最後兩個字節(包裝記錄的一部分,其中一個不是)的含義是什麼?OrientDB網絡二進制協議 - 創建CLASS時返回什麼?

我發佈了命令「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.

謝謝!

回答

0

從CREATE CLASS返回的數字是數據庫中類的數量。至於0最後,我不知道。

Scott