Class: Fluent::CassandraInsertor
- Inherits:
-
BufferedOutput
- Object
- BufferedOutput
- Fluent::CassandraInsertor
- Includes:
- CassandraConnection
- Defined in:
- lib/fluent/plugin/out_cassandra_insert.rb
Instance Method Summary collapse
-
#configure(conf) ⇒ Object
shutdown.
-
#format(tag, time, record) ⇒ Object
configure.
-
#shutdown ⇒ Object
start.
- #start ⇒ Object
- #write(chunk) ⇒ Object
Methods included from CassandraConnection
Instance Method Details
#configure(conf) ⇒ Object
shutdown
32 33 34 35 36 |
# File 'lib/fluent/plugin/out_cassandra_insert.rb', line 32 def configure(conf) super @insertValue = self.insert_value end |
#format(tag, time, record) ⇒ Object
configure
38 39 40 |
# File 'lib/fluent/plugin/out_cassandra_insert.rb', line 38 def format(tag, time, record) record.to_msgpack end |
#shutdown ⇒ Object
start
27 28 29 30 |
# File 'lib/fluent/plugin/out_cassandra_insert.rb', line 27 def shutdown super @session.close if @session end |
#start ⇒ Object
22 23 24 25 |
# File 'lib/fluent/plugin/out_cassandra_insert.rb', line 22 def start super @session ||= get_session(self.host, self.port, self.keyspace, self.connect_timeout, self.username, self.password) end |
#write(chunk) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/fluent/plugin/out_cassandra_insert.rb', line 42 def write(chunk) chunk.msgpack_each { |record| @insertValue = prepareParameter(@insertValue, record) insertCassandra(@insertValue) } end |