You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
708 B

6 years ago
6 years ago
6 years ago
6 years ago
  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) 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, 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. )