Module: Fluent::FlydataSyncDiffBased

Defined in:
lib/flydata/fluent-plugins/flydata_plugin_ext/flydata_sync_diff_based.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.include_modules(base) ⇒ Object



6
7
8
9
# File 'lib/flydata/fluent-plugins/flydata_plugin_ext/flydata_sync_diff_based.rb', line 6

def self.include_modules(base)
  base.send(:include, FlydataSync)
  base.send(:include, self)
end

.included(base) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/flydata/fluent-plugins/flydata_plugin_ext/flydata_sync_diff_based.rb', line 11

def self.included(base)
  base.class_eval do
    config_param :fetch_interval, :time, default: 60   # 1 minute
    config_param :retry_interval, :time, default: 30   # 30 seconds
    config_param :emit_chunk_limit, :size, default: 64 * (1024 ** 2)   # 64MB, should be equal or less than buffer_chunk_limit
  end
end

Instance Method Details

#configure(conf) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/flydata/fluent-plugins/flydata_plugin_ext/flydata_sync_diff_based.rb', line 19

def configure(conf)
  super
  @table_src_pos_files = @tables.inject({}) do |ret, table_name|
    ret[table_name.to_sym] = self.class::SOURCE_POSITION_FILE_CLASS.new(
      @sync_fm.table_source_pos_file_path(table_name)
    )
    ret
  end
end