fluent-plugin-ilm_hbase 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7196bc7b6d0b83505d43c17b24faeecfd0ce6b7
4
- data.tar.gz: bed4db35b2f619fb5efa09aa74f83ff24b1644b1
3
+ metadata.gz: f19171bee111d1750ff276142aef2c4e36abe435
4
+ data.tar.gz: 19939bd172473245c2de7d8efff4748f092ebb4a
5
5
  SHA512:
6
- metadata.gz: db4027c78077da4bfd6a134dd3c5d982af6a6c769278bd9f17da3e3bfcb6bf7cfbe48e27423f9323d1890bd83e1b693aee00f768cf0144efca68f3ec63b551ec
7
- data.tar.gz: 993cd81551652459a22200667160f519188730a766cc076e978c6d1be00a8fe1d92db84d1a616d55e98941e91715c3265bb5984ee6440611a06775c6fdf46465
6
+ metadata.gz: 67109ee1d0550e0a99922437969f2069a2795156b43a13323f86d45f13670816201926fb39f597fa48020815de3df4fa9a03d23f2f3310b0a825efd852ad1fb5
7
+ data.tar.gz: 636f4992faed72f2dbd4b661053df52673abe6af6eb95896f2238c6dfc31d28eb410691a72f51abe953b45a8d0391084d4b6f447257e528ab9baed610db76309
@@ -20,8 +20,8 @@ module Fluent
20
20
  config_set_default :time_key, nil
21
21
 
22
22
 
23
- config_param :include_custom_timestamp, :bool, :default=>false
24
- config_param :custom_time_stamp_key, :string, :default => nil
23
+ config_param :include_custom_row_key, :bool, :default=>false
24
+ config_param :custom_key_list, :string, :default => nil
25
25
  config_param :tag_column_name, :string, :default => nil
26
26
  config_param :time_column_name, :string, :default => nil
27
27
  config_param :fields_to_columns_mapping, :string
@@ -35,8 +35,8 @@ module Fluent
35
35
  src_to_dst.split("=>")
36
36
  }
37
37
  @mapping = Hash[*@fields_to_columns.flatten]
38
- @rowchangeflag = @include_custom_timestamp
39
- @timekey = @custom_time_stamp_key
38
+ @rowchangeflag = @include_custom_row_key
39
+ @rowkeys = @custom_key_list.split(",")
40
40
  @customrow = SecureRandom.uuid
41
41
  end
42
42
 
@@ -94,17 +94,20 @@ MESSAGE
94
94
  end
95
95
 
96
96
  def write(chunk)
97
- if @rowchangeflag
97
+ row_key = ""
98
+ row_attrs = Array.new
99
+ if @rowchangeflag
98
100
  chunk.msgpack_each {|row_values|
99
- row_values.each {|column_family_and_column, value|
100
- if column_family_and_column == @custom_time_stamp_key
101
- @customrow = value
102
- end
103
-
104
- }
105
-
106
- }
107
- end
101
+
102
+ row_attrs << row_values.select do |column_family_and_column, value|
103
+ rowkeys.include? column_family_and_column
104
+ end.map do |column_family_and_column, value| value end
105
+
106
+ }
107
+ head, *tail = row_attrs
108
+ row_key << head
109
+ tail.each do |value| row_key << "-"; row_key << value; end
110
+ end
108
111
  chunk.msgpack_each {|row_values|
109
112
  event = {}
110
113
 
@@ -115,7 +118,7 @@ MESSAGE
115
118
  }
116
119
 
117
120
  row = MassiveRecord::Wrapper::Row.new
118
- row.id = @customrow
121
+ row.id = row_key
119
122
  row.values = event
120
123
  row.table = @table
121
124
  row.save
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-ilm_hbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - testman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-28 00:00:00.000000000 Z
11
+ date: 2017-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler