working b2 sink

This commit is contained in:
Chris Lu
2018-11-04 11:58:59 -08:00
parent f050b22d6c
commit 8dfac6a4cf
6 changed files with 55 additions and 10 deletions

View File

@@ -34,7 +34,9 @@ func (r *Replicator) Replicate(key string, message *filer_pb.EventNotification)
glog.V(4).Infof("skipping %v outside of %v", key, r.source.Dir)
return nil
}
key = filepath.Join(r.sink.GetSinkToDirectory(), key[len(r.source.Dir):])
newKey := filepath.Join(r.sink.GetSinkToDirectory(), key[len(r.source.Dir):])
glog.V(3).Infof("replicate %s => %s", key, newKey)
key = newKey
if message.OldEntry != nil && message.NewEntry == nil {
glog.V(4).Infof("deleting %v", key)
return r.sink.DeleteEntry(key, message.OldEntry.IsDirectory, message.DeleteChunks)