Skip to content

Commit 10205ab

Browse files
Fix warnings and long code lines
1 parent f7c8ecf commit 10205ab

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

cmd/pbm/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,9 @@ func main() {
244244
StringVar(&restore.pitrBase)
245245
restoreCmd.Flag("num-parallel-collections", "Number of parallel collections").
246246
Int32Var(&restore.numParallelColls)
247-
restoreCmd.Flag("num-insertion-workers-per-collection", "Specifies the number of insertion workers to run concurrently per collection. For large imports, increasing the number of insertion workers may increase the speed of the import.").
247+
restoreCmd.Flag("num-insertion-workers-per-collection",
248+
"Specifies the number of insertion workers to run concurrently per collection. For large imports, "+
249+
"increasing the number of insertion workers may increase the speed of the import.").
248250
Int32Var(&restore.numInsertionWorkers)
249251
restoreCmd.Flag("ns", `Namespaces to restore (e.g. "db1.*,db2.collection2"). If not set, restore all ("*.*")`).
250252
StringVar(&restore.ns)

pbm/restore/logical.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ type oplogRange struct {
8080
type restoreUsersAndRolesOption bool
8181

8282
// New creates a new restore object
83-
func New(leadConn connect.Client, nodeConn *mongo.Client, brief topo.NodeBrief, cfg *config.Config, rsMap map[string]string, numParallelColls, numInsertionWorkersPerCol int) *Restore {
83+
func New(leadConn connect.Client,
84+
nodeConn *mongo.Client,
85+
brief topo.NodeBrief,
86+
cfg *config.Config,
87+
rsMap map[string]string,
88+
numParallelColls,
89+
numInsertionWorkersPerCol int) *Restore {
8490
if rsMap == nil {
8591
rsMap = make(map[string]string)
8692
}
@@ -1324,7 +1330,11 @@ func (r *Restore) applyOplog(ctx context.Context, ranges []oplogRange, options *
13241330
}
13251331

13261332
func (r *Restore) snapshot(input io.Reader, cloneNS snapshot.CloneNS, excludeRouterCollections bool) error {
1327-
rf, err := snapshot.NewRestore(r.brief.URI, r.cfg, cloneNS, r.numParallelColls, r.numInsertionWorkersPerCol, excludeRouterCollections)
1333+
rf, err := snapshot.NewRestore(r.brief.URI,
1334+
r.cfg, cloneNS,
1335+
r.numParallelColls,
1336+
r.numInsertionWorkersPerCol,
1337+
excludeRouterCollections)
13281338
if err != nil {
13291339
return err
13301340
}

pbm/snapshot/restore.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ func (c *CloneNS) IsSpecified() bool {
5353
return c.FromNS != "" && c.ToNS != ""
5454
}
5555

56-
func NewRestore(uri string, cfg *config.Config, cloneNS CloneNS, numParallelColls int, numInsertionWorkersPerCol int, excludeRouterCollections bool) (io.ReaderFrom, error) {
56+
func NewRestore(uri string,
57+
cfg *config.Config,
58+
cloneNS CloneNS,
59+
numParallelColls,
60+
numInsertionWorkersPerCol int,
61+
excludeRouterCollections bool) (io.ReaderFrom, error) {
5762
topts := options.New("mongorestore",
5863
"0.0.1",
5964
"none",

0 commit comments

Comments
 (0)