Class: DistributedTrie::KvsTc
- Defined in:
- lib/distributedtrie/kvs/tokyocabinet.rb
Overview
Tokyo Cabinet implementation
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
Instance Method Summary collapse
-
#initialize(dbFilename) ⇒ KvsTc
constructor
A new instance of KvsTc.
Methods inherited from KvsBase
Methods inherited from KvsIf
#_getInternal, #delete, #get, #put!
Constructor Details
#initialize(dbFilename) ⇒ KvsTc
Returns a new instance of KvsTc.
41 42 43 44 45 46 47 |
# File 'lib/distributedtrie/kvs/tokyocabinet.rb', line 41 def initialize( dbFilename ) if not dbFilename.match( /[.]tch$/ ) raise ArgumentError, "Info KvsTc.new() method get only '*.tch' suffix" end @db = TokyoCabinet::HDB.new( ) @db.open( dbFilename, TokyoCabinet::HDB::OWRITER | TokyoCabinet::HDB::OCREAT ) end |
Instance Attribute Details
#db ⇒ Object (readonly)
Returns the value of attribute db.
49 50 51 |
# File 'lib/distributedtrie/kvs/tokyocabinet.rb', line 49 def db @db end |