fluent-plugin-dynamodb-streams 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/fluent-plugin-dynamodb-streams.gemspec +1 -1
- data/lib/fluent/plugin/in_dynamodb_streams.rb +23 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f6a67b282ccec2e95492d9d2591364f27670987
|
4
|
+
data.tar.gz: 4d199387a7dd7fd3c1b3730365496e402feb5f62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9371ef516f73f4a9024ff75f622418c4ed7347acd0644683ed71d70bbc178c35c72ce81f7410181bbe6f8fcddd3be63d4c91a7f80c85c5d089fd919a311ec2e
|
7
|
+
data.tar.gz: 62379f3119c5f875d5a5d0efda77747c61eb488d563e6338efe7457cc64832ed4ac74ece38c0893cf9fcac0415843a9d3195c8218bf2f6aaf02e83019efb4474
|
data/README.md
CHANGED
@@ -2,8 +2,9 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/fluent-plugin-dynamodb-streams.svg)](http://badge.fury.io/rb/fluent-plugin-dynamodb-streams)
|
4
4
|
[![Build Status](https://travis-ci.org/takus/fluent-plugin-dynamodb-streams.svg?branch=master)](https://travis-ci.org/takus/fluent-plugin-dynamodb-streams)
|
5
|
-
[![Code Climate](https://codeclimate.com/github/takus/fluent-plugin-dynamodb-streams/badges/gpa.svg)](https://codeclimate.com/github/takus/fluent-plugin-dynamodb-streams)
|
6
5
|
[![Test Coverage](https://codeclimate.com/github/takus/fluent-plugin-dynamodb-streams/badges/coverage.svg)](https://codeclimate.com/github/takus/fluent-plugin-dynamodb-streams/coverage)
|
6
|
+
[![Code Climate](https://codeclimate.com/github/takus/fluent-plugin-dynamodb-streams/badges/gpa.svg)](https://codeclimate.com/github/takus/fluent-plugin-dynamodb-streams)
|
7
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/grade/a9fc76d35c8d4175bcb23e5c4b38fb85)](https://www.codacy.com/app/takus/fluent-plugin-dynamodb-streams)
|
7
8
|
|
8
9
|
Fluentd input plugin for [AWS DynamoDB Streams](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Streams.html).
|
9
10
|
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-plugin-dynamodb-streams"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.3"
|
8
8
|
spec.authors = ["Takumi Sakamoto"]
|
9
9
|
spec.email = ["takumi.saka@gmail.com"]
|
10
10
|
spec.summary = %q{Amazon DynamoDB Streams input plugin for Fluentd}
|
@@ -44,7 +44,7 @@ module Fluent
|
|
44
44
|
unless @pos_file
|
45
45
|
@pos_memory = {}
|
46
46
|
end
|
47
|
-
|
47
|
+
|
48
48
|
options = {}
|
49
49
|
options[:region] = @aws_region if @aws_region
|
50
50
|
options[:credentials] = Aws::Credentials.new(@aws_key_id, @aws_sec_key) if @aws_key_id && @aws_sec_key
|
@@ -66,10 +66,7 @@ module Fluent
|
|
66
66
|
while @running
|
67
67
|
sleep @fetch_interval
|
68
68
|
|
69
|
-
|
70
|
-
stream_arn: @stream_arn
|
71
|
-
}).stream_description.shards.each do |s|
|
72
|
-
|
69
|
+
get_shards.each do |s|
|
73
70
|
if s.sequence_number_range.ending_sequence_number
|
74
71
|
remove_sequence(s.shard_id)
|
75
72
|
next
|
@@ -100,6 +97,27 @@ module Fluent
|
|
100
97
|
end
|
101
98
|
end
|
102
99
|
|
100
|
+
def get_shards()
|
101
|
+
shards = []
|
102
|
+
|
103
|
+
last_shard_id = nil
|
104
|
+
begin
|
105
|
+
s = @client.describe_stream({
|
106
|
+
stream_arn: @stream_arn,
|
107
|
+
exclusive_start_shard_id: last_shard_id,
|
108
|
+
}).stream_description
|
109
|
+
|
110
|
+
shards = shards + s.shards
|
111
|
+
|
112
|
+
if s.last_evaluated_shard_id == last_shard_id then
|
113
|
+
break
|
114
|
+
end
|
115
|
+
last_shard_id = s.last_evaluated_shard_id
|
116
|
+
end while last_shard_id
|
117
|
+
|
118
|
+
shards
|
119
|
+
end
|
120
|
+
|
103
121
|
def set_iterator(shard_id)
|
104
122
|
if load_sequence(shard_id)
|
105
123
|
@iterator[shard_id] = @client.get_shard_iterator({
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-dynamodb-streams
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takumi Sakamoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|