class Fluent::Plugin::GriddbOutput

Constants

DEFAULT_BUFFER_TYPE
DEFAULT_FORMATTER

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_griddb.rb, line 22
def initialize
  super
end

Public Instance Methods

configure(conf) click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_griddb.rb, line 35
def configure(conf)
  compat_parameters_convert(conf, :buffer, :formatter)
  super
          
          if @host.nil? || @host.empty?
                  raise Fluent::ConfigError, "Host must be not null or empty"
          end
          
          if @cluster.nil? || @cluster.empty?
                  raise Fluent::ConfigError, "Cluster must be not null or empty"
          end
          
          if @database.nil? || @database.empty?
                  raise Fluent::ConfigError, "Database must be not null or empty"
          end
          
          if @container.nil? || @container.empty?
                  raise Fluent::ConfigError, "Container must be not null or empty"
          end
          
          if @username.nil? || @username.empty?
                  raise Fluent::ConfigError, "Username must be not null or empty"
          end
          
          if @password.nil? || @password.empty?
                  raise Fluent::ConfigError, "Password must be not null or empty"
          end
  
          raise Fluent::ConfigError, "'tag' in chunk_keys is required." if !@chunk_key_tag && @buffered 
          
  if @formatter_config = conf.elements('format').first
    log.warn "griddb out plugin is not support format section"
  end
end
format(tag, time, record) click to toggle source

Format data is auto supported by Fluentd

# File lib/fluent/plugin/out_griddb.rb, line 83
def format(tag, time, record)
          [time, record].to_msgpack
end
formatted_to_msgpack_binary?() click to toggle source
# File lib/fluent/plugin/out_griddb.rb, line 87
def formatted_to_msgpack_binary?
  true
end
handle_record(tag, time, record) click to toggle source

Put record to server

# File lib/fluent/plugin/out_griddb.rb, line 96
    def handle_record(tag, time, record)
  req, uri = create_request(record)
  send_request(req, uri)
end
multi_workers_ready?() click to toggle source
# File lib/fluent/plugin/out_griddb.rb, line 91
def multi_workers_ready?
  true
end
prefer_buffered_processing() click to toggle source
# File lib/fluent/plugin/out_griddb.rb, line 78
def prefer_buffered_processing
  @buffered
end
process(tag, es) click to toggle source

Overwrite when Not use buffer

# File lib/fluent/plugin/out_griddb.rb, line 102
def process(tag, es)
  es.each do |time, record|                
            arrays_2 = convert(record)
    handle_record(tag, time, arrays_2)
  end
end
shutdown() click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_griddb.rb, line 74
def shutdown
  super
end
start() click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_griddb.rb, line 70
def start
  super
end
write(chunk) click to toggle source

Overwrite when use buffer

# File lib/fluent/plugin/out_griddb.rb, line 110
def write(chunk)
  tag = chunk.metadata.tag                
  $real_container = extract_placeholders(@container, chunk)
          arrays_2 = chunk_convert(chunk)
          handle_record(tag, DateTime.now, arrays_2)
end