public void close() {
        spillAndReleaseAllData();
        spiller.close();
        poolSizeChecker.shutdown();
    }
@Test
    void testResultPartitionClosed() throws Exception {
        CompletableFuture<Void> resultPartitionReleaseFuture = new CompletableFuture<>();
        HsSpillingStrategy spillingStrategy =
                TestingSpillingStrategy.builder()
                        .setOnResultPartitionClosedFunction(
                                (ignore) -> {
                                    resultPartitionReleaseFuture.complete(null);
                                    return Decision.NO_ACTION;
                                })
                        .build();
        HsMemoryDataManager memoryDataManager = createMemoryDataManager(spillingStrategy);
        memoryDataManager.close();
        assertThat(resultPartitionReleaseFuture).isCompleted();
    }