@@ -34,6 +34,7 @@ var runCmd = &cli.Command{
34
34
leveldbCmd ,
35
35
yugabyteCmd ,
36
36
yugabyteMigrateCmd ,
37
+ yugabyteAddIndexCmd ,
37
38
},
38
39
}
39
40
@@ -274,15 +275,17 @@ var yugabyteAddIndexCmd = &cli.Command{
274
275
Usage : "postgres connect string eg 'postgresql://postgres:postgres@localhost'" ,
275
276
Required : true ,
276
277
},
277
- & cli.StringFlag {
278
- Name : "miner-address" ,
279
- Usage : "default miner address eg f1234" ,
280
- },
281
278
& cli.StringFlag {
282
279
Name : "filename" ,
283
280
Usage : "" ,
284
281
Required : true ,
285
282
},
283
+ & cli.IntFlag {
284
+ Name : "CQLTimeout" ,
285
+ Usage : "client timeout value in seconds for CQL queries" ,
286
+ Required : false ,
287
+ Value : yugabyte .CqlTimeout ,
288
+ },
286
289
},
287
290
Action : func (cctx * cli.Context ) error {
288
291
ctx := cliutil .ReqContext (cctx )
@@ -291,11 +294,16 @@ var yugabyteAddIndexCmd = &cli.Command{
291
294
settings := yugabyte.DBSettings {
292
295
Hosts : cctx .StringSlice ("hosts" ),
293
296
ConnectString : cctx .String ("connect-string" ),
297
+ CQLTimeout : cctx .Int ("CQLTimeout" ),
294
298
}
295
299
296
300
migrator := yugabyte .NewMigrator (settings , migrations .DisabledMinerAddr )
297
301
298
302
bdsvc := svc .NewYugabyte (settings , migrator )
303
+ err := bdsvc .Impl .Start (ctx )
304
+ if err != nil {
305
+ return err
306
+ }
299
307
300
308
piececidStr := cctx .String ("filename" )
301
309
@@ -336,7 +344,7 @@ var yugabyteAddIndexCmd = &cli.Command{
336
344
return fmt .Errorf ("generating index for piece %s: %w" , piececid , err )
337
345
}
338
346
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 ))
340
348
341
349
now = time .Now ()
342
350
@@ -345,6 +353,7 @@ var yugabyteAddIndexCmd = &cli.Command{
345
353
if resp .Err != "" {
346
354
return fmt .Errorf ("failed to add index to yugabytedb: %s" , resp .Err )
347
355
}
356
+ log .Warnw ("adding index to yugabytedb" , "progress" , resp .Progress )
348
357
}
349
358
log .Warnw ("added index to yugabytedb successfully" , "took" , time .Since (now ))
350
359
0 commit comments