-
Notifications
You must be signed in to change notification settings - Fork 465
/
compaction_setup_inputs
153 lines (141 loc) · 2.56 KB
/
compaction_setup_inputs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
setup-inputs a a
L0
a.SET.1-b.SET.2
----
L0
000001:[a#1,1-b#2,1]
setup-inputs c c
L0
a.SET.1-b.SET.2
----
# Verify we expand the start level inputs to a clean cut.
setup-inputs a a
L1
a.SET.1-b.SET.2
b.SET.1-c.SET.2
----
L1
000001:[a#1,1-b#2,1]
000002:[b#1,1-c#2,1]
# The range deletion sentinel acts as a clean cut boundary.
setup-inputs a a
L1
a.SET.1-b.RANGEDEL.72057594037927935
b.SET.1-c.SET.2
----
L1
000001:[a#1,1-b#72057594037927935,15]
# Verify we expand the output level inputs to a clean cut.
setup-inputs a a
L1
a.SET.5-b.SET.6
L2
a.SET.3-c.SET.4
c.SET.3-d.SET.2
----
L1
000001:[a#5,1-b#6,1]
L2
000002:[a#3,1-c#4,1]
000003:[c#3,1-d#2,1]
# Verify we expand the output level inputs to a clean cut.
setup-inputs a a
L1
a.SET.5-b.SET.6
L2
a.SET.3-c.RANGEDEL.72057594037927935
c.SET.3-d.SET.2
----
L1
000001:[a#5,1-b#6,1]
L2
000002:[a#3,1-c#72057594037927935,15]
# Verify we grow the start level inputs to include all sstables which
# lie within the output level bounds.
setup-inputs a a
L1
a.SET.5-b.SET.6
c.SET.4-e.SET.3
L2
a.SET.3-d.SET.4
----
L1
000001:[a#5,1-b#6,1]
000002:[c#4,1-e#3,1]
L2
000003:[a#3,1-d#4,1]
# Verify we limit the start level input expansion according to available
# disk capacity.
setup-inputs avail-bytes=10 a a
L1
a.SET.5-b.SET.6 size=2
c.SET.4-e.SET.3 size=1
L2
a.SET.3-d.SET.4 size=3
----
L1
000001:[a#5,1-b#6,1]
L2
000003:[a#3,1-d#4,1]
# Verify the available disk capacity limit doesn't affect the
# output level clean-cut expansion.
setup-inputs avail-bytes=10 a a
L1
a.SET.5-b.SET.6 size=5
c.SET.4-e.SET.3 size=10
L2
a.SET.3-d.SET.4 size=5
d.SET.2-e.SET.2 size=5
----
L1
000001:[a#5,1-b#6,1]
L2
000003:[a#3,1-d#4,1]
000004:[d#2,1-e#2,1]
# We won't grow the start level inputs if doing so would grow the
# output level inputs.
setup-inputs a a
L1
a.SET.5-b.SET.6
c.SET.4-e.SET.3
L2
a.SET.3-d.SET.4
e.SET.2-f.SET.1
----
L1
000001:[a#5,1-b#6,1]
L2
000003:[a#3,1-d#4,1]
# Verify setup inputs can identify compacting files in range
setup-inputs a a
L1
a.SET.5-b.SET.6
L2
a.SET.3-c.SET.4
c.SET.3-d.SET.2 compacting
d.SET.3-e.SET.6
----
L1
000001:[a#5,1-b#6,1]
L2
000002:[a#3,1-c#4,1]
000003:[c#3,1-d#2,1]
000004:[d#3,1-e#6,1]
is-compacting
# Verify when there is one file in range and it is compacting
setup-inputs a a
L2
a.SET.3-c.SET.4 compacting
d.SET.3-e.SET.2
----
L2
000001:[a#3,1-c#4,1]
is-compacting
# Verify when there is one file in level and is compacting
setup-inputs a a
L2
a.SET.3-c.SET.4 compacting
----
L2
000001:[a#3,1-c#4,1]
is-compacting