Skip to content

Commit

Permalink
remove commented code
Browse files Browse the repository at this point in the history
Signed-off-by: Vilius Okockis <[email protected]>
  • Loading branch information
DeathBorn committed Mar 27, 2024
1 parent 2e48ab9 commit 25ba5a4
Showing 1 changed file with 0 additions and 93 deletions.
93 changes: 0 additions & 93 deletions go/cmd/boost/boost/boost.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,96 +183,3 @@ func (b *Boost) Play(ctx context.Context) error {
}
}
}

// func RunBoost(cfg *BoostConfig) {
// vgtid := &binlogdatapb.VGtid{}
// filter := &binlogdatapb.Filter{}
// if err := json2.Unmarshal([]byte(*&cfg.Gtid), &vgtid); err != nil {
// log.Fatal(err)
// }
// if err := json2.Unmarshal([]byte(*&cfg.Filter), &filter); err != nil {
// log.Fatal(err)
// }
// fmt.Println(vgtid)
// fmt.Println(filter)
// fmt.Println("Will start streaming...")
// ctx := context.Background()
// conn, err := vtgateconn.Dial(ctx, fmt.Sprintf("%s:%s", cfg.Host, cfg.Port))
// if err != nil {
// log.Fatal(err)
// }

// defer conn.Close()
// flags := &vtgatepb.VStreamFlags{
// //MinimizeSkew: false,
// //HeartbeatInterval: 60, //seconds
// }
// var fields []*querypb.Field
// reader, err := conn.VStream(ctx, cfg.TabletType, vgtid, filter, flags)
// if err != nil {
// log.Fatal(err)
// }
// connect := false
// numErrors := 0
// for {
// if connect { // if vtgate returns a transient error try reconnecting from the last seen vgtid
// fmt.Println("Reconnecting...")
// reader, err = conn.VStream(ctx, cfg.TabletType, vgtid, filter, flags)
// log.Fatal(err)
// connect = false
// }
// e, err := reader.Recv()
// fmt.Println("_----")
// switch err {
// case nil:
// _ = e
// for _, ev := range e {

// switch ev.Type {
// case binlogdatapb.VEventType_HEARTBEAT:
// fmt.Println("Got Heartbeat")
// // track vgtid
// case binlogdatapb.VEventType_VGTID:
// vgtid = ev.Vgtid
// // receive new schema
// case binlogdatapb.VEventType_FIELD:
// fields = ev.FieldEvent.Fields
// b := []string{}
// for _, f := range fields {
// b = append(b, fmt.Sprintf("%q:%q", f.Name, f.Type))
// }
// fmt.Println(fmt.Sprintf("{ \"table\" : %q, \"fields\": { %s }}", ev.FieldEvent.TableName, strings.Join(b[:], ",")))
// // print last vgtid with rows
// case binlogdatapb.VEventType_ROW:
// jsonValue, _ := json.Marshal(vgtid)
// fmt.Println(string(jsonValue))
// for _, rowChange := range ev.RowEvent.RowChanges {
// row := sqltypes.MakeRowTrusted(fields, rowChange.After)
// jsonValue, _ = json.Marshal(row)
// fmt.Println(fmt.Sprintf("{ \"table\" : %q, \"row\": %s}", ev.RowEvent.TableName, string(jsonValue)))

// }

// }
// }
// case io.EOF:
// fmt.Printf("stream ended\n")
// return
// default:
// fmt.Printf("%s:: remote error: %v\n", time.Now(), err)
// numErrors++
// if numErrors > 10 { // if vtgate is continuously unavailable error the test
// return
// }
// if strings.Contains(strings.ToLower(err.Error()), "unavailable") {
// // this should not happen, but maybe the buffering logic might return a transient
// // error during resharding. So adding this logic to reduce future flakiness
// time.Sleep(100 * time.Millisecond)
// connect = true
// } else {
// // failure, stop test
// return
// }
// }
// }
// }

0 comments on commit 25ba5a4

Please sign in to comment.