Class TransactionLogAccess
java.lang.Object
io.trino.plugin.deltalake.transactionlog.TransactionLogAccess
-
Constructor Summary
ConstructorsConstructorDescriptionTransactionLogAccess(TypeManager typeManager, CheckpointSchemaManager checkpointSchemaManager, DeltaLakeConfig deltaLakeConfig, FileFormatDataSourceStats fileFormatDataSourceStats, TrinoFileSystemFactory fileSystemFactory, ParquetReaderConfig parquetReaderConfig) -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcanonicalizeColumnName(String columnName) voidcleanupQuery(ConnectorSession session) static List<DeltaLakeColumnMetadata>columnsWithStats(MetadataEntry metadataEntry, ProtocolEntry protocolEntry, TypeManager typeManager) static com.google.common.collect.ImmutableList<DeltaLakeColumnMetadata>columnsWithStats(List<DeltaLakeColumnMetadata> schema, List<String> partitionColumns) voidgetActiveFiles(TableSnapshot tableSnapshot, ConnectorSession session) getCommitInfoEntries(TableSnapshot tableSnapshot, ConnectorSession session) io.airlift.jmx.CacheStatsMBeangetJsonEntries(TrinoFileSystem fileSystem, String transactionLogDir, List<Long> forVersions) io.airlift.jmx.CacheStatsMBeangetMetadataEntry(TableSnapshot tableSnapshot, ConnectorSession session) getPastTableVersions(TrinoFileSystem fileSystem, String transactionLogDir, Instant startAt, long lastVersion) Returns a stream of transaction log versions betweenstartAtpoint in time andlastVersion.getProtocolEntries(TableSnapshot tableSnapshot, ConnectorSession session) getProtocolEntry(ConnectorSession session, TableSnapshot tableSnapshot) getRemoveEntries(TableSnapshot tableSnapshot, ConnectorSession session) getSnapshot(ConnectorSession session, SchemaTableName table, String tableLocation, Optional<Long> atVersion) getTransactionLogEntries(ConnectorSession session, TableSnapshot tableSnapshot, Set<CheckpointEntryIterator.EntryType> entryTypes, Function<Stream<DeltaLakeTransactionLogEntry>, Stream<Object>> entryMapper) voidinvalidateCache(SchemaTableName schemaTableName, Optional<String> tableLocation) protected TableSnapshotloadSnapshot(ConnectorSession session, SchemaTableName table, String tableLocation) static <T> Map<CanonicalColumnName,T> toCanonicalNameKeyedMap(Map<String, T> map, Map<String, CanonicalColumnName> canonicalColumnNames) Deprecated.
-
Constructor Details
-
TransactionLogAccess
@Inject public TransactionLogAccess(TypeManager typeManager, CheckpointSchemaManager checkpointSchemaManager, DeltaLakeConfig deltaLakeConfig, FileFormatDataSourceStats fileFormatDataSourceStats, TrinoFileSystemFactory fileSystemFactory, ParquetReaderConfig parquetReaderConfig)
-
-
Method Details
-
getDataFileMetadataCacheStats
public io.airlift.jmx.CacheStatsMBean getDataFileMetadataCacheStats() -
getMetadataCacheStats
public io.airlift.jmx.CacheStatsMBean getMetadataCacheStats() -
getSnapshot
public TableSnapshot getSnapshot(ConnectorSession session, SchemaTableName table, String tableLocation, Optional<Long> atVersion) throws IOException - Throws:
IOException
-
cleanupQuery
-
loadSnapshot
protected TableSnapshot loadSnapshot(ConnectorSession session, SchemaTableName table, String tableLocation) throws IOException - Throws:
IOException
-
flushCache
public void flushCache() -
invalidateCache
-
getMetadataEntry
-
getActiveFiles
-
columnsWithStats
public static List<DeltaLakeColumnMetadata> columnsWithStats(MetadataEntry metadataEntry, ProtocolEntry protocolEntry, TypeManager typeManager) -
columnsWithStats
public static com.google.common.collect.ImmutableList<DeltaLakeColumnMetadata> columnsWithStats(List<DeltaLakeColumnMetadata> schema, List<String> partitionColumns) -
getRemoveEntries
public Stream<RemoveFileEntry> getRemoveEntries(TableSnapshot tableSnapshot, ConnectorSession session) -
getTransactionLogEntries
public Map<Class<?>,Object> getTransactionLogEntries(ConnectorSession session, TableSnapshot tableSnapshot, Set<CheckpointEntryIterator.EntryType> entryTypes, Function<Stream<DeltaLakeTransactionLogEntry>, Stream<Object>> entryMapper) -
getProtocolEntry
-
getProtocolEntries
public Stream<ProtocolEntry> getProtocolEntries(TableSnapshot tableSnapshot, ConnectorSession session) -
getCommitInfoEntries
public Stream<CommitInfoEntry> getCommitInfoEntries(TableSnapshot tableSnapshot, ConnectorSession session) -
getJsonEntries
public Stream<DeltaLakeTransactionLogEntry> getJsonEntries(TrinoFileSystem fileSystem, String transactionLogDir, List<Long> forVersions) -
getPastTableVersions
public List<Long> getPastTableVersions(TrinoFileSystem fileSystem, String transactionLogDir, Instant startAt, long lastVersion) Returns a stream of transaction log versions betweenstartAtpoint in time andlastVersion. -
canonicalizeColumnName
-
toCanonicalNameKeyedMap
public static <T> Map<CanonicalColumnName,T> toCanonicalNameKeyedMap(Map<String, T> map, Map<String, CanonicalColumnName> canonicalColumnNames) -
toOriginalNameKeyedMap
Deprecated.
-