Search in sources :

Example 1 with CopyOnWriteRollbackActionExecutor

use of org.apache.hudi.table.action.rollback.CopyOnWriteRollbackActionExecutor in project hudi by apache.

the class CopyOnWriteRestoreActionExecutor method rollbackInstant.

@Override
protected HoodieRollbackMetadata rollbackInstant(HoodieInstant instantToRollback) {
    if (!instantToRollback.getAction().equals(HoodieTimeline.COMMIT_ACTION) && !instantToRollback.getAction().equals(HoodieTimeline.REPLACE_COMMIT_ACTION)) {
        throw new HoodieRollbackException("Unsupported action in rollback instant:" + instantToRollback);
    }
    table.getMetaClient().reloadActiveTimeline();
    String newInstantTime = HoodieActiveTimeline.createNewInstantTime();
    table.scheduleRollback(context, newInstantTime, instantToRollback, false, false);
    table.getMetaClient().reloadActiveTimeline();
    CopyOnWriteRollbackActionExecutor rollbackActionExecutor = new CopyOnWriteRollbackActionExecutor(context, config, table, newInstantTime, instantToRollback, true, true, false, false);
    return rollbackActionExecutor.execute();
}
Also used : HoodieRollbackException(org.apache.hudi.exception.HoodieRollbackException) CopyOnWriteRollbackActionExecutor(org.apache.hudi.table.action.rollback.CopyOnWriteRollbackActionExecutor)

Aggregations

HoodieRollbackException (org.apache.hudi.exception.HoodieRollbackException)1 CopyOnWriteRollbackActionExecutor (org.apache.hudi.table.action.rollback.CopyOnWriteRollbackActionExecutor)1