zhoulii opened a new issue, #6679:
URL: https://github.com/apache/paimon/issues/6679

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   
   ### Paimon version
   
   1.0
   
   ### Compute Engine
   
   flink 1.18
   
   ### Minimal reproduce step
   
   @Test
       public void testDiskUsage() throws Exception {
           ExternalBuffer buffer = newBuffer(MemorySize.ofKibiBytes(1));
   
           int number = 5000; // 16 * 5000
           List<Long> expected = insertMulti(buffer, number);
           assertThat(number).isEqualTo(buffer.size());
           assertBuffer(expected, buffer);
           assertThat(buffer.getSpillChannels().size()).isGreaterThan(0);
           assertThat(buffer.flushMemory()).isFalse();
   
           assertThat(buffer.getDiskUsage())
                   .isEqualTo(
                           buffer.getSpillChannels().stream()
                                   .map(
                                           c -> {
                                               try {
                                                   return Files.size(
                                                           
Paths.get(c.getChannel().getPath()));
                                               } catch (IOException e) {
                                                   throw new 
RuntimeException(e);
                                               }
                                           })
                                   .reduce(0L, Long::sum));
       }
   
   ### What doesn't meet your expectations?
   
   the result of `org.apache.paimon.disk.ExternalBuffer#getDiskUsage` is much 
larger than actual disk usage.
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to