Class CloudwatchRecordHandler

  • All Implemented Interfaces:
    com.amazonaws.services.lambda.runtime.RequestStreamHandler

    public class CloudwatchRecordHandler
    extends RecordHandler
    Handles data read record requests for the Athena Cloudwatch Connector.

    For more detail, please see the module's README.md, some notable characteristics of this class include:

    1. Reads and maps Cloudwatch Logs data for a specific LogStream (split) 2. Attempts to push down time range predicates into Cloudwatch.

    • Constructor Detail

      • CloudwatchRecordHandler

        public CloudwatchRecordHandler​(Map<String,​String> configOptions)
      • CloudwatchRecordHandler

        protected CloudwatchRecordHandler​(com.amazonaws.services.s3.AmazonS3 amazonS3,
                                          com.amazonaws.services.secretsmanager.AWSSecretsManager secretsManager,
                                          com.amazonaws.services.athena.AmazonAthena athena,
                                          com.amazonaws.services.logs.AWSLogs awsLogs,
                                          Map<String,​String> configOptions)
    • Method Detail

      • readWithConstraint

        protected void readWithConstraint​(BlockSpiller spiller,
                                          ReadRecordsRequest recordsRequest,
                                          QueryStatusChecker queryStatusChecker)
                                   throws TimeoutException,
                                          InterruptedException
        Scans Cloudwatch Logs using the LogStream and optional Time stamp filters.
        Specified by:
        readWithConstraint in class RecordHandler
        Parameters:
        spiller - A BlockSpiller that should be used to write the row data associated with this Split. The BlockSpiller automatically handles chunking the response, encrypting, and spilling to S3.
        recordsRequest - Details of the read request, including: 1. The Split 2. The Catalog, Database, and Table the read request is for. 3. The filtering predicate (if any) 4. The columns required for projection.
        queryStatusChecker - A QueryStatusChecker that you can use to stop doing work for a query that has already terminated
        Throws:
        TimeoutException
        InterruptedException
        See Also:
        RecordHandler