public class AppendOnlyFileStoreTable extends Object
FileStoreTable
for append table.Modifier and Type | Field and Description |
---|---|
protected CatalogEnvironment |
catalogEnvironment |
protected FileIO |
fileIO |
protected SegmentsCache<Path> |
manifestCache |
protected Path |
path |
protected org.apache.paimon.shade.caffeine2.com.github.benmanes.caffeine.cache.Cache<Path,Snapshot> |
snapshotCache |
protected org.apache.paimon.shade.caffeine2.com.github.benmanes.caffeine.cache.Cache<String,Statistics> |
statsCache |
protected TableSchema |
tableSchema |
Constructor and Description |
---|
AppendOnlyFileStoreTable(FileIO fileIO,
Path path,
TableSchema tableSchema,
CatalogEnvironment catalogEnvironment) |
Modifier and Type | Method and Description |
---|---|
BranchManager |
branchManager() |
CatalogEnvironment |
catalogEnvironment() |
ChangelogManager |
changelogManager() |
FileStoreTable |
copy(Map<String,String> dynamicOptions)
Copy this table with adding dynamic options.
|
FileStoreTable |
copy(TableSchema newTableSchema) |
protected FileStoreTable |
copyInternal(Map<String,String> dynamicOptions,
boolean tryTimeTravel) |
FileStoreTable |
copyWithLatestSchema()
TODO: this method is weird, old options will overwrite new options.
|
FileStoreTable |
copyWithoutTimeTravel(Map<String,String> dynamicOptions)
Doesn't change table schema even when there exists time travel scan options.
|
CoreOptions |
coreOptions() |
void |
createBranch(String branchName)
Create an empty branch.
|
void |
createBranch(String branchName,
String tagName)
Create a branch from given tag.
|
RowKeyExtractor |
createRowKeyExtractor() |
void |
createTag(String tagName)
Create a tag from latest snapshot.
|
void |
createTag(String tagName,
java.time.Duration timeRetained) |
void |
createTag(String tagName,
long fromSnapshotId)
Create a tag from given snapshot.
|
void |
createTag(String tagName,
long fromSnapshotId,
java.time.Duration timeRetained) |
String |
currentBranch() |
void |
deleteBranch(String branchName)
Delete a branch by branchName.
|
void |
deleteTag(String tagName)
Delete a tag by name.
|
boolean |
equals(Object o) |
void |
fastForward(String branchName)
Merge a branch to main branch.
|
FileIO |
fileIO()
File io of this table.
|
Snapshot |
findSnapshot(long fromSnapshotId) |
String |
fullName()
Full name of the table, default is database.tableName.
|
Identifier |
identifier() |
SimpleFileReader<IndexManifestEntry> |
indexManifestFileReader()
Reader to read index manifest entry from index manifest file.
|
Optional<Snapshot> |
latestSnapshot()
Get the latest snapshot for this table, or empty if there are no snapshots.
|
Path |
location() |
SimpleFileReader<ManifestEntry> |
manifestFileReader()
Reader to read manifest entry from manifest file.
|
SimpleFileReader<ManifestFileMeta> |
manifestListReader()
Reader to read manifest file meta from manifest list file.
|
String |
name()
A name to identify this table.
|
TableCommitImpl |
newCommit(String commitUser) |
ExpireSnapshots |
newExpireChangelog() |
ExpireSnapshots |
newExpireSnapshots()
Manually expire snapshots, parameters can be controlled independently of table options.
|
LocalTableQuery |
newLocalTableQuery() |
InnerTableRead |
newRead() |
DataTableBatchScan |
newScan() |
SnapshotReader |
newSnapshotReader() |
StreamDataTableScan |
newStreamScan() |
TableWriteImpl<InternalRow> |
newWrite(String commitUser) |
TableWriteImpl<InternalRow> |
newWrite(String commitUser,
ManifestCacheFilter manifestFilter) |
Optional<WriteSelector> |
newWriteSelector() |
protected java.util.function.BiConsumer<FileStoreScan,Predicate> |
nonPartitionFilterConsumer() |
void |
renameTag(String tagName,
String targetTagName) |
void |
replaceTag(String tagName,
Long fromSnapshotId,
java.time.Duration timeRetained)
Replace a tag with new snapshot id and new time retained.
|
void |
rollbackTo(long snapshotId)
Rollback table's state to a specific snapshot.
|
void |
rollbackTo(String tagName)
Rollback table's state to a specific tag.
|
protected RowKindGenerator |
rowKindGenerator() |
TableSchema |
schema() |
SchemaManager |
schemaManager() |
void |
setManifestCache(SegmentsCache<Path> manifestCache) |
void |
setSnapshotCache(org.apache.paimon.shade.caffeine2.com.github.benmanes.caffeine.cache.Cache<Path,Snapshot> cache) |
void |
setStatsCache(org.apache.paimon.shade.caffeine2.com.github.benmanes.caffeine.cache.Cache<String,Statistics> cache) |
Snapshot |
snapshot(long snapshotId)
Get the
Snapshot from snapshot id. |
SnapshotManager |
snapshotManager() |
protected SplitGenerator |
splitGenerator() |
Optional<Statistics> |
statistics()
Optional statistics of this table.
|
AppendOnlyFileStore |
store() |
boolean |
supportStreamingReadOverwrite()
Currently, the streaming read of overwrite is implemented by reversing the
RowKind of
overwrote records to RowKind.DELETE , so only tables that have primary key support it. |
FileStoreTable |
switchToBranch(String branchName)
Get
DataTable with branch identified by branchName . |
TagManager |
tagManager() |
String |
uuid()
UUID of the table, metastore can provide the true UUID of this table, default is the full
name.
|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bucketMode, bucketSpec, comment, options, partitionKeys, primaryKeys, rowType
newBatchWriteBuilder, newReadBuilder, newStreamWriteBuilder
deleteBranches, deleteTags
protected final FileIO fileIO
protected final Path path
protected final TableSchema tableSchema
protected final CatalogEnvironment catalogEnvironment
@Nullable protected transient SegmentsCache<Path> manifestCache
@Nullable protected transient org.apache.paimon.shade.caffeine2.com.github.benmanes.caffeine.cache.Cache<Path,Snapshot> snapshotCache
@Nullable protected transient org.apache.paimon.shade.caffeine2.com.github.benmanes.caffeine.cache.Cache<String,Statistics> statsCache
public AppendOnlyFileStoreTable(FileIO fileIO, Path path, TableSchema tableSchema, CatalogEnvironment catalogEnvironment)
public AppendOnlyFileStore store()
protected SplitGenerator splitGenerator()
public boolean supportStreamingReadOverwrite()
RowKind
of
overwrote records to RowKind.DELETE
, so only tables that have primary key support it.protected java.util.function.BiConsumer<FileStoreScan,Predicate> nonPartitionFilterConsumer()
public InnerTableRead newRead()
public TableWriteImpl<InternalRow> newWrite(String commitUser)
public TableWriteImpl<InternalRow> newWrite(String commitUser, ManifestCacheFilter manifestFilter)
public LocalTableQuery newLocalTableQuery()
public String currentBranch()
public void setManifestCache(SegmentsCache<Path> manifestCache)
setManifestCache
in interface FileStoreTable
public void setSnapshotCache(org.apache.paimon.shade.caffeine2.com.github.benmanes.caffeine.cache.Cache<Path,Snapshot> cache)
setSnapshotCache
in interface FileStoreTable
public void setStatsCache(org.apache.paimon.shade.caffeine2.com.github.benmanes.caffeine.cache.Cache<String,Statistics> cache)
setStatsCache
in interface FileStoreTable
public Optional<Snapshot> latestSnapshot()
Table
latestSnapshot
in interface Table
public Snapshot snapshot(long snapshotId)
Table
Snapshot
from snapshot id.public SimpleFileReader<ManifestFileMeta> manifestListReader()
Table
manifestListReader
in interface Table
public SimpleFileReader<ManifestEntry> manifestFileReader()
Table
manifestFileReader
in interface Table
public SimpleFileReader<IndexManifestEntry> indexManifestFileReader()
Table
indexManifestFileReader
in interface Table
public String fullName()
Table
public Identifier identifier()
public String uuid()
Table
public Optional<Statistics> statistics()
Table
statistics
in interface Table
public Optional<WriteSelector> newWriteSelector()
newWriteSelector
in interface InnerTable
public CatalogEnvironment catalogEnvironment()
catalogEnvironment
in interface FileStoreTable
public RowKeyExtractor createRowKeyExtractor()
createRowKeyExtractor
in interface FileStoreTable
public SnapshotReader newSnapshotReader()
newSnapshotReader
in interface DataTable
public DataTableBatchScan newScan()
newScan
in interface DataTable
newScan
in interface InnerTable
public StreamDataTableScan newStreamScan()
newStreamScan
in interface InnerTable
public FileStoreTable copy(Map<String,String> dynamicOptions)
Table
copy
in interface FileStoreTable
copy
in interface Table
public FileStoreTable copyWithoutTimeTravel(Map<String,String> dynamicOptions)
FileStoreTable
copyWithoutTimeTravel
in interface FileStoreTable
protected FileStoreTable copyInternal(Map<String,String> dynamicOptions, boolean tryTimeTravel)
public FileStoreTable copyWithLatestSchema()
FileStoreTable
copyWithLatestSchema
in interface FileStoreTable
public FileStoreTable copy(TableSchema newTableSchema)
copy
in interface FileStoreTable
public SchemaManager schemaManager()
schemaManager
in interface DataTable
public CoreOptions coreOptions()
coreOptions
in interface DataTable
public TableSchema schema()
schema
in interface FileStoreTable
public SnapshotManager snapshotManager()
snapshotManager
in interface DataTable
public ChangelogManager changelogManager()
changelogManager
in interface DataTable
public ExpireSnapshots newExpireSnapshots()
Table
newExpireSnapshots
in interface Table
public ExpireSnapshots newExpireChangelog()
newExpireChangelog
in interface Table
public TableCommitImpl newCommit(String commitUser)
newCommit
in interface FileStoreTable
newCommit
in interface InnerTable
public void rollbackTo(long snapshotId)
Table
rollbackTo
in interface Table
public Snapshot findSnapshot(long fromSnapshotId) throws SnapshotNotExistException
SnapshotNotExistException
public void createTag(String tagName, long fromSnapshotId)
Table
public void createTag(String tagName, long fromSnapshotId, java.time.Duration timeRetained)
public void createTag(String tagName)
Table
public void createTag(String tagName, java.time.Duration timeRetained)
public void replaceTag(String tagName, @Nullable Long fromSnapshotId, @Nullable java.time.Duration timeRetained)
Table
replaceTag
in interface Table
public void deleteTag(String tagName)
Table
public void createBranch(String branchName)
Table
createBranch
in interface Table
public void createBranch(String branchName, String tagName)
Table
createBranch
in interface Table
public void deleteBranch(String branchName)
Table
deleteBranch
in interface Table
public void fastForward(String branchName)
Table
fastForward
in interface Table
public void rollbackTo(String tagName)
Table
rollbackTo
in interface Table
public TagManager tagManager()
tagManager
in interface DataTable
public BranchManager branchManager()
branchManager
in interface DataTable
public FileStoreTable switchToBranch(String branchName)
FileStoreTable
DataTable
with branch identified by branchName
. Note that this method
does not keep dynamic options in current table.switchToBranch
in interface DataTable
switchToBranch
in interface FileStoreTable
protected RowKindGenerator rowKindGenerator()
Copyright © 2023–2025 The Apache Software Foundation. All rights reserved.