thinp_xml 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bin/cache_xml +4 -1
- data/features/cache_create.feature +18 -7
- data/lib/thinp_xml/cache/emit.rb +1 -1
- data/lib/thinp_xml/cache/metadata.rb +1 -1
- data/lib/thinp_xml/version.rb +1 -1
- data/spec/cache_builder_spec.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDI2YmNiNDk0MDVmYWRmMTE1ZWU3MTM4NGQ2NjM4MzAwY2IxNTYyMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZDI0YzI0OWJjNTdhZmVmMmQ2ZmU5NmFhOWU1NjJjZWJhYWQ5NzNiOQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODliNDQ3MDBlNzIxOTMyODc5YzBhNjczYjJmMjg2Y2M5MzJiNTYwMzYyODc0
|
10
|
+
ZWMwY2U5OTJiYTBiM2I5OWQ4ZDNkZGMxNTE4NGNlZjhiYzRlYTBmNTdmYTM3
|
11
|
+
NTNiM2M3Y2MxOTNlNTBhZTc5ZWVjY2JhNDMyZjgxYmU4Yjg0ODA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2I3NDM3Mjc2MzE4YjY1M2UwYmMxZTUyMWYyYWI0MDczODY2ZTcwM2YwMDI3
|
14
|
+
MGM5NmQ3MTBiNzA3OGZmNjhmZDMwMzJhYzQxYTFhODI4NThhZGQ1ZTViYTcy
|
15
|
+
Yjk1NjY0NDkzNDBmMTVhN2ZiNDc5NmFkZGE1ZGUwNTI0MmY3YjQ=
|
data/bin/cache_xml
CHANGED
@@ -47,13 +47,15 @@ CacheCommandLine = CommandLine::Parser.new do
|
|
47
47
|
value_switch :nr_mappings, :distribution, '--nr-mappings'
|
48
48
|
value_switch :mapping_policy, :layout, '--layout'
|
49
49
|
value_switch :dirty_percentage, :percentage, '--dirty-percent'
|
50
|
+
value_switch :policy, :string, '--policy'
|
50
51
|
|
51
52
|
global do
|
52
53
|
switches :help
|
53
54
|
end
|
54
55
|
|
55
56
|
command :create do
|
56
|
-
switches :nr_cache_blocks, :uuid, :block_size, :nr_mappings,
|
57
|
+
switches :nr_cache_blocks, :uuid, :block_size, :nr_mappings,
|
58
|
+
:mapping_policy, :dirty_percentage, :policy
|
57
59
|
end
|
58
60
|
end
|
59
61
|
|
@@ -82,6 +84,7 @@ class Dispatcher
|
|
82
84
|
b.nr_mappings = opts.fetch(:nr_mappings, 0)
|
83
85
|
b.mapping_policy = opts.fetch(:mapping_policy, :random)
|
84
86
|
b.dirty_percentage = opts.fetch(:dirty_percentage, 0)
|
87
|
+
b.policy_name = opts.fetch(:policy, 'mq')
|
85
88
|
md = b.generate
|
86
89
|
write_xml(md, STDOUT)
|
87
90
|
end
|
@@ -4,7 +4,7 @@ Feature: I can create new metadata
|
|
4
4
|
When I cache_xml create
|
5
5
|
Then the stdout should contain:
|
6
6
|
"""
|
7
|
-
<superblock uuid="" block_size="128" nr_cache_blocks="0">
|
7
|
+
<superblock uuid="" block_size="128" nr_cache_blocks="0" policy="mq">
|
8
8
|
</superblock>
|
9
9
|
"""
|
10
10
|
|
@@ -12,7 +12,7 @@ Feature: I can create new metadata
|
|
12
12
|
When I cache_xml create --uuid 'one two three'
|
13
13
|
Then the stdout should contain:
|
14
14
|
"""
|
15
|
-
<superblock uuid="one two three" block_size="128" nr_cache_blocks="0">
|
15
|
+
<superblock uuid="one two three" block_size="128" nr_cache_blocks="0" policy="mq">
|
16
16
|
</superblock>
|
17
17
|
"""
|
18
18
|
|
@@ -20,7 +20,7 @@ Feature: I can create new metadata
|
|
20
20
|
When I cache_xml create --block-size 512
|
21
21
|
Then the stdout should contain:
|
22
22
|
"""
|
23
|
-
<superblock uuid="" block_size="512" nr_cache_blocks="0">
|
23
|
+
<superblock uuid="" block_size="512" nr_cache_blocks="0" policy="mq">
|
24
24
|
</superblock>
|
25
25
|
"""
|
26
26
|
|
@@ -28,7 +28,7 @@ Feature: I can create new metadata
|
|
28
28
|
When I cache_xml create --nr-cache-blocks 345
|
29
29
|
Then the stdout should contain:
|
30
30
|
"""
|
31
|
-
<superblock uuid="" block_size="128" nr_cache_blocks="345">
|
31
|
+
<superblock uuid="" block_size="128" nr_cache_blocks="345" policy="mq">
|
32
32
|
</superblock>
|
33
33
|
"""
|
34
34
|
|
@@ -36,7 +36,7 @@ Feature: I can create new metadata
|
|
36
36
|
When I cache_xml create --nr-cache-blocks uniform[123..124]
|
37
37
|
Then the stdout should contain:
|
38
38
|
"""
|
39
|
-
<superblock uuid="" block_size="128" nr_cache_blocks="123">
|
39
|
+
<superblock uuid="" block_size="128" nr_cache_blocks="123" policy="mq">
|
40
40
|
</superblock>
|
41
41
|
"""
|
42
42
|
|
@@ -44,7 +44,7 @@ Feature: I can create new metadata
|
|
44
44
|
When I cache_xml create --nr-cache-blocks 3 --nr-mappings 3 --layout linear
|
45
45
|
Then the stdout should contain:
|
46
46
|
"""
|
47
|
-
<superblock uuid="" block_size="128" nr_cache_blocks="3">
|
47
|
+
<superblock uuid="" block_size="128" nr_cache_blocks="3" policy="mq">
|
48
48
|
<mapping cache_block="0" origin_block="0" dirty="false"/>
|
49
49
|
<mapping cache_block="1" origin_block="1" dirty="false"/>
|
50
50
|
<mapping cache_block="2" origin_block="2" dirty="false"/>
|
@@ -55,11 +55,22 @@ Feature: I can create new metadata
|
|
55
55
|
When I cache_xml create --nr-cache-blocks 3 --nr-mappings 3 --layout linear --dirty-percent 100
|
56
56
|
Then the stdout should contain:
|
57
57
|
"""
|
58
|
-
<superblock uuid="" block_size="128" nr_cache_blocks="3">
|
58
|
+
<superblock uuid="" block_size="128" nr_cache_blocks="3" policy="mq">
|
59
59
|
<mapping cache_block="0" origin_block="0" dirty="true"/>
|
60
60
|
<mapping cache_block="1" origin_block="1" dirty="true"/>
|
61
61
|
<mapping cache_block="2" origin_block="2" dirty="true"/>
|
62
62
|
</superblock>
|
63
63
|
"""
|
64
64
|
|
65
|
+
Scenario: Take the policy name
|
66
|
+
When I cache_xml create --nr-cache-blocks 3 --nr-mappings 3 --layout linear --policy fred
|
67
|
+
Then the stdout should contain:
|
68
|
+
"""
|
69
|
+
<superblock uuid="" block_size="128" nr_cache_blocks="3" policy="fred">
|
70
|
+
<mapping cache_block="0" origin_block="0" dirty="false"/>
|
71
|
+
<mapping cache_block="1" origin_block="1" dirty="false"/>
|
72
|
+
<mapping cache_block="2" origin_block="2" dirty="false"/>
|
73
|
+
</superblock>
|
74
|
+
"""
|
75
|
+
|
65
76
|
|
data/lib/thinp_xml/cache/emit.rb
CHANGED
@@ -11,7 +11,7 @@ module CacheXML
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def emit_superblock(sb, &block)
|
14
|
-
@e.emit_tag(sb, 'superblock', :uuid, :block_size, :nr_cache_blocks, &block)
|
14
|
+
@e.emit_tag(sb, 'superblock', :uuid, :block_size, :nr_cache_blocks, :policy, &block)
|
15
15
|
end
|
16
16
|
|
17
17
|
def emit_mapping(m)
|
data/lib/thinp_xml/version.rb
CHANGED
data/spec/cache_builder_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thinp_xml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Thornber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ejt_command_line
|