store-digest 0.1.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/TODO.org +37 -0
- data/lib/store/digest/driver/lmdb.rb +2 -0
- data/lib/store/digest/driver.rb +19 -0
- data/lib/store/digest/meta/lmdb.rb +1025 -357
- data/lib/store/digest/meta.rb +178 -5
- data/lib/store/digest/object.rb +144 -39
- data/lib/store/digest/version.rb +1 -1
- data/lib/store/digest.rb +28 -23
- data/store-digest.gemspec +11 -9
- metadata +42 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7f43c259332c6cc6088efb366ad28d2147b94e8c4e1cfb5441033ebaac252243
|
|
4
|
+
data.tar.gz: 2a99ec000985e57084b152b760810a4aef3cc62cc11fa69429207a5258bd531c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 93aa7826a0e4264dbf9c968616d4095b083aec7d595075a42de888988209f9e0707d6a1329d406164d9c96cd3477eb326011b52d2498bae500fb4bbc1b316b6d
|
|
7
|
+
data.tar.gz: 9e032440c5305f600a29b9ffb814da91212c0757c755f0ce9ba46a2d85b19c80f0f664d7ab17d073ace412bd4d0b9721ea43b35015ff4cbf7300b9d66c12674b
|
data/TODO.org
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#+STARTUP: showall indent hidestars
|
|
2
|
+
* TODO upgrade metadata format
|
|
3
|
+
- [ ] get rid of the idea of a 'primary' digest algorithm
|
|
4
|
+
- [ ] change the main record to being keyed by integers and contain all hashes
|
|
5
|
+
- old: ≥209 bytes + 316 mapping
|
|
6
|
+
- new: ≥218 + 220 mapping
|
|
7
|
+
- [ ] make digest -> integer mapping
|
|
8
|
+
- [ ] add version to metadata
|
|
9
|
+
- [ ] add function to upgrade metadata store
|
|
10
|
+
* TODO add cache capability
|
|
11
|
+
- [ ] add fields to control:
|
|
12
|
+
- [ ] total bytes in cache
|
|
13
|
+
- [ ] total objects in cache
|
|
14
|
+
- [ ] cache clearing mechanism
|
|
15
|
+
- [ ] hook cache expiration to adding a new object
|
|
16
|
+
- [ ] decrement bytes and count for both cache and main data from control
|
|
17
|
+
- [ ] increment deleted bytes and count
|
|
18
|
+
- [ ] when cache is overwritten by the identical non-cache object, it does the right thing
|
|
19
|
+
- [ ] clear cache flag from the metadata record
|
|
20
|
+
- [ ] decrement cache summaries from control database
|
|
21
|
+
* TODO add indices
|
|
22
|
+
- [ ] qualitative attributes
|
|
23
|
+
- [ ] content-type
|
|
24
|
+
- [ ] language
|
|
25
|
+
- [ ] charset
|
|
26
|
+
- [ ] encoding
|
|
27
|
+
- [ ] time stamps
|
|
28
|
+
- [ ] created (record added to store)
|
|
29
|
+
- [ ] modified (from initial insertion)
|
|
30
|
+
- [ ] metadata updated
|
|
31
|
+
- [ ] record deleted
|
|
32
|
+
- [ ] index hooks
|
|
33
|
+
- [ ] add record
|
|
34
|
+
- [ ] update value
|
|
35
|
+
- [ ] remove record
|
|
36
|
+
* TODO web ui
|
|
37
|
+
- see [[https://github.com/doriantaylor/rb-store-digest-http][Store:::Digest::HTTP]]
|
data/lib/store/digest/driver.rb
CHANGED
|
@@ -6,6 +6,25 @@ module Store::Digest::Driver
|
|
|
6
6
|
# this is the only implementation we have so far
|
|
7
7
|
autoload :LMDB, 'store/digest/driver/lmdb'
|
|
8
8
|
|
|
9
|
+
private
|
|
10
|
+
|
|
11
|
+
# for the mapsize parameter
|
|
12
|
+
UNITS = { nil => 1 }
|
|
13
|
+
'kmgtpe'.split('').each_with_index do |x, i|
|
|
14
|
+
j = i + 1
|
|
15
|
+
UNITS[x] = 1000 ** j
|
|
16
|
+
UNITS[x.upcase] = 1024 ** j
|
|
17
|
+
end
|
|
18
|
+
UNITS.freeze
|
|
19
|
+
|
|
20
|
+
def int_bytes bytes
|
|
21
|
+
m = /\A\s*(\d+)([kmgtpeKMGTPE])?\s*\Z/s.match bytes.to_s
|
|
22
|
+
raise ArgumentError, "#{bytes} not a viable byte size" unless m
|
|
23
|
+
|
|
24
|
+
factor, unit = m.captures
|
|
25
|
+
factor.to_i * UNITS[unit]
|
|
26
|
+
end
|
|
27
|
+
|
|
9
28
|
protected
|
|
10
29
|
|
|
11
30
|
def setup **options
|