@@ -54,7 +54,7 @@ namespace BitFunnel
54
54
// way SimplePlanner is connected.
55
55
std::vector<DocId> Factories::RunQueryPlanner (TermMatchNode const & tree,
56
56
ISimpleIndex const & index,
57
- IDiagnosticStream* diagnosticStream)
57
+ IDiagnosticStream& diagnosticStream)
58
58
{
59
59
// TODO: this really shouldn't create its own allocator.
60
60
Allocator allocator (4096 *16 );
@@ -92,18 +92,18 @@ namespace BitFunnel
92
92
ISimpleIndex const & index,
93
93
// IThreadResources& threadResources,
94
94
IAllocator& allocator,
95
- IDiagnosticStream* diagnosticStream)
95
+ IDiagnosticStream& diagnosticStream)
96
96
// bool generateNonBodyPlan,
97
97
// unsigned maxIterationsScannedBetweenTerminationChecks)
98
98
: m_resultsProcessor(Factories::CreateSimpleResultsProcessor())
99
99
// : // m_x64FunctionGeneratorWrapper(threadResources),
100
100
// m_maxIterationsScannedBetweenTerminationChecks(maxIterationsScannedBetweenTerminationChecks)
101
101
{
102
- if (diagnosticStream != nullptr && diagnosticStream-> IsEnabled (" planning/term" ))
102
+ if (diagnosticStream. IsEnabled (" planning/term" ))
103
103
{
104
- std::ostream& out = diagnosticStream-> GetStream ();
104
+ std::ostream& out = diagnosticStream. GetStream ();
105
105
std::unique_ptr<IObjectFormatter>
106
- formatter (Factories::CreateObjectFormatter (diagnosticStream-> GetStream ()));
106
+ formatter (Factories::CreateObjectFormatter (diagnosticStream. GetStream ()));
107
107
108
108
out << " --------------------" << std::endl;
109
109
out << " Term Plan:" << std::endl;
@@ -117,11 +117,11 @@ namespace BitFunnel
117
117
// generateNonBodyPlan,
118
118
allocator);
119
119
120
- if (diagnosticStream != nullptr && diagnosticStream-> IsEnabled (" planning/row" ))
120
+ if (diagnosticStream. IsEnabled (" planning/row" ))
121
121
{
122
- std::ostream& out = diagnosticStream-> GetStream ();
122
+ std::ostream& out = diagnosticStream. GetStream ();
123
123
std::unique_ptr<IObjectFormatter>
124
- formatter (Factories::CreateObjectFormatter (diagnosticStream-> GetStream ()));
124
+ formatter (Factories::CreateObjectFormatter (diagnosticStream. GetStream ()));
125
125
126
126
out << " --------------------" << std::endl;
127
127
out << " Row Plan:" << std::endl;
@@ -131,11 +131,11 @@ namespace BitFunnel
131
131
132
132
m_planRows = &rowPlan.GetPlanRows ();
133
133
134
- if (diagnosticStream != nullptr && diagnosticStream-> IsEnabled (" planning/planrows" ))
134
+ if (diagnosticStream. IsEnabled (" planning/planrows" ))
135
135
{
136
- std::ostream& out = diagnosticStream-> GetStream ();
136
+ std::ostream& out = diagnosticStream. GetStream ();
137
137
std::unique_ptr<IObjectFormatter>
138
- formatter (Factories::CreateObjectFormatter (diagnosticStream-> GetStream ()));
138
+ formatter (Factories::CreateObjectFormatter (diagnosticStream. GetStream ()));
139
139
140
140
out << " --------------------" << std::endl;
141
141
out << " IPlanRows:" << std::endl;
@@ -161,11 +161,11 @@ namespace BitFunnel
161
161
allocator);
162
162
163
163
164
- if (diagnosticStream != nullptr && diagnosticStream-> IsEnabled (" planning/rewrite" ))
164
+ if (diagnosticStream. IsEnabled (" planning/rewrite" ))
165
165
{
166
- std::ostream& out = diagnosticStream-> GetStream ();
166
+ std::ostream& out = diagnosticStream. GetStream ();
167
167
std::unique_ptr<IObjectFormatter>
168
- formatter (Factories::CreateObjectFormatter (diagnosticStream-> GetStream ()));
168
+ formatter (Factories::CreateObjectFormatter (diagnosticStream. GetStream ()));
169
169
170
170
out << " --------------------" << std::endl;
171
171
out << " Rewritten Plan:" << std::endl;
@@ -178,11 +178,11 @@ namespace BitFunnel
178
178
compiler.Compile (rewritten);
179
179
CompileNode const & compileTree = compiler.CreateTree (c_maxRankValue);
180
180
181
- if (diagnosticStream != nullptr && diagnosticStream-> IsEnabled (" planning/compile" ))
181
+ if (diagnosticStream. IsEnabled (" planning/compile" ))
182
182
{
183
- std::ostream& out = diagnosticStream-> GetStream ();
183
+ std::ostream& out = diagnosticStream. GetStream ();
184
184
std::unique_ptr<IObjectFormatter>
185
- formatter (Factories::CreateObjectFormatter (diagnosticStream-> GetStream ()));
185
+ formatter (Factories::CreateObjectFormatter (diagnosticStream. GetStream ()));
186
186
187
187
out << " --------------------" << std::endl;
188
188
out << " Compile Nodes:" << std::endl;
@@ -223,14 +223,16 @@ namespace BitFunnel
223
223
size_t sliceCount = sliceBuffers.size ();
224
224
225
225
// Iterations per slice calculation.
226
- auto iterationsPerSlice = shard.GetSliceCapacity () >> 6 >> c_maxRankValue;
226
+ const int c_horribleRankHack = 3 ;
227
+ auto iterationsPerSlice = shard.GetSliceCapacity () >> 6 >> c_horribleRankHack;
227
228
228
229
ByteCodeInterpreter intepreter (m_code,
229
230
*m_resultsProcessor,
230
231
sliceCount,
231
232
reinterpret_cast <char * const *>(sliceBuffers.data ()),
232
233
iterationsPerSlice,
233
- rowSet.GetRowOffsets (c_shardId));
234
+ rowSet.GetRowOffsets (c_shardId),
235
+ diagnosticStream);
234
236
235
237
intepreter.Run ();
236
238
0 commit comments