Class: Fluentd::Setting::OutMongo
- Inherits:
-
Object
- Object
- Fluentd::Setting::OutMongo
show all
- Includes:
- Common
- Defined in:
- app/models/fluentd/setting/out_mongo.rb
Constant Summary
collapse
- KEYS =
[
:match,
:host, :port, :database, :collection, :capped, :capped_size, :capped_max, :user, :password, :tag_mapped,
:buffer_type, :buffer_path, :buffer_queue_limit, :buffer_chunk_limit, :flush_interval, :retry_wait, :retry_limit, :max_retry_wait, :num_threads,
].freeze
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Common
#boolenan, #child_class, #children_of, #column_type, #conf, #empty_value?, #flag, #input_plugin?, #output_plugin?, #plugin_type_name, #print_if_present, #to_config, #values_of
Class Method Details
.initial_params ⇒ Object
35
36
37
38
39
40
41
42
|
# File 'app/models/fluentd/setting/out_mongo.rb', line 35
def self.initial_params
{
host: "127.0.0.1",
port: 27017,
capped: true,
capped_size: "100m",
}
end
|
Instance Method Details
#advanced_options ⇒ Object
51
52
53
54
55
56
|
# File 'app/models/fluentd/setting/out_mongo.rb', line 51
def advanced_options
[
:capped, :capped_size, :capped_max, :buffer_type, :buffer_path, :buffer_queue_limit, :buffer_chunk_limit,
:flush_interval, :retry_wait, :retry_limit, :max_retry_wait, :num_threads,
]
end
|
#common_options ⇒ Object
44
45
46
47
48
49
|
# File 'app/models/fluentd/setting/out_mongo.rb', line 44
def common_options
[
:match, :host, :port, :database, :collection,
:tag_mapped, :user, :password,
]
end
|
#validate_capped ⇒ Object
24
25
26
27
|
# File 'app/models/fluentd/setting/out_mongo.rb', line 24
def validate_capped
return true if capped.blank?
errors.add(:capped_size, :blank) if capped_size.blank?
end
|
#validate_collection ⇒ Object
29
30
31
32
33
|
# File 'app/models/fluentd/setting/out_mongo.rb', line 29
def validate_collection
if tag_mapped.blank? && collection.blank?
errors.add(:collection, :blank)
end
end
|