Search in sources :

Example 1 with HoodieMetadataFileSystemView

use of org.apache.hudi.metadata.HoodieMetadataFileSystemView in project hudi by apache.

the class FileSystemViewManager method createInMemoryFileSystemView.

/**
 * Create an in-memory file System view for a table.
 */
private static HoodieTableFileSystemView createInMemoryFileSystemView(HoodieMetadataConfig metadataConfig, FileSystemViewStorageConfig viewConf, HoodieTableMetaClient metaClient, SerializableSupplier<HoodieTableMetadata> metadataSupplier) {
    LOG.info("Creating InMemory based view for basePath " + metaClient.getBasePath());
    HoodieTimeline timeline = metaClient.getActiveTimeline().filterCompletedAndCompactionInstants();
    if (metadataConfig.enabled()) {
        ValidationUtils.checkArgument(metadataSupplier != null, "Metadata supplier is null. Cannot instantiate metadata file system view");
        return new HoodieMetadataFileSystemView(metaClient, metaClient.getActiveTimeline().getCommitsTimeline().filterCompletedInstants(), metadataSupplier.get());
    }
    return new HoodieTableFileSystemView(metaClient, timeline, viewConf.isIncrementalTimelineSyncEnabled());
}
Also used : HoodieTimeline(org.apache.hudi.common.table.timeline.HoodieTimeline) HoodieMetadataFileSystemView(org.apache.hudi.metadata.HoodieMetadataFileSystemView)

Aggregations

HoodieTimeline (org.apache.hudi.common.table.timeline.HoodieTimeline)1 HoodieMetadataFileSystemView (org.apache.hudi.metadata.HoodieMetadataFileSystemView)1