Shutdown is invoked by the Amazon Kinesis Client Library to indicate it will no longer send data records to this RecordProcessor instance.
(input *interfaces.ShutdownInput)
| 270 | // Shutdown is invoked by the Amazon Kinesis Client Library to indicate it will |
| 271 | // no longer send data records to this RecordProcessor instance. |
| 272 | func (p *recordProcessor) Shutdown(input *interfaces.ShutdownInput) { |
| 273 | log.WithFields(log.Fields{ |
| 274 | "shard": p.shardID, |
| 275 | "reason": aws.StringValue(interfaces.ShutdownReasonMessage(input.ShutdownReason)), |
| 276 | }).Info("Shutting down a KCL record processor") |
| 277 | |
| 278 | // The shard is closed and completely read, so we checkpoint the nil value that informs |
| 279 | // vmware-go-kcl about that fact |
| 280 | if input.ShutdownReason == interfaces.TERMINATE { |
| 281 | if err := input.Checkpointer.Checkpoint(nil); err != nil { |
| 282 | log.Errorf("Error checkpointing nil: %v", err) |
| 283 | } |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | // Initialize is invoked by the Amazon Kinesis Client Library before data |
| 288 | // records are delivered to the RecordProcessor instance (via processRecords). |