Skip to content

Commit 274df41

Browse files
committed
fixup
1 parent 5cbaefd commit 274df41

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

extern/boostd-data/cmd/run.go

+14-5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ var runCmd = &cli.Command{
3434
leveldbCmd,
3535
yugabyteCmd,
3636
yugabyteMigrateCmd,
37+
yugabyteAddIndexCmd,
3738
},
3839
}
3940

@@ -274,15 +275,17 @@ var yugabyteAddIndexCmd = &cli.Command{
274275
Usage: "postgres connect string eg 'postgresql://postgres:postgres@localhost'",
275276
Required: true,
276277
},
277-
&cli.StringFlag{
278-
Name: "miner-address",
279-
Usage: "default miner address eg f1234",
280-
},
281278
&cli.StringFlag{
282279
Name: "filename",
283280
Usage: "",
284281
Required: true,
285282
},
283+
&cli.IntFlag{
284+
Name: "CQLTimeout",
285+
Usage: "client timeout value in seconds for CQL queries",
286+
Required: false,
287+
Value: yugabyte.CqlTimeout,
288+
},
286289
},
287290
Action: func(cctx *cli.Context) error {
288291
ctx := cliutil.ReqContext(cctx)
@@ -291,11 +294,16 @@ var yugabyteAddIndexCmd = &cli.Command{
291294
settings := yugabyte.DBSettings{
292295
Hosts: cctx.StringSlice("hosts"),
293296
ConnectString: cctx.String("connect-string"),
297+
CQLTimeout: cctx.Int("CQLTimeout"),
294298
}
295299

296300
migrator := yugabyte.NewMigrator(settings, migrations.DisabledMinerAddr)
297301

298302
bdsvc := svc.NewYugabyte(settings, migrator)
303+
err := bdsvc.Impl.Start(ctx)
304+
if err != nil {
305+
return err
306+
}
299307

300308
piececidStr := cctx.String("filename")
301309

@@ -336,7 +344,7 @@ var yugabyteAddIndexCmd = &cli.Command{
336344
return fmt.Errorf("generating index for piece %s: %w", piececid, err)
337345
}
338346

339-
log.Warnw("read index successfully", "took", time.Since(now))
347+
log.Warnw("read index successfully", "piececid", piececid, "recs", len(recs), "took", time.Since(now))
340348

341349
now = time.Now()
342350

@@ -345,6 +353,7 @@ var yugabyteAddIndexCmd = &cli.Command{
345353
if resp.Err != "" {
346354
return fmt.Errorf("failed to add index to yugabytedb: %s", resp.Err)
347355
}
356+
log.Warnw("adding index to yugabytedb", "progress", resp.Progress)
348357
}
349358
log.Warnw("added index to yugabytedb successfully", "took", time.Since(now))
350359

0 commit comments

Comments
 (0)