replication_sink.go 761 B

12345678910111213141516171819202122
  1. package sink
  2. import (
  3. "context"
  4. "github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
  5. "github.com/chrislusf/seaweedfs/weed/replication/source"
  6. "github.com/chrislusf/seaweedfs/weed/util"
  7. )
  8. type ReplicationSink interface {
  9. GetName() string
  10. Initialize(configuration util.Configuration, prefix string) error
  11. DeleteEntry(ctx context.Context, key string, isDirectory, deleteIncludeChunks bool) error
  12. CreateEntry(ctx context.Context, key string, entry *filer_pb.Entry) error
  13. UpdateEntry(ctx context.Context, key string, oldEntry *filer_pb.Entry, newParentPath string, newEntry *filer_pb.Entry, deleteIncludeChunks bool) (foundExistingEntry bool, err error)
  14. GetSinkToDirectory() string
  15. SetSourceFiler(s *source.FilerSource)
  16. }
  17. var (
  18. Sinks []ReplicationSink
  19. )