Search in sources :

Example 1 with HoodieMemoryConfig

use of org.apache.hudi.config.HoodieMemoryConfig in project hudi by apache.

the class TestSparkIOUtils method testMaxMemoryPerPartitionMergeWithMaxSizeDefined.

@Test
public void testMaxMemoryPerPartitionMergeWithMaxSizeDefined() {
    String path = basePath.toString();
    long mergeMaxSize = 1000;
    long compactionMaxSize = 1000;
    HoodieMemoryConfig memoryConfig = HoodieMemoryConfig.newBuilder().withMaxMemoryMaxSize(mergeMaxSize, compactionMaxSize).build();
    HoodieWriteConfig config = HoodieWriteConfig.newBuilder().withPath(path).withMemoryConfig(memoryConfig).build();
    assertEquals(mergeMaxSize, IOUtils.getMaxMemoryPerPartitionMerge(contextSupplier, config));
    assertEquals(compactionMaxSize, IOUtils.getMaxMemoryPerCompaction(contextSupplier, config));
}
Also used : HoodieMemoryConfig(org.apache.hudi.config.HoodieMemoryConfig) HoodieWriteConfig(org.apache.hudi.config.HoodieWriteConfig) Test(org.junit.jupiter.api.Test)

Aggregations

HoodieMemoryConfig (org.apache.hudi.config.HoodieMemoryConfig)1 HoodieWriteConfig (org.apache.hudi.config.HoodieWriteConfig)1 Test (org.junit.jupiter.api.Test)1