@@ -16,16 +16,24 @@ executable. A record processor in Ruby typically looks something like:
16
16
require ' aws/kclrb'
17
17
18
18
class SampleRecordProcessor < Aws ::KCLrb ::RecordProcessorBase
19
- def init_processor (shard_id )
19
+ def init_processor (initialize_input )
20
20
# initialize
21
21
end
22
22
23
- def process_records (records , checkpointer )
23
+ def process_records (process_records_input )
24
24
# process batch of records
25
25
end
26
26
27
- def shutdown (checkpointer , reason )
28
- # cleanup
27
+ def lease_lost (lease_lost_input )
28
+ # lease was lost, cleanup
29
+ end
30
+
31
+ def shard_ended (shard_ended_input )
32
+ # shard has ended, cleanup
33
+ end
34
+
35
+ def shutdown_requested (shutdown_requested_input )
36
+ # shutdown has been requested
29
37
end
30
38
end
31
39
@@ -69,10 +77,11 @@ The sample application consists of two components:
69
77
The following defaults are used in the sample application:
70
78
71
79
* * Stream name* : ` kclrbsample `
80
+ * * Region* : ` us-east-1 `
72
81
* * Number of shards* : 2
73
82
* * Amazon KCL application name* : ` RubyKCLSample `
74
- * * Amazon DynamoDB table for Amazon KCL application* : ` RubyKCLSample `
75
- * * Sample application output directory * : ` /tmp/kclrbsample/ `
83
+ * * Amazon DynamoDB table for KCL application* : ` RubyKCLSample `
84
+ * * Amazon CloudWatch metrics namespace for KCL application * : ` RubyKCLSample `
76
85
77
86
### Running the Data Producer
78
87
@@ -105,7 +114,7 @@ To run the data processor, run the following commands:
105
114
106
115
``` sh
107
116
cd samples
108
- rake run
117
+ rake run properties_file=sample.properties
109
118
```
110
119
111
120
#### Notes
@@ -118,6 +127,7 @@ To run the data processor, run the following commands:
118
127
* ` executableName = samples/sample_kcl.rb `
119
128
* ` streamName = kclrbsample `
120
129
* ` applicationName = RubyKCLSample `
130
+ * ` regionName = us-east-1 `
121
131
122
132
### Cleaning Up
123
133
@@ -126,7 +136,7 @@ create a real DynamoDB table to track the Amazon KCL application state, thus pot
126
136
incurring AWS costs. Once done, you can log in to AWS management console and delete these
127
137
resources. Specifically, the sample application will create in your default AWS region
128
138
129
- * an * Amazon Kinesis stream * named ` kclrbsample `
139
+ * an * Amazon Kinesis Data Stream * named ` kclrbsample `
130
140
* an * Amazon DynamoDB table* named ` RubyKCLSample `
131
141
132
142
## Running on Amazon EC2
@@ -147,7 +157,7 @@ Amazon Linux can be found at `/usr/bin/java` and should be 1.7 or greater.
147
157
cd kclrb/samples
148
158
rake run_producer
149
159
# ... and in another terminal
150
- rake run
160
+ rake run properties_file=sample.properties
151
161
```
152
162
153
163
## Under the Hood - What You Should Know about Amazon KCL's [ MultiLangDaemon] [ multi-lang-daemon ]
0 commit comments