repo.or.cz
/
metropolis.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Rakefile: kill raa_update task
[metropolis.git]
/
lib
/
metropolis
/
tc
/
hdb
/
ex.rb
blob
d205a76da6be41f3f70325172e5681159bf6592e
1
module Metropolis::TC::HDB::EX
2
def self.extended(obj)
3
obj.instance_eval do
4
@wr_flags |= @rd_flags
5
@rd_flags = nil
6
@dbv.each { |(hdb, path)|
7
hdb.open(path, @wr_flags) or ex!(:open, hdb)
8
}
9
@ex_dbv = @dbv.map { |(hdb,_)| hdb }
10
end
11
end
12
13
def reader(key)
14
yield @ex_dbv[multi_hash(key) % @nr_slots]
15
end
16
17
alias_method :writer, :reader
18
end