@@ -168,9 +168,8 @@ func (ml *PCSM) Recover(ctx context.Context, data []byte) error {
168168 nsFilter := sel .MakeFilter (cp .NSInclude , cp .NSExclude )
169169 catalog := NewCatalog (ml .target )
170170 // Use default options for recovery (clone tuning is less relevant when resuming from checkpoint)
171- defaultOpts := & StartOptions {}
172- clone := NewClone (ml .source , ml .target , catalog , nsFilter , defaultOpts )
173- repl := NewRepl (ml .source , ml .target , catalog , nsFilter , false )
171+ clone := NewClone (ml .source , ml .target , catalog , nsFilter , & CloneOptions {})
172+ repl := NewRepl (ml .source , ml .target , catalog , nsFilter , & ReplOptions {})
174173
175174 if cp .Catalog != nil {
176175 err = catalog .Recover (cp .Catalog )
@@ -285,27 +284,17 @@ func (ml *PCSM) resetError() {
285284
286285// StartOptions represents the options for starting the PCSM.
287286type StartOptions struct {
288- // PauseOnInitialSync indicates whether to finalize after the initial sync.
287+ // PauseOnInitialSync indicates whether to pause after the initial sync completes .
289288 PauseOnInitialSync bool
290- // IncludeNamespaces are the namespaces to include.
289+ // IncludeNamespaces are the namespaces to include in replication .
291290 IncludeNamespaces []string
292- // ExcludeNamespaces are the namespaces to exclude.
291+ // ExcludeNamespaces are the namespaces to exclude from replication .
293292 ExcludeNamespaces []string
294293
295- // Clone tuning options
296- // CloneParallelism is the number of collections to clone in parallel.
297- CloneParallelism int
298- // CloneReadWorkers is the number of read workers during clone.
299- CloneReadWorkers int
300- // CloneInsertWorkers is the number of insert workers during clone.
301- CloneInsertWorkers int
302- // CloneSegmentSizeBytes is the segment size for clone operations in bytes.
303- CloneSegmentSizeBytes int64
304- // CloneReadBatchSizeBytes is the read batch size during clone in bytes.
305- CloneReadBatchSizeBytes int32
306-
307- // UseCollectionBulkWrite indicates whether to use collection-level bulk write.
308- UseCollectionBulkWrite bool
294+ // Clone contains clone tuning options.
295+ Clone CloneOptions
296+ // Repl contains replication behavior options.
297+ Repl ReplOptions
309298}
310299
311300// Start starts the replication process with the given options.
@@ -336,8 +325,8 @@ func (ml *PCSM) Start(_ context.Context, options *StartOptions) error {
336325 ml .nsFilter = sel .MakeFilter (ml .nsInclude , ml .nsExclude )
337326 ml .pauseOnInitialSync = options .PauseOnInitialSync
338327 ml .catalog = NewCatalog (ml .target )
339- ml .clone = NewClone (ml .source , ml .target , ml .catalog , ml .nsFilter , options )
340- ml .repl = NewRepl (ml .source , ml .target , ml .catalog , ml .nsFilter , options .UseCollectionBulkWrite )
328+ ml .clone = NewClone (ml .source , ml .target , ml .catalog , ml .nsFilter , & options . Clone )
329+ ml .repl = NewRepl (ml .source , ml .target , ml .catalog , ml .nsFilter , & options .Repl )
341330 ml .state = StateRunning
342331
343332 go ml .run ()
0 commit comments