MCPcopy Create free account
hub / github.com/ByConity/ByConity / writeSuffix

Method writeSuffix

src/Storages/Distributed/DistributedBlockOutputStream.cpp:505–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503
504
505void DistributedBlockOutputStream::writeSuffix()
506{
507 auto log_performance = [this]()
508 {
509 double elapsed = watch.elapsedSeconds();
510 LOG_DEBUG(log, "It took {} sec. to insert {} blocks, {} rows per second. {}", elapsed, inserted_blocks, inserted_rows / elapsed, getCurrentStateDescription());
511 };
512
513 /// Pool finished means that some exception had been thrown before,
514 /// and scheduling new jobs will return "Cannot schedule a task" error.
515 if (insert_sync && pool && !pool->finished())
516 {
517 finished_jobs_count = 0;
518 try
519 {
520 for (auto & shard_jobs : per_shard_jobs)
521 {
522 for (JobReplica & job : shard_jobs.replicas_jobs)
523 {
524 if (job.stream)
525 {
526 pool->scheduleOrThrowOnError([&job]()
527 {
528 job.stream->writeSuffix();
529 });
530 }
531 }
532 }
533 }
534 catch (...)
535 {
536 pool->wait();
537 throw;
538 }
539
540 try
541 {
542 pool->wait();
543 log_performance();
544 }
545 catch (Exception & exception)
546 {
547 log_performance();
548 exception.addMessage(getCurrentStateDescription());
549 throw;
550 }
551 }
552}
553
554
555IColumn::Selector DistributedBlockOutputStream::createSelector(const Block & source_block) const

Callers 5

processFileMethod · 0.45
sendBatchMethod · 0.45
sendSeparateFilesMethod · 0.45
writeToLocalMethod · 0.45
writeToShardMethod · 0.45

Calls 5

addMessageMethod · 0.80
elapsedSecondsMethod · 0.45
finishedMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected