class Fluent::Plugin::Storage

Constants

DEFAULT_TYPE

Attributes

log[RW]

Public Class Methods

validate_key(key) click to toggle source
# File lib/fluent/plugin/storage.rb, line 34
def self.validate_key(key)
  raise ArgumentError, "key must be a string (or symbol for to_s)" unless key.is_a?(String) || key.is_a?(Symbol)
  key.to_s
end

Public Instance Methods

delete(key) click to toggle source
# File lib/fluent/plugin/storage.rb, line 74
def delete(key)
  # return deleted value
  raise NotImplementedError, "Implement this method in child class"
end
fetch(key, defval) click to toggle source
# File lib/fluent/plugin/storage.rb, line 65
def fetch(key, defval)
  raise NotImplementedError, "Implement this method in child class"
end
get(key) click to toggle source
# File lib/fluent/plugin/storage.rb, line 61
def get(key)
  raise NotImplementedError, "Implement this method in child class"
end
implementation() click to toggle source
# File lib/fluent/plugin/storage.rb, line 49
def implementation
  self
end
load() click to toggle source
# File lib/fluent/plugin/storage.rb, line 53
def load
  # load storage data from any data source, or initialize storage internally
end
persistent_always?() click to toggle source
# File lib/fluent/plugin/storage.rb, line 41
def persistent_always?
  false
end
put(key, value) click to toggle source
# File lib/fluent/plugin/storage.rb, line 69
def put(key, value)
  # return value
  raise NotImplementedError, "Implement this method in child class"
end
save() click to toggle source
# File lib/fluent/plugin/storage.rb, line 57
def save
  # save internal data store into data source (to be loaded)
end
synchronized?() click to toggle source
# File lib/fluent/plugin/storage.rb, line 45
def synchronized?
  false
end
update(key, &block) click to toggle source
# File lib/fluent/plugin/storage.rb, line 79
def update(key, &block) # transactional get-and-update
  raise NotImplementedError, "Implement this method in child class"
end