filer: cache small file to filer store

This commit is contained in:
Chris Lu
2020-11-30 04:34:04 -08:00
parent a9c6be5fc3
commit f4abd01adf
17 changed files with 531 additions and 472 deletions

View File

@@ -18,6 +18,7 @@ func (entry *Entry) EncodeAttributesAndChunks() ([]byte, error) {
Extended: entry.Extended,
HardLinkId: entry.HardLinkId,
HardLinkCounter: entry.HardLinkCounter,
Content: entry.Content,
}
return proto.Marshal(message)
}
@@ -38,6 +39,7 @@ func (entry *Entry) DecodeAttributesAndChunks(blob []byte) error {
entry.HardLinkId = message.HardLinkId
entry.HardLinkCounter = message.HardLinkCounter
entry.Content = message.Content
return nil
}
@@ -122,6 +124,9 @@ func EqualEntry(a, b *Entry) bool {
if a.HardLinkCounter != b.HardLinkCounter {
return false
}
if !bytes.Equal(a.Content, b.Content) {
return false
}
return true
}