add filer notification

This commit is contained in:
Chris Lu
2018-08-13 01:20:49 -07:00
parent 75d63db60d
commit f036ef8a3c
13 changed files with 428 additions and 101 deletions

View File

@@ -173,6 +173,10 @@ func (fs *FilerServer) UpdateEntry(ctx context.Context, req *filer_pb.UpdateEntr
}
if filer2.EqualEntry(entry, newEntry) {
return &filer_pb.UpdateEntryResponse{}, err
}
if err = fs.filer.UpdateEntry(newEntry); err == nil {
for _, garbage := range unusedChunks {
glog.V(0).Infof("deleting %s old chunk: %v, [%d, %d)", fullpath, garbage.FileId, garbage.Offset, garbage.Offset+int64(garbage.Size))
@@ -184,6 +188,8 @@ func (fs *FilerServer) UpdateEntry(ctx context.Context, req *filer_pb.UpdateEntr
}
}
fs.filer.NotifyUpdateEvent(entry, newEntry)
return &filer_pb.UpdateEntryResponse{}, err
}