|
21 | 21 | package com.apple.foundationdb.record.query.plan.cascades.debug; |
22 | 22 |
|
23 | 23 | import com.apple.foundationdb.record.logging.KeyValueLogMessage; |
24 | | -import com.apple.foundationdb.record.query.combinatorics.TopologicalSort; |
25 | 24 | import com.apple.foundationdb.record.query.plan.cascades.CascadesRuleCall; |
26 | 25 | import com.apple.foundationdb.record.query.plan.cascades.PlanContext; |
27 | 26 | import com.apple.foundationdb.record.query.plan.cascades.Quantifier; |
|
53 | 52 | import java.util.Objects; |
54 | 53 | import java.util.Optional; |
55 | 54 | import java.util.concurrent.TimeUnit; |
56 | | -import java.util.function.Consumer; |
57 | 55 | import java.util.function.IntUnaryOperator; |
58 | 56 | import java.util.stream.Collectors; |
59 | 57 |
|
60 | | -import static com.apple.foundationdb.record.query.plan.cascades.properties.ReferencesAndDependenciesProperty.referencesAndDependencies; |
61 | | - |
62 | 58 | /** |
63 | 59 | * <p> |
64 | 60 | * Implementation of a debugger that maintains symbol tables for easier human consumption e.g. in test cases and/or |
@@ -176,14 +172,6 @@ public void onQuery(@Nonnull final String recordQuery, @Nonnull final PlanContex |
176 | 172 | logQuery(); |
177 | 173 | } |
178 | 174 |
|
179 | | - void restartState() { |
180 | | - eventStateStack.pop(); |
181 | | - eventStateStack.push(EventState.copyOf(getCurrentEventState())); |
182 | | - |
183 | | - symbolTablesStack.pop(); |
184 | | - symbolTablesStack.push(SymbolTables.copyOf(getCurrentSymbolState())); |
185 | | - } |
186 | | - |
187 | 175 | @Override |
188 | 176 | @SuppressWarnings("PMD.GuardLogStatement") // false positive |
189 | 177 | public void onEvent(final Event event) { |
@@ -406,24 +394,6 @@ public static DebuggerWithSymbolTables withPrerecordedEvents(@Nonnull final Stri |
406 | 394 | return new DebuggerWithSymbolTables(true, true, fileName); |
407 | 395 | } |
408 | 396 |
|
409 | | - public static void printForEachExpression(@Nonnull final Reference root) { |
410 | | - forEachExpression(root, expression -> { |
411 | | - System.out.println("expression: " + |
412 | | - SymbolDebugger.mapDebugger(debugger -> debugger.nameForObject(expression)).orElseThrow() + "; " + |
413 | | - "hashCodeWithoutChildren: " + expression.hashCodeWithoutChildren() + "explain: " + expression); |
414 | | - }); |
415 | | - } |
416 | | - |
417 | | - public static void forEachExpression(@Nonnull final Reference root, @Nonnull final Consumer<RelationalExpression> consumer) { |
418 | | - final var references = referencesAndDependencies().evaluate(root); |
419 | | - final var referenceList = TopologicalSort.anyTopologicalOrderPermutation(references).orElseThrow(); |
420 | | - for (final var reference : referenceList) { |
421 | | - for (final var member : reference.getAllMemberExpressions()) { |
422 | | - consumer.accept(member); |
423 | | - } |
424 | | - } |
425 | | - } |
426 | | - |
427 | 397 | @FunctionalInterface |
428 | 398 | private interface SupplierWithException<T> { |
429 | 399 |
|
|
0 commit comments