EncodeRecordKey encodes the recordPrefix, row handle into a kv.Key.
(recordPrefix kv.Key, h kv.Handle)
| 122 | |
| 123 | // EncodeRecordKey encodes the recordPrefix, row handle into a kv.Key. |
| 124 | func EncodeRecordKey(recordPrefix kv.Key, h kv.Handle) kv.Key { |
| 125 | buf := make([]byte, 0, len(recordPrefix)+h.Len()) |
| 126 | if ph, ok := h.(kv.PartitionHandle); ok { |
| 127 | recordPrefix = GenTableRecordPrefix(ph.PartitionID) |
| 128 | } |
| 129 | buf = append(buf, recordPrefix...) |
| 130 | buf = append(buf, h.Encoded()...) |
| 131 | return buf |
| 132 | } |
| 133 | |
| 134 | func hasTablePrefix(key kv.Key) bool { |
| 135 | return key[0] == tablePrefix[0] |