Skip to content

Commit 03118c5

Browse files
sahilpalviapfifer
authored andcommitted
Updating documentation (#32)
* Updating documentation for aws-kclrb 2.0.0 * Fixing sample
1 parent d5c2bba commit 03118c5

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,24 @@ executable. A record processor in Ruby typically looks something like:
1616
require 'aws/kclrb'
1717

1818
class SampleRecordProcessor < Aws::KCLrb::RecordProcessorBase
19-
def init_processor(shard_id)
19+
def init_processor(initialize_input)
2020
# initialize
2121
end
2222

23-
def process_records(records, checkpointer)
23+
def process_records(process_records_input)
2424
# process batch of records
2525
end
2626

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
2937
end
3038
end
3139

@@ -69,10 +77,11 @@ The sample application consists of two components:
6977
The following defaults are used in the sample application:
7078

7179
* *Stream name*: `kclrbsample`
80+
* *Region*: `us-east-1`
7281
* *Number of shards*: 2
7382
* *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`
7685

7786
### Running the Data Producer
7887

@@ -105,7 +114,7 @@ To run the data processor, run the following commands:
105114

106115
```sh
107116
cd samples
108-
rake run
117+
rake run properties_file=sample.properties
109118
```
110119

111120
#### Notes
@@ -118,6 +127,7 @@ To run the data processor, run the following commands:
118127
* `executableName = samples/sample_kcl.rb`
119128
* `streamName = kclrbsample`
120129
* `applicationName = RubyKCLSample`
130+
* `regionName = us-east-1`
121131

122132
### Cleaning Up
123133

@@ -126,7 +136,7 @@ create a real DynamoDB table to track the Amazon KCL application state, thus pot
126136
incurring AWS costs. Once done, you can log in to AWS management console and delete these
127137
resources. Specifically, the sample application will create in your default AWS region
128138

129-
* an *Amazon Kinesis stream* named `kclrbsample`
139+
* an *Amazon Kinesis Data Stream* named `kclrbsample`
130140
* an *Amazon DynamoDB table* named `RubyKCLSample`
131141

132142
## Running on Amazon EC2
@@ -147,7 +157,7 @@ Amazon Linux can be found at `/usr/bin/java` and should be 1.7 or greater.
147157
cd kclrb/samples
148158
rake run_producer
149159
# ... and in another terminal
150-
rake run
160+
rake run properties_file=sample.properties
151161
```
152162

153163
## Under the Hood - What You Should Know about Amazon KCL's [MultiLangDaemon][multi-lang-daemon]

samples/sample_kcl.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
class SampleRecordProcessor < Aws::KCLrb::V2::RecordProcessorBase
2828
# (see Aws::KCLrb::V2::RecordProcessorBase#init_processor)
2929
def init_processor(initialize_input)
30-
@shard_id = initialize_input['shardId']
30+
@shard_id = initialize_input.shard_id
3131
@checkpoint_freq_seconds = 10
3232
end
3333

0 commit comments

Comments
 (0)