8686import org .apache .iotdb .db .queryengine .plan .planner .plan .node .source .DeviceRegionScanNode ;
8787import org .apache .iotdb .db .queryengine .plan .planner .plan .node .source .LastQueryScanNode ;
8888import org .apache .iotdb .db .queryengine .plan .planner .plan .node .source .SeriesScanNode ;
89- import org .apache .iotdb .db .queryengine .plan .planner .plan .node .source .SeriesSourceNode ;
9089import org .apache .iotdb .db .queryengine .plan .planner .plan .node .source .ShowQueriesNode ;
90+ import org .apache .iotdb .db .queryengine .plan .planner .plan .node .source .SourceNode ;
9191import org .apache .iotdb .db .queryengine .plan .planner .plan .node .source .TimeseriesRegionScanNode ;
9292import org .apache .iotdb .db .queryengine .plan .planner .plan .parameter .AggregationDescriptor ;
9393import org .apache .iotdb .db .queryengine .plan .planner .plan .parameter .AggregationStep ;
110110import org .apache .commons .lang3 .Validate ;
111111import org .apache .tsfile .enums .TSDataType ;
112112import org .apache .tsfile .file .metadata .IDeviceID ;
113+ import org .apache .tsfile .utils .Accountable ;
113114
114115import java .util .ArrayList ;
115116import java .util .Arrays ;
@@ -1114,15 +1115,16 @@ public LogicalPlanBuilder planSeriesSchemaFetchSource(
11141115 overlappedPatternTree .appendFullPath (pathPattern );
11151116 }
11161117 this .root .addChild (
1117- new SeriesSchemaFetchScanNode (
1118- context .getQueryId ().genPlanNodeId (),
1119- storageGroupPath ,
1120- overlappedPatternTree ,
1121- templateMap ,
1122- withTags ,
1123- withAttributes ,
1124- withTemplate ,
1125- withAliasForce ));
1118+ reserveMemoryForAccountableNode (
1119+ new SeriesSchemaFetchScanNode (
1120+ context .getQueryId ().genPlanNodeId (),
1121+ storageGroupPath ,
1122+ overlappedPatternTree ,
1123+ templateMap ,
1124+ withTags ,
1125+ withAttributes ,
1126+ withTemplate ,
1127+ withAliasForce )));
11261128 } catch (IllegalPathException e ) {
11271129 // definitely won't happen
11281130 throw new RuntimeException (e );
@@ -1146,11 +1148,12 @@ public LogicalPlanBuilder planDeviceSchemaFetchSource(
11461148 overlappedPatternTree .appendFullPath (pathPattern );
11471149 }
11481150 this .root .addChild (
1149- new DeviceSchemaFetchScanNode (
1150- context .getQueryId ().genPlanNodeId (),
1151- databasePath ,
1152- overlappedPatternTree ,
1153- authorityScope ));
1151+ reserveMemoryForAccountableNode (
1152+ new DeviceSchemaFetchScanNode (
1153+ context .getQueryId ().genPlanNodeId (),
1154+ databasePath ,
1155+ overlappedPatternTree ,
1156+ authorityScope )));
11541157 } catch (IllegalPathException e ) {
11551158 // definitely won't happen
11561159 throw new RuntimeException (e );
@@ -1425,7 +1428,8 @@ public LogicalPlanBuilder planTimeseriesRegionScan(
14251428 * We need to check the memory used by SeriesSourceNodes.(Number of other PlanNodes are rather
14261429 * small compared to SourceNodes and could be safely ignored for now.)
14271430 */
1428- private PlanNode reserveMemoryForAccountableNode (final SeriesSourceNode sourceNode ) {
1431+ private <T extends SourceNode & Accountable > T reserveMemoryForAccountableNode (
1432+ final T sourceNode ) {
14291433 this .context .reserveMemoryForFrontEnd (
14301434 MemoryEstimationHelper .getEstimatedSizeOfAccountableObject (sourceNode ));
14311435 return sourceNode ;
0 commit comments