replication: simplify parallel replication variables & expose them in config

closes #140
This commit is contained in:
Christian Schwarz
2021-02-28 23:33:28 +01:00
parent 07f2bfff6a
commit 0ceea1b792
13 changed files with 246 additions and 47 deletions
+10 -2
View File
@@ -1,6 +1,7 @@
package logic
import (
"github.com/go-playground/validator"
"github.com/pkg/errors"
"github.com/zrepl/zrepl/config"
@@ -8,8 +9,15 @@ import (
)
type PlannerPolicy struct {
EncryptedSend tri // all sends must be encrypted (send -w, and encryption!=off)
ReplicationConfig *pdu.ReplicationConfig
EncryptedSend tri // all sends must be encrypted (send -w, and encryption!=off)
ReplicationConfig *pdu.ReplicationConfig
SizeEstimationConcurrency int `validate:"gte=1"`
}
var validate = validator.New()
func (p PlannerPolicy) Validate() error {
return validate.Struct(p)
}
func ReplicationConfigFromConfig(in *config.Replication) (*pdu.ReplicationConfig, error) {