restructure and rename, making mainfsm the replication package itself

This commit is contained in:
Christian Schwarz
2018-08-22 00:10:09 +02:00
parent 2f205d205b
commit 301c7b2dd5
17 changed files with 348 additions and 303 deletions
+3 -4
View File
@@ -14,7 +14,6 @@ import (
"github.com/pkg/errors"
"github.com/problame/go-streamrpc"
"github.com/zrepl/zrepl/cmd/replication"
"github.com/zrepl/zrepl/cmd/replication/common"
)
type PullJob struct {
@@ -30,7 +29,7 @@ type PullJob struct {
Debug JobDebugSettings
task *Task
rep replication.Replication
rep *replication.Replication
}
func parsePullJob(c JobParsingContext, name string, i map[string]interface{}) (j *PullJob, err error) {
@@ -189,12 +188,12 @@ func (j *PullJob) doRun(ctx context.Context) {
}
ctx = common.ContextWithLogger(ctx, replicationLogAdaptor{j.task.Log().WithField("subsystem", "replication")})
ctx = replication.WithLogger(ctx, replicationLogAdaptor{j.task.Log().WithField("subsystem", "replication")})
ctx = streamrpc.ContextWithLogger(ctx, streamrpcLogAdaptor{j.task.Log().WithField("subsystem", "rpc.protocol")})
ctx = context.WithValue(ctx, contextKeyLog, j.task.Log().WithField("subsystem", "rpc.endpoint"))
j.rep = replication.NewReplication()
j.rep.Drive(ctx, common.NewEndpointPairPull(sender, puller))
j.rep.Drive(ctx, sender, puller)
client.Close()
j.task.Finish()