@RestController public class HTTPQueryController extends MetricController
Constructor and Description |
---|
HTTPQueryController(HandlerService handlerService,
QueryService queryService,
BQLService bqlService,
StatusService statusService,
com.yahoo.bullet.common.metrics.MetricPublisher metricPublisher)
Constructor that takes various services.
|
Modifier and Type | Method and Description |
---|---|
CompletableFuture<org.springframework.http.ResponseEntity<Object>> |
deleteAsyncQuery(String id)
This method handles DELETEs for any asynchronous queries submitted to the API.
|
CompletableFuture<org.springframework.http.ResponseEntity<Object>> |
submitAsyncQuery(String asyncQuery)
This method handles POSTs for asynchronous queries to the API.
|
CompletableFuture<String> |
submitHTTPQuery(String query)
The method that handles POSTs to this endpoint.
|
org.springframework.web.servlet.mvc.method.annotation.SseEmitter |
submitSSEQuery(String query)
The method that handles SSE POSTs to this endpoint.
|
org.springframework.http.ResponseEntity<Object> |
validateQuery(String query)
The method that handles POSTed queries to this endpoint and validates them.
|
incrementMetric, incrementMetric, publishMetrics, toMetric
@Autowired public HTTPQueryController(HandlerService handlerService, QueryService queryService, BQLService bqlService, StatusService statusService, com.yahoo.bullet.common.metrics.MetricPublisher metricPublisher)
handlerService
- The HandlerService
to use.queryService
- The QueryService
to use.bqlService
- The BQLService
to use.statusService
- The StatusService
to use.metricPublisher
- The MetricPublisher
to use. It can be null.@PostMapping(path="${bullet.endpoint.validate}", consumes="text/plain", produces="application/json") public org.springframework.http.ResponseEntity<Object> validateQuery(@RequestBody String query)
query
- The String query to submit.CompletableFuture
representing the eventual result.@PostMapping(path="${bullet.endpoint.http}", consumes="text/plain", produces="application/json") public CompletableFuture<String> submitHTTPQuery(@RequestBody String query)
HandlerService
to
register and transmit the query to Bullet.query
- The String query to submit.CompletableFuture
representing the eventual result.@PostMapping(value="${bullet.endpoint.sse}", consumes="text/plain", produces="application/json") public org.springframework.web.servlet.mvc.method.annotation.SseEmitter submitSSEQuery(@RequestBody String query)
HandlerService
to
register and transmit the query to Bullet.query
- The String query to submit.SseEmitter
to send streaming results.@PostMapping(value="${bullet.endpoint.async}", consumes="text/plain", produces="application/json") public CompletableFuture<org.springframework.http.ResponseEntity<Object>> submitAsyncQuery(@RequestBody String asyncQuery)
asyncQuery
- The String query to submit.CompletableFuture
that resolves to either a QueryResponse
or a QueryError
.@DeleteMapping(path="${bullet.endpoint.async}/{id}") public CompletableFuture<org.springframework.http.ResponseEntity<Object>> deleteAsyncQuery(@PathVariable String id)
id
- The ID returned in the QueryResponse
from the previous submit call signifying the query to delete.CompletableFuture
that resolves to a 200 if the delete was successful or the appropriate code otherwise.Copyright © 2021 Pivotal Software, Inc.. All rights reserved.