Search in sources :

Example 1 with NoOpConsistencyGuard

use of org.apache.hudi.common.fs.NoOpConsistencyGuard in project hudi by apache.

the class TestCompactionCommand method generateCompactionInstances.

private void generateCompactionInstances() throws IOException {
    // create MOR table.
    new TableCommand().createTable(tablePath, tableName, HoodieTableType.MERGE_ON_READ.name(), "", TimelineLayoutVersion.VERSION_1, HoodieAvroPayload.class.getName());
    CompactionTestUtils.setupAndValidateCompactionOperations(HoodieCLI.getTableMetaClient(), true, 1, 2, 3, 4);
    HoodieActiveTimeline activeTimeline = HoodieCLI.getTableMetaClient().reloadActiveTimeline();
    // Create six commits
    Arrays.asList("001", "003", "005", "007").forEach(timestamp -> {
        activeTimeline.transitionCompactionInflightToComplete(new HoodieInstant(HoodieInstant.State.INFLIGHT, COMPACTION_ACTION, timestamp), Option.empty());
    });
    // Simulate a compaction commit in metadata table timeline
    // so the archival in data table can happen
    HoodieTestUtils.createCompactionCommitInMetadataTable(hadoopConf(), new HoodieWrapperFileSystem(FSUtils.getFs(tablePath, hadoopConf()), new NoOpConsistencyGuard()), tablePath, "007");
}
Also used : HoodieInstant(org.apache.hudi.common.table.timeline.HoodieInstant) HoodieActiveTimeline(org.apache.hudi.common.table.timeline.HoodieActiveTimeline) HoodieWrapperFileSystem(org.apache.hudi.common.fs.HoodieWrapperFileSystem) NoOpConsistencyGuard(org.apache.hudi.common.fs.NoOpConsistencyGuard) HoodieAvroPayload(org.apache.hudi.common.model.HoodieAvroPayload)

Example 2 with NoOpConsistencyGuard

use of org.apache.hudi.common.fs.NoOpConsistencyGuard in project hudi by apache.

the class HoodieTableMetaClient method getFs.

/**
 * Get the FS implementation for this table.
 */
public HoodieWrapperFileSystem getFs() {
    if (fs == null) {
        FileSystem fileSystem = FSUtils.getFs(metaPath, hadoopConf.newCopy());
        if (fileSystemRetryConfig.isFileSystemActionRetryEnable()) {
            fileSystem = new HoodieRetryWrapperFileSystem(fileSystem, fileSystemRetryConfig.getMaxRetryIntervalMs(), fileSystemRetryConfig.getMaxRetryNumbers(), fileSystemRetryConfig.getInitialRetryIntervalMs(), fileSystemRetryConfig.getRetryExceptions());
        }
        ValidationUtils.checkArgument(!(fileSystem instanceof HoodieWrapperFileSystem), "File System not expected to be that of HoodieWrapperFileSystem");
        fs = new HoodieWrapperFileSystem(fileSystem, consistencyGuardConfig.isConsistencyCheckEnabled() ? new FailSafeConsistencyGuard(fileSystem, consistencyGuardConfig) : new NoOpConsistencyGuard());
    }
    return fs;
}
Also used : HoodieRetryWrapperFileSystem(org.apache.hudi.common.fs.HoodieRetryWrapperFileSystem) HoodieWrapperFileSystem(org.apache.hudi.common.fs.HoodieWrapperFileSystem) HoodieRetryWrapperFileSystem(org.apache.hudi.common.fs.HoodieRetryWrapperFileSystem) FileSystem(org.apache.hadoop.fs.FileSystem) HoodieWrapperFileSystem(org.apache.hudi.common.fs.HoodieWrapperFileSystem) FailSafeConsistencyGuard(org.apache.hudi.common.fs.FailSafeConsistencyGuard) NoOpConsistencyGuard(org.apache.hudi.common.fs.NoOpConsistencyGuard)

Aggregations

HoodieWrapperFileSystem (org.apache.hudi.common.fs.HoodieWrapperFileSystem)2 NoOpConsistencyGuard (org.apache.hudi.common.fs.NoOpConsistencyGuard)2 FileSystem (org.apache.hadoop.fs.FileSystem)1 FailSafeConsistencyGuard (org.apache.hudi.common.fs.FailSafeConsistencyGuard)1 HoodieRetryWrapperFileSystem (org.apache.hudi.common.fs.HoodieRetryWrapperFileSystem)1 HoodieAvroPayload (org.apache.hudi.common.model.HoodieAvroPayload)1 HoodieActiveTimeline (org.apache.hudi.common.table.timeline.HoodieActiveTimeline)1 HoodieInstant (org.apache.hudi.common.table.timeline.HoodieInstant)1