2018-09-23 07:40:36 +00:00
|
|
|
package sink
|
|
|
|
|
|
|
|
import (
|
2019-03-16 00:20:24 +00:00
|
|
|
"context"
|
2018-09-23 07:40:36 +00:00
|
|
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
|
|
|
"github.com/chrislusf/seaweedfs/weed/replication/source"
|
2018-10-04 06:36:52 +00:00
|
|
|
"github.com/chrislusf/seaweedfs/weed/util"
|
2018-09-23 07:40:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type ReplicationSink interface {
|
2018-10-04 06:36:52 +00:00
|
|
|
GetName() string
|
|
|
|
Initialize(configuration util.Configuration) error
|
2019-03-16 00:20:24 +00:00
|
|
|
DeleteEntry(ctx context.Context, key string, isDirectory, deleteIncludeChunks bool) error
|
|
|
|
CreateEntry(ctx context.Context, key string, entry *filer_pb.Entry) error
|
|
|
|
UpdateEntry(ctx context.Context, key string, oldEntry, newEntry *filer_pb.Entry, deleteIncludeChunks bool) (foundExistingEntry bool, err error)
|
2018-09-23 07:40:36 +00:00
|
|
|
GetSinkToDirectory() string
|
|
|
|
SetSourceFiler(s *source.FilerSource)
|
|
|
|
}
|
2018-10-04 06:36:52 +00:00
|
|
|
|
|
|
|
var (
|
|
|
|
Sinks []ReplicationSink
|
|
|
|
)
|