Search in sources :

Example 1 with DynamodbStreamRecord

use of com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord in project bender by Nextdoor.

the class DynamodbEventIterator method next.

@Override
public InternalEvent next() {
    DynamodbStreamRecord record = this.iterator.next();
    String stringKeys = this.serializer.serialize(record.getDynamodb().getKeys());
    String stringRecord = this.serializer.serialize(record);
    return new DynamodbInternalEvent(record, stringKeys, stringRecord, this.context);
}
Also used : DynamodbStreamRecord(com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord)

Example 2 with DynamodbStreamRecord

use of com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord in project bender by Nextdoor.

the class DynamodbHandler method handler.

public void handler(DynamodbEvent event, Context context) throws HandlerException {
    if (!initialized) {
        init(context);
    }
    this.recordIterator = new DynamodbEventIterator(new LambdaContext(context), event.getRecords());
    DynamodbStreamRecord firstRecord = event.getRecords().get(0);
    this.source = SourceUtils.getSource(firstRecord.getEventSourceARN(), sources);
    super.process(context);
}
Also used : DynamodbStreamRecord(com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord) LambdaContext(com.nextdoor.bender.LambdaContext)

Aggregations

DynamodbStreamRecord (com.amazonaws.services.lambda.runtime.events.DynamodbEvent.DynamodbStreamRecord)2 LambdaContext (com.nextdoor.bender.LambdaContext)1