Module: Higgs::TransactionManager::InitOptions
- Included in:
- Higgs::TransactionManager
- Defined in:
- lib/higgs/tman.rb
Overview
options for Higgs::TransactionManager
Instance Attribute Summary collapse
-
#read_only ⇒ Object
readonly
Returns the value of attribute read_only.
Instance Method Summary collapse
-
#init_options(options) ⇒ Object
these options are defined.
Instance Attribute Details
#read_only ⇒ Object (readonly)
Returns the value of attribute read_only.
84 85 86 |
# File 'lib/higgs/tman.rb', line 84 def read_only @read_only end |
Instance Method Details
#init_options(options) ⇒ Object
these options are defined.
:read_only
-
if
true
then transaction is always read-only. default isfalse
.:standby
is standby mode. in standby mode, transaction is read-only and Higgs::TransactionManager#apply_journal_log is callable. if Higgs::TransactionManager#switch_to_write is called in standby mode then state of manager changes from standby mode to read-write mode. :decode
-
procedure to decode data on read. if
:string_only
property at an entry istrue
thendecode
is not used to read the entry. default isproc{|r| r }
. :encode
-
procedure to encode data on write. if
:string_only
property at an entry istrue
thenencode
is not used to write the entry. default isproc{|w| w }
. :lock_manager
-
lock of a transaction and individual data. default is a new instance of Higgs::GiantLockManager.
:master_cache
-
read-cache for encoded string data. defauilt is a new instance of Higgs::LRUCache.
:secondary_cache
-
secondary read-cache for encoded string data. key of cache is always unique string. default is no effect.
:jlog_apply_dir
-
journal logs under the directory of this parameter is applied to storage on call of Higgs::TransactionManager#apply_journal_log
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/higgs/tman.rb', line 69 def () if (.key? :read_only) then @read_only = [:read_only] else @read_only = false end @decode = [:decode] || proc{|r| r } @encode = [:encode] || proc{|w| w } @lock_manager = [:lock_manager] || GiantLockManager.new @master_cache = [:master_cache] || LRUCache.new @secondary_cache = [:secondary_cache] || PseudoSecondaryCache.instance @jlog_apply_dir = [:jlog_apply_dir] || nil end |