Skip to content

Commit

Permalink
Add chunked responses and streaming of raw queries.
Browse files Browse the repository at this point in the history
Refactored query engine to have different processing pipeline for raw queries. This enables queries that have a large offset to not keep everything in memory. It also makes it so that queries against raw data that have a limit will only p
rocess up to that limit and then bail out.

Raw data queries will only read up to a certain point in the map phase before yielding to the engine for further processing.

Fixes #2029 and fixes #2030
  • Loading branch information
pauldix authored and otoolep committed Apr 9, 2015
1 parent 0309593 commit 7db3724
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/influxd/server_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@ func TestSingleServer(t *testing.T) {
defer nodes.Close()

runTestsData(t, testName, nodes, "mydb", "myrp")
runTest_rawDataReturnsInOrder(t, testName, nodes, "mydb", "myrp")
//runTest_rawDataReturnsInOrder(t, testName, nodes, "mydb", "myrp")
}

func Test3NodeServer(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions httpd/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const (
)

const (
// With raw data queries, mappers will read up to this amount before sending results back to the engine
DefaultChunkSize = 10000
)

Expand Down
1 change: 1 addition & 0 deletions influxql/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ func (m *MapReduceJob) processRawQuery(out chan *Row, filterEmptyResults bool) {
}
valuesSent += len(values)
}

valuesToReturn = append(valuesToReturn, values...)

// hit the chunk size? Send out what has been accumulated, but keep
Expand Down

0 comments on commit 7db3724

Please sign in to comment.