use of com.amazonaws.athena.connector.lambda.records.RecordRequestType in project aws-athena-query-federation by awslabs.
the class RecordHandler method doHandleRequest.
protected final void doHandleRequest(BlockAllocator allocator, ObjectMapper objectMapper, RecordRequest req, OutputStream outputStream) throws Exception {
logger.info("doHandleRequest: request[{}]", req);
RecordRequestType type = req.getRequestType();
switch(type) {
case READ_RECORDS:
try (RecordResponse response = doReadRecords(allocator, (ReadRecordsRequest) req)) {
logger.info("doHandleRequest: response[{}]", response);
assertNotNull(response);
objectMapper.writeValue(outputStream, response);
}
return;
default:
throw new IllegalArgumentException("Unknown request type " + type);
}
}
Aggregations