Class: Fluent::RedisMultiTypeCounterOutput::RecordKey

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/out_redis_multi_type_counter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(count_key, count_hash_key, count_zset_key, store_list) ⇒ RecordKey

Returns a new instance of RecordKey.



105
106
107
108
109
110
# File 'lib/fluent/plugin/out_redis_multi_type_counter.rb', line 105

def initialize(count_key, count_hash_key, count_zset_key, store_list)
  @count_key = count_key
  @count_hash_key = count_hash_key
  @count_zset_key = count_zset_key
  @store_list = store_list
end

Instance Attribute Details

#count_hash_keyObject (readonly)

Returns the value of attribute count_hash_key.



103
104
105
# File 'lib/fluent/plugin/out_redis_multi_type_counter.rb', line 103

def count_hash_key
  @count_hash_key
end

#count_keyObject (readonly)

Returns the value of attribute count_key.



103
104
105
# File 'lib/fluent/plugin/out_redis_multi_type_counter.rb', line 103

def count_key
  @count_key
end

#count_zset_keyObject (readonly)

Returns the value of attribute count_zset_key.



103
104
105
# File 'lib/fluent/plugin/out_redis_multi_type_counter.rb', line 103

def count_zset_key
  @count_zset_key
end

#store_listObject (readonly)

Returns the value of attribute store_list.



103
104
105
# File 'lib/fluent/plugin/out_redis_multi_type_counter.rb', line 103

def store_list
  @store_list
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


125
126
127
128
# File 'lib/fluent/plugin/out_redis_multi_type_counter.rb', line 125

def eql?(other)
  return @count_key.eql?(other.count_key) && @count_hash_key.eql?(other.count_hash_key) && 
    @count_zset_key.eql?(other.count_zset_key)
end

#hashObject



112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/fluent/plugin/out_redis_multi_type_counter.rb', line 112

def hash
  hash_key = ""

  keys = [@count_key, @count_hash_key, @count_zset_key]
  keys.select { |key| 
    key != nil
  }.each { |key|
    hash_key += ("@@@@" + key)
  }

  hash_key.hash
end