vrajat commented on code in PR #15523: URL: https://github.com/apache/pinot/pull/15523#discussion_r2056543692
########## pinot-core/src/main/java/org/apache/pinot/core/query/executor/TableExecutionInfo.java: ########## @@ -0,0 +1,197 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.pinot.core.query.executor; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutorService; +import javax.annotation.Nullable; +import org.apache.pinot.core.query.pruner.SegmentPrunerService; +import org.apache.pinot.core.query.pruner.SegmentPrunerStatistics; +import org.apache.pinot.core.query.request.context.QueryContext; +import org.apache.pinot.core.query.request.context.TimerContext; +import org.apache.pinot.segment.local.data.manager.SegmentDataManager; +import org.apache.pinot.segment.spi.IndexSegment; +import org.apache.pinot.segment.spi.SegmentContext; + + +public interface TableExecutionInfo { + /** + * Check if consuming segments are being queried. + * @return true if consuming segments are being queried, false otherwise + */ + boolean hasRealtime(); + + /** + * Get the index segments for a table referenced in the query. + * @return A list of index segments for the table + */ + List<IndexSegment> getIndexSegments(); + + /** + * Get a copy of the index segments for a table referenced in the query as some functions may mutate the list. + * @return A copy of the list of index segments for the table + */ + List<IndexSegment> getCopyOfIndexSegments(); + + /** + * Get the SegmentContext for all the index segments. + * @return A map of index segments to their SegmentContext + */ + @Nullable + Map<IndexSegment, SegmentContext> getProvidedSegmentContexts(); + + /** + * List of segment names to query. + * @return A list of segment names to query + */ + List<String> getSegmentsToQuery(); + + /** + * List of optional segments to query. + * @return A list of optional segments to query + */ + List<String> getOptionalSegments(); + + /** + * Get the list of segment data managers for the segments that are being queried. + * @return A list of segment data managers for the segments that are being queried + */ + List<SegmentDataManager> getSegmentDataManagers(); + + /** + * Release the lock acquired on the segment data managers. + */ + void releaseSegmentDataManagers(); + + /** + * Get the list of SegmentContexts for the index segments selected in getSelectedSegmentsInfo. + * @param selectedSegments A list of index segments selected in getSelectedSegmentsInfo + * @param queryOptions A map of query options + * @return A list of SegmentContexts for the index segments selected in getSelectedSegmentsInfo + */ + List<SegmentContext> getSegmentContexts(List<IndexSegment> selectedSegments, Map<String, String> queryOptions); + + /** + * Get the list of segments that are not acquired. + * @return A list of segments that are not acquired + */ + List<String> getNotAcquiredSegments(); + + /** + * Get the list of segments that are missing. + * @return A list of segments that are missing + */ + List<String> getMissingSegments(); + + /** + * Get the number of segments acquired. + * @return The number of segments acquired + */ + int getNumSegmentsAcquired(); + + /** + * Get the selected segments and segment contexts for a table referenced in a query. The information is gathered + * in a SelectSegmentsInfo object. + * @param queryContext + * @param timerContext + * @param executorService + * @param segmentPrunerService Review Comment: Done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org