aboutsummaryrefslogtreecommitdiff
path: root/weed/replication
diff options
context:
space:
mode:
Diffstat (limited to 'weed/replication')
-rw-r--r--weed/replication/replicator.go10
-rw-r--r--weed/replication/sink/backupsink/backup_sink.go18
-rw-r--r--weed/replication/sink/localincrementalsink/local_incremental_sink.go18
3 files changed, 23 insertions, 23 deletions
diff --git a/weed/replication/replicator.go b/weed/replication/replicator.go
index 81d546c3c..7688029e6 100644
--- a/weed/replication/replicator.go
+++ b/weed/replication/replicator.go
@@ -42,14 +42,14 @@ func (r *Replicator) Replicate(ctx context.Context, key string, message *filer_p
return nil
}
var dateKey string
- if r.sink.GetName() == "backup" {
- var crTime int64
+ if r.sink.GetName() == "local_incremental" {
+ var mTime int64
if message.NewEntry != nil {
- crTime = message.NewEntry.Attributes.Crtime
+ mTime = message.NewEntry.Attributes.Mtime
} else if message.OldEntry != nil {
- crTime = message.OldEntry.Attributes.Crtime
+ mTime = message.OldEntry.Attributes.Mtime
}
- dateKey = time.Unix(crTime, 0).Format("2006-01-02")
+ dateKey = time.Unix(mTime, 0).Format("2006-01-02")
}
newKey := util.Join(r.sink.GetSinkToDirectory(), dateKey, key[len(r.source.Dir):])
glog.V(3).Infof("replicate %s => %s", key, newKey)
diff --git a/weed/replication/sink/backupsink/backup_sink.go b/weed/replication/sink/backupsink/backup_sink.go
deleted file mode 100644
index df0a778d1..000000000
--- a/weed/replication/sink/backupsink/backup_sink.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package backupsink
-
-import (
- "github.com/chrislusf/seaweedfs/weed/replication/sink"
- "github.com/chrislusf/seaweedfs/weed/replication/sink/localsink"
-)
-
-type BackupSink struct {
- localsink.LocalSink
-}
-
-func (backupsink *BackupSink) GetName() string {
- return "backup"
-}
-
-func init() {
- sink.Sinks = append(sink.Sinks, &BackupSink{})
-}
diff --git a/weed/replication/sink/localincrementalsink/local_incremental_sink.go b/weed/replication/sink/localincrementalsink/local_incremental_sink.go
new file mode 100644
index 000000000..97da3a5f7
--- /dev/null
+++ b/weed/replication/sink/localincrementalsink/local_incremental_sink.go
@@ -0,0 +1,18 @@
+package localincrementalsink
+
+import (
+ "github.com/chrislusf/seaweedfs/weed/replication/sink"
+ "github.com/chrislusf/seaweedfs/weed/replication/sink/localsink"
+)
+
+type LocalIncSink struct {
+ localsink.LocalSink
+}
+
+func (localincsink *LocalIncSink) GetName() string {
+ return "local_incremental"
+}
+
+func init() {
+ sink.Sinks = append(sink.Sinks, &LocalIncSink{})
+}