4 # :title: TokyoCabinet B+Tree registry implementation
6 # TokyoCabinet is a "modern implementation of the DBM".
7 # http://fallabs.com/tokyocabinet/
10 require 'tokyocabinet'
16 class TokyoCabinetAccessor < AbstractAccessor
18 def initialize(filename)
19 super filename + '.tdb'
25 @registry = TokyoCabinet::BDB.new
26 @registry.open(@filename,
27 TokyoCabinet::BDB::OREADER |
28 TokyoCabinet::BDB::OCREAT |
29 TokyoCabinet::BDB::OWRITER)
35 return unless @registry
40 return unless @registry
45 return default unless dbexists?
47 registry.delete(key.to_s)
48 value # return deleted value if success