Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: clean up coprocessor streaming code #35277

Merged
merged 5 commits into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions distsql/distsql.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func Select(ctx context.Context, sctx sessionctx.Context, kvReq *kv.Request, fie
hook.(func(*kv.Request))(kvReq)
}

kvReq.Streaming = false
enabledRateLimitAction := sctx.GetSessionVars().EnabledRateLimitAction
originalSQL := sctx.GetSessionVars().StmtCtx.OriginalSQL
eventCb := func(event trxevents.TransactionEvent) {
Expand Down Expand Up @@ -111,20 +110,8 @@ func Select(ctx context.Context, sctx sessionctx.Context, kvReq *kv.Request, fie
}

// kvReq.MemTracker is used to trace and control memory usage in DistSQL layer;
// for streamResult, since it is a pipeline which has no buffer, it's not necessary to trace it;
// for selectResult, we just use the kvReq.MemTracker prepared for co-processor
// instead of creating a new one for simplification.
if kvReq.Streaming {
return &streamResult{
label: "dag-stream",
sqlType: label,
resp: resp,
rowLen: len(fieldTypes),
fieldTypes: fieldTypes,
ctx: sctx,
feedback: fb,
}, nil
}
return &selectResult{
label: "dag",
resp: resp,
Expand Down
6 changes: 0 additions & 6 deletions distsql/request_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,6 @@ func (builder *RequestBuilder) SetFromSessionVars(sv *variable.SessionVars) *Req
return builder
}

// SetStreaming sets "Streaming" flag for "kv.Request".
func (builder *RequestBuilder) SetStreaming(streaming bool) *RequestBuilder {
builder.Request.Streaming = streaming
return builder
}

// SetPaging sets "Paging" flag for "kv.Request".
func (builder *RequestBuilder) SetPaging(paging bool) *RequestBuilder {
builder.Request.Paging = paging
Expand Down
8 changes: 0 additions & 8 deletions distsql/request_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ func TestRequestBuilder1(t *testing.T) {
IsolationLevel: 0,
Priority: 0,
NotFillCache: false,
Streaming: false,
ReplicaRead: kv.ReplicaReadLeader,
ReadReplicaScope: kv.GlobalReplicaScope,
}
Expand Down Expand Up @@ -352,7 +351,6 @@ func TestRequestBuilder2(t *testing.T) {
IsolationLevel: 0,
Priority: 0,
NotFillCache: false,
Streaming: false,
ReplicaRead: kv.ReplicaReadLeader,
ReadReplicaScope: kv.GlobalReplicaScope,
}
Expand Down Expand Up @@ -400,7 +398,6 @@ func TestRequestBuilder3(t *testing.T) {
IsolationLevel: 0,
Priority: 0,
NotFillCache: false,
Streaming: false,
ReplicaRead: kv.ReplicaReadLeader,
ReadReplicaScope: kv.GlobalReplicaScope,
}
Expand Down Expand Up @@ -432,7 +429,6 @@ func TestRequestBuilder4(t *testing.T) {
SetDAGRequest(&tipb.DAGRequest{}).
SetDesc(false).
SetKeepOrder(false).
SetStreaming(true).
SetFromSessionVars(variable.NewSessionVars()).
Build()
require.NoError(t, err)
Expand All @@ -447,7 +443,6 @@ func TestRequestBuilder4(t *testing.T) {
Concurrency: variable.DefDistSQLScanConcurrency,
IsolationLevel: 0,
Priority: 0,
Streaming: true,
NotFillCache: false,
ReplicaRead: kv.ReplicaReadLeader,
ReadReplicaScope: kv.GlobalReplicaScope,
Expand Down Expand Up @@ -493,7 +488,6 @@ func TestRequestBuilder5(t *testing.T) {
IsolationLevel: kv.RC,
Priority: 1,
NotFillCache: true,
Streaming: false,
ReadReplicaScope: kv.GlobalReplicaScope,
}
require.Equal(t, expect, actual)
Expand Down Expand Up @@ -523,7 +517,6 @@ func TestRequestBuilder6(t *testing.T) {
IsolationLevel: 0,
Priority: 0,
NotFillCache: true,
Streaming: false,
ReadReplicaScope: kv.GlobalReplicaScope,
}
require.Equal(t, expect, actual)
Expand Down Expand Up @@ -559,7 +552,6 @@ func TestRequestBuilder7(t *testing.T) {
IsolationLevel: 0,
Priority: 0,
NotFillCache: false,
Streaming: false,
ReplicaRead: replicaRead.replicaReadType,
ReadReplicaScope: kv.GlobalReplicaScope,
}
Expand Down
1 change: 0 additions & 1 deletion distsql/select_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ var (

var (
_ SelectResult = (*selectResult)(nil)
_ SelectResult = (*streamResult)(nil)
_ SelectResult = (*serialSelectResults)(nil)
)

Expand Down
177 changes: 0 additions & 177 deletions distsql/stream.go

This file was deleted.

Loading