T - Type of dataI - Type of inputsK - Type of keysO - Type of outputspublic abstract class BaseHoodieWriteClient<T,I,K,O> extends BaseHoodieClient implements RunsTableService
| Modifier and Type | Field and Description |
|---|---|
protected Option<Pair<HoodieInstant,Map<String,String>>> |
lastCompletedTxnAndMetadata |
protected static String |
LOOKUP_STR |
protected Set<String> |
pendingInflightAndRequestedInstants |
protected BaseHoodieTableServiceClient<?,?,O> |
tableServiceClient |
protected com.codahale.metrics.Timer.Context |
writeTimer |
basePath, config, context, fs, hadoopConf, heartbeatClient, metrics, txnManager| Constructor and Description |
|---|
BaseHoodieWriteClient(HoodieEngineContext context,
HoodieWriteConfig writeConfig,
Option<EmbeddedTimelineService> timelineService,
SupportsUpgradeDowngrade upgradeDowngradeHelper)
Deprecated.
|
BaseHoodieWriteClient(HoodieEngineContext context,
HoodieWriteConfig writeConfig,
SupportsUpgradeDowngrade upgradeDowngradeHelper)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(String colName,
org.apache.avro.Schema schema) |
void |
addColumn(String colName,
org.apache.avro.Schema schema,
String doc,
String position,
TableChange.ColumnPositionChange.ColumnPositionType positionType)
add columns to table.
|
void |
archive()
Trigger archival for the table.
|
protected void |
archive(HoodieTable table)
Trigger archival for the table.
|
protected void |
autoArchiveOnCommit(HoodieTable table) |
protected void |
autoCleanOnCommit() |
void |
bootstrap(Option<Map<String,String>> extraMetadata)
Main API to run bootstrap to hudi.
|
abstract O |
bulkInsert(I records,
String instantTime)
Loads the given HoodieRecords, as inserts into the table.
|
abstract O |
bulkInsert(I records,
String instantTime,
Option<BulkInsertPartitioner> userDefinedBulkInsertPartitioner)
Loads the given HoodieRecords, as inserts into the table.
|
abstract O |
bulkInsertPreppedRecords(I preppedRecords,
String instantTime,
Option<BulkInsertPartitioner> bulkInsertPartitioner)
Loads the given HoodieRecords, as inserts into the table.
|
HoodieCleanMetadata |
clean() |
HoodieCleanMetadata |
clean(boolean skipLocking)
Deprecated.
|
HoodieCleanMetadata |
clean(String cleanInstantTime)
Clean up any stale/old files/data lying around (either on file storage or index storage) based on the
configurations and CleaningPolicy used.
|
HoodieCleanMetadata |
clean(String cleanInstantTime,
boolean skipLocking)
Deprecated.
|
HoodieCleanMetadata |
clean(String cleanInstantTime,
boolean scheduleInline,
boolean skipLocking)
Clean up any stale/old files/data lying around (either on file storage or index storage) based on the
configurations and CleaningPolicy used.
|
void |
close()
Releases any resources used by the client.
|
HoodieWriteMetadata<O> |
cluster(String clusteringInstantTime)
Performs Clustering for the workload stored in instant-time.
|
HoodieWriteMetadata<O> |
cluster(String clusteringInstant,
boolean shouldComplete)
Ensures clustering instant is in expected state and performs clustering for the plan stored in metadata.
|
protected void |
commit(HoodieTable table,
String commitActionType,
String instantTime,
HoodieCommitMetadata metadata,
List<HoodieWriteStat> stats,
HoodieData<WriteStatus> writeStatuses) |
boolean |
commit(String instantTime,
O writeStatuses)
Commit changes performed at the given instantTime marker.
|
boolean |
commit(String instantTime,
O writeStatuses,
Option<Map<String,String>> extraMetadata)
Commit changes performed at the given instantTime marker.
|
boolean |
commit(String instantTime,
O writeStatuses,
Option<Map<String,String>> extraMetadata,
String commitActionType,
Map<String,List<String>> partitionToReplacedFileIds) |
abstract boolean |
commit(String instantTime,
O writeStatuses,
Option<Map<String,String>> extraMetadata,
String commitActionType,
Map<String,List<String>> partitionToReplacedFileIds,
Option<BiConsumer<HoodieTableMetaClient,HoodieCommitMetadata>> extraPreCommitFunc) |
void |
commitCompaction(String compactionInstantTime,
HoodieCommitMetadata metadata,
Option<Map<String,String>> extraMetadata)
Commit a compaction operation.
|
void |
commitLogCompaction(String logCompactionInstantTime,
HoodieCommitMetadata metadata,
Option<Map<String,String>> extraMetadata)
Commit a log compaction operation.
|
boolean |
commitStats(String instantTime,
HoodieData<WriteStatus> writeStatuses,
List<HoodieWriteStat> stats,
Option<Map<String,String>> extraMetadata,
String commitActionType) |
boolean |
commitStats(String instantTime,
HoodieData<WriteStatus> writeStatuses,
List<HoodieWriteStat> stats,
Option<Map<String,String>> extraMetadata,
String commitActionType,
Map<String,List<String>> partitionToReplaceFileIds,
Option<BiConsumer<HoodieTableMetaClient,HoodieCommitMetadata>> extraPreCommitFunc) |
HoodieWriteMetadata<O> |
compact(String compactionInstantTime)
Performs Compaction for the workload stored in instant-time.
|
protected HoodieWriteMetadata<O> |
compact(String compactionInstantTime,
boolean shouldComplete)
Ensures compaction instant is in expected state and performs Compaction for the workload stored in instant-time.
|
protected void |
completeCompaction(HoodieCommitMetadata metadata,
HoodieTable table,
String compactionCommitTime)
Commit Compaction and track metrics.
|
protected void |
completeLogCompaction(HoodieCommitMetadata metadata,
HoodieTable table,
String logCompactionCommitTime)
Commit Log Compaction and track metrics.
|
protected abstract HoodieIndex<?,?> |
createIndex(HoodieWriteConfig writeConfig) |
protected abstract HoodieTable<T,I,K,O> |
createTable(HoodieWriteConfig config,
org.apache.hadoop.conf.Configuration hadoopConf) |
protected abstract HoodieTable<T,I,K,O> |
createTable(HoodieWriteConfig config,
org.apache.hadoop.conf.Configuration hadoopConf,
HoodieTableMetaClient metaClient) |
abstract O |
delete(K keys,
String instantTime)
|
void |
deleteColumns(String... colNames)
delete columns to table.
|
abstract O |
deletePrepped(I preppedRecords,
String instantTime)
Delete records from Hoodie table based on
HoodieKey and HoodieRecordLocation specified in
preppedRecords. |
void |
deleteSavepoint()
Delete a savepoint based on the latest commit action on the savepoint timeline.
|
void |
deleteSavepoint(String savepointTime)
Delete a savepoint that was created.
|
protected void |
doInitTable(WriteOperationType operationType,
HoodieTableMetaClient metaClient,
Option<String> instantTime)
Performs necessary bootstrapping operations (for ex, validating whether Metadata Table has to be bootstrapped).
|
void |
dropIndex(List<MetadataPartitionType> partitionTypes)
Drops the index and removes the metadata partitions.
|
abstract I |
filterExists(I hoodieRecords)
Filter out HoodieRecords that already exists in the output folder.
|
HoodieIndex<?,?> |
getIndex() |
HoodieMetrics |
getMetrics() |
WriteOperationType |
getOperationType() |
BaseHoodieTableServiceClient<?,?,O> |
getTableServiceClient() |
Option<HoodieIndexCommitMetadata> |
index(String indexInstantTime)
Runs INDEX action to build out the metadata partitions as planned for the given instant time.
|
protected void |
initMetadataTable(Option<String> instantTime)
Bootstrap the metadata table.
|
HoodieTable |
initTable(WriteOperationType operationType,
Option<String> instantTime)
Instantiates and initializes instance of
HoodieTable, performing crucial bootstrapping
operations such as:
NOTE: This method is engine-agnostic and SHOULD NOT be overloaded, please check on
doInitTable(WriteOperationType, HoodieTableMetaClient, Option) instead
Checking whether upgrade/downgrade is required
Bootstrapping Metadata Table (if required)
Initializing metrics contexts
|
protected HoodieTable |
initTable(WriteOperationType operationType,
Option<String> instantTime,
boolean initMetadataTable) |
protected Option<String> |
inlineScheduleCompaction(Option<Map<String,String>> extraMetadata)
Schedules compaction inline.
|
abstract O |
insert(I records,
String instantTime)
Inserts the given HoodieRecords, into the table.
|
abstract O |
insertPreppedRecords(I preppedRecords,
String instantTime)
Inserts the given prepared records into the Hoodie table, at the supplied instantTime.
|
boolean |
lazyRollbackFailedIndexing()
Rolls back the failed delta commits corresponding to the indexing action.
|
HoodieWriteMetadata<O> |
logCompact(String logCompactionInstantTime)
Performs Log Compaction for the workload stored in instant-time.
|
protected HoodieWriteMetadata<O> |
logCompact(String logCompactionInstantTime,
boolean shouldComplete)
Ensures compaction instant is in expected state and performs Log Compaction for the workload stored in instant-time.s
|
protected void |
mayBeCleanAndArchive(HoodieTable table)
Triggers cleaning and archival for the table of interest.
|
protected void |
postCommit(HoodieTable table,
HoodieCommitMetadata metadata,
String instantTime,
Option<Map<String,String>> extraMetadata)
Post Commit Hook.
|
O |
postWrite(HoodieWriteMetadata<O> result,
String instantTime,
HoodieTable hoodieTable)
Common method containing steps to be performed after write (upsert/insert/..) operations including auto-commit.
|
protected void |
preCommit(HoodieInstant inflightInstant,
HoodieCommitMetadata metadata)
Any pre-commit actions like conflict resolution goes here.
|
void |
preWrite(String instantTime,
WriteOperationType writeOperationType,
HoodieTableMetaClient metaClient)
Common method containing steps to be performed before write (upsert/insert/...
|
protected void |
releaseResources(String instantTime)
Called after each write, to release any resources used.
|
void |
renameColumn(String colName,
String newName)
rename col name for hudi table.
|
void |
reOrderColPosition(String colName,
String referColName,
TableChange.ColumnPositionChange.ColumnPositionType orderType)
reorder the position of col.
|
HoodieRestoreMetadata |
restoreToInstant(String savepointToRestoreTimestamp,
boolean initialMetadataTableIfNecessary)
NOTE : This action requires all writers (ingest and compact) to a table to be stopped before proceeding.
|
void |
restoreToSavepoint()
Restore the data to a savepoint based on the latest commit action on the savepoint timeline.
|
void |
restoreToSavepoint(String savepointTime)
Restore the data to the savepoint.
|
boolean |
rollback(String commitInstantTime)
Deprecated.
|
boolean |
rollback(String commitInstantTime,
String rollbackInstantTimestamp)
Deprecated.
|
boolean |
rollbackFailedWrites()
Rollback failed writes if any.
|
void |
runAnyPendingCompactions()
Run any pending compactions.
|
void |
runAnyPendingLogCompactions()
Run any pending log compactions.
|
protected void |
runTableServicesInline(HoodieTable table,
HoodieCommitMetadata metadata,
Option<Map<String,String>> extraMetadata) |
void |
savepoint(String user,
String comment)
Create a savepoint based on the latest commit action on the timeline.
|
void |
savepoint(String instantTime,
String user,
String comment)
Savepoint a specific commit instant time.
|
protected boolean |
scheduleCleaningAtInstant(String instantTime,
Option<Map<String,String>> extraMetadata)
Schedules a new cleaning instant with passed-in instant time.
|
Option<String> |
scheduleClustering(Option<Map<String,String>> extraMetadata)
Schedules a new clustering instant.
|
boolean |
scheduleClusteringAtInstant(String instantTime,
Option<Map<String,String>> extraMetadata)
Schedules a new clustering instant with passed-in instant time.
|
Option<String> |
scheduleCompaction(Option<Map<String,String>> extraMetadata)
Schedules a new compaction instant.
|
boolean |
scheduleCompactionAtInstant(String instantTime,
Option<Map<String,String>> extraMetadata)
Schedules a new compaction instant with passed-in instant time.
|
Option<String> |
scheduleIndexing(List<MetadataPartitionType> partitionTypes)
Schedules INDEX action.
|
Option<String> |
scheduleLogCompaction(Option<Map<String,String>> extraMetadata)
Schedules a new log compaction instant.
|
boolean |
scheduleLogCompactionAtInstant(String instantTime,
Option<Map<String,String>> extraMetadata)
Schedules a new log compaction instant with passed-in instant time.
|
Option<String> |
scheduleTableService(Option<Map<String,String>> extraMetadata,
TableServiceType tableServiceType)
Schedule table services such as clustering, compaction & cleaning.
|
Option<String> |
scheduleTableService(String instantTime,
Option<Map<String,String>> extraMetadata,
TableServiceType tableServiceType)
Schedule table services such as clustering, compaction & cleaning.
|
void |
setOperationType(WriteOperationType operationType) |
protected void |
setWriteSchemaForDeletes(HoodieTableMetaClient metaClient)
Sets write schema from last instant since deletes may not have schema set in the config.
|
String |
startCommit()
Provides a new commit time for a write operation (insert/update/delete).
|
String |
startCommit(String actionType,
HoodieTableMetaClient metaClient)
Provides a new commit time for a write operation (insert/update/delete/insert_overwrite/insert_overwrite_table) with specified action.
|
void |
startCommitWithTime(String instantTime)
Provides a new commit time for a write operation (insert/update/delete/insert_overwrite/insert_overwrite_table) without specified action.
|
void |
startCommitWithTime(String instantTime,
String actionType)
Completes a new commit time for a write operation (insert/update/delete/insert_overwrite/insert_overwrite_table) with specified action.
|
protected void |
tryUpgrade(HoodieTableMetaClient metaClient,
Option<String> instantTime)
Upgrades the hoodie table if need be when moving to a new Hudi version.
|
void |
updateColumnComment(String colName,
String doc)
update col comment for hudi table.
|
void |
updateColumnNullability(String colName,
boolean nullable)
update col nullable attribute for hudi table.
|
void |
updateColumnType(String colName,
Type newType)
update col Type for hudi table.
|
abstract O |
upsert(I records,
String instantTime)
Upsert a batch of new records into Hoodie table at the supplied instantTime.
|
abstract O |
upsertPreppedRecords(I preppedRecords,
String instantTime)
Upserts the given prepared records into the Hoodie table, at the supplied instantTime.
|
protected void |
writeTableMetadata(HoodieTable table,
String instantTime,
HoodieCommitMetadata metadata,
HoodieData<WriteStatus> writeStatuses)
Write the HoodieCommitMetadata to metadata table if available.
|
createMetaClient, finalizeWrite, getConfig, getEngineContext, getHeartbeatClient, getTimelineServer, initWrapperFSMetrics, resolveWriteConflictclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitshouldDelegateToTableServiceManager, tableServicesEnabledprotected static final String LOOKUP_STR
protected transient com.codahale.metrics.Timer.Context writeTimer
protected Option<Pair<HoodieInstant,Map<String,String>>> lastCompletedTxnAndMetadata
protected BaseHoodieTableServiceClient<?,?,O> tableServiceClient
@Deprecated public BaseHoodieWriteClient(HoodieEngineContext context, HoodieWriteConfig writeConfig, SupportsUpgradeDowngrade upgradeDowngradeHelper)
context - HoodieEngineContextwriteConfig - instance of HoodieWriteConfigupgradeDowngradeHelper - engine-specific instance of SupportsUpgradeDowngrade@Deprecated public BaseHoodieWriteClient(HoodieEngineContext context, HoodieWriteConfig writeConfig, Option<EmbeddedTimelineService> timelineService, SupportsUpgradeDowngrade upgradeDowngradeHelper)
context - HoodieEngineContextwriteConfig - instance of HoodieWriteConfigtimelineService - Timeline Service that runs as part of write client.protected abstract HoodieIndex<?,?> createIndex(HoodieWriteConfig writeConfig)
public void setOperationType(WriteOperationType operationType)
public WriteOperationType getOperationType()
public BaseHoodieTableServiceClient<?,?,O> getTableServiceClient()
public boolean commit(String instantTime, O writeStatuses)
public boolean commit(String instantTime, O writeStatuses, Option<Map<String,String>> extraMetadata)
public boolean commit(String instantTime, O writeStatuses, Option<Map<String,String>> extraMetadata, String commitActionType, Map<String,List<String>> partitionToReplacedFileIds)
public abstract boolean commit(String instantTime, O writeStatuses, Option<Map<String,String>> extraMetadata, String commitActionType, Map<String,List<String>> partitionToReplacedFileIds, Option<BiConsumer<HoodieTableMetaClient,HoodieCommitMetadata>> extraPreCommitFunc)
public boolean commitStats(String instantTime, HoodieData<WriteStatus> writeStatuses, List<HoodieWriteStat> stats, Option<Map<String,String>> extraMetadata, String commitActionType)
public boolean commitStats(String instantTime, HoodieData<WriteStatus> writeStatuses, List<HoodieWriteStat> stats, Option<Map<String,String>> extraMetadata, String commitActionType, Map<String,List<String>> partitionToReplaceFileIds, Option<BiConsumer<HoodieTableMetaClient,HoodieCommitMetadata>> extraPreCommitFunc)
protected void commit(HoodieTable table, String commitActionType, String instantTime, HoodieCommitMetadata metadata, List<HoodieWriteStat> stats, HoodieData<WriteStatus> writeStatuses) throws IOException
IOExceptionprotected abstract HoodieTable<T,I,K,O> createTable(HoodieWriteConfig config, org.apache.hadoop.conf.Configuration hadoopConf)
protected abstract HoodieTable<T,I,K,O> createTable(HoodieWriteConfig config, org.apache.hadoop.conf.Configuration hadoopConf, HoodieTableMetaClient metaClient)
protected void preCommit(HoodieInstant inflightInstant, HoodieCommitMetadata metadata)
inflightInstant - instant of inflight operation.metadata - commit metadata for which pre commit is being invoked.protected void writeTableMetadata(HoodieTable table, String instantTime, HoodieCommitMetadata metadata, HoodieData<WriteStatus> writeStatuses)
table - HoodieTable of interest.instantTime - instant time of the commit.metadata - instance of HoodieCommitMetadata.writeStatuses - WriteStatuses for the completed action.public abstract I filterExists(I hoodieRecords)
hoodieRecords - Input Hoodie records.public void bootstrap(Option<Map<String,String>> extraMetadata)
public abstract O upsert(I records, String instantTime)
records - hoodieRecords to upsertinstantTime - Instant time of the commitpublic abstract O upsertPreppedRecords(I preppedRecords, String instantTime)
This implementation requires that the input records are already tagged, and de-duped if needed.
preppedRecords - Prepared HoodieRecords to upsertinstantTime - Instant time of the commitpublic abstract O insert(I records, String instantTime)
This implementation skips the index check and is able to leverage benefits such as small file handling/blocking alignment, as with upsert(), by profiling the workload
records - HoodieRecords to insertinstantTime - Instant time of the commitpublic abstract O insertPreppedRecords(I preppedRecords, String instantTime)
This implementation skips the index check, skips de-duping and is able to leverage benefits such as small file handling/blocking alignment, as with insert(), by profiling the workload. The prepared HoodieRecords should be de-duped if needed.
preppedRecords - HoodieRecords to insertinstantTime - Instant time of the commitpublic abstract O bulkInsert(I records, String instantTime)
This implementation uses sortBy (which does range partitioning based on reservoir sampling) and attempts to control
the numbers of files with less memory compared to the BaseHoodieWriteClient#insert(I, String)
records - HoodieRecords to insertinstantTime - Instant time of the commitpublic abstract O bulkInsert(I records, String instantTime, Option<BulkInsertPartitioner> userDefinedBulkInsertPartitioner)
This implementation uses sortBy (which does range partitioning based on reservoir sampling) and attempts to control
the numbers of files with less memory compared to the BaseHoodieWriteClient#insert(I, String). Optionally
it allows users to specify their own partitioner. If specified then it will be used for repartitioning records. See
BulkInsertPartitioner.
records - HoodieRecords to insertinstantTime - Instant time of the commituserDefinedBulkInsertPartitioner - If specified then it will be used to partition input records before they are inserted
into hoodie.public abstract O bulkInsertPreppedRecords(I preppedRecords, String instantTime, Option<BulkInsertPartitioner> bulkInsertPartitioner)
This implementation uses sortBy (which does range partitioning based on reservoir sampling) and attempts to control
the numbers of files with less memory compared to the BaseHoodieWriteClient#insert(I, String). Optionally
it allows users to specify their own partitioner. If specified then it will be used for repartitioning records. See
BulkInsertPartitioner.
preppedRecords - HoodieRecords to insertinstantTime - Instant time of the commitbulkInsertPartitioner - If specified then it will be used to partition input records before they are inserted
into hoodie.public abstract O deletePrepped(I preppedRecords, String instantTime)
HoodieKey and HoodieRecordLocation specified in
preppedRecords.preppedRecords - Empty records with key and locator set.instantTime - Commit time handle.public void preWrite(String instantTime, WriteOperationType writeOperationType, HoodieTableMetaClient metaClient)
instantTime - writeOperationType - metaClient - public O postWrite(HoodieWriteMetadata<O> result, String instantTime, HoodieTable hoodieTable)
result - Commit Action ResultinstantTime - Instant TimehoodieTable - Hoodie Tableprotected void postCommit(HoodieTable table, HoodieCommitMetadata metadata, String instantTime, Option<Map<String,String>> extraMetadata)
table - table to commit onmetadata - Commit Metadata corresponding to committed instantinstantTime - Instant TimeextraMetadata - Additional Metadata passed by userprotected void mayBeCleanAndArchive(HoodieTable table)
table - instance of HoodieTable of interest.protected void runTableServicesInline(HoodieTable table, HoodieCommitMetadata metadata, Option<Map<String,String>> extraMetadata)
protected void autoCleanOnCommit()
protected void autoArchiveOnCommit(HoodieTable table)
public void runAnyPendingCompactions()
public void runAnyPendingLogCompactions()
public void savepoint(String user, String comment)
user - User creating the savepointcomment - Comment for the savepointpublic void savepoint(String instantTime, String user, String comment)
This gives an option to rollback the state to the savepoint anytime. Savepoint needs to be manually created and deleted.
Savepoint should be on a commit that could not have been cleaned.
instantTime - Commit that should be savepointeduser - User creating the savepointcomment - Comment for the savepointpublic void deleteSavepoint()
public void deleteSavepoint(String savepointTime)
savepointTime - Savepoint time to deletepublic void restoreToSavepoint()
public void restoreToSavepoint(String savepointTime)
savepointTime - Savepoint time to rollback to@Deprecated public boolean rollback(String commitInstantTime) throws HoodieRollbackException
HoodieRollbackException@Deprecated public boolean rollback(String commitInstantTime, String rollbackInstantTimestamp) throws HoodieRollbackException
HoodieRollbackExceptionpublic HoodieRestoreMetadata restoreToInstant(String savepointToRestoreTimestamp, boolean initialMetadataTableIfNecessary) throws HoodieRestoreException
savepointToRestoreTimestamp - savepoint instant time to which restoration is requestedHoodieRestoreExceptionpublic HoodieCleanMetadata clean(String cleanInstantTime) throws HoodieIOException
HoodieIOException@Deprecated public HoodieCleanMetadata clean(String cleanInstantTime, boolean skipLocking) throws HoodieIOException
cleanInstantTime - instant time for clean.skipLocking - if this is triggered by another parent transaction, locking can be skipped.HoodieCleanMetadata.HoodieIOExceptionpublic HoodieCleanMetadata clean(String cleanInstantTime, boolean scheduleInline, boolean skipLocking) throws HoodieIOException
scheduleTableService(String, Option, TableServiceType) and disable inline scheduling
of clean.cleanInstantTime - instant time for clean.scheduleInline - true if needs to be scheduled inline. false otherwise.skipLocking - if this is triggered by another parent transaction, locking can be skipped.HoodieIOExceptionpublic HoodieCleanMetadata clean()
@Deprecated public HoodieCleanMetadata clean(boolean skipLocking)
skipLocking - if this is triggered by another parent transaction, locking can be skipped.HoodieCleanMetadata.protected void archive(HoodieTable table)
table - table to commit on.public void archive()
public String startCommit()
public String startCommit(String actionType, HoodieTableMetaClient metaClient)
public void startCommitWithTime(String instantTime)
instantTime - Instant time to be generatedpublic void startCommitWithTime(String instantTime, String actionType)
public Option<String> scheduleCompaction(Option<Map<String,String>> extraMetadata) throws HoodieIOException
extraMetadata - Extra Metadata to be storedHoodieIOExceptionpublic boolean scheduleCompactionAtInstant(String instantTime, Option<Map<String,String>> extraMetadata) throws HoodieIOException
instantTime - Compaction Instant TimeextraMetadata - Extra Metadata to be storedHoodieIOExceptionpublic Option<String> scheduleIndexing(List<MetadataPartitionType> partitionTypes)
partitionTypes - - list of MetadataPartitionType which needs to be indexedpublic Option<HoodieIndexCommitMetadata> index(String indexInstantTime)
indexInstantTime - - instant time for the requested INDEX actionOption after successful indexing.public void dropIndex(List<MetadataPartitionType> partitionTypes)
partitionTypes - - list of MetadataPartitionType which needs to be indexedpublic HoodieWriteMetadata<O> cluster(String clusteringInstantTime)
clusteringInstantTime - Clustering Instant Timepublic HoodieWriteMetadata<O> compact(String compactionInstantTime)
compactionInstantTime - Compaction Instant Timepublic void commitCompaction(String compactionInstantTime, HoodieCommitMetadata metadata, Option<Map<String,String>> extraMetadata)
compactionInstantTime - Compaction Instant Timemetadata - All the metadata that gets stored along with a commitextraMetadata - Extra Metadata to be storedprotected void completeCompaction(HoodieCommitMetadata metadata, HoodieTable table, String compactionCommitTime)
public Option<String> scheduleLogCompaction(Option<Map<String,String>> extraMetadata) throws HoodieIOException
extraMetadata - Extra Metadata to be storedHoodieIOExceptionpublic boolean scheduleLogCompactionAtInstant(String instantTime, Option<Map<String,String>> extraMetadata) throws HoodieIOException
instantTime - Log Compaction Instant TimeextraMetadata - Extra Metadata to be storedHoodieIOExceptionpublic HoodieWriteMetadata<O> logCompact(String logCompactionInstantTime)
logCompactionInstantTime - Log Compaction Instant Timepublic void commitLogCompaction(String logCompactionInstantTime, HoodieCommitMetadata metadata, Option<Map<String,String>> extraMetadata)
logCompactionInstantTime - Log Compaction Instant Timemetadata - All the metadata that gets stored along with a commitextraMetadata - Extra Metadata to be storedprotected void completeLogCompaction(HoodieCommitMetadata metadata, HoodieTable table, String logCompactionCommitTime)
protected HoodieWriteMetadata<O> compact(String compactionInstantTime, boolean shouldComplete)
compactionInstantTime - Compaction Instant Timeprotected Option<String> inlineScheduleCompaction(Option<Map<String,String>> extraMetadata)
extraMetadata - extra metadata to be used.protected HoodieWriteMetadata<O> logCompact(String logCompactionInstantTime, boolean shouldComplete)
logCompactionInstantTime - Compaction Instant Timepublic Option<String> scheduleClustering(Option<Map<String,String>> extraMetadata) throws HoodieIOException
extraMetadata - Extra Metadata to be storedHoodieIOExceptionpublic boolean scheduleClusteringAtInstant(String instantTime, Option<Map<String,String>> extraMetadata) throws HoodieIOException
instantTime - clustering Instant TimeextraMetadata - Extra Metadata to be storedHoodieIOExceptionprotected boolean scheduleCleaningAtInstant(String instantTime, Option<Map<String,String>> extraMetadata) throws HoodieIOException
instantTime - cleaning Instant TimeextraMetadata - Extra Metadata to be storedHoodieIOExceptionpublic HoodieWriteMetadata<O> cluster(String clusteringInstant, boolean shouldComplete)
clusteringInstant - Clustering Instant Timepublic Option<String> scheduleTableService(Option<Map<String,String>> extraMetadata, TableServiceType tableServiceType)
extraMetadata - Metadata to pass onto the scheduled service instanttableServiceType - Type of table service to schedulepublic Option<String> scheduleTableService(String instantTime, Option<Map<String,String>> extraMetadata, TableServiceType tableServiceType)
extraMetadata - Metadata to pass onto the scheduled service instanttableServiceType - Type of table service to schedulepublic HoodieMetrics getMetrics()
public HoodieIndex<?,?> getIndex()
protected void doInitTable(WriteOperationType operationType, HoodieTableMetaClient metaClient, Option<String> instantTime)
NOTE: THIS OPERATION IS EXECUTED UNDER LOCK, THEREFORE SHOULD AVOID ANY OPERATIONS NOT REQUIRING EXTERNAL SYNCHRONIZATION
metaClient - instance of HoodieTableMetaClientinstantTime - current inflight instant timeprotected void initMetadataTable(Option<String> instantTime)
instantTime - current inflight instant timeprotected final HoodieTable initTable(WriteOperationType operationType, Option<String> instantTime, boolean initMetadataTable)
public final HoodieTable initTable(WriteOperationType operationType, Option<String> instantTime)
HoodieTable, performing crucial bootstrapping
operations such as:
NOTE: This method is engine-agnostic and SHOULD NOT be overloaded, please check on
doInitTable(WriteOperationType, HoodieTableMetaClient, Option) instead
protected void setWriteSchemaForDeletes(HoodieTableMetaClient metaClient)
protected void releaseResources(String instantTime)
public void close()
BaseHoodieClientclose in interface AutoCloseableclose in class BaseHoodieClientprotected void tryUpgrade(HoodieTableMetaClient metaClient, Option<String> instantTime)
metaClient - instance of HoodieTableMetaClient to use.instantTime - instant time of interest if we have one.public boolean lazyRollbackFailedIndexing()
TODO(HUDI-5733): This should be cleaned up once the proper fix of rollbacks in the metadata table is landed.
true if rollback happens; false otherwise.public boolean rollbackFailedWrites()
public void addColumn(String colName, org.apache.avro.Schema schema, String doc, String position, TableChange.ColumnPositionChange.ColumnPositionType positionType)
colName - col name to be added. if we want to add col to a nested filed, the fullName should be specifiedschema - col type to be added.doc - col doc to be added.position - col position to be addedpositionType - col position change type. now support three change types: first/after/beforepublic void addColumn(String colName, org.apache.avro.Schema schema)
public void deleteColumns(String... colNames)
colNames - col name to be deleted. if we want to delete col from a nested filed, the fullName should be specifiedpublic void renameColumn(String colName, String newName)
colName - col name to be renamed. if we want to rename col from a nested filed, the fullName should be specifiednewName - new name for current col. no need to specify fullName.public void updateColumnNullability(String colName, boolean nullable)
colName - col name to be changed. if we want to change col from a nested filed, the fullName should be specifiednullable - .public void updateColumnType(String colName, Type newType)
colName - col name to be changed. if we want to change col from a nested filed, the fullName should be specifiednewType - .public void updateColumnComment(String colName, String doc)
colName - col name to be changed. if we want to change col from a nested filed, the fullName should be specifieddoc - .public void reOrderColPosition(String colName, String referColName, TableChange.ColumnPositionChange.ColumnPositionType orderType)
colName - column which need to be reordered. if we want to change col from a nested filed, the fullName should be specified.referColName - reference position.orderType - col position change type. now support three change types: first/after/beforeCopyright © 2023 The Apache Software Foundation. All rights reserved.