public class PrimaryKeyFileStoreTable extends Object
FileStoreTable for primary key 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 |
|---|
PrimaryKeyFileStoreTable(FileIO fileIO,
Path path,
TableSchema tableSchema,
CatalogEnvironment catalogEnvironment) |
| Modifier and Type | Method and Description |
|---|---|
BranchManager |
branchManager() |
CatalogEnvironment |
catalogEnvironment() |
ChangelogManager |
changelogManager() |
ConsumerManager |
consumerManager() |
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() |
protected Runnable |
newExpireRunnable() |
ExpireSnapshots |
newExpireSnapshots()
Manually expire snapshots, parameters can be controlled independently of table options.
|
LocalTableQuery |
newLocalTableQuery() |
InnerTableRead |
newRead() |
DataTableBatchScan |
newScan() |
SnapshotReader |
newSnapshotReader() |
StreamDataTableScan |
newStreamScan() |
TableWriteImpl<KeyValue> |
newWrite(String commitUser) |
TableWriteImpl<KeyValue> |
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.
|
KeyValueFileStore |
store() |
boolean |
supportStreamingReadOverwrite() |
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, waitbucketMode, bucketSpec, comment, options, partitionKeys, primaryKeys, purgeFiles, rowTypenewBatchWriteBuilder, newReadBuilder, newStreamWriteBuilderdeleteBranches, deleteTagsprotected 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 PrimaryKeyFileStoreTable(FileIO fileIO, Path path, TableSchema tableSchema, CatalogEnvironment catalogEnvironment)
public KeyValueFileStore store()
protected SplitGenerator splitGenerator()
public boolean supportStreamingReadOverwrite()
protected java.util.function.BiConsumer<FileStoreScan,Predicate> nonPartitionFilterConsumer()
public InnerTableRead newRead()
public TableWriteImpl<KeyValue> newWrite(String commitUser)
public TableWriteImpl<KeyValue> newWrite(String commitUser, ManifestCacheFilter manifestFilter)
public LocalTableQuery newLocalTableQuery()
public RowKeyExtractor createRowKeyExtractor()
createRowKeyExtractor in interface FileStoreTablepublic String currentBranch()
public void setManifestCache(SegmentsCache<Path> manifestCache)
setManifestCache in interface FileStoreTablepublic void setSnapshotCache(org.apache.paimon.shade.caffeine2.com.github.benmanes.caffeine.cache.Cache<Path,Snapshot> cache)
setSnapshotCache in interface FileStoreTablepublic void setStatsCache(org.apache.paimon.shade.caffeine2.com.github.benmanes.caffeine.cache.Cache<String,Statistics> cache)
setStatsCache in interface FileStoreTablepublic Optional<Snapshot> latestSnapshot()
TablelatestSnapshot in interface Tablepublic Snapshot snapshot(long snapshotId)
TableSnapshot from snapshot id.public SimpleFileReader<ManifestFileMeta> manifestListReader()
TablemanifestListReader in interface Tablepublic SimpleFileReader<ManifestEntry> manifestFileReader()
TablemanifestFileReader in interface Tablepublic SimpleFileReader<IndexManifestEntry> indexManifestFileReader()
TableindexManifestFileReader in interface Tablepublic String fullName()
Tablepublic Identifier identifier()
public String uuid()
Tablepublic Optional<Statistics> statistics()
Tablestatistics in interface Tablepublic Optional<WriteSelector> newWriteSelector()
newWriteSelector in interface InnerTablepublic CatalogEnvironment catalogEnvironment()
catalogEnvironment in interface FileStoreTablepublic SnapshotReader newSnapshotReader()
newSnapshotReader in interface DataTablepublic DataTableBatchScan newScan()
newScan in interface DataTablenewScan in interface InnerTablepublic StreamDataTableScan newStreamScan()
newStreamScan in interface InnerTablepublic FileStoreTable copy(Map<String,String> dynamicOptions)
Tablecopy in interface FileStoreTablecopy in interface Tablepublic FileStoreTable copyWithoutTimeTravel(Map<String,String> dynamicOptions)
FileStoreTablecopyWithoutTimeTravel in interface FileStoreTableprotected FileStoreTable copyInternal(Map<String,String> dynamicOptions, boolean tryTimeTravel)
public FileStoreTable copyWithLatestSchema()
FileStoreTablecopyWithLatestSchema in interface FileStoreTablepublic FileStoreTable copy(TableSchema newTableSchema)
copy in interface FileStoreTablepublic SchemaManager schemaManager()
schemaManager in interface DataTablepublic CoreOptions coreOptions()
coreOptions in interface DataTablepublic TableSchema schema()
schema in interface FileStoreTablepublic SnapshotManager snapshotManager()
snapshotManager in interface DataTablepublic ChangelogManager changelogManager()
changelogManager in interface DataTablepublic ExpireSnapshots newExpireSnapshots()
TablenewExpireSnapshots in interface Tablepublic ExpireSnapshots newExpireChangelog()
newExpireChangelog in interface Tablepublic TableCommitImpl newCommit(String commitUser)
newCommit in interface FileStoreTablenewCommit in interface InnerTablepublic ConsumerManager consumerManager()
consumerManager in interface DataTablepublic void rollbackTo(long snapshotId)
TablerollbackTo in interface Tablepublic Snapshot findSnapshot(long fromSnapshotId) throws SnapshotNotExistException
SnapshotNotExistExceptionpublic void createTag(String tagName, long fromSnapshotId)
Tablepublic void createTag(String tagName, long fromSnapshotId, java.time.Duration timeRetained)
public void createTag(String tagName)
Tablepublic void createTag(String tagName, java.time.Duration timeRetained)
public void replaceTag(String tagName, @Nullable Long fromSnapshotId, @Nullable java.time.Duration timeRetained)
TablereplaceTag in interface Tablepublic void deleteTag(String tagName)
Tablepublic void createBranch(String branchName)
TablecreateBranch in interface Tablepublic void createBranch(String branchName, String tagName)
TablecreateBranch in interface Tablepublic void deleteBranch(String branchName)
TabledeleteBranch in interface Tablepublic void fastForward(String branchName)
TablefastForward in interface Tablepublic void rollbackTo(String tagName)
TablerollbackTo in interface Tablepublic TagManager tagManager()
tagManager in interface DataTablepublic BranchManager branchManager()
branchManager in interface DataTablepublic FileStoreTable switchToBranch(String branchName)
FileStoreTableDataTable with branch identified by branchName. Note that this method
does not keep dynamic options in current table.switchToBranch in interface DataTableswitchToBranch in interface FileStoreTableprotected RowKindGenerator rowKindGenerator()
Copyright © 2023–2025 The Apache Software Foundation. All rights reserved.