MCPcopy Create free account
hub / github.com/apache/orc / WriterImpl

Method WriterImpl

c++/src/Writer.cc:367–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365 const WriterId WriterImpl::writerId = WriterId::ORC_CPP_WRITER;
366
367 WriterImpl::WriterImpl(const Type& t, OutputStream* stream, const WriterOptions& opts)
368 : outStream_(stream), options_(opts), type_(t) {
369 streamsFactory_ = createStreamsFactory(options_, outStream_);
370 columnWriter_ = buildWriter(type_, *streamsFactory_, options_);
371 stripeRows_ = totalRows_ = indexRows_ = 0;
372 currentOffset_ = 0;
373 stripesAtLastFlush_ = 0;
374 lastFlushOffset_ = 0;
375
376 useTightNumericVector_ = opts.getUseTightNumericVector();
377
378 if (options_.getCompressionBlockSize() % options_.getMemoryBlockSize() != 0) {
379 throw std::invalid_argument(
380 "Compression block size must be a multiple of memory block size.");
381 }
382
383 // compression stream for stripe footer, file footer and metadata
384 compressionStream_ = createCompressor(
385 options_.getCompression(), outStream_, options_.getCompressionStrategy(),
386 options_.getOutputBufferCapacity(), options_.getCompressionBlockSize(),
387 options_.getMemoryBlockSize(), *options_.getMemoryPool(), options_.getWriterMetrics());
388
389 // uncompressed stream for post script
390 bufferedStream_.reset(new BufferedOutputStream(*options_.getMemoryPool(), outStream_,
391 1024, // buffer capacity: 1024 bytes
392 options_.getCompressionBlockSize(),
393 options_.getWriterMetrics()));
394
395 init();
396 }
397
398 std::unique_ptr<ColumnVectorBatch> WriterImpl::createRowBatch(uint64_t size) const {
399 return type_.createRowBatch(size, *options_.getMemoryPool(), false, useTightNumericVector_);

Callers

nothing calls this directly

Calls 11

createStreamsFactoryFunction · 0.85
buildWriterFunction · 0.85
getMemoryBlockSizeMethod · 0.80
getWriterMetricsMethod · 0.80
resetMethod · 0.65
getCompressionMethod · 0.45
getMemoryPoolMethod · 0.45

Tested by

no test coverage detected