Commit 44f8061
committed
HBASE-29368 [Precursor] Add API surface and refactoring for key management feature
This commit prepares the codebase for the upcoming key management feature
(HBASE-29368) by introducing the necessary API definitions, protocol buffer
changes, and infrastructure refactoring. No functional changes are included;
all implementation will follow in the feature PR.
This precursor PR essentially extracts the API surface definitions and
infrastructure refactoring from the main feature PR (apache#7421) to facilitate
easier review. By separating the ~15k line feature PR into a smaller precursor
containing interface definitions, protocol changes, and method signature
updates, the subsequent feature PR will focus purely on implementation logic.
API Surface Additions:
* New interfaces:
- KeymetaAdmin: Admin API for key management operations
- Server methods for cache management (getManagedKeyDataCache, getSystemKeyCache)
* Protocol buffer definitions:
- ManagedKeys.proto: Definitions for managed key data and operations
- Admin.proto: RPC methods for key management admin operations
- Procedure.proto: Key rotation procedure support
Infrastructure Refactoring:
* Encryption context creation:
- Moved createEncryptionContext from EncryptionUtil (client) to SecurityUtil (server)
where it properly belongs, as it requires server-side resources
- Added overloads to support future key encryption key (KEK) parameters
* Method signature updates:
- Added ManagedKeyDataCache and SystemKeyCache parameters to encryption-related
methods throughout HRegion, HStore, HStoreFile, and HFile classes
- Updated constructors and factory methods to thread cache references
- All cache parameters are currently null/unused, enabling gradual feature rollout
* New utility methods:
- Encryption.encryptWithGivenKey() / decryptWithGivenKey(): Extract method
refactoring to support both subject-based and KEK-based encryption
- EncryptionUtil.wrapKey() / unwrapKey() overloads with KEK parameter
- Bytes.add() 4-argument overload for concatenation
Stub Infrastructure:
* Blank place holder shells for some public data classes such as
ManagedKeyData and KeymetaAdminClient
* Stub implementations for key management services and caches that return null
or throw UnsupportedOperationException, clearly documented as placeholders
* New package org.apache.hadoop.hbase.keymeta for key management classes
* Mock services updated to support new cache getter methods for testing
Code Organization:
* Procedure framework: Added support for region-level server name tracking
to support future key rotation procedures
* Testing infrastructure updated to support new constructor signatures
All stub implementations clearly document they are placeholders for the
upcoming feature PR. Existing encryption functionality remains unchanged
and continues to work as before.
Testing:
* All existing tests pass (precursor introduces no functional changes)
* Build completes successfully with new API surface
* Backward compatibility maintained for non-key-management code paths1 parent 9805ddc commit 44f8061
80 files changed
Lines changed: 1717 additions & 281 deletions
File tree
- hbase-client/src/main/java/org/apache/hadoop/hbase
- client
- keymeta
- security
- hbase-common/src/main/java/org/apache/hadoop/hbase
- io/crypto
- keymeta
- util
- hbase-procedure/src/main/java/org/apache/hadoop/hbase/procedure2
- hbase-protocol-shaded/src/main/protobuf
- server
- io
- region
- hbase-server/src
- main/java/org/apache/hadoop/hbase
- client
- io/hfile
- keymeta
- master
- assignment
- procedure
- region
- regionserver
- storefiletracker
- replication/regionserver
- security
- util
- test/java/org/apache/hadoop/hbase
- master
- cleaner
- region
- procedure2/store/region
- regionserver
- rsgroup
- security/token
- snapshot
- util
- hbase-shell
- src
- main/ruby/hbase
- test/ruby
- hbase-testing-util/src/main/java/org/apache/hadoop/hbase
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
170 | 174 | | |
171 | 175 | | |
172 | 176 | | |
| |||
320 | 324 | | |
321 | 325 | | |
322 | 326 | | |
| 327 | + | |
323 | 328 | | |
324 | 329 | | |
325 | 330 | | |
| |||
522 | 527 | | |
523 | 528 | | |
524 | 529 | | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
525 | 535 | | |
526 | 536 | | |
527 | 537 | | |
| |||
1337 | 1347 | | |
1338 | 1348 | | |
1339 | 1349 | | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
1340 | 1364 | | |
1341 | 1365 | | |
1342 | 1366 | | |
| |||
Lines changed: 89 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
Lines changed: 47 additions & 59 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
83 | 97 | | |
84 | 98 | | |
85 | 99 | | |
| |||
100 | 114 | | |
101 | 115 | | |
102 | 116 | | |
103 | | - | |
104 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
105 | 123 | | |
106 | 124 | | |
107 | 125 | | |
| |||
118 | 136 | | |
119 | 137 | | |
120 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
121 | 154 | | |
122 | 155 | | |
123 | 156 | | |
| |||
126 | 159 | | |
127 | 160 | | |
128 | 161 | | |
129 | | - | |
| 162 | + | |
130 | 163 | | |
131 | 164 | | |
132 | 165 | | |
133 | | - | |
| 166 | + | |
| 167 | + | |
134 | 168 | | |
135 | 169 | | |
136 | 170 | | |
| |||
143 | 177 | | |
144 | 178 | | |
145 | 179 | | |
146 | | - | |
147 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
148 | 187 | | |
149 | 188 | | |
150 | 189 | | |
| |||
176 | 215 | | |
177 | 216 | | |
178 | 217 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
| 218 | + | |
231 | 219 | | |
232 | 220 | | |
233 | 221 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
100 | 120 | | |
0 commit comments