Created
November 8, 2017 14:31
-
-
Save pdeschen/0114c49539e29027746636d655deccd2 to your computer and use it in GitHub Desktop.
medium/serverless/S3EventHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public Void handleRequest(S3Event event, Context context) { | |
List<S3EventNotificationRecord> records = event.getRecords(); | |
... | |
String bucket = record.getS3().getBucket().getName(); | |
String key = decodeKey(record.getS3().getObject().getKey()); | |
... | |
// fetch recording off S3 bucket | |
S3Object object = getS3Object(bucket, key); | |
MosResult mos = computeMos(object); | |
// store custom metrics | |
mCloudWatchMosMetricProducer.put(mos, CLOUDWATCH_METRICS_NAMESPACE); | |
// send kinesis event | |
mKinesisMosRecordProducer.put(mos, KINESIS_STREAM_NAME); | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment