diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-09-23 00:40:36 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-09-23 00:40:36 -0700 |
| commit | 9fe24991d5b5be0cd3f56cbb65883c67c20fdfe6 (patch) | |
| tree | be465d1ceae0b8968986b09c13cf2ac2dcca5873 /weed/replication/replicator.go | |
| parent | 7d6b2a4740c32c3a07a4ce4204da2debee371bcd (diff) | |
| download | seaweedfs-9fe24991d5b5be0cd3f56cbb65883c67c20fdfe6.tar.xz seaweedfs-9fe24991d5b5be0cd3f56cbb65883c67c20fdfe6.zip | |
refactoring
Diffstat (limited to 'weed/replication/replicator.go')
| -rw-r--r-- | weed/replication/replicator.go | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/weed/replication/replicator.go b/weed/replication/replicator.go index 3e4bccc10..5884bd35b 100644 --- a/weed/replication/replicator.go +++ b/weed/replication/replicator.go @@ -3,9 +3,9 @@ package replication import ( "strings" - "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/replication/sink" + "github.com/chrislusf/seaweedfs/weed/replication/sink/filersink" "github.com/chrislusf/seaweedfs/weed/replication/source" "github.com/chrislusf/seaweedfs/weed/util" ) @@ -17,20 +17,12 @@ type Replicator struct { func NewReplicator(sourceConfig, sinkConfig util.Configuration) *Replicator { - sink := &sink.FilerSink{} + sink := &filersink.FilerSink{} sink.Initialize(sinkConfig) source := &source.FilerSource{} source.Initialize(sourceConfig) - if sourceConfig.GetString("grpcAddress") == sinkConfig.GetString("grpcAddress") { - fromDir := sourceConfig.GetString("directory") - toDir := sinkConfig.GetString("directory") - if strings.HasPrefix(toDir, fromDir) { - glog.Fatalf("recursive replication! source directory %s includes the sink directory %s", fromDir, toDir) - } - } - sink.SetSourceFiler(source) return &Replicator{ |
