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

Method prepare

src/Processors/Transforms/FinalSampleTransform.cpp:33–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33IProcessor::Status FinalSampleTransform::prepare()
34{
35 auto & output = outputs.front();
36
37 /// Check can output.
38 if (output.isFinished() || stop_reading)
39 {
40 output.finish();
41 for (auto & input : inputs)
42 input.close();
43
44 if (has_output && output_chunk)
45 {
46 output.push(std::move(output_chunk));
47 has_output = false;
48 }
49
50 return Status::Finished;
51 }
52
53 if (!output.canPush())
54 {
55 for (auto & input : inputs)
56 input.setNotNeeded();
57 return Status::PortFull;
58 }
59
60 /// Output if has data.
61 if (has_output)
62 {
63 output.push(std::move(output_chunk));
64 has_output = false;
65
66 return Status::PortFull;
67 }
68
69 if (has_input)
70 return Status::Ready;
71
72 bool all_inputs_finished = true;
73 for (auto & input: inputs)
74 {
75 if (!input.isFinished())
76 {
77 all_inputs_finished = false;
78 break;
79 }
80 }
81 if (all_inputs_finished)
82 {
83 output.finish();
84 return Status::Finished;
85 }
86
87 for (auto & input: inputs)
88 {
89 input.setNeeded();
90 if (input.hasData())

Callers

nothing calls this directly

Calls 10

frontMethod · 0.80
canPushMethod · 0.80
setNotNeededMethod · 0.80
setNeededMethod · 0.80
hasDataMethod · 0.80
isFinishedMethod · 0.45
finishMethod · 0.45
closeMethod · 0.45
pushMethod · 0.45
pullMethod · 0.45

Tested by

no test coverage detected