Commit 908462e 1 parent c6fe269 commit 908462e Copy full SHA for 908462e
File tree 2 files changed +29
-0
lines changed
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 26
26
#include " folly/io/Cursor.h"
27
27
28
28
#include < algorithm>
29
+ #include < iterator>
29
30
#include < limits>
31
+ #include < memory>
30
32
#include < numeric>
31
33
#include < optional>
32
34
#include < tuple>
@@ -325,6 +327,10 @@ TabletReader::TabletReader(
325
327
NIMBLE_CHECK (
326
328
stripes->offset () + readSize >= fileSize,
327
329
" Incomplete stripes metadata." );
330
+ stripesMetadata_ = std::make_unique<MetadataSection>(
331
+ stripes->offset (),
332
+ stripes->size (),
333
+ static_cast <CompressionType>(stripes->compression_type ()));
328
334
stripes_ = std::make_unique<MetadataBuffer>(
329
335
memoryPool_,
330
336
footerIOBuf,
@@ -340,6 +346,16 @@ TabletReader::TabletReader(
340
346
(stripeGroups->size () ==
341
347
*stripesRoot->group_indices ()->rbegin () + 1 ),
342
348
" Unexpected stripe group count" );
349
+ std::transform (
350
+ stripeGroups->cbegin (),
351
+ stripeGroups->cend (),
352
+ std::back_inserter (stripeGroupsMetadata_),
353
+ [](const auto & stripeGroup) {
354
+ return MetadataSection{
355
+ stripeGroup->offset (),
356
+ stripeGroup->size (),
357
+ static_cast <CompressionType>(stripeGroup->compression_type ())};
358
+ });
343
359
344
360
// Always eagerly load if it's the only stripe group and is already
345
361
// fetched
Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
#pragma once
17
+
18
+ #include < memory>
17
19
#include < span>
20
+ #include < vector>
18
21
19
22
#include " dwio/nimble/common/Checksum.h"
20
23
#include " dwio/nimble/common/Types.h"
@@ -252,6 +255,14 @@ class TabletReader {
252
255
const StripeIdentifier& stripe,
253
256
std::span<const uint32_t > streamIdentifiers) const ;
254
257
258
+ const MetadataSection* stripesMetadata () const {
259
+ return stripesMetadata_.get ();
260
+ }
261
+
262
+ std::span<const MetadataSection> stripeGroupsMetadata () const {
263
+ return stripeGroupsMetadata_;
264
+ }
265
+
255
266
std::unordered_map<std::string, MetadataSection> optionalSections () const {
256
267
return optionalSections_;
257
268
}
@@ -354,6 +365,8 @@ class TabletReader {
354
365
uint32_t stripeCount_{0 };
355
366
const uint32_t * stripeRowCounts_{nullptr };
356
367
const uint64_t * stripeOffsets_{nullptr };
368
+ std::unique_ptr<MetadataSection> stripesMetadata_;
369
+ std::vector<MetadataSection> stripeGroupsMetadata_;
357
370
std::unordered_map<std::string, MetadataSection> optionalSections_;
358
371
mutable folly::Synchronized<
359
372
std::unordered_map<std::string, std::unique_ptr<MetadataBuffer>>>
You can’t perform that action at this time.
0 commit comments