Skip to content

Commit

Permalink
Remove commented code
Browse files Browse the repository at this point in the history
Signed-off-by: MyonKeminta <[email protected]>
  • Loading branch information
MyonKeminta committed Jul 23, 2024
1 parent a9b312b commit 8dfa046
Showing 1 changed file with 0 additions and 127 deletions.
127 changes: 0 additions & 127 deletions client/tso_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,23 +172,6 @@ func (s tsoTSOStreamAdapter) Recv() (tsoRequestResult, error) {
}, nil
}

//// TSO Stream
//
//type tsoStream interface {
// getServerURL() string
// //// processRequests processes TSO requests in streaming mode to get timestamps
// //processRequests(
// // clusterID uint64, keyspaceID, keyspaceGroupID uint32, dcLocation string,
// // count int64, batchStartTime time.Time,
// //) (respKeyspaceGroupID uint32, physical, logical int64, suffixBits uint32, err error)
// processRequestsAsync(
// clusterID uint64, keyspaceID, keyspaceGroupID uint32, dcLocation string,
// count int64, batchStartTime time.Time, resultCh chan<- tsoRequestResult,
// )
//
// Close()
//}

type tsoStream struct {
serverURL string
stream grpcTSOStreamAdapter
Expand Down Expand Up @@ -234,113 +217,3 @@ func (s *tsoStream) processRequests(
physical, logical, suffixBits = res.physical, res.logical, res.suffixBits
return
}

//
//type pdTSOStream struct {
// serverURL string
// stream pdpb.PD_TsoClient
//}
//
//func (s *pdTSOStream) getServerURL() string {
// return s.serverURL
//}
//
//func (s *pdTSOStream) processRequests(
// clusterID uint64, _, _ uint32, dcLocation string, count int64, batchStartTime time.Time,
//) (respKeyspaceGroupID uint32, physical, logical int64, suffixBits uint32, err error) {
// start := time.Now()
// req := &pdpb.TsoRequest{
// Header: &pdpb.RequestHeader{
// ClusterId: clusterID,
// },
// Count: uint32(count),
// DcLocation: dcLocation,
// }
//
// if err = s.stream.Send(req); err != nil {
// if err == io.EOF {
// err = errs.ErrClientTSOStreamClosed
// } else {
// err = errors.WithStack(err)
// }
// return
// }
// tsoBatchSendLatency.Observe(float64(time.Since(batchStartTime)))
// resp, err := s.stream.Recv()
// if err != nil {
// if err == io.EOF {
// err = errs.ErrClientTSOStreamClosed
// } else {
// err = errors.WithStack(err)
// }
// return
// }
// requestDurationTSO.Observe(time.Since(start).Seconds())
// tsoBatchSize.Observe(float64(count))
//
// if resp.GetCount() != uint32(count) {
// err = errors.WithStack(errTSOLength)
// return
// }
//
// ts := resp.GetTimestamp()
// respKeyspaceGroupID = defaultKeySpaceGroupID
// physical, logical, suffixBits = ts.GetPhysical(), ts.GetLogical(), ts.GetSuffixBits()
// return
//}
//
//type tsoTSOStream struct {
// serverURL string
// stream tsopb.TSO_TsoClient
//}
//
//func (s *tsoTSOStream) getServerURL() string {
// return s.serverURL
//}
//
//func (s *tsoTSOStream) processRequests(
// clusterID uint64, keyspaceID, keyspaceGroupID uint32, dcLocation string,
// count int64, batchStartTime time.Time,
//) (respKeyspaceGroupID uint32, physical, logical int64, suffixBits uint32, err error) {
// start := time.Now()
// req := &tsopb.TsoRequest{
// Header: &tsopb.RequestHeader{
// ClusterId: clusterID,
// KeyspaceId: keyspaceID,
// KeyspaceGroupId: keyspaceGroupID,
// },
// Count: uint32(count),
// DcLocation: dcLocation,
// }
//
// if err = s.stream.Send(req); err != nil {
// if err == io.EOF {
// err = errs.ErrClientTSOStreamClosed
// } else {
// err = errors.WithStack(err)
// }
// return
// }
// tsoBatchSendLatency.Observe(float64(time.Since(batchStartTime)))
// resp, err := s.stream.Recv()
// if err != nil {
// if err == io.EOF {
// err = errs.ErrClientTSOStreamClosed
// } else {
// err = errors.WithStack(err)
// }
// return
// }
// requestDurationTSO.Observe(time.Since(start).Seconds())
// tsoBatchSize.Observe(float64(count))
//
// if resp.GetCount() != uint32(count) {
// err = errors.WithStack(errTSOLength)
// return
// }
//
// ts := resp.GetTimestamp()
// respKeyspaceGroupID = resp.GetHeader().GetKeyspaceGroupId()
// physical, logical, suffixBits = ts.GetPhysical(), ts.GetLogical(), ts.GetSuffixBits()
// return
//}

0 comments on commit 8dfa046

Please sign in to comment.