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); }
/** * Performs a field substitution with the lambda invocation context as the source. * * @param ievent * @param config */ private Map<String, String> getContext(InternalEvent ievent) { Map<String, String> contexts = ievent.getCtx().getContextAsMap(); if (!this.includes.isEmpty()) { contexts.keySet().retainAll(this.includes); } this.excludes.forEach(exclude -> { contexts.remove(exclude); }); return contexts; } }
private S3Wrapper(final InternalEvent internal) { S3InternalEvent s3Event = ((S3InternalEvent) internal); this.s3Key = s3Event.getS3Key(); this.s3Bucket = s3Event.getS3Bucket(); this.s3KeyVersion = s3Event.getS3KeyVersion(); this.functionName = internal.getCtx().getContext().getFunctionName(); this.functionVersion = internal.getCtx().getContext().getFunctionVersion(); this.processingTime = System.currentTimeMillis(); this.timestamp = internal.getEventTime(); this.processingDelay = processingTime - timestamp; this.sha1Hash = internal.getEventSha1Hash(); if (internal.getEventObj() != null) { this.payload = internal.getEventObj().getPayload(); } else { this.payload = null; } }
private S3Wrapper(final InternalEvent internal) { S3InternalEvent s3Event = ((S3InternalEvent) internal); this.s3Key = s3Event.getS3Key(); this.s3Bucket = s3Event.getS3Bucket(); this.s3KeyVersion = s3Event.getS3KeyVersion(); this.functionName = internal.getCtx().getContext().getFunctionName(); this.functionVersion = internal.getCtx().getContext().getFunctionVersion(); this.processingTime = System.currentTimeMillis(); this.timestamp = internal.getEventTime(); this.processingDelay = processingTime - timestamp; this.sha1Hash = internal.getEventSha1Hash(); if (internal.getEventObj() != null) { this.payload = internal.getEventObj().getPayload(); } else { this.payload = null; } }
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); }
private KinesisWrapper(final InternalEvent internal) { KinesisEventRecord eventRecord = ((KinesisInternalEvent) internal).getRecord(); Record record = eventRecord.getKinesis(); this.partitionKey = record.getPartitionKey(); this.sequenceNumber = record.getSequenceNumber(); this.eventSource = eventRecord.getEventSource(); this.sourceArn = eventRecord.getEventSourceARN(); this.functionName = internal.getCtx().getContext().getFunctionName(); this.functionVersion = internal.getCtx().getContext().getFunctionVersion(); this.processingTime = System.currentTimeMillis(); this.arrivalTime = record.getApproximateArrivalTimestamp().getTime(); this.timestamp = internal.getEventTime(); this.processingDelay = processingTime - timestamp; if (internal.getEventObj() != null) { this.payload = internal.getEventObj().getPayload(); } else { this.payload = null; } }
/** * Performs a field substitution with the lambda invocation context as the source. * * @param ievent * @param config */ private Map<String, String> getContext(InternalEvent ievent) { Map<String, String> contexts = ievent.getCtx().getContextAsMap(); if (!this.includes.isEmpty()) { contexts.keySet().retainAll(this.includes); } this.excludes.forEach(exclude -> { contexts.remove(exclude); }); return contexts; } }
@Override public void handler(List<DummyEvent> events, Context context) throws HandlerException { if (!initialized) { init(context); } this.eventIterator = new DummyEventIterator(events, new LambdaContext(context)); this.process(context); }
private KinesisWrapper(final InternalEvent internal) { KinesisEventRecord eventRecord = ((KinesisInternalEvent) internal).getRecord(); Record record = eventRecord.getKinesis(); this.partitionKey = record.getPartitionKey(); this.sequenceNumber = record.getSequenceNumber(); this.eventSource = eventRecord.getEventSource(); this.sourceArn = eventRecord.getEventSourceARN(); this.functionName = internal.getCtx().getContext().getFunctionName(); this.functionVersion = internal.getCtx().getContext().getFunctionVersion(); this.processingTime = System.currentTimeMillis(); this.arrivalTime = record.getApproximateArrivalTimestamp().getTime(); this.timestamp = internal.getEventTime(); this.processingDelay = processingTime - timestamp; if (internal.getEventObj() != null) { this.payload = internal.getEventObj().getPayload(); } else { this.payload = null; } }
@Override public void handler(Iterator<DummyEvent> events, Context context) throws HandlerException { if (!initialized) { init(context); } this.eventIterator = new DummyEventIterator(events, new LambdaContext(context)); this.process(context); }
public void handler(KinesisEvent event, Context context) throws HandlerException { if (!initialized) { init(context); } KinesisHandlerConfig handlerConfig = (KinesisHandlerConfig) this.config.getHandlerConfig(); this.recordIterator = new KinesisEventIterator(new LambdaContext(context), event.getRecords(), handlerConfig.getAddShardIdToPartitions()); /* * Get processors based on the source stream ARN */ KinesisEventRecord firstRecord = event.getRecords().get(0); this.source = SourceUtils.getSource(firstRecord.getEventSourceARN(), sources); super.process(context); }
public void handler(KinesisEvent event, Context context) throws HandlerException { if (!initialized) { init(context); } KinesisHandlerConfig handlerConfig = (KinesisHandlerConfig) this.config.getHandlerConfig(); this.recordIterator = new KinesisEventIterator(new LambdaContext(context), event.getRecords(), handlerConfig.getAddShardIdToPartitions()); /* * Get processors based on the source stream ARN */ KinesisEventRecord firstRecord = event.getRecords().get(0); this.source = SourceUtils.getSource(firstRecord.getEventSourceARN(), sources); super.process(context); }
new S3EventIterator(new LambdaContext(context), toProcess, s3ClientFactory);
new S3EventIterator(new LambdaContext(context), toProcess, s3ClientFactory);
new S3EventIterator(new LambdaContext(context), toProcess, s3ClientFactory);
new S3EventIterator(new LambdaContext(context), toProcess, s3ClientFactory);