aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/entry_codec.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-07-19 02:47:27 -0700
committerChris Lu <chris.lu@gmail.com>2021-07-19 02:47:27 -0700
commit450222dd64727caaa958ec99988e5352d3cad54c (patch)
tree133cbd5e1c3cf123bd327685eb901969a5926fb9 /weed/filer/entry_codec.go
parent8dc5def435826dcbe1e97098f55394ed42529ea9 (diff)
downloadseaweedfs-450222dd64727caaa958ec99988e5352d3cad54c.tar.xz
seaweedfs-450222dd64727caaa958ec99988e5352d3cad54c.zip
add remote to filer.Entry and filer_pb entry, add RemoteConf
Diffstat (limited to 'weed/filer/entry_codec.go')
-rw-r--r--weed/filer/entry_codec.go23
1 files changed, 6 insertions, 17 deletions
diff --git a/weed/filer/entry_codec.go b/weed/filer/entry_codec.go
index 4c613f068..55c937b39 100644
--- a/weed/filer/entry_codec.go
+++ b/weed/filer/entry_codec.go
@@ -12,14 +12,8 @@ import (
)
func (entry *Entry) EncodeAttributesAndChunks() ([]byte, error) {
- message := &filer_pb.Entry{
- Attributes: EntryAttributeToPb(entry),
- Chunks: entry.Chunks,
- Extended: entry.Extended,
- HardLinkId: entry.HardLinkId,
- HardLinkCounter: entry.HardLinkCounter,
- Content: entry.Content,
- }
+ message := &filer_pb.Entry{}
+ entry.ToExistingProtoEntry(message)
return proto.Marshal(message)
}
@@ -31,15 +25,7 @@ func (entry *Entry) DecodeAttributesAndChunks(blob []byte) error {
return fmt.Errorf("decoding value blob for %s: %v", entry.FullPath, err)
}
- entry.Attr = PbToEntryAttribute(message.Attributes)
-
- entry.Extended = message.Extended
-
- entry.Chunks = message.Chunks
-
- entry.HardLinkId = message.HardLinkId
- entry.HardLinkCounter = message.HardLinkCounter
- entry.Content = message.Content
+ FromPbEntryToExistingEntry(message, entry)
return nil
}
@@ -129,6 +115,9 @@ func EqualEntry(a, b *Entry) bool {
if !bytes.Equal(a.Content, b.Content) {
return false
}
+ if !proto.Equal(a.Remote, b.Remote) {
+ return false
+ }
return true
}