Class FileMetadataInfoCollector
java.lang.Object
org.apache.drill.exec.metastore.analyze.FileMetadataInfoCollector
- All Implemented Interfaces:
MetadataInfoCollector
Implementation of
MetadataInfoCollector
for file-based tables.-
Constructor Summary
ConstructorDescriptionFileMetadataInfoCollector
(BasicTablesRequests basicRequests, TableInfo tableInfo, FormatSelection selection, PlannerSettings settings, Supplier<org.apache.calcite.rel.core.TableScan> tableScanSupplier, List<SchemaPath> interestingColumns, MetadataType metadataLevel, int segmentColumnsCount) -
Method Summary
Modifier and TypeMethodDescriptionReturns list of all metadata info instances which should be handled either producing analyze or when fetching from the Metastore.static FileSelection
getExpandedFileSelection
(FileSelection fileSelection) ReturnsFileSelection
file selection based on specified file selection with expanded file statuses.Returns list of files metadata info which should be fetched from the Metastore.static List<org.apache.hadoop.fs.FileStatus>
getFileStatuses
(FileSelection fileSelection, DrillFileSystem fs) Returns list ofFileStatus
file statuses obtained from specifiedFileSelection
file selection.Returns list of all metadata info which corresponds to top-level segments and should be removed from the Metastore.org.apache.calcite.rel.core.TableScan
ReturnsTableScan
instance which will be used when produced incremental analyze.Returns list of row groups metadata info which should be fetched from the Metastore.org.apache.drill.shaded.guava.com.google.common.collect.Multimap<Integer,
MetadataInfo> Returns list of segments metadata info which should be fetched from the Metastore.boolean
Returns true if table metadata is outdated.
-
Constructor Details
-
FileMetadataInfoCollector
public FileMetadataInfoCollector(BasicTablesRequests basicRequests, TableInfo tableInfo, FormatSelection selection, PlannerSettings settings, Supplier<org.apache.calcite.rel.core.TableScan> tableScanSupplier, List<SchemaPath> interestingColumns, MetadataType metadataLevel, int segmentColumnsCount) throws IOException - Throws:
IOException
-
-
Method Details
-
getRowGroupsInfo
Description copied from interface:MetadataInfoCollector
Returns list of row groups metadata info which should be fetched from the Metastore.- Specified by:
getRowGroupsInfo
in interfaceMetadataInfoCollector
- Returns:
- list of row groups metadata info
-
getFilesInfo
Description copied from interface:MetadataInfoCollector
Returns list of files metadata info which should be fetched from the Metastore.- Specified by:
getFilesInfo
in interfaceMetadataInfoCollector
- Returns:
- list of files metadata info
-
getSegmentsInfo
public org.apache.drill.shaded.guava.com.google.common.collect.Multimap<Integer,MetadataInfo> getSegmentsInfo()Description copied from interface:MetadataInfoCollector
Returns list of segments metadata info which should be fetched from the Metastore.- Specified by:
getSegmentsInfo
in interfaceMetadataInfoCollector
- Returns:
- list of segments metadata info
-
getAllMetaToHandle
Description copied from interface:MetadataInfoCollector
Returns list of all metadata info instances which should be handled either producing analyze or when fetching from the Metastore.- Specified by:
getAllMetaToHandle
in interfaceMetadataInfoCollector
- Returns:
- list of all metadata info
-
getMetadataToRemove
Description copied from interface:MetadataInfoCollector
Returns list of all metadata info which corresponds to top-level segments and should be removed from the Metastore.- Specified by:
getMetadataToRemove
in interfaceMetadataInfoCollector
- Returns:
- list of all metadata info which should be removed
-
getPrunedScan
public org.apache.calcite.rel.core.TableScan getPrunedScan()Description copied from interface:MetadataInfoCollector
ReturnsTableScan
instance which will be used when produced incremental analyze. Table scan will contain minimal selection required for obtaining correct metadata.- Specified by:
getPrunedScan
in interfaceMetadataInfoCollector
- Returns:
TableScan
instance
-
isOutdated
public boolean isOutdated()Description copied from interface:MetadataInfoCollector
Returns true if table metadata is outdated.- Specified by:
isOutdated
in interfaceMetadataInfoCollector
- Returns:
- true if table metadata is outdated
-
getFileStatuses
public static List<org.apache.hadoop.fs.FileStatus> getFileStatuses(FileSelection fileSelection, DrillFileSystem fs) throws IOException Returns list ofFileStatus
file statuses obtained from specifiedFileSelection
file selection. Specified file selection may be expanded fully if it wasn't expanded before.- Parameters:
fileSelection
- file selectionfs
- file system- Returns:
- list of
FileStatus
file statuses - Throws:
IOException
-
getExpandedFileSelection
public static FileSelection getExpandedFileSelection(FileSelection fileSelection) throws IOException ReturnsFileSelection
file selection based on specified file selection with expanded file statuses.- Parameters:
fileSelection
- file selection- Returns:
- expanded file selection
- Throws:
IOException
-