MCPcopy Create free account
hub / github.com/bytedance/bolt / enqueue

Method enqueue

bolt/dwio/common/BufferedInput.cpp:94–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92std::unique_ptr<SeekableInputStream> BufferedInput::enqueue(
93 Region region,
94 const dwio::common::StreamIdentifier* /*si*/) {
95 if (region.length == 0) {
96 return std::make_unique<SeekableArrayInputStream>(
97 static_cast<const char*>(nullptr), 0);
98 }
99
100 // if the region is already in buffer - such as metadata
101 auto ret = readBuffer(region.offset, region.length);
102 if (ret) {
103 return ret;
104 }
105
106 // push to region pool and give the caller the callback
107 regions_.push_back(region);
108 return std::make_unique<SeekableArrayInputStream>(
109 // Save "i", the position in which this region was enqueued. This will
110 // help faster lookup using enqueuedToBufferOffset_ later.
111 [region, this, i = regions_.size() - 1]() {
112 auto result = readInternal(region.offset, region.length, i);
113 BOLT_CHECK(
114 std::get<1>(result) != MAX_UINT64,
115 "Fail to read region offset={} length={}",
116 region.offset,
117 region.length);
118 return result;
119 });
120}
121
122bool BufferedInput::useVRead() const {
123 // Use value explicitly set by the user if any, otherwise use the GFLAG
124 // We want to update this on every use for now because during the onboarding
125 // to wsVRLoad=true we may change the value of this GFLAG programmatically

Callers 10

ReaderBaseMethod · 0.45
fetchStripeMethod · 0.45
getCompressedStreamMethod · 0.45
getStreamMethod · 0.45
makeStripeDataMethod · 0.45
FileWithReadAheadMethod · 0.45
testLoadsMethod · 0.45
enqueueReadsFunction · 0.45
enqueueRowGroupMethod · 0.45
TEST_FFunction · 0.45

Calls 3

readBufferFunction · 0.85
push_backMethod · 0.45
sizeMethod · 0.45

Tested by 5

makeStripeDataMethod · 0.36
FileWithReadAheadMethod · 0.36
testLoadsMethod · 0.36
enqueueReadsFunction · 0.36
TEST_FFunction · 0.36